Hi,

On Thu, Feb 14, 2013 at 05:06:55PM +0100, Sascha Hauer wrote:
> > > > > > Maybe we can ignore dr_mode in host-only and device-only builds and 
> > > > > > only
> > > > > > look at it for DRD builds ?
> > > > > 
> > > > > If something is or is not compiled in the kernel this doesn't mean 
> > > > > the kernel
> > > > > is not started on boards with a different situation.
> > > > 
> > > > who said kernel wouldn't start ? If you request a host-only build, you
> > > > need to force your IP into working as host, since that's all you have,
> > > > either that or you bail out on probe().
> > > 
> > > Let me clarify, I don't want to use Kconfig to specify my boards
> > > capabilities. If a kernel is compiled for host mode only and the
> > > devicetree specifies a port is device-only, then yes, the driver
> > > should bail out on probe, maybe leaving a message that it found
> > > a device for which the suitable role is not compiled in.
> > 
> > yeah, this is why I said we should ignore dr_mode (or bail out) when
> > !OTG.
> 
> Ok, that's what the patch effectively does. We have this in chipidea/core.c:
> 
> |     dr_mode = ci->platdata->dr_mode;
> |     if (dr_mode == USB_DR_MODE_UNKNOWN)
> |             dr_mode = USB_DR_MODE_OTG;
> 
> default to otg if nothing specified.

you missed my point. I wanted something like:

dr_mode = ci->platdata->dr_mode;
if ((dr_mode == USB_DR_MODE_UNKNOWN) || !IS_ENABLED(CONFIG_USB_CHIPIDEA_OTG)
        dr_mode = USB_DR_MODE_OTG;

this copes with the situation where dr_mode == USB_DR_MODE_HOST but
kernel is gadget-only.


-- 
balbi

Attachment: signature.asc
Description: Digital signature

Reply via email to