2007-12-23 11:50:40

by Al Boldi

[permalink] [raw]
Subject: [PATCH] USB Kconfig: Reorganize USB Kconfig Menu


Reogranize USB Kconfig Menu, and move USB_GADGET out into the Device Driver
Menu. This helps the USB Kconfig Menu to be more logical/usable.

Cc: David Brownell <[email protected]>
Cc: Greg KH <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Al Boldi <[email protected]>

---

--- 23.a/drivers/Kconfig
+++ 23.b/drivers/Kconfig
@@ -70,6 +70,8 @@ source "drivers/hid/Kconfig"

source "drivers/usb/Kconfig"

+source "drivers/usb/gadget/Kconfig"
+
source "drivers/mmc/Kconfig"

source "drivers/leds/Kconfig"
--- 23.a/drivers/usb/Kconfig
+++ 23.b/drivers/usb/Kconfig
@@ -2,8 +2,8 @@
# USB device configuration
#

-menuconfig USB_SUPPORT
- bool "USB support"
+config USB_SUPPORT
+ bool
depends on HAS_IOMEM
default y
---help---
@@ -52,8 +52,8 @@ config USB_ARCH_HAS_EHCI
default PCI

# ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.
-config USB
- tristate "Support for Host-side USB"
+menuconfig USB
+ tristate "Host-side USB"
depends on USB_ARCH_HAS_HCD
---help---
Universal Serial Bus (USB) is a specification for a serial bus
@@ -87,21 +87,16 @@ config USB
To compile this driver as a module, choose M here: the
module will be called usbcore.

+if USB
+
source "drivers/usb/core/Kconfig"

source "drivers/usb/host/Kconfig"

-source "drivers/usb/class/Kconfig"
-
source "drivers/usb/storage/Kconfig"

-source "drivers/usb/image/Kconfig"
-
source "drivers/usb/mon/Kconfig"

-comment "USB port drivers"
- depends on USB
-
config USB_USS720
tristate "USS720 parport driver"
depends on USB && PARPORT
@@ -133,10 +128,13 @@ config USB_USS720

source "drivers/usb/serial/Kconfig"

-source "drivers/usb/misc/Kconfig"
-
source "drivers/usb/atm/Kconfig"

-source "drivers/usb/gadget/Kconfig"
+source "drivers/usb/class/Kconfig"
+
+source "drivers/usb/image/Kconfig"
+
+source "drivers/usb/misc/Kconfig"

+endif # USB
endif # USB_SUPPORT
--- 23.a/drivers/usb/serial/Kconfig
+++ 23.b/drivers/usb/serial/Kconfig
@@ -2,10 +2,7 @@
# USB Serial device configuration
#

-menu "USB Serial Converter support"
- depends on USB!=n
-
-config USB_SERIAL
+menuconfig USB_SERIAL
tristate "USB Serial Converter support"
depends on USB
---help---
@@ -20,6 +17,8 @@ config USB_SERIAL
To compile this driver as a module, choose M here: the
module will be called usbserial.

+if USB_SERIAL
+
config USB_SERIAL_CONSOLE
bool "USB Serial Console device support (EXPERIMENTAL)"
depends on USB_SERIAL=y && EXPERIMENTAL
@@ -581,5 +580,4 @@ config USB_EZUSB
default y


-endmenu
-
+endif # USB_SERIAL
--- 23.a/drivers/usb/core/Kconfig
+++ 23.b/drivers/usb/core/Kconfig
@@ -1,6 +1,12 @@
#
# USB Core configuration
#
+menuconfig USB_CORE_MENU
+ bool "USB Core Config"
+ depends on USB
+
+if USB_CORE_MENU
+
config USB_DEBUG
bool "USB verbose debug messages"
depends on USB
@@ -142,3 +148,4 @@ config USB_OTG_BLACKLIST_HUB
external hubs. OTG hosts are allowed to reduce hardware
and software costs by not supporting external hubs.

+endif # USB_CORE_MENU
--- 23.a/drivers/usb/host/Kconfig
+++ 23.b/drivers/usb/host/Kconfig
@@ -1,7 +1,7 @@
#
# USB Host Controller Drivers
#
-comment "USB Host Controller Drivers"
+menu "USB Host Controller Drivers"
depends on USB

config USB_EHCI_HCD
@@ -248,3 +248,4 @@ config USB_R8A66597_HCD
To compile this driver as a module, choose M here: the
module will be called r8a66597-hcd.

+endmenu
--- 23.a/drivers/usb/class/Kconfig
+++ 23.b/drivers/usb/class/Kconfig
@@ -1,9 +1,12 @@
#
# USB Class driver configuration
#
-comment "USB Device Class drivers"
+menuconfig USB_DEVICE_CLASS_MENU
+ bool "USB Device Class drivers"
depends on USB

+if USB_DEVICE_CLASS_MENU
+
config USB_ACM
tristate "USB Modem (CDC ACM) support"
depends on USB
@@ -29,3 +32,4 @@ config USB_PRINTER
To compile this driver as a module, choose M here: the
module will be called usblp.

+endif # USB_DEVICE_CLASS_MENU
--- 23.a/drivers/usb/gadget/Kconfig
+++ 23.b/drivers/usb/gadget/Kconfig
@@ -12,10 +12,8 @@
# With help from a special transceiver and a "Mini-AB" jack, systems with
# both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG).
#
-menu "USB Gadget Support"
-
-config USB_GADGET
- tristate "Support for USB Gadgets"
+menuconfig USB_GADGET
+ tristate "Peripheral-side USB"
help
USB is a master/slave protocol, organized with one master
host (such as a PC) controlling up to 127 peripheral devices.
@@ -42,6 +40,8 @@ config USB_GADGET
For more information, see <http://www.linux-usb.org/gadget> and
the kernel DocBook documentation for this API.

+if USB_GADGET
+
config USB_GADGET_DEBUG
boolean "Debugging messages"
depends on USB_GADGET && DEBUG_KERNEL && EXPERIMENTAL
@@ -522,4 +522,4 @@ config USB_MIDI_GADGET

endchoice

-endmenu
+endif # USB_GADGET
--- 23.a/drivers/usb/storage/Kconfig
+++ 23.b/drivers/usb/storage/Kconfig
@@ -2,11 +2,12 @@
# USB Storage driver configuration
#

-comment "NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'"
-comment "may also be needed; see USB_STORAGE Help for more information"
+comment "NOTE: USB_STORAGE needs SCSI, and 'SCSI disk support' may"
+ depends on USB
+comment "also be needed; see USB_STORAGE Help for more information"
depends on USB

-config USB_STORAGE
+menuconfig USB_STORAGE
tristate "USB Mass Storage support"
depends on USB && SCSI
---help---
--- 23.a/drivers/usb/atm/Kconfig
+++ 23.b/drivers/usb/atm/Kconfig
@@ -2,10 +2,7 @@
# USB/ATM DSL configuration
#

-menu "USB DSL modem support"
- depends on USB
-
-config USB_ATM
+menuconfig USB_ATM
tristate "USB DSL modem support"
depends on USB && ATM
select CRC32
@@ -18,6 +15,8 @@ config USB_ATM
To compile this driver as a module, choose M here: the
module will be called usbatm.

+if USB_ATM
+
config USB_SPEEDTOUCH
tristate "Speedtouch USB support"
depends on USB_ATM
@@ -70,4 +69,4 @@ config USB_XUSBATM
To compile this driver as a module, choose M here: the
module will be called xusbatm.

-endmenu
+endif # USB_ATM
--- 23.a/drivers/usb/image/Kconfig
+++ 23.b/drivers/usb/image/Kconfig
@@ -1,9 +1,12 @@
#
# USB Imageing devices configuration
#
-comment "USB Imaging devices"
+menuconfig USB_IMG_MENU
+ bool "USB Imaging devices"
depends on USB

+if USB_IMG_MENU
+
config USB_MDC800
tristate "USB Mustek MDC800 Digital Camera support (EXPERIMENTAL)"
depends on USB && EXPERIMENTAL
@@ -28,3 +31,5 @@ config USB_MICROTEK
The scanner will appear as a scsi generic device to the rest
of the system. Scsi support is required.
This driver can be compiled as a module, called microtek.
+
+endif # USB_IMG_MENU
--- 23.a/drivers/usb/misc/Kconfig
+++ 23.b/drivers/usb/misc/Kconfig
@@ -1,9 +1,12 @@
#
# USB Miscellaneous driver configuration
#
-comment "USB Miscellaneous drivers"
+menuconfig USB_MISC_MENU
+ bool "USB Miscellaneous drivers"
depends on USB

+if USB_MISC_MENU
+
config USB_EMI62
tristate "EMI 6|2m USB Audio interface support"
depends on USB
@@ -269,3 +272,4 @@ config USB_TEST
See <http://www.linux-usb.org/usbtest/> for more information,
including sample test device firmware and "how to use it".

+endif # USB_MISC_MENU


2007-12-23 12:37:37

by Jan Engelhardt

[permalink] [raw]
Subject: Re: [PATCH] USB Kconfig: Reorganize USB Kconfig Menu


On Dec 23 2007 14:49, Al Boldi wrote:
>--- 23.a/drivers/usb/Kconfig
>+++ 23.b/drivers/usb/Kconfig
>@@ -2,8 +2,8 @@
> # USB device configuration
> #
>
>-menuconfig USB_SUPPORT
>- bool "USB support"
>+config USB_SUPPORT
>+ bool
> depends on HAS_IOMEM
> default y
> ---help---

With this patch, is USB_SUPPORT still needed? It is not visible (anymore),
always is y and no other options select/depend on it (according to
Kconfig '/' function).

Looks good.

2007-12-23 13:18:19

by Al Boldi

[permalink] [raw]
Subject: Re: [PATCH] USB Kconfig: Reorganize USB Kconfig Menu

Jan Engelhardt wrote:
> On Dec 23 2007 14:49, Al Boldi wrote:
> >--- 23.a/drivers/usb/Kconfig
> >+++ 23.b/drivers/usb/Kconfig
> >@@ -2,8 +2,8 @@
> > # USB device configuration
> > #
> >
> >-menuconfig USB_SUPPORT
> >- bool "USB support"
> >+config USB_SUPPORT
> >+ bool
> > depends on HAS_IOMEM
> > default y
> > ---help---
>
> With this patch, is USB_SUPPORT still needed? It is not visible (anymore),
> always is y and no other options select/depend on it (according to
> Kconfig '/' function).

Well, I left it in, because of defconfig dependencies, and HAS_IOMEM is
needed for a few archs.

> Looks good.


Thanks!

--
Al

2007-12-23 15:25:40

by Jan Engelhardt

[permalink] [raw]
Subject: Re: [PATCH] USB Kconfig: Reorganize USB Kconfig Menu


On Dec 23 2007 16:15, Al Boldi wrote:
>> >-menuconfig USB_SUPPORT
>> >- bool "USB support"
>> >+config USB_SUPPORT
>> >+ bool
>> > depends on HAS_IOMEM
>> > default y
>> > ---help---
>>
>> With this patch, is USB_SUPPORT still needed? It is not visible (anymore),
>> always is y and no other options select/depend on it (according to
>> Kconfig '/' function).
>
>Well, I left it in, because of defconfig dependencies, and HAS_IOMEM is
>needed for a few archs.
>
But I do not see any config option that depends on USB_SUPPORT.

2007-12-23 15:27:30

by Jan Engelhardt

[permalink] [raw]
Subject: Re: [PATCH] USB Kconfig: Reorganize USB Kconfig Menu


On Dec 23 2007 16:25, Jan Engelhardt wrote:
>On Dec 23 2007 16:15, Al Boldi wrote:
>>> >-menuconfig USB_SUPPORT
>>> >- bool "USB support"
>>> >+config USB_SUPPORT
>>> >+ bool
>>> > depends on HAS_IOMEM
>>> > default y
>>> > ---help---
>>>
>>> With this patch, is USB_SUPPORT still needed? It is not visible (anymore),
>>> always is y and no other options select/depend on it (according to
>>> Kconfig '/' function).
>>
>>Well, I left it in, because of defconfig dependencies, and HAS_IOMEM is
>>needed for a few archs.
>>
>But I do not see any config option that depends on USB_SUPPORT.
>
Nevermind, I just grepped for 'depends on.*USB_SUPPORT' rather than 'if
USB_SUPPORT'.

2007-12-27 22:19:17

by David Brownell

[permalink] [raw]
Subject: Re: [PATCH] USB Kconfig: Reorganize USB Kconfig Menu

On Sunday 23 December 2007, Al Boldi wrote:
>
> Reogranize USB Kconfig Menu, and move USB_GADGET out into the Device Driver
> Menu. This helps the USB Kconfig Menu to be more logical/usable.
>
> Cc: David Brownell <[email protected]>
> Cc: Greg KH <[email protected]>
> Cc: Andrew Morton <[email protected]>
> Signed-off-by: Al Boldi <[email protected]>

Along those lines, sure ... but this particular patch can't quite
be the answer. For one thing, it rather critially needs the appended,
else it won't work on ARM. (And quite a lot of the ARM platforms
need the gadget stack!!)

There are ISTR a few other platforms which, for reasons unknown to
me, don't source drivers/Kconfig but recreate portions of it on
their own ... that's not something that this patch should change.

Also, looking at this in xconfig shows some oddness. That "core"
submenu holds stuff that would logically be part of the toplevel
menu for host side USB. While that toplevel menu has the USS720
driver, which seems more like a "miscellany" thing...

The comment about SCSI shouldn't show when SCSI is defined; and
the comment aboue "SCSI disk support" belongs with the mass storage
menu, not at the top level. The way that the mass storage menu
is presented also hides the fact that you can get fully functional
mass storage support without checking *any* of the drivers there,
since the core already handles standard devices.

That "ARCH_HAS_HCD" mess has IMO outlived its utility, and should
vanish.

- Dave



--- a/arch/arm/Kconfig 2007-12-27 14:01:31.000000000 -0800
+++ b/arch/arm/Kconfig 2007-12-27 14:01:43.000000000 -0800
@@ -1068,6 +1068,8 @@ source "drivers/hid/Kconfig"

source "drivers/usb/Kconfig"

+source "drivers/usb/gadget/Kconfig"
+
source "drivers/mmc/Kconfig"

source "drivers/leds/Kconfig"

2007-12-28 23:35:26

by Adrian Bunk

[permalink] [raw]
Subject: Re: [PATCH] USB Kconfig: Reorganize USB Kconfig Menu

On Thu, Dec 27, 2007 at 02:18:58PM -0800, David Brownell wrote:
> On Sunday 23 December 2007, Al Boldi wrote:
> >
> > Reogranize USB Kconfig Menu, and move USB_GADGET out into the Device Driver
> > Menu. This helps the USB Kconfig Menu to be more logical/usable.
> >
> > Cc: David Brownell <[email protected]>
> > Cc: Greg KH <[email protected]>
> > Cc: Andrew Morton <[email protected]>
> > Signed-off-by: Al Boldi <[email protected]>
>
> Along those lines, sure ... but this particular patch can't quite
> be the answer. For one thing, it rather critially needs the appended,
> else it won't work on ARM. (And quite a lot of the ARM platforms
> need the gadget stack!!)
>
> There are ISTR a few other platforms which, for reasons unknown to
> me, don't source drivers/Kconfig but recreate portions of it on
> their own ... that's not something that this patch should change.

$ find . -name Kconfig\* | xargs grep drivers/usb/Kconfig
./arch/arm/Kconfig:source "drivers/usb/Kconfig"
./arch/cris/Kconfig:source "drivers/usb/Kconfig"
./arch/h8300/Kconfig:source "drivers/usb/Kconfig"
./arch/v850/Kconfig:source "drivers/usb/Kconfig"
./drivers/Kconfig:source "drivers/usb/Kconfig"
$

> Also, looking at this in xconfig shows some oddness. That "core"
> submenu holds stuff that would logically be part of the toplevel
> menu for host side USB. While that toplevel menu has the USS720
> driver, which seems more like a "miscellany" thing...
>
> The comment about SCSI shouldn't show when SCSI is defined; and
> the comment aboue "SCSI disk support" belongs with the mass storage
> menu, not at the top level. The way that the mass storage menu
> is presented also hides the fact that you can get fully functional
> mass storage support without checking *any* of the drivers there,
> since the core already handles standard devices.
>...

The SCSI dependency should be handled through select - there's no
reason for bothering the kconfig user wih such implementation details.

> - Dave
>...


cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2007-12-30 19:10:34

by Al Boldi

[permalink] [raw]
Subject: Re: [PATCH] USB Kconfig: Reorganize USB Kconfig Menu

Adrian Bunk wrote:
> On Thu, Dec 27, 2007 at 02:18:58PM -0800, David Brownell wrote:
> > Also, looking at this in xconfig shows some oddness. That "core"
> > submenu holds stuff that would logically be part of the toplevel
> > menu for host side USB. While that toplevel menu has the USS720
> > driver, which seems more like a "miscellany" thing...

This one probably belongs in its own sub-menu, but as it is only one option,
it's not considered worthwhile, so we leave it as is.

> > The comment about SCSI shouldn't show when SCSI is defined; and
> > the comment aboue "SCSI disk support" belongs with the mass storage
> > menu, not at the top level. The way that the mass storage menu
> > is presented also hides the fact that you can get fully functional
> > mass storage support without checking *any* of the drivers there,
> > since the core already handles standard devices.
> >...
>
> The SCSI dependency should be handled through select - there's no
> reason for bothering the kconfig user wih such implementation details.

Agreed, and while we are at it, also select ATM for DSL, like this:

--- 23.a/drivers/usb/atm/Kconfig
+++ 23.b/drivers/usb/atm/Kconfig
@@ -4,7 +4,8 @@

menuconfig USB_ATM
tristate "USB DSL modem support"
- depends on USB && ATM
+ depends on USB && NET
+ select ATM
select CRC32
default n
help
--- 23.a/drivers/usb/storage/Kconfig
+++ 23.b/drivers/usb/storage/Kconfig
@@ -2,14 +2,10 @@
# USB Storage driver configuration
#

-comment "NOTE: USB_STORAGE needs SCSI, and 'SCSI disk support' may"
- depends on USB
-comment "also be needed; see USB_STORAGE Help for more information"
- depends on USB
-
menuconfig USB_STORAGE
tristate "USB Mass Storage support"
- depends on USB && SCSI
+ depends on USB
+ select SCSI
---help---
Say Y here if you want to connect USB mass storage devices to your
computer's USB port. This is the driver you need for USB
@@ -18,13 +14,17 @@ menuconfig USB_STORAGE
similar devices. This driver may also be used for some cameras
and card readers.

- This option depends on 'SCSI' support being enabled, but you
- probably also need 'SCSI device support: SCSI disk support'
+ This option selects 'SCSI' support , but you probably
+ also need 'SCSI device support: SCSI disk support'
(BLK_DEV_SD) for most USB storage devices.

To compile this driver as a module, choose M here: the
module will be called usb-storage.

+if USB_STORAGE
+comment "NOTE: USB_STORAGE selects SCSI, but 'SCSI disk support' may"
+comment "also be needed; see USB_STORAGE Help for more information"
+
config USB_STORAGE_DEBUG
bool "USB Mass Storage verbose debug"
depends on USB_STORAGE
@@ -147,6 +147,8 @@ config USB_STORAGE_KARMA
on the resulting scsi device node returns the Karma to normal
operation.

+endif # USB_STORAGE
+
config USB_LIBUSUAL
bool "The shared table of common (or usual) storage devices"
depends on USB


Thanks!

--
Al