diff mbox series

usb: typec: STUSB160X should select REGMAP_I2C

Message ID 20211004232103.23893-1-rdunlap@infradead.org (mailing list archive)
State Superseded
Headers show
Series usb: typec: STUSB160X should select REGMAP_I2C | expand

Commit Message

Randy Dunlap Oct. 4, 2021, 11:21 p.m. UTC
REGMAP_I2C is not a user visible kconfig symbol so driver configs
should not "depend on" it. They should depend on I2C and then
select REGMAP_I2C.

If this worked, it was only because some other driver had set/enabled
REGMAP_I2C.

Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Amelie Delaunay <amelie.delaunay@st.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/typec/Kconfig |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Amelie Delaunay Oct. 5, 2021, 6:39 a.m. UTC | #1
On 10/5/21 1:21 AM, Randy Dunlap wrote:
> REGMAP_I2C is not a user visible kconfig symbol so driver configs
> should not "depend on" it. They should depend on I2C and then
> select REGMAP_I2C.
> 
> If this worked, it was only because some other driver had set/enabled
> REGMAP_I2C.
> 
> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>

Thanks for your patch.

Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>

> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Cc: Amelie Delaunay <amelie.delaunay@st.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> ---
>   drivers/usb/typec/Kconfig |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- lnx-515-rc4.orig/drivers/usb/typec/Kconfig
> +++ lnx-515-rc4/drivers/usb/typec/Kconfig
> @@ -65,9 +65,9 @@ config TYPEC_HD3SS3220
>   
>   config TYPEC_STUSB160X
>   	tristate "STMicroelectronics STUSB160x Type-C controller driver"
> -	depends on I2C
> -	depends on REGMAP_I2C
>   	depends on USB_ROLE_SWITCH || !USB_ROLE_SWITCH
> +	depends on I2C
> +	select REGMAP_I2C
>   	help
>   	  Say Y or M here if your system has STMicroelectronics STUSB160x
>   	  Type-C port controller.
>
Heikki Krogerus Oct. 5, 2021, 10:37 a.m. UTC | #2
On Mon, Oct 04, 2021 at 04:21:03PM -0700, Randy Dunlap wrote:
> REGMAP_I2C is not a user visible kconfig symbol so driver configs
> should not "depend on" it. They should depend on I2C and then
> select REGMAP_I2C.
> 
> If this worked, it was only because some other driver had set/enabled
> REGMAP_I2C.
> 
> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Cc: Amelie Delaunay <amelie.delaunay@st.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/Kconfig |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- lnx-515-rc4.orig/drivers/usb/typec/Kconfig
> +++ lnx-515-rc4/drivers/usb/typec/Kconfig
> @@ -65,9 +65,9 @@ config TYPEC_HD3SS3220
>  
>  config TYPEC_STUSB160X
>  	tristate "STMicroelectronics STUSB160x Type-C controller driver"
> -	depends on I2C
> -	depends on REGMAP_I2C
>  	depends on USB_ROLE_SWITCH || !USB_ROLE_SWITCH
> +	depends on I2C
> +	select REGMAP_I2C
>  	help
>  	  Say Y or M here if your system has STMicroelectronics STUSB160x
>  	  Type-C port controller.
Greg Kroah-Hartman Oct. 5, 2021, 11:48 a.m. UTC | #3
On Mon, Oct 04, 2021 at 04:21:03PM -0700, Randy Dunlap wrote:
> REGMAP_I2C is not a user visible kconfig symbol so driver configs
> should not "depend on" it. They should depend on I2C and then
> select REGMAP_I2C.
> 
> If this worked, it was only because some other driver had set/enabled
> REGMAP_I2C.
> 
> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Cc: Amelie Delaunay <amelie.delaunay@st.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> ---
>  drivers/usb/typec/Kconfig |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

With this applied, I get the following build error:

drivers/of/Kconfig:69:error: recursive dependency detected!
drivers/of/Kconfig:69:	symbol OF_IRQ depends on IRQ_DOMAIN
kernel/irq/Kconfig:59:	symbol IRQ_DOMAIN is selected by REGMAP
drivers/base/regmap/Kconfig:7:	symbol REGMAP default is visible depending on REGMAP_I2C
drivers/base/regmap/Kconfig:20:symbol REGMAP_I2C is selected by TYPEC_STUSB160X
drivers/usb/typec/Kconfig:66:	symbol TYPEC_STUSB160X depends on USB_ROLE_SWITCH
drivers/usb/roles/Kconfig:3:	symbol USB_ROLE_SWITCH is selected by USB_MUSB_MEDIATEK
drivers/usb/musb/Kconfig:119:	symbol USB_MUSB_MEDIATEK depends on GENERIC_PHY
drivers/phy/Kconfig:8:	symbol GENERIC_PHY is selected by PHY_BCM_NS_USB3
drivers/phy/broadcom/Kconfig:49:	symbol PHY_BCM_NS_USB3 depends on MDIO_BUS
drivers/net/mdio/Kconfig:13:	symbol MDIO_BUS depends on MDIO_DEVICE
drivers/net/mdio/Kconfig:6:	symbol MDIO_DEVICE is selected by PHYLIB
drivers/net/phy/Kconfig:16:	symbol PHYLIB is selected by ARC_EMAC_CORE
drivers/net/ethernet/arc/Kconfig:19:	symbol ARC_EMAC_CORE is selected by ARC_EMAC
drivers/net/ethernet/arc/Kconfig:25:	symbol ARC_EMAC depends on OF_IRQ
For a resolution refer to Documentation/kbuild/kconfig-language.rst
subsection "Kconfig recursive dependency limitations"

So I can't take it as-is :(

thanks,

greg k-h
Randy Dunlap Oct. 5, 2021, 7:04 p.m. UTC | #4
On 10/5/21 4:48 AM, Greg Kroah-Hartman wrote:
> On Mon, Oct 04, 2021 at 04:21:03PM -0700, Randy Dunlap wrote:
>> REGMAP_I2C is not a user visible kconfig symbol so driver configs
>> should not "depend on" it. They should depend on I2C and then
>> select REGMAP_I2C.
>>
>> If this worked, it was only because some other driver had set/enabled
>> REGMAP_I2C.
>>
>> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>> Cc: Amelie Delaunay <amelie.delaunay@st.com>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: linux-usb@vger.kernel.org
>> ---
>>   drivers/usb/typec/Kconfig |    4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> With this applied, I get the following build error:
> 
> drivers/of/Kconfig:69:error: recursive dependency detected!
> drivers/of/Kconfig:69:	symbol OF_IRQ depends on IRQ_DOMAIN
> kernel/irq/Kconfig:59:	symbol IRQ_DOMAIN is selected by REGMAP
> drivers/base/regmap/Kconfig:7:	symbol REGMAP default is visible depending on REGMAP_I2C
> drivers/base/regmap/Kconfig:20:symbol REGMAP_I2C is selected by TYPEC_STUSB160X
> drivers/usb/typec/Kconfig:66:	symbol TYPEC_STUSB160X depends on USB_ROLE_SWITCH
> drivers/usb/roles/Kconfig:3:	symbol USB_ROLE_SWITCH is selected by USB_MUSB_MEDIATEK
> drivers/usb/musb/Kconfig:119:	symbol USB_MUSB_MEDIATEK depends on GENERIC_PHY
> drivers/phy/Kconfig:8:	symbol GENERIC_PHY is selected by PHY_BCM_NS_USB3
> drivers/phy/broadcom/Kconfig:49:	symbol PHY_BCM_NS_USB3 depends on MDIO_BUS
> drivers/net/mdio/Kconfig:13:	symbol MDIO_BUS depends on MDIO_DEVICE
> drivers/net/mdio/Kconfig:6:	symbol MDIO_DEVICE is selected by PHYLIB
> drivers/net/phy/Kconfig:16:	symbol PHYLIB is selected by ARC_EMAC_CORE
> drivers/net/ethernet/arc/Kconfig:19:	symbol ARC_EMAC_CORE is selected by ARC_EMAC
> drivers/net/ethernet/arc/Kconfig:25:	symbol ARC_EMAC depends on OF_IRQ
> For a resolution refer to Documentation/kbuild/kconfig-language.rst
> subsection "Kconfig recursive dependency limitations"
> 
> So I can't take it as-is :(

Darn, I never saw that, but I'll look into it.

thanks.
Randy Dunlap Oct. 5, 2021, 11:05 p.m. UTC | #5
On 10/5/21 12:04 PM, Randy Dunlap wrote:
> On 10/5/21 4:48 AM, Greg Kroah-Hartman wrote:
>> On Mon, Oct 04, 2021 at 04:21:03PM -0700, Randy Dunlap wrote:
>>> REGMAP_I2C is not a user visible kconfig symbol so driver configs
>>> should not "depend on" it. They should depend on I2C and then
>>> select REGMAP_I2C.
>>>
>>> If this worked, it was only because some other driver had set/enabled
>>> REGMAP_I2C.
>>>
>>> Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")
>>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>>> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>>> Cc: Amelie Delaunay <amelie.delaunay@st.com>
>>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> Cc: linux-usb@vger.kernel.org
>>> ---
>>>   drivers/usb/typec/Kconfig |    4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> With this applied, I get the following build error:
>>
>> drivers/of/Kconfig:69:error: recursive dependency detected!
>> drivers/of/Kconfig:69:    symbol OF_IRQ depends on IRQ_DOMAIN
>> kernel/irq/Kconfig:59:    symbol IRQ_DOMAIN is selected by REGMAP
>> drivers/base/regmap/Kconfig:7:    symbol REGMAP default is visible depending on REGMAP_I2C
>> drivers/base/regmap/Kconfig:20:symbol REGMAP_I2C is selected by TYPEC_STUSB160X
>> drivers/usb/typec/Kconfig:66:    symbol TYPEC_STUSB160X depends on USB_ROLE_SWITCH
>> drivers/usb/roles/Kconfig:3:    symbol USB_ROLE_SWITCH is selected by USB_MUSB_MEDIATEK
>> drivers/usb/musb/Kconfig:119:    symbol USB_MUSB_MEDIATEK depends on GENERIC_PHY
>> drivers/phy/Kconfig:8:    symbol GENERIC_PHY is selected by PHY_BCM_NS_USB3
>> drivers/phy/broadcom/Kconfig:49:    symbol PHY_BCM_NS_USB3 depends on MDIO_BUS
>> drivers/net/mdio/Kconfig:13:    symbol MDIO_BUS depends on MDIO_DEVICE
>> drivers/net/mdio/Kconfig:6:    symbol MDIO_DEVICE is selected by PHYLIB
>> drivers/net/phy/Kconfig:16:    symbol PHYLIB is selected by ARC_EMAC_CORE
>> drivers/net/ethernet/arc/Kconfig:19:    symbol ARC_EMAC_CORE is selected by ARC_EMAC
>> drivers/net/ethernet/arc/Kconfig:25:    symbol ARC_EMAC depends on OF_IRQ
>> For a resolution refer to Documentation/kbuild/kconfig-language.rst
>> subsection "Kconfig recursive dependency limitations"
>>
>> So I can't take it as-is :(
> 
> Darn, I never saw that, but I'll look into it.

Yeah, I easily see that in linux-next instead of mainline.

Still digging into it.  :(
diff mbox series

Patch

--- lnx-515-rc4.orig/drivers/usb/typec/Kconfig
+++ lnx-515-rc4/drivers/usb/typec/Kconfig
@@ -65,9 +65,9 @@  config TYPEC_HD3SS3220
 
 config TYPEC_STUSB160X
 	tristate "STMicroelectronics STUSB160x Type-C controller driver"
-	depends on I2C
-	depends on REGMAP_I2C
 	depends on USB_ROLE_SWITCH || !USB_ROLE_SWITCH
+	depends on I2C
+	select REGMAP_I2C
 	help
 	  Say Y or M here if your system has STMicroelectronics STUSB160x
 	  Type-C port controller.