Re: pxa27x_udc -- support for usb gadget for pxa27x?

From: Mark Underwood
Date: Sat Nov 26 2005 - 18:03:18 EST



--- Pavel Machek <pavel@xxxxxx> wrote:

> Hi!
>
> > > > Ultimately, it would be nice to have the Zaurus detect whether a usb
> > > > host or client was present (using gpio 41 maybe?) and then activate the
> > > > host (ohci) or client (pxa27x_udc) driver as appropriate.
> > >
> > > Unfortunately, that would make ohci unfunctional for me. I have normal
> > > usb device cable, connected to "USB gender changer" -- basically two
> > > female connectors -- so that I can plug USB network card into that.
> > >
> >
> > Just a thought. How about a sysfs entry which you can use to jam the device into either slave
> or
> > host mode?
>
> Yes, that would do the trick. Auto sense is probably good solution,
> too, it is just that it should have /sys override or something like
> that.
>
> Pavel

That is what I was thinking. Do you have an OTG device in your sysfs tree in which you could add
this?

I have been working on a platform which also has OTG and I have been thinking how to handle OTG in
a generic way.

A while back I started work on an OTG subsystem as there doesn?t seem to be any standard way of
implementing OTG controller driver in the kernel. The only example I could find was the TI OMAP
which has all the OTG stuff in the driver for the external transceiver (plus it also seemed to
have 3 or 4 OTG state machines). The idea of the subsystem is to break the OTG driver into its
constituent parts:

USB Host driver : This is already is the kernel and shouldn?t require any alteration.

USB Device driver: Again, the OTG subsystem should use the current framework.

USB Logic driver: This is the part of the OTG hardware that connects the slave or the host the
physical connector plus clock control etc.

USB Transceiver: This driver generates the special signals the OTG protocol uses as well as
detecting the signals that will cause a change of state in the state machine.

USB state machine: Some hardware has the state machine build into them, some don?t, and some have
an incomplete implementation. This driver will implement in software what is lacking in the
hardware state machine.

This flexible subsystem should allow you to combine any USB master, USB device, USB OTG logic and
transceiver (be it internal as part of the OTG block or an external transceiver). This is only in
the early stages of development and I would need to talk to the USB guys first to see what I have
missed (I need to have another look at the otg_transceiver struct again). What would be great to
see in sysfs is something like:

/sys/devices/platform/otg1
|--host (symbolic link to device)
|--gadget (symbolic link to device)
|--otg_logic (symbolic link to device)
|--transceiver (symbolic link to device)
`--force_mode

Just an idea!

Mark

> Thanks, Sharp!
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>




___________________________________________________________
How much free photo storage do you get? Store your holiday
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/