On Friday 27 April 2007, Peter Korsgaard wrote:
> David> Given that any dual-role controller can run in three modes,
> David> I'm curious why you don't give config options here.  The three
> David> mode being: host-only, peripheral-only, and OTG.
> 
> David> That choice would naturally be part of this core patch; the
> David> host patch would affect two roles, and the gadget patch would
> David> also affect two roles.
> 
> Please see patch 3 and 4 in the series for host/peripheral options. I
> can move the Kconfig stuff to the base patch if you prefer.

You didn't get my point.  Those patches add options for host, and
for peripheral/gadget.   But not OTG, which is the only legit
way to combine the two... you should have a "choice" of the three,
not two independent options.


> David> Again, see how the musb_hdrc code handles this. 


> >> +       /* Fill in needed attributes */ +       sie->pdev =
> >> platform_device_register_simple("c67x00_sie",
> >> +                                                   id++, NULL, 0);
> 
> David> This seems wrong.  Not only should drivers not create device
> David> nodes themselves, but the only way this could be the right way
> David> to fit into the driver model would be if each SIE were its own
> David> host (or OTG) bus segment with independent driver.  In your
> David> case, one driver would handle each usb_hostN bus.
> 
> I know. I'm unfortunately pretty clueless of the finer details of the
> driver model.

I suppose we can could educate you ... if we must ... ;)


> The chips have 2 (more-or-less) independent SIEs. The idea was to have
> seperate hcd/udc's for each SIE, which I guess means seperate struct
> devices?

Doesn't mean separate device structs, no.

Means separate HCD structs, yes ... parented by the single device node.
And this being USB, there can be only one gadget/udc struct, again
parented by the single device node.

The normal way to arrange that is to have the platform_data for that
device say how that board works:  mode of SIE0 is host/otg/peripheral;
of SIE1 is host/peripheral; and have your probe() logic report errors
like configuring two peripheral ports (or one peripheral and one OTG,
or one peripheral and one host).  The simple way to think of that is:
what kind of connector is hooked up?  A/Mini-A; B/Mini-B; or Mini-AB.

Then when the probe() does its work, it would report errors if it's
told to configure a port mode it can't support (e.g. host or OTG
without the host side; peripheral or OTG without peripheral).  It's
fine if the board has e.g. only host side connectors but the driver
is more capable (OTG).

- Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to