Re: PXA27x UDC - serial gadet

Rodolfo Giometti <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization GNU/Linux Device Drivers, Embedded Systems and Courses
Message-ID <[email protected]>
On Thu, Oct 18, 2007 at 11:50:59AM +0200, Thomi Aurel RUAG A wrote:
> Hello, Rodolfo

Hello. :)

> I tried your pxa27x_udc driver (found on your PXA27x UDC Homepage) and managed to get
> the serial gadget at least compiling and "insmod"-ing without error.

Great!

> My little tests with "echo" and "cat" on the resulting tty (only linux) were successfull but i know
> it is necessary to do further testing (which i don't know actually).

Ok, when you are sure your modifications are ok, please send a patch
to me.

> The necessary adaptions are limited to the drivers/usb/gadget/serial.c
> and are listed below (i hope the diff is usefull for your needs):
> 
> -- DIFF START --
> --- a/drivers/usb/gadget/serial.c
> +++ b/drivers/usb/gadget/serial.c
> @@ -1377,20 +1377,29 @@
> 
>         usb_ep_autoconfig_reset(gadget);
> 
> -       ep = usb_ep_autoconfig(gadget, &gs_fullspeed_in_desc, 0, 0, 0);
> +       ep = usb_ep_autoconfig(gadget, &gs_fullspeed_in_desc,
> +        (int)gs_acm_config_desc.bConfigurationValue,
> +        (int)gs_data_interface_desc.bInterfaceNumber,
> +        (int)gs_data_interface_desc.bAlternateSetting);
>         if (!ep)
>                 goto autoconf_fail;
>         EP_IN_NAME = ep->name;
>         ep->driver_data = ep;   /* claim the endpoint */
> 
> -       ep = usb_ep_autoconfig(gadget, &gs_fullspeed_out_desc, 0, 0, 0);
> +       ep = usb_ep_autoconfig(gadget, &gs_fullspeed_out_desc,
> +        (int)gs_acm_config_desc.bConfigurationValue,
> +        (int)gs_data_interface_desc.bInterfaceNumber,
> +        (int)gs_data_interface_desc.bAlternateSetting);
>         if (!ep)
>                 goto autoconf_fail;
>         EP_OUT_NAME = ep->name;
>         ep->driver_data = ep;   /* claim the endpoint */
> 
>         if (use_acm) {
> -               ep = usb_ep_autoconfig(gadget, &gs_fullspeed_notify_desc, 0, 0, 0);
> +               ep = usb_ep_autoconfig(gadget, &gs_fullspeed_notify_desc,
> +          (int)gs_acm_config_desc.bConfigurationValue,
> +          (int)gs_control_interface_desc.bInterfaceNumber,
> +          (int)gs_control_interface_desc.bAlternateSetting);
>                 if (!ep) {
>                         printk(KERN_ERR "gs_bind: cannot run ACM on %s\n", gadget->name);
>                         goto autoconf_fail;
> -- DIFF END --

It seems sane.

> I've done similar steps as Alexander Yurtsev did in his file_storage_pxa27x_udc.diff.
> 
> Dring my studies on the usb gadget sources i've wondering why this similar adaptions
> of the usb_ep_autoconfig in the usb gadget drivers are necessary. Because i can't see any
> impact that a pxa27x_udc driver work or rework would have on the usb gadget drivers (I thought
> the udc driver is independent of the usb gadget driver).
> 
> Are the usb gadget drivers working on other platforms? If so, i probably fixed a pxa27x specific
> problem on the wrong side (conceptually)?

This was necessary do brain-damage pxa27x_udc controller design. See
this thread http://lkml.org/lkml/2007/6/28/285 and the PXA27X
developer's manual chapter 12.

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    [email protected]
Linux Device Driver                             [email protected]
Embedded Systems                     		[email protected]
UNIX programming                     phone:     +39 349 2432127

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.