Skip to contentSkip to conversation

usb: geneirc Kconfig fixes

PATCH Superseded Felipe Contreras 2 participants 15 messages Oct 19, 2010

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover usb: geneirc Kconfig fixes

Hi,

This gets rid of some warnings, makes defconfigs smarter by having more proper dependencies, and general cleanups.

BTW, this is the reason USB_GADGET_MUSB_HDRC sometimes is not selected:
http://article.gmane.org/gmane.linux.kbuild.devel/5480

Felipe Contreras (3):
usb: fix Kconfig warning
usb: trivial Kconfig cleanups
drivers: cleanup Kconfig stuff

 drivers/mfd/Kconfig        |    4 +++-
 drivers/usb/core/Kconfig   |    3 ---
 drivers/usb/gadget/Kconfig |   18 +++---------------
 drivers/usb/musb/Kconfig   |   19 +++++--------------
 4 files changed, 11 insertions(+), 33 deletions(-)
Signature · 1 line
1.7.3.1.2.g7fe2b
#1 lore raw

PATCH 1/3 usb: fix Kconfig warning

warning: (USB_MUSB_HDRC_HCD && USB_SUPPORT && USB_MUSB_HDRC && (USB_MUSB_HOST || USB_MUSB_OTG) && USB_GADGET_MUSB_HDRC || USB_MUSB_OTG && <choice> && USB && USB_GADGET && PM && EXPERIMENTAL) selects USB_OTG which has unmet direct dependencies (USB_GADGET_OMAP && ARCH_OMAP_OTG && USB_OHCI_HCD)

This doesn't seem to happen on 2.6.36-rc8, but still doesn't make sense to keep this useless config.

---
 drivers/usb/gadget/Kconfig |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)
drivers/usb/gadget/Kconfig +0 -11
index cd27f9b..19a6eb6 100644
@@ -209,17 +209,6 @@ config USB_OMAP
 	default USB_GADGET
 	select USB_GADGET_SELECTED
 
-config USB_OTG
-	boolean "OTG Support"
-	depends on USB_GADGET_OMAP && ARCH_OMAP_OTG && USB_OHCI_HCD
-	help
-	   The most notable feature of USB OTG is support for a
-	   "Dual-Role" device, which can act as either a device
-	   or a host.  The initial role choice can be changed
-	   later, when two dual-role devices talk to each other.
-
-	   Select this only if your OMAP board has a Mini-AB connector.
-
 config USB_GADGET_PXA25X
 	boolean "PXA 25x or IXP 4xx"
 	depends on (ARCH_PXA && PXA25x) || ARCH_IXP4XX
Signature · 1 line
1.7.3.1.2.g7fe2b
#2 lore raw

Re: [PATCH 1/3] usb: fix Kconfig warning

Quoted 23 lines · Felipe Contreras

warning: (USB_MUSB_HDRC_HCD && USB_SUPPORT && USB_MUSB_HDRC && (USB_MUSB_HOST || USB_MUSB_OTG) && USB_GADGET_MUSB_HDRC || USB_MUSB_OTG && <choice> && USB && USB_GADGET && PM && EXPERIMENTAL) selects USB_OTG which has unmet direct dependencies (USB_GADGET_OMAP && ARCH_OMAP_OTG && USB_OHCI_HCD)

This doesn't seem to happen on 2.6.36-rc8, but still doesn't make sense to keep this useless config.

---
drivers/usb/gadget/Kconfig | 11 -----------

1 files changed, 0 insertions(+), 11 deletions(-)
drivers/usb/gadget/Kconfig +0 -1
index cd27f9b..19a6eb6 100644
@@ -209,17 +209,6 @@ config USB_OMAP
 	default USB_GADGET
 	select USB_GADGET_SELECTED
 
-config USB_OTG

drivers/usb/gadget/Kconfig config USB_OMAP · line 222

Quoted 10 lines
drivers/usb/gadget/Kconfig +0 -10
-	boolean "OTG Support"
-	depends on USB_GADGET_OMAP && ARCH_OMAP_OTG && USB_OHCI_HCD
-	help
-	   The most notable feature of USB OTG is support for a
-	   "Dual-Role" device, which can act as either a device
-	   or a host.  The initial role choice can be changed
-	   later, when two dual-role devices talk to each other.
-
-	   Select this only if your OMAP board has a Mini-AB connector.
-

ok since this is replicated on drivers/usb/core/Kconfig but it's not reflected on changelog. Could you add some extra comment ?

Signature · 1 line
balbi
#3 lore raw

PATCH 2/3 usb: trivial Kconfig cleanups

In reply to Felipe Contreras
---
 drivers/usb/core/Kconfig   |    3 ---
 drivers/usb/gadget/Kconfig |    2 +-
 drivers/usb/musb/Kconfig   |   17 ++++-------------
 3 files changed, 5 insertions(+), 17 deletions(-)
drivers/usb/core/Kconfig +0 -3
index 9eed5b5..8f57a26 100644
@@ -110,8 +110,6 @@ config USB_OTG
 	bool
 	depends on USB && EXPERIMENTAL
 	depends on USB_SUSPEND
-	default n
-
 
 config USB_OTG_WHITELIST
 	bool "Rely on OTG Targeted Peripherals List"
@@ -139,4 +137,3 @@ config USB_OTG_BLACKLIST_HUB
 	  external hubs.  OTG hosts are allowed to reduce hardware
 	  and software costs by not supporting external hubs.  So
 	  are "Embedded Hosts" that don't offer OTG support.
-
drivers/usb/gadget/Kconfig +1 -1
index 19a6eb6..c530bc6 100644
@@ -125,7 +125,6 @@ choice
 config USB_GADGET_AT91
 	boolean "Atmel AT91 USB Device Port"
 	depends on ARCH_AT91 && !ARCH_AT91SAM9RL && !ARCH_AT91CAP9 && !ARCH_AT91SAM9G45
-	select USB_GADGET_SELECTED
 	help
 	   Many Atmel AT91 processors (such as the AT91RM2000) have a
 	   full speed USB Device Port with support for five configurable
@@ -139,6 +138,7 @@ config USB_AT91
 	tristate
 	depends on USB_GADGET_AT91
 	default USB_GADGET
+	select USB_GADGET_SELECTED
 
 config USB_GADGET_ATMEL_USBA
 	boolean "Atmel USBA"
drivers/usb/musb/Kconfig +4 -13
index cfd38ed..20895c4 100644
@@ -8,12 +8,12 @@ comment "Enable Host or Gadget support to see Inventra options"
 
 # (M)HDRC = (Multipoint) Highspeed Dual-Role Controller
 config USB_MUSB_HDRC
+	tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
 	depends on (USB || USB_GADGET)
 	depends on (ARM || (BF54x && !BF544) || (BF52x && !BF522 && !BF523))
 	select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN)
 	select TWL4030_USB if MACH_OMAP_3430SDP
 	select USB_OTG_UTILS
-	tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
 	help
 	  Say Y here if your system has a dual role high speed USB
 	  controller based on the Mentor Graphics silicon IP.  Then
@@ -79,8 +79,8 @@ choice
 # use USB_MUSB_HDRC_HCD not USB_MUSB_HOST to #ifdef host side support;
 # OTG needs both roles, not just USB_MUSB_HOST.
 config USB_MUSB_HOST
-	depends on USB
 	bool "USB Host"
+	depends on USB
 	help
 	  Say Y here if your system supports the USB host role.
 	  If it has a USB "A" (rectangular), "Mini-A" (uncommon),
@@ -90,8 +90,8 @@ config USB_MUSB_HOST
 # use USB_GADGET_MUSB_HDRC not USB_MUSB_PERIPHERAL to #ifdef peripheral
 # side support ... OTG needs both roles
 config USB_MUSB_PERIPHERAL
-	depends on USB_GADGET
 	bool "USB Peripheral (gadget stack)"
+	depends on USB_GADGET
 	select USB_GADGET_MUSB_HDRC
 	help
 	  Say Y here if your system supports the USB peripheral role.
@@ -100,8 +100,8 @@ config USB_MUSB_PERIPHERAL
 	  (With a "Mini-AB" connector, you should enable USB OTG.)
 
 config USB_MUSB_OTG
-	depends on USB && USB_GADGET && PM && EXPERIMENTAL
 	bool "Both host and peripheral:  USB OTG (On The Go) Device"
+	depends on USB && USB_GADGET && PM && EXPERIMENTAL
 	select USB_GADGET_MUSB_HDRC
 	select USB_OTG
 	help
@@ -125,14 +125,6 @@ config USB_MUSB_OTG
 
 endchoice
 
-# enable peripheral support (including with OTG)
-config USB_GADGET_MUSB_HDRC
-	bool
-	depends on USB_MUSB_HDRC && (USB_MUSB_PERIPHERAL || USB_MUSB_OTG)
-#	default y
-#	select USB_GADGET_DUALSPEED
-#	select USB_GADGET_SELECTED
-
 # enables host support (including with OTG)
 config USB_MUSB_HDRC_HCD
 	bool
@@ -140,7 +132,6 @@ config USB_MUSB_HDRC_HCD
 	select USB_OTG if USB_GADGET_MUSB_HDRC
 	default y
 
-
 config MUSB_PIO_ONLY
 	bool 'Disable DMA (always use PIO)'
 	depends on USB_MUSB_HDRC
Signature · 1 line
1.7.3.1.2.g7fe2b
#4 lore raw

Re: [PATCH 2/3] usb: trivial Kconfig cleanups

hi,

drivers/usb/musb/Kconfig config USB_MUSB_OTG · line 135

Quoted 12 lines · Felipe Contreras
(quoted diff) +0 -0
@@ -125,14 +125,6 @@ config USB_MUSB_OTG
 

endchoice

drivers/usb/musb/Kconfig +0 -8
-# enable peripheral support (including with OTG)
-config USB_GADGET_MUSB_HDRC
-	bool
-	depends on USB_MUSB_HDRC && (USB_MUSB_PERIPHERAL || USB_MUSB_OTG)
-#	default y
-#	select USB_GADGET_DUALSPEED
-#	select USB_GADGET_SELECTED
-
$ git grep -e CONFIG_USB_GADGET_MUSB_HDRC drivers/usb/
drivers/usb/gadget/gadget_chips.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/Makefile:ifeq ($(CONFIG_USB_GADGET_MUSB_HDRC),y)
drivers/usb/musb/am35x.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/da8xx.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#endif /* CONFIG_USB_GADGET_MUSB_HDRC */
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
drivers/usb/musb/musb_core.h:#ifndef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#error bogus Kconfig output ... select CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/tusb6010.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/tusb6010.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/tusb6010.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC

NAK

Signature · 1 line
balbi
#5 lore raw

Re: [PATCH 2/3] usb: trivial Kconfig cleanups

Quoted 33 lines · Felipe Balbi

drivers/usb/musb/Kconfig config USB_MUSB_OTG · line 135

Quoted 13 lines · Felipe Contreras
(quoted diff) +0 -0
@@ -125,14 +125,6 @@ config USB_MUSB_OTG
 

endchoice

drivers/usb/musb/Kconfig +0 -8
-# enable peripheral support (including with OTG)
-config USB_GADGET_MUSB_HDRC
-       bool
-       depends on USB_MUSB_HDRC && (USB_MUSB_PERIPHERAL || USB_MUSB_OTG)
-#      default y
-#      select USB_GADGET_DUALSPEED
-#      select USB_GADGET_SELECTED
-
$ git grep -e CONFIG_USB_GADGET_MUSB_HDRC drivers/usb/
drivers/usb/gadget/gadget_chips.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/Makefile:ifeq ($(CONFIG_USB_GADGET_MUSB_HDRC),y)
drivers/usb/musb/am35x.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/da8xx.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#endif /* CONFIG_USB_GADGET_MUSB_HDRC */
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
drivers/usb/musb/musb_core.h:#ifndef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#error bogus Kconfig output ... select
CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
Quoted 8 lines
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/tusb6010.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/tusb6010.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/tusb6010.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC

So?

% git grep USB_GADGET_MUSB_HDRC -- '*/Kconfig' drivers/usb/gadget/Kconfig:config USB_GADGET_MUSB_HDRC drivers/usb/musb/Kconfig:# use USB_GADGET_MUSB_HDRC not USB_MUSB_PERIPHERAL to #ifdef peripheral

drivers/usb/musb/Kconfig:       select USB_GADGET_MUSB_HDRC
drivers/usb/musb/Kconfig:       select USB_GADGET_MUSB_HDRC

drivers/usb/musb/Kconfig:config USB_GADGET_MUSB_HDRC
drivers/usb/musb/Kconfig: select USB_OTG if USB_GADGET_MUSB_HDRC

(it's defined twice)

Signature · 1 line
Felipe Contreras
#6 lore raw

Re: [PATCH 2/3] usb: trivial Kconfig cleanups

Quoted 49 lines · Felipe Contreras
Quoted 33 lines · Felipe Balbi

drivers/usb/musb/Kconfig config USB_MUSB_OTG · line 135

Quoted 13 lines · Felipe Contreras
(quoted diff) +0 -0
@@ -125,14 +125,6 @@ config USB_MUSB_OTG
 

endchoice

drivers/usb/musb/Kconfig +0 -8
-# enable peripheral support (including with OTG)
-config USB_GADGET_MUSB_HDRC
-       bool
-       depends on USB_MUSB_HDRC && (USB_MUSB_PERIPHERAL || USB_MUSB_OTG)
-#      default y
-#      select USB_GADGET_DUALSPEED
-#      select USB_GADGET_SELECTED
-
$ git grep -e CONFIG_USB_GADGET_MUSB_HDRC drivers/usb/
drivers/usb/gadget/gadget_chips.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/Makefile:ifeq ($(CONFIG_USB_GADGET_MUSB_HDRC),y)
drivers/usb/musb/am35x.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/da8xx.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#endif /* CONFIG_USB_GADGET_MUSB_HDRC */
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.c:#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
drivers/usb/musb/musb_core.h:#ifndef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#error bogus Kconfig output ... select
CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
Quoted 8 lines
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/musb_core.h:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/tusb6010.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/tusb6010.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC
drivers/usb/musb/tusb6010.c:#ifdef CONFIG_USB_GADGET_MUSB_HDRC

So?

% git grep USB_GADGET_MUSB_HDRC -- '*/Kconfig' drivers/usb/gadget/Kconfig:config USB_GADGET_MUSB_HDRC drivers/usb/musb/Kconfig:# use USB_GADGET_MUSB_HDRC not USB_MUSB_PERIPHERAL to #ifdef peripheral

Quoted 6 lines
drivers/usb/musb/Kconfig:       select USB_GADGET_MUSB_HDRC
drivers/usb/musb/Kconfig:       select USB_GADGET_MUSB_HDRC

drivers/usb/musb/Kconfig:config USB_GADGET_MUSB_HDRC
drivers/usb/musb/Kconfig: select USB_OTG if USB_GADGET_MUSB_HDRC

(it's defined twice)

you're right, had missed that. This is ok too.

Signature · 1 line
balbi
#7 lore raw

PATCH 3/3 drivers: cleanup Kconfig stuff

In reply to Felipe Contreras

Add missing dependencies, and remove redundant ones.

---
 drivers/mfd/Kconfig        |    4 +++-
 drivers/usb/gadget/Kconfig |    5 ++---
 drivers/usb/musb/Kconfig   |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
drivers/mfd/Kconfig +3 -1
index db51ea1..523df52 100644
@@ -156,6 +156,8 @@ config MENELAUS
 config TWL4030_CORE
 	bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
 	depends on I2C=y && GENERIC_HARDIRQS
+	depends on ARCH_OMAP3 || ARCH_OMAP4
+	default y
 	help
 	  Say yes here if you have TWL4030 / TWL6030 family chip on your board.
 	  This core driver provides register access and IRQ handling
@@ -169,7 +171,7 @@ config TWL4030_CORE
 
 config TWL4030_POWER
 	bool "Support power resources on TWL4030 family chips"
-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE
 	help
 	  Say yes here if you want to use the power resources on the
 	  TWL4030 family chips.  Most of these resources are regulators,
drivers/usb/gadget/Kconfig +2 -3
index c530bc6..1fb074f 100644
@@ -111,7 +111,6 @@ config	USB_GADGET_SELECTED
 #
 choice
 	prompt "USB Peripheral Controller"
-	depends on USB_GADGET
 	help
 	   A USB device uses a controller to talk to its host.
 	   Systems should have only one such upstream link.
@@ -191,7 +190,6 @@ config USB_GADGET_OMAP
 	boolean "OMAP USB Device Controller"
 	depends on ARCH_OMAP
 	select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG
-	select USB_OTG_UTILS if ARCH_OMAP
 	help
 	   Many Texas Instruments OMAP processors have flexible full
 	   speed USB device controllers, with support for up to 30
@@ -842,7 +840,8 @@ config USB_CDC_COMPOSITE
 
 config USB_G_NOKIA
 	tristate "Nokia composite gadget"
-	depends on PHONET
+	depends on PHONET && MACH_NOKIA_RX51
+	depends on USB_GADGET_MUSB_HDRC
 	help
 	  The Nokia composite gadget provides support for acm, obex
 	  and phonet in only one composite gadget driver.
drivers/usb/musb/Kconfig +1 -1
index 20895c4..5484258 100644
@@ -12,7 +12,7 @@ config USB_MUSB_HDRC
 	depends on (USB || USB_GADGET)
 	depends on (ARM || (BF54x && !BF544) || (BF52x && !BF522 && !BF523))
 	select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN)
-	select TWL4030_USB if MACH_OMAP_3430SDP
+	select TWL4030_USB if ARCH_OMAP3
 	select USB_OTG_UTILS
 	help
 	  Say Y here if your system has a dual role high speed USB
Signature · 1 line
1.7.3.1.2.g7fe2b
#8 lore raw

Re: [PATCH 3/3] drivers: cleanup Kconfig stuff

Hi,

drivers/mfd/Kconfig config MENELAUS · line 159

Quoted 9 lines · Felipe Contreras
drivers/mfd/Kconfig +0 -0
index db51ea1..523df52 100644
@@ -156,6 +156,8 @@ config MENELAUS

config TWL4030_CORE

	bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
	depends on I2C=y && GENERIC_HARDIRQS
drivers/mfd/Kconfig +1 -0
+	depends on ARCH_OMAP3 || ARCH_OMAP4

It's just an i2c chip, not depending on OMAP will allow us for a much needed compile test on linux-next with different architectures.

drivers/mfd/Kconfig config TWL4030_CORE · line 174

Quoted 6 lines
drivers/mfd/Kconfig +0 -0
@@ -169,7 +171,7 @@ config TWL4030_CORE
 

config TWL4030_POWER
bool "Support power resources on TWL4030 family chips"

drivers/mfd/Kconfig +1 -1
-	depends on TWL4030_CORE && ARM
+	depends on TWL4030_CORE

ok.

drivers/mfd/Kconfig config USB_GADGET_OMAP · line 194

Quoted 5 lines
drivers/mfd/Kconfig +0 -1
@@ -191,7 +190,6 @@ config USB_GADGET_OMAP
 	boolean "OMAP USB Device Controller"
 	depends on ARCH_OMAP
 	select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG
-	select USB_OTG_UTILS if ARCH_OMAP

ok.

drivers/mfd/Kconfig

Quoted 6 lines
drivers/mfd/Kconfig +0 -0
@@ -842,7 +840,8 @@ config USB_CDC_COMPOSITE
 

config USB_G_NOKIA
tristate "Nokia composite gadget"

drivers/mfd/Kconfig +1 -1
-	depends on PHONET
+	depends on PHONET && MACH_NOKIA_RX51

no. g_nokia only depends on PHONET, if someone else wants to use on another board, it's fine by me. Otherwise we will have to keep on adding more and more boards.

drivers/mfd/Kconfig

Quoted 1 line
drivers/mfd/Kconfig +1 -0
+	depends on USB_GADGET_MUSB_HDRC

this gadget also works on controllers other than musb. As long as they support enough endpoints and alternate settings, it should just work.

It was fine as it was before. NAK

drivers/usb/musb/Kconfig config USB_MUSB_HDRC · line 15

Quoted 10 lines
drivers/usb/musb/Kconfig +1 -1
index 20895c4..5484258 100644
@@ -12,7 +12,7 @@ config USB_MUSB_HDRC
 	depends on (USB || USB_GADGET)
 	depends on (ARM || (BF54x && !BF544) || (BF52x && !BF522 && !BF523))
 	select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN)
-	select TWL4030_USB if MACH_OMAP_3430SDP
+	select TWL4030_USB if ARCH_OMAP3

we have omap3-based boards which don't use twl4030-usb, they use nop-usb-xceiv. How do you want to handle that ?? NAK

Signature · 1 line
balbi
#9 lore raw

Re: [PATCH 3/3] drivers: cleanup Kconfig stuff

Quoted 14 lines · Felipe Balbi
Quoted 10 lines · Felipe Contreras
drivers/mfd/Kconfig +0 -0
index db51ea1..523df52 100644
@@ -156,6 +156,8 @@ config MENELAUS

config TWL4030_CORE
       bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support" depends on I2C=y && GENERIC_HARDIRQS
+       depends on ARCH_OMAP3 || ARCH_OMAP4

It's just an i2c chip, not depending on OMAP will allow us for a much needed compile test on linux-next with different architectures.

Ok.

Quoted 10 lines
Quoted 6 lines
drivers/mfd/Kconfig +0 -0
@@ -842,7 +840,8 @@ config USB_CDC_COMPOSITE
 

config USB_G_NOKIA
       tristate "Nokia composite gadget"
-       depends on PHONET
+       depends on PHONET && MACH_NOKIA_RX51

no. g_nokia only depends on PHONET, if someone else wants to use on another board, it's fine by me. Otherwise we will have to keep on adding more and more boards.

Ok.

Quoted 6 lines
Quoted 1 line

+       depends on USB_GADGET_MUSB_HDRC

this gadget also works on controllers other than musb. As long as they support enough endpoints and alternate settings, it should just work.

It was fine as it was before. NAK

It's not fine. You can build with CONFIG_USB_G_NOKIA=y, and it doesn't work. Definitely some dependency is missing.

Quoted 6 lines
Quoted 6 lines
drivers/usb/musb/Kconfig +0 -0
index 20895c4..5484258 100644
@@ -12,7 +12,7 @@ config USB_MUSB_HDRC
        depends on (USB || USB_GADGET)
Quoted 8 lines
Quoted 5 lines

       depends on (ARM || (BF54x && !BF544) || (BF52x && !BF522 && !BF523))
       select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN)
-       select TWL4030_USB if MACH_OMAP_3430SDP
+       select TWL4030_USB if ARCH_OMAP3

we have omap3-based boards which don't use twl4030-usb, they use nop-usb-xceiv. How do you want to handle that ?? NAK

How do you handle USB_MUSB_HDRC=y and NOP_USB_XCEIV=n and TWL4030_USB=n?

depends on (NOP_USB_XCEIV || TWL4030_USB) ?

Signature · 1 line
Felipe Contreras
#10 lore raw

Re: [PATCH 3/3] drivers: cleanup Kconfig stuff

Hi,

Quoted 4 lines · Felipe Contreras
Quoted 1 line

It was fine as it was before. NAK

It's not fine. You can build with CONFIG_USB_G_NOKIA=y, and it doesn't work. Definitely some dependency is missing.

if phonet is not set it should not build. If phonet is set to module and g_nokia to built-in, then it's your mistake.

Quoted 3 lines

How do you handle USB_MUSB_HDRC=y and NOP_USB_XCEIV=n and TWL4030_USB=n?

depends on (NOP_USB_XCEIV || TWL4030_USB) ?

you're selecting, not depending on this patch. What I mean is that you will enable a useless driver on some boards if you "select TWL4030_USB if ARCH_OMAP3"

Signature · 1 line
balbi
#11 lore raw

Re: [PATCH 3/3] drivers: cleanup Kconfig stuff

Quoted 9 lines · Felipe Balbi
Quoted 5 lines · Felipe Contreras
Quoted 2 lines

It was fine as it was before. NAK

It's not fine. You can build with CONFIG_USB_G_NOKIA=y, and it doesn't work. Definitely some dependency is missing.

if phonet is not set it should not build. If phonet is set to module and g_nokia to built-in, then it's your mistake.

I'm not talking about phonet, I replied to your comment regarding USB_GADGET_MUSB_HDRC. For me USB_GADGET_MUSB_HDRC=n USB_G_NOKIA=y doesn't work, but the Kconfig allows it.

Quoted 7 lines
Quoted 3 lines

How do you handle USB_MUSB_HDRC=y and NOP_USB_XCEIV=n and TWL4030_USB=n?

depends on (NOP_USB_XCEIV || TWL4030_USB) ?

you're selecting, not depending on this patch. What I mean is that you will enable a useless driver on some boards if you "select TWL4030_USB if ARCH_OMAP3"

Ok, I'll make it: depends on (NOP_USB_XCEIV || TWL4030_USB)

BTW, if you want to try this:
./scripts/kconfig/conf --defconfig=usb_defconfig arch/arm/Kconfig

usb_defconfig:
CONFIG_ARCH_OMAP=y
CONFIG_EXPERIMENTAL=y
CONFIG_NET=y
CONFIG_PHONET=y

CONFIG_USB=y
CONFIG_USB_GADGET=y
CONFIG_USB_MUSB_OTG=y
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_G_NOKIA=y

# TODO USB_MUSB_OTG should select this
CONFIG_USB_GADGET_MUSB_HDRC=y

I expect TWL4030_USB and USB_OTG to be automatically selected.

Signature · 1 line
Felipe Contreras
#12 lore raw

Re: [PATCH 3/3] drivers: cleanup Kconfig stuff

Hi,

Quoted 3 lines · Felipe Contreras

I'm not talking about phonet, I replied to your comment regarding USB_GADGET_MUSB_HDRC. For me USB_GADGET_MUSB_HDRC=n USB_G_NOKIA=y doesn't work, but the Kconfig allows it.

I see, that's a problem for sure.

Quoted 17 lines

Ok, I'll make it: depends on (NOP_USB_XCEIV || TWL4030_USB)

BTW, if you want to try this:
./scripts/kconfig/conf --defconfig=usb_defconfig arch/arm/Kconfig

usb_defconfig:
CONFIG_ARCH_OMAP=y
CONFIG_EXPERIMENTAL=y
CONFIG_NET=y
CONFIG_PHONET=y

CONFIG_USB=y
CONFIG_USB_GADGET=y
CONFIG_USB_MUSB_OTG=y
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_G_NOKIA=y

Quoted 4 lines

# TODO USB_MUSB_OTG should select this
CONFIG_USB_GADGET_MUSB_HDRC=y

I expect TWL4030_USB and USB_OTG to be automatically selected.

could be, but that's a board-by-board thing. It's not mandatory to have twl4030-usb, it's mandatory to have a transceiver, not matter which one it is.

Signature · 1 line
balbi
#13 lore raw

Re: [PATCH 3/3] drivers: cleanup Kconfig stuff

Quoted 25 lines · Felipe Balbi
Quoted 4 lines · Felipe Contreras

I'm not talking about phonet, I replied to your comment regarding USB_GADGET_MUSB_HDRC. For me USB_GADGET_MUSB_HDRC=n USB_G_NOKIA=y doesn't work, but the Kconfig allows it.

I see, that's a problem for sure.

Quoted 17 lines

Ok, I'll make it: depends on (NOP_USB_XCEIV || TWL4030_USB)

BTW, if you want to try this:
./scripts/kconfig/conf --defconfig=usb_defconfig arch/arm/Kconfig

usb_defconfig:
CONFIG_ARCH_OMAP=y
CONFIG_EXPERIMENTAL=y
CONFIG_NET=y
CONFIG_PHONET=y

CONFIG_USB=y
CONFIG_USB_GADGET=y
CONFIG_USB_MUSB_OTG=y
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_G_NOKIA=y

Quoted 8 lines
Quoted 4 lines

# TODO USB_MUSB_OTG should select this
CONFIG_USB_GADGET_MUSB_HDRC=y

I expect TWL4030_USB and USB_OTG to be automatically selected.

could be, but that's a board-by-board thing. It's not mandatory to have twl4030-usb, it's mandatory to have a transceiver, not matter which one it is.

I see, but is it possible that in a board you have the two? If not, there must be a way to find the correct transceiver based on the configuration. If yes, then there must be a way to select a sensible one by default, rather than not having any.

This way, for example it would be possible to get rid of some lines in a minimal n900_defconfig (used in MeeGo[1]), and eventually hopefully get rid of all of them (except CONFIG_SND_OMAP_SOC_RX51=y).

[1] http://meego.gitorious.org/meego-os-base/kernel-source/blobs/master/config-arm-n900

Signature · 1 line
Felipe Contreras
#14 lore raw

Re: [PATCH 3/3] drivers: cleanup Kconfig stuff

Hi,

Quoted 1 line · Felipe Contreras

I see, but is it possible that in a board you have the two? If not,

Yes. N900 is one of them :-) It has twl4030-usb for VBUS/ID (id isn't used) and isp1707 for data lines. It's insane but it's becoming more and more common to see a HW with two transceivers.

Quoted 3 lines

there must be a way to find the correct transceiver based on the configuration. If yes, then there must be a way to select a sensible one by default, rather than not having any.

True, but currently that's not the case. We needed a real usb transceiver "class" (or something else) where you have something like:

struct usb_xceiv {
	struct list_head	head;
	struct device		dev;
	unsigned		capabilities;
	...
};

then you define a transceiver with:

struct usb_xceiv twl4030_usb {
	.name		= "twl4030-usb",
	.capabilities	= USB_XCEIV_CAP_VBUS
		| USB_XCEIV_CAP_DETECT_CHARGER
		| USB_XCEIV_CAP_DATA
		| USB_XCEIV_CAP_WHATEVER_BOARD_NEEDS,
	...
};

capabilities will also be board-specific in most cases, so you could bring that from platform_data. Currently there's no such thing and I'm too busy with musb/ehci/ohci/UDC Class to start that.

BTW, this also means the otg_transceiver is a mis-name as a transceiver is needed in any connection is isn't TLL (transceiver-less link), so you have usb transceiver in host-only and gadget-only configurations too.

If nobody starts the usb_xceiv class, I'll do it at some point and while doing that drivers/usb/otg will be renamed to drivers/usb/xceiv together with all structures and headers. Drivers/usb/otg will hold real otg peculiarities.

Quoted 3 lines

This way, for example it would be possible to get rid of some lines in a minimal n900_defconfig (used in MeeGo[1]), and eventually hopefully get rid of all of them (except CONFIG_SND_OMAP_SOC_RX51=y).

true, it would also allow you to have one binary for all your products :-) althought not so optimal, it's good to ease development/testing.

Signature · 1 line
balbi