ZLP sending request from gadget
Hi Balbi, This is regarding the gadget serial (serial.c) deciding to send the ZLP by setting req->zero to 1/0. The udc driver in our case decides to send the ZLP based on the req->zero value set by the gadget. But we see that the serial gadget driver does not set req->zero. But others like u_ether and f_massstorage are setting the same. Is there any specific reason why this is not done in gadget serial ? -- Anjana -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: USB ID detection interrupt - non OTG PHY
Hi David, Its a single phy for both host and device modes. Thanks Anjana On Wed, Mar 11, 2015 at 3:36 AM, David Cohen wrote: > Hi Anjana, > > On Tue, Mar 03, 2015 at 09:27:09AM +0800, Peter Chen wrote: >> On Mon, Mar 02, 2015 at 11:47:31AM +0530, Anjana V Kumar wrote: >> > Hi Peter, >> > >> > I will need to configure both the phy and the controller. >> > >> > Thanks >> > Anjana >> > >> > On Mon, Mar 2, 2015 at 11:24 AM, Peter Chen >> > wrote: >> > > >> > > >> > >> This is regarding the registering and handling of ID interrupt to swich >> > >> between >> > >> host and device mode. >> > >> >> > >> My aim is to have OTG functionality for a not-OTG phy. >> > >> >> > >> We wanted to register an ID interrupt which fires of change in ID >> > >> value. Based >> > >> on this ID value, we need to configure the phy to host or device mode. > > Do you really have a single phy for both modes or do you have a single > port connected to different host and device phys? > > BR, David > >> > > >> > > Do you really need to configure USB PHY (not usb controller) according >> > > to host or device mode? >> > > If it is, you need to handle your id switch routine at phy's driver, >> > > since you need >> > > to set PHY's register according to id value. >> > > >> > > Peter >> > > >> >> It may be no easy to handle it if you can't handle all things >> at controller driver, like handle id and vbus. Have a look >> for below thread, some framework are not ready, like DRD library, >> George, any updates for that? >> >> https://lkml.org/lkml/2014/12/23/442 >> >> -- >> >> Best Regards, >> Peter Chen >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-usb" in >> the body of a message to majord...@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html -- Anjana -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: USB ID detection interrupt - non OTG PHY
Hi Peter, I will need to configure both the phy and the controller. Thanks Anjana On Mon, Mar 2, 2015 at 11:24 AM, Peter Chen wrote: > > >> This is regarding the registering and handling of ID interrupt to swich >> between >> host and device mode. >> >> My aim is to have OTG functionality for a not-OTG phy. >> >> We wanted to register an ID interrupt which fires of change in ID value. >> Based >> on this ID value, we need to configure the phy to host or device mode. > > Do you really need to configure USB PHY (not usb controller) according to > host or device mode? > If it is, you need to handle your id switch routine at phy's driver, since > you need > to set PHY's register according to id value. > > Peter > -- Anjana -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
USB ID detection interrupt - non OTG PHY
Hi All, This is regarding the registering and handling of ID interrupt to swich between host and device mode. My aim is to have OTG functionality for a not-OTG phy. We wanted to register an ID interrupt which fires of change in ID value. Based on this ID value, we need to configure the phy to host or device mode. We are trying to find which would be the best approach to register the ID interrupt. When I checked the existing drivers, I could see three possible ways to handle the same, 1. To do all the handling in the ehci/ohci/gadget drivers. 2. To do the handling in the PHY driver (drivers/phy/) 3. To create a separate driver to handle the same. Request your suggestions on the same. Thanking You, Anjana -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: gadget serial driver - configuration value
Hi All, Can you please help me understand the assignment of bConfigurationValue in gadget serial driver. As I had mentioned in my previous mail, I agree that no two configurations can have same bConfigurationValue, but in this case, the implementation is (drivers/usb/gadget/serial.c) 247 if (use_acm) { 248 serial_config_driver.label = "CDC ACM config"; 249 serial_config_driver.bConfigurationValue = 2; 250 ... 253 } else if (use_obex) { 254 serial_config_driver.label = "CDC OBEX config"; 255 serial_config_driver.bConfigurationValue = 3; 256 ... 259 } else { 260 serial_config_driver.label = "Generic Serial config"; 261 serial_config_driver.bConfigurationValue = 1; 262... 265 } In this case we cannot have the three configurations together. Hence I wanted to confirm if there was any other reason as to why different numbers were assigned. Can you please help me on the same. Thanks and Regards Anjana On Fri, Sep 5, 2014 at 6:30 PM, Anjana V Kumar wrote: > On Thu, Sep 4, 2014 at 7:38 PM, Alan Stern wrote: >> On Thu, 4 Sep 2014, Anjana V Kumar wrote: >> >>> >> We see that, the three configurations listed in serial driver (CDC >>> >> ACM, CDC OBEX, generic serial) cannot be present together as per the >>> >> current implementation. Is there a specific reason why the >>> >> configuration values were set as 1, 2 and 3 instead of setting all to >>> >> 1? >>> > >>> > well, setting configuration 0 means that you're not selecting any >>> > configuration. Basically you go back to "Addressed" state, so you can't >>> > use configuration 0 for anything, really. >>> > >>> >>> Sorry for not being clear, I am not setting the configuration to 0. >>> The question was, can we set all the three configuration values of CDC >>> ACM, CDC OBEX, and generic serial to 1? >>> Was there any specific reason as to why the configuration values were >>> set as 1,2 and 3. We cannot have all three at the same time according >>> to the current "if, elseif, else" implementation, >> >> No two configurations can have the same bConfigurationValue. If the >> gadget has three different configs then it must have three different >> config values. >> > I agree that no two configurations can have same bConfigurationValue, > but in this case, the implementation is (drivers/usb/gadget/serial.c) > > 247 if (use_acm) { > 248 serial_config_driver.label = "CDC ACM config"; > 249 serial_config_driver.bConfigurationValue = 2; > 250 ... > 253 } else if (use_obex) { > 254 serial_config_driver.label = "CDC OBEX config"; > 255 serial_config_driver.bConfigurationValue = 3; > 256 ... > 259 } else { > 260 serial_config_driver.label = "Generic Serial config"; > 261 serial_config_driver.bConfigurationValue = 1; > 262... > 265 } > > In this case we cannot have the three configurations together. > Hence I wanted to confirm if there was any other reason as to why > different numbers were assigned. > >> Alan Stern >> > > > > -- > Anjana -- Anjana -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: gadget serial driver - configuration value
On Thu, Sep 4, 2014 at 7:38 PM, Alan Stern wrote: > On Thu, 4 Sep 2014, Anjana V Kumar wrote: > >> >> We see that, the three configurations listed in serial driver (CDC >> >> ACM, CDC OBEX, generic serial) cannot be present together as per the >> >> current implementation. Is there a specific reason why the >> >> configuration values were set as 1, 2 and 3 instead of setting all to >> >> 1? >> > >> > well, setting configuration 0 means that you're not selecting any >> > configuration. Basically you go back to "Addressed" state, so you can't >> > use configuration 0 for anything, really. >> > >> >> Sorry for not being clear, I am not setting the configuration to 0. >> The question was, can we set all the three configuration values of CDC >> ACM, CDC OBEX, and generic serial to 1? >> Was there any specific reason as to why the configuration values were >> set as 1,2 and 3. We cannot have all three at the same time according >> to the current "if, elseif, else" implementation, > > No two configurations can have the same bConfigurationValue. If the > gadget has three different configs then it must have three different > config values. > I agree that no two configurations can have same bConfigurationValue, but in this case, the implementation is (drivers/usb/gadget/serial.c) 247 if (use_acm) { 248 serial_config_driver.label = "CDC ACM config"; 249 serial_config_driver.bConfigurationValue = 2; 250 ... 253 } else if (use_obex) { 254 serial_config_driver.label = "CDC OBEX config"; 255 serial_config_driver.bConfigurationValue = 3; 256 ... 259 } else { 260 serial_config_driver.label = "Generic Serial config"; 261 serial_config_driver.bConfigurationValue = 1; 262... 265 } In this case we cannot have the three configurations together. Hence I wanted to confirm if there was any other reason as to why different numbers were assigned. > Alan Stern > -- Anjana -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: gadget serial driver - configuration value
On Wed, Sep 3, 2014 at 8:19 PM, Felipe Balbi wrote: > On Wed, Sep 03, 2014 at 02:48:43PM +0530, Anjana V Kumar wrote: >> Hi, >> >> This is regarding an issue we are facing with the gadget serial driver >> (driver/usb/gadget/serial.c). >> >> We have a hardware limitation and the USB hardware can only have >> bconfigurationvalue 0 or 1. > > what kind of limitation is this. Configuration value is a SW-only > choice. What HW are you using ? Which kernel are you using ? Do you have > logs of the problem ? > I am using 3.10 kernel. The issue is that the set_configuration(2) is stalled, while the set_configuration(1) passes with the USB hardware I am using. >> In the CDC ACM config in gadget serial driver the configuration value >> is set to 2. Is there a specific reason why this was done? >> >> We see that, the three configurations listed in serial driver (CDC >> ACM, CDC OBEX, generic serial) cannot be present together as per the >> current implementation. Is there a specific reason why the >> configuration values were set as 1, 2 and 3 instead of setting all to >> 1? > > well, setting configuration 0 means that you're not selecting any > configuration. Basically you go back to "Addressed" state, so you can't > use configuration 0 for anything, really. > Sorry for not being clear, I am not setting the configuration to 0. The question was, can we set all the three configuration values of CDC ACM, CDC OBEX, and generic serial to 1? Was there any specific reason as to why the configuration values were set as 1,2 and 3. We cannot have all three at the same time according to the current "if, elseif, else" implementation, > -- > balbi -- Anjana -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
gadget serial driver - configuration value
Hi, This is regarding an issue we are facing with the gadget serial driver (driver/usb/gadget/serial.c). We have a hardware limitation and the USB hardware can only have bconfigurationvalue 0 or 1. In the CDC ACM config in gadget serial driver the configuration value is set to 2. Is there a specific reason why this was done? We see that, the three configurations listed in serial driver (CDC ACM, CDC OBEX, generic serial) cannot be present together as per the current implementation. Is there a specific reason why the configuration values were set as 1, 2 and 3 instead of setting all to 1? -- Anjana -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html