Patchwork [v1,09/12] usb: dwc3: Registering a role switch in the DRD code.

login
register
mail settings
Submitter Heikki Krogerus
Date Dec. 4, 2018, 10:54 a.m.
Message ID <20181204105416.GA10657@kuha.fi.intel.com>
Download mbox | patch
Permalink /patch/671735/
State New
Headers show

Comments

Heikki Krogerus - Dec. 4, 2018, 10:54 a.m.
On Mon, Dec 03, 2018 at 11:45:12AM +0800, Yu Chen wrote:
> The Type-C drivers use USB role switch API to inform the
> system about the negotiated data role, so registering a role
> switch in the DRD code in order to support platforms with
> USB Type-C connectors.
> 
> Cc: Felipe Balbi <balbi@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Yu Chen <chenyu56@huawei.com>
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> 
> --
> v0:
> The patch is provided by Heikki Krogerus. I modified and test it
> on Hikey960 platform.
> --
> ---
>  drivers/usb/dwc3/core.h |  2 ++
>  drivers/usb/dwc3/drd.c  | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 51 insertions(+)

You need to select USB_ROLE_SWITCH in Kconfig:
Yu Chen - Dec. 5, 2018, 12:56 a.m.
On 2018/12/4 18:54, Heikki Krogerus wrote:
> On Mon, Dec 03, 2018 at 11:45:12AM +0800, Yu Chen wrote:
>> The Type-C drivers use USB role switch API to inform the
>> system about the negotiated data role, so registering a role
>> switch in the DRD code in order to support platforms with
>> USB Type-C connectors.
>>
>> Cc: Felipe Balbi <balbi@kernel.org>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Signed-off-by: Yu Chen <chenyu56@huawei.com>
>> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>>
>> --
>> v0:
>> The patch is provided by Heikki Krogerus. I modified and test it
>> on Hikey960 platform.
>> --
>> ---
>>  drivers/usb/dwc3/core.h |  2 ++
>>  drivers/usb/dwc3/drd.c  | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 51 insertions(+)
> 
> You need to select USB_ROLE_SWITCH in Kconfig:
> 
> diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
> index 1a0404fda596..3a0cb9f1f38a 100644
> --- a/drivers/usb/dwc3/Kconfig
> +++ b/drivers/usb/dwc3/Kconfig
> @@ -42,6 +42,7 @@ config USB_DWC3_DUAL_ROLE
>         bool "Dual Role mode"
>         depends on ((USB=y || USB=USB_DWC3) && (USB_GADGET=y || USB_GADGET=USB_DWC3))
>         depends on (EXTCON=y || EXTCON=USB_DWC3)
> +       select USB_ROLE_SWITCH
>         help
>           This is the default mode of working of DWC3 controller where
>           both host and gadget features are enabled.
> 

OK.

Thanks!

Patch

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 1a0404fda596..3a0cb9f1f38a 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -42,6 +42,7 @@  config USB_DWC3_DUAL_ROLE
        bool "Dual Role mode"
        depends on ((USB=y || USB=USB_DWC3) && (USB_GADGET=y || USB_GADGET=USB_DWC3))
        depends on (EXTCON=y || EXTCON=USB_DWC3)
+       select USB_ROLE_SWITCH
        help
          This is the default mode of working of DWC3 controller where
          both host and gadget features are enabled.