This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

stop enumeration of USB gadget

Hello,

I am working on HID gadget driver. I want to stop enumeration process when i connect the embedded board  with host PC. For that i am using usb_function_deactivate() API in fuction hidg_bind_config() , after adding  function to configuration. e.g

 int __init hidg_bind_config(struct usb_configuration *c,
                 struct hidg_func_descriptor *fdesc, int index)
 {     ...........................

       ............................

     status = usb_add_function(c, &hidg->func);      
    if (status)
        kfree(hidg);

    if ((usb_function_deactivate(&hidg->func)) == 0)
        printk("----------something--------------\n");

    return status;
}        

Even though the API is executed successfully, when i connect the board to host PC , the enumeration is getting started. So am i doing this in wrong way or something else ? I am using DM8148 with RDK 4.1.

Thanks.

  • Devang,

    I will check this and come back to you when I have something.

    Best regards,
    Pavel

  • Devang,

    In what mode (gadget/device or host) is the DM814x USB when you connect it to the USB of the host PC?

    Regards,
    Pavel

  • Hi pavel,

    I am using DM8148 in gadget mode.

    Regards,

    Devang

  • Hi pavel,

    I am exploring the USB gadget, and found that even if we disable the function/gadget  during bind() function using usb_function_deactivate()  which reset the SOFTCONN bit of POWER register, musb core again set this bit to 1 during musb_start() function which is called later on.

    So currently i got one solution to reset this SOFTCONN, still i am exploring it to get better solution.

    Please correct me if i am wrong. Any input from you will help me to get better solution.

    Regards,

    Devang

  • Hi pavel,

    I have used usb_function_deactivate() at end of gadget driver init function and i am activating USB enumeration through IOCTL from application. with these changes i am able to get gadget driver functional in synchronization with application and everything works fine.


    But, sometimes when i disconnect and again connect the gadget device, enumeration fails. To further debug the issue i have put prints in composite.c file inside function composite_setup().

    I have noted that when the enumeration is successful this function is called around 14-15 times before i get any request in my hid gadget driver, but when enumeration fails, only 4-8 calls are made to function composite_setup() and i am not getting any request in my hid gadget driver.


    Can you suggest something  or explain how this enumeration of HID gadget happens ?

    Regards,

    Devang

  • Hi Pavel,

    Any suggestion on above issue ??

    I am waiting for your inputs.  Any kind of help will be appreciated.

    Regards,

    Devang