Re: [PATCH] usb: dwc3: Allow building USB_DWC3_QCOM without EXTCON

2019-04-19 Thread Marc Gonzalez
On 19/04/2019 13:24, Greg Kroah-Hartman wrote:

> On Fri, Apr 19, 2019 at 11:59:08AM +0200, Marc Gonzalez wrote:
>
>> Keep EXTCON support optional, since some platforms do not need it.
>>
>> Fixes: 3def4031b3e3 ("usb: dwc3: add EXTCON dependency for qcom")
>> Signed-off-by: Marc Gonzalez 
>> ---
>>  drivers/usb/dwc3/Kconfig | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
>> index 2b1494460d0c..6bd1a28c535f 100644
>> --- a/drivers/usb/dwc3/Kconfig
>> +++ b/drivers/usb/dwc3/Kconfig
>> @@ -115,7 +115,8 @@ config USB_DWC3_ST
>>  
>>  config USB_DWC3_QCOM
>>  tristate "Qualcomm Platform"
>> -depends on EXTCON && (ARCH_QCOM || COMPILE_TEST)
>> +depends on ARCH_QCOM || COMPILE_TEST
>> +depends on EXTCON || !EXTCON
> 
> Why is this last line needed?  Does it really do anything?

For the record, there are 42 instances of this unintuitive kconfig syntax:

$ git grep 'depends on [A-Z_]* || !' | wc
 42 3422965

https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt
An expression can have a value of 'n', 'm' or 'y' (0, 1, 2 respectively for 
calculations).


"BAR depends on FOO" means (FOO=m && BAR=m) || (FOO=y && BAR=m) || (FOO=y && 
BAR=y) || BAR=n

NB: (FOO=m && BAR=y) is explicitly forbidden by kconfig (special-cased?)
("This feature depends on another which has been configured as a module.
As a result, this feature will be built as a module.")


"BAR depends on !FOO" means (FOO=n && BAR=m) || (FOO=n && BAR=y)


Thus "BAR depends on FOO || !FOO" means ALL 9 combinations EXCEPT (FOO=m && 
BAR=y)

Regards.


[PATCH] usb: dwc3: Allow building USB_DWC3_QCOM without EXTCON

2019-04-19 Thread Marc Gonzalez
Keep EXTCON support optional, since some platforms do not need it.

Fixes: 3def4031b3e3 ("usb: dwc3: add EXTCON dependency for qcom")
Signed-off-by: Marc Gonzalez 
---
 drivers/usb/dwc3/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 2b1494460d0c..6bd1a28c535f 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -115,7 +115,8 @@ config USB_DWC3_ST
 
 config USB_DWC3_QCOM
tristate "Qualcomm Platform"
-   depends on EXTCON && (ARCH_QCOM || COMPILE_TEST)
+   depends on ARCH_QCOM || COMPILE_TEST
+   depends on EXTCON || !EXTCON
depends on OF
default USB_DWC3
help
-- 
2.17.1


Re: [PATCH] usb: dwc3: Allow building USB_DWC3_QCOM without EXTCON

2019-04-24 Thread Marc Gonzalez
On 19/04/2019 11:59, Marc Gonzalez wrote:

> Keep EXTCON support optional, since some platforms do not need it.
> 
> Fixes: 3def4031b3e3 ("usb: dwc3: add EXTCON dependency for qcom")
> Signed-off-by: Marc Gonzalez 
> ---
>  drivers/usb/dwc3/Kconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
> index 2b1494460d0c..6bd1a28c535f 100644
> --- a/drivers/usb/dwc3/Kconfig
> +++ b/drivers/usb/dwc3/Kconfig
> @@ -115,7 +115,8 @@ config USB_DWC3_ST
>  
>  config USB_DWC3_QCOM
>   tristate "Qualcomm Platform"
> - depends on EXTCON && (ARCH_QCOM || COMPILE_TEST)
> + depends on ARCH_QCOM || COMPILE_TEST
> + depends on EXTCON || !EXTCON
>   depends on OF
>   default USB_DWC3
>   help

Can I get an amen? :-)

Arnd? Greg? Mom?


[PATCH v2] usb: dwc3: Allow building USB_DWC3_QCOM without EXTCON

2019-04-24 Thread Marc Gonzalez
Keep EXTCON support optional, as some platforms do not need it.

Do the same for USB_DWC3_OMAP while we're at it.

Fixes: 3def4031b3e3f ("usb: dwc3: add EXTCON dependency for qcom")
Signed-off-by: Marc Gonzalez 
---
Changes from v1: Do the same change for USB_DWC3_OMAP, as suggested by Arnd
---
 drivers/usb/dwc3/Kconfig | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 2b1494460d0c..784309435916 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -54,7 +54,8 @@ comment "Platform Glue Driver Support"
 
 config USB_DWC3_OMAP
tristate "Texas Instruments OMAP5 and similar Platforms"
-   depends on EXTCON && (ARCH_OMAP2PLUS || COMPILE_TEST)
+   depends on ARCH_OMAP2PLUS || COMPILE_TEST
+   depends on EXTCON || !EXTCON
depends on OF
default USB_DWC3
help
@@ -115,7 +116,8 @@ config USB_DWC3_ST
 
 config USB_DWC3_QCOM
tristate "Qualcomm Platform"
-   depends on EXTCON && (ARCH_QCOM || COMPILE_TEST)
+   depends on ARCH_QCOM || COMPILE_TEST
+   depends on EXTCON || !EXTCON
depends on OF
default USB_DWC3
help
-- 
2.17.1


Re: [PATCH v2] USB: move usb debugfs directory creation to the usb common core

2019-06-05 Thread Marc Gonzalez
On 05/06/2019 11:28, Greg Kroah-Hartman wrote:

> The USB gadget subsystem wants to use the USB debugfs root directory, so
> move it to the common "core" USB code so that it is properly initialized
> and removed as needed.
> 
> In order to properly do this, we need to load the common code before the
> usb core code, when everything is linked into the kernel, so reorder the
> link order of the code.
> 
> Also as the usb common code has the possibility of the led trigger logic
> to be merged into it, handle the build option properly by only having
> one module init/exit function and have the common code initialize the
> led trigger if needed.
> 
> Reported-by: From: Chunfeng Yun 

You have a spurious "From: " in there ;-)

Regards.