Re: [PATCH v3 2/2] usb: dwc2: add 'mode' which based on Kconfig select or dts setting

From: Doug Anderson
Date: Wed Aug 06 2014 - 18:13:41 EST


Paul,

On Tue, Aug 5, 2014 at 1:08 PM, Paul Zimmerman
<Paul.Zimmerman@xxxxxxxxxxxx> wrote:
>> Maybe dwc2 is refer to the Kconfig in dwc3 for there is a choice from
>> one of "Host only mode", "Gadget only mode" and "Dual Role mode",
>> which means the role is decided by the Kconfig.
>>
>> In my opinion, there maybe more than one controller in a Soc, and for
>> different
>> usage, the mode select should not be done in Kconfig, it's better to do that
>> in dts file.
>> I agree with you that the CONFIG_USB_DWC2_HOST should defined for host
>> functionality, not for role definition.
>>
>> Paul: what do you think?
>
> I'm confused about how your dual-role mode implementation is supposed
> to work. Right now, the host and peripheral modes are compiled as
> separate drivers, and there is no dual-role mode in the Kconfig. So I
> don't see how your code can work. Have you tested it?

Ah, interesting. I just assumed that since you could compile both in
that dual mode was there, but I clearly was confused.

I don't think Kever had tested dual_role mode.


> Dinh Nguyen is working on a patch series to add dual-role support, I
> think you have seen that, right? That adds the Kconfig options for all
> three modes. Maybe you should build on top of that?

I hadn't personally seen it, but now I have! I guess this is the
newest <https://www.mail-archive.com/linux-usb@xxxxxxxxxxxxxxx/msg46103.html>.

I haven't done a thorough review, but I think Kever's patch v4
<https://patchwork.kernel.org/patch/4682711/> is still relevant since
I don't see anything parsing the dr_mode in Dinh's patches.

-Doug
--
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/