From 21aef0dd68573aafa70e90172c495e5eb47a52b1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 15 Feb 2020 07:38:35 -0600 Subject: [PATCH] drivers/*/Kconfig: Consolidate driver Kconfig Files. This commit does two things: 1. First, it reorganizes the driver Kconfig files so that each is self contained. Before, a part of the driver configuration was in drivers/Kconfig and the rest was in in drivers/xyz/Konfig. Now, all of the driver configuration is consolitated in the latter. 2. Second, this commit correct numerous serious errors introduced in a previous reorganization of the driver Kconfig files. This was first noted by Nicholas Chin in PR270 for the case of the drivers/i2c/Kconfig but some examination indicates that the error was introduced into several other Kconfig files as well. The nature of the introduced error was basically this: - Nothing must intervene between the menuconfig selection and the following conditional configuration otpions. - A previous PR erroneously introduced unconditional options between the menuconfig and the following confditional logic, thus corrupting the driver menus. This error was easy to make because the driver Kconfig files were not well modularized. Making them fully self-contained should eliminate this kind of error in the future. --- drivers/1wire/Kconfig | 6 + drivers/Kconfig | 228 ------------------------------------ drivers/analog/Kconfig | 9 ++ drivers/audio/Kconfig | 11 ++ drivers/bch/Kconfig | 9 ++ drivers/can/Kconfig | 7 ++ drivers/contactless/Kconfig | 6 + drivers/eeprom/Kconfig | 6 + drivers/i2c/Kconfig | 7 ++ drivers/i2s/Kconfig | 8 ++ drivers/input/Kconfig | 8 ++ drivers/mmcsd/Kconfig | 10 ++ drivers/modem/Kconfig | 6 + drivers/mtd/Kconfig | 15 ++- drivers/net/Kconfig | 16 +++ drivers/pipes/Kconfig | 7 ++ drivers/rf/Kconfig | 6 + drivers/rptun/Kconfig | 7 ++ drivers/sensors/Kconfig | 6 + drivers/serial/Kconfig | 8 ++ drivers/usbdev/Kconfig | 6 + drivers/usbhost/Kconfig | 6 + drivers/usbmisc/Kconfig | 8 +- drivers/usbmonitor/Kconfig | 10 ++ drivers/video/Kconfig | 6 + drivers/wireless/Kconfig | 6 + 26 files changed, 196 insertions(+), 232 deletions(-) diff --git a/drivers/1wire/Kconfig b/drivers/1wire/Kconfig index c79af85d2e..bdf1a8cea5 100644 --- a/drivers/1wire/Kconfig +++ b/drivers/1wire/Kconfig @@ -3,6 +3,12 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig 1WIRE + bool "1wire Device Support" + default n + ---help--- + Drivers for various 1wire devices. + if 1WIRE config 1WIRE_DS28E17 diff --git a/drivers/Kconfig b/drivers/Kconfig index ffb0114659..ed3612d085 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -76,264 +76,36 @@ endmenu # Buffering source drivers/crypto/Kconfig source drivers/loop/Kconfig - -menuconfig CAN - bool "CAN Driver Support" - default n - ---help--- - This selection enables building of the "upper-half" CAN driver. - See include/nuttx/can/can.h for further CAN driver information. - source drivers/can/Kconfig - -menuconfig I2C - bool "I2C Driver Support" - default n - ---help--- - This selection enables building of the "upper-half" I2C driver. - See include/nuttx/i2c/i2c_master.h for further I2C driver information. - source drivers/i2c/Kconfig source drivers/spi/Kconfig - -menuconfig I2S - bool "I2S Driver Support" - default n - ---help--- - This selection enables selection of common I2S options. This option - should be enabled by all platforms that support I2S interfaces. - See include/nuttx/audio/i2s.h for further I2S driver information. - source drivers/i2s/Kconfig source drivers/timers/Kconfig - -menuconfig ANALOG - bool "Analog Device(ADC/DAC) Support" - default n - ---help--- - This directory holds implementations of analog device drivers. - This includes drivers for Analog to Digital Conversion (ADC) as - well as drivers for Digital to Analog Conversion (DAC). - See include/nuttx/analog/*.h for registration information. - source drivers/analog/Kconfig - -menuconfig DRIVERS_AUDIO - bool "Audio Device Support" - default n - ---help--- - Enable support for audio device drivers. This includes drivers for - MP3, WMA and Ogg Vorbis encoding, decoding, as well as drivers for - interfacing with external DSP chips to perform custom audio functions. - - NOTE: All of these drivers depend on support from the audio subsystem - enabled with the AUDIO selection. - source drivers/audio/Kconfig - -menuconfig DRIVERS_VIDEO - bool "Video Device Support" - default n - ---help--- - Enable support for video device drivers. - source drivers/video/Kconfig - -menuconfig BCH - bool "Block-to-Character (BCH) Support" - default n - ---help--- - Contains logic that may be used to convert a block driver into - a character driver. This is the complementary conversion as that - performed by loop.c. See include/nuttx/drivers/drivers.h for - registration information. - source drivers/bch/Kconfig - -menuconfig INPUT - bool "Input Device Support" - default n - ---help--- - This directory holds implementations of input device drivers. - This includes such things as touchscreen and keypad drivers. - See include/nuttx/input/*.h for registration information. - source drivers/input/Kconfig source drivers/ioexpander/Kconfig source drivers/lcd/Kconfig source drivers/leds/Kconfig - -# MMC/SD-related platform capabilities - -menuconfig MMCSD - bool "MMC/SD Driver Support" - default n - ---help--- - Support for MMC/SD block drivers. MMC/SD block drivers based on - SPI and SDIO/MCI interfaces are supported. See include/nuttx/mmcsd.h - and include/nuttx/sdio.h for further information. - source drivers/mmcsd/Kconfig - -menuconfig MODEM - bool "Modem Support" - default n - ---help--- - Enable modem support. - source drivers/modem/Kconfig - -menuconfig MTD - bool "Memory Technology Device (MTD) Support" - default n - ---help--- - Memory Technology Device (MTD) drivers. Some simple drivers for - memory technologies like FLASH, EEPROM, NVRAM, etc. See - include/nuttx/mtd/mtd.h - - (Note: This is a simple memory interface and should not be - confused with the "real" MTD developed at infradead.org. This - logic is unrelated; I just used the name MTD because I am not - aware of any other common way to refer to this class of devices). - source drivers/mtd/Kconfig - -menuconfig EEPROM - bool "EEPROM support" - default n - ---help--- - This directory holds implementations of EEPROM drivers. - source drivers/eeprom/Kconfig - -menuconfig NETDEVICES - bool "Network Device/PHY Support" - default n if !ARCH_HAVE_PHY - default y if ARCH_HAVE_PHY - depends on NET - ---help--- - Network interface driver and PHY selections. This options enables - selection of drivers for external Ethernet MAC chips. The majority - of MCUs, however, have built-in, internal Ethernet MAC peripherals - and that Ethernet support is selected in the MCU-specific - configuration menus. - - Most Ethernet MAC drivers, whether internal or external, will - require configuration of an external PHY device. That external PHY - device is also selected via this menu. - source drivers/net/Kconfig - -menuconfig PIPES - bool "FIFO and named pipe drivers" - default n - ---help--- - FIFO and named pipe drivers. Standard interfaces are declared - in include/unistd.h - source drivers/pipes/Kconfig source drivers/power/Kconfig - -menuconfig RPTUN - bool "Remote Proc Tunnel Driver Support" - default n - depends on OPENAMP - ---help--- - RPTUN driver is used for multi-cores' communication. - source drivers/rptun/Kconfig - -menuconfig SENSORS - bool "Sensor Device Support" - default n - ---help--- - Drivers for various sensors - source drivers/sensors/Kconfig - -menuconfig SERIAL - bool "Serial Driver Support" - default y - ---help--- - Front-end character drivers for chip-specific UARTs. This provide - some TTY-like functionality and are commonly used (but not required - for) the NuttX system console. See also include/nuttx/serial/serial.h - source drivers/serial/Kconfig - -menuconfig USBDEV - bool "USB Device Driver Support" - default n - ---help--- - USB device drivers. See also include/nuttx/usb/usbdev.h - source drivers/usbdev/Kconfig - -menuconfig USBHOST - bool "USB Host Driver Support" - default n - ---help--- - USB host drivers. See also include/nuttx/usb/usbhost.h - source drivers/usbhost/Kconfig - -menuconfig USBMISC - bool "USB Miscellaneous drivers" - default n - ---help--- - USB Miscellaneous drivers. - source drivers/usbmisc/Kconfig - -menuconfig USBMONITOR - bool "USB Monitor" - default n - depends on HAVE_USBTRACE - ---help--- - If USB device tracing (USBDEV_TRACE) AND/OR USB host tracing - (USBHOST_TRACE) are enabled then this option will select the USB - monitor. The USB monitor is a daemon that will periodically collect - the buffered USB trace data and dump it to the SYSLOG device. - source drivers/usbmonitor/Kconfig - -menuconfig DRIVERS_WIRELESS - bool "Wireless Device Support" - default n - ---help--- - Drivers for various wireless devices. - source drivers/wireless/Kconfig - -menuconfig DRIVERS_CONTACTLESS - bool "Contactless Device Support" - default n - ---help--- - Drivers for various contactless devices. - source drivers/contactless/Kconfig - -menuconfig 1WIRE - bool "1wire Device Support" - default n - ---help--- - Drivers for various 1wire devices. - source drivers/1wire/Kconfig source drivers/syslog/Kconfig - -menuconfig SPECIFIC_DRIVERS - bool "Board specific drivers" - default n - ---help--- - Board specific drivers located in each board/driver folder. - source drivers/platform/Kconfig - -menuconfig DRIVERS_RF - bool "RF Device Support" - default n - ---help--- - Drivers for various RF devices - source drivers/rf/Kconfig diff --git a/drivers/analog/Kconfig b/drivers/analog/Kconfig index 608003df26..cc23fef13c 100644 --- a/drivers/analog/Kconfig +++ b/drivers/analog/Kconfig @@ -3,6 +3,15 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig ANALOG + bool "Analog Device(ADC/DAC) Support" + default n + ---help--- + This directory holds implementations of analog device drivers. + This includes drivers for Analog to Digital Conversion (ADC) as + well as drivers for Digital to Analog Conversion (DAC). + See include/nuttx/analog/*.h for registration information. + if ANALOG config ADC diff --git a/drivers/audio/Kconfig b/drivers/audio/Kconfig index 7729787861..e305551aa4 100644 --- a/drivers/audio/Kconfig +++ b/drivers/audio/Kconfig @@ -3,6 +3,17 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig DRIVERS_AUDIO + bool "Audio Device Support" + default n + ---help--- + Enable support for audio device drivers. This includes drivers for + MP3, WMA and Ogg Vorbis encoding, decoding, as well as drivers for + interfacing with external DSP chips to perform custom audio functions. + + NOTE: All of these drivers depend on support from the audio subsystem + enabled with the AUDIO selection. + if DRIVERS_AUDIO config AUDIO_TONE diff --git a/drivers/bch/Kconfig b/drivers/bch/Kconfig index 0735d37ac6..38a36e54d6 100644 --- a/drivers/bch/Kconfig +++ b/drivers/bch/Kconfig @@ -3,6 +3,15 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig BCH + bool "Block-to-Character (BCH) Support" + default n + ---help--- + Contains logic that may be used to convert a block driver into + a character driver. This is the complementary conversion as that + performed by loop.c. See include/nuttx/drivers/drivers.h for + registration information. + if BCH config BCH_ENCRYPTION diff --git a/drivers/can/Kconfig b/drivers/can/Kconfig index 8b1b7f41ac..f4df515d2a 100644 --- a/drivers/can/Kconfig +++ b/drivers/can/Kconfig @@ -7,6 +7,13 @@ config ARCH_HAVE_CAN_ERRORS bool default n +menuconfig CAN + bool "CAN Driver Support" + default n + ---help--- + This selection enables building of the "upper-half" CAN driver. + See include/nuttx/can/can.h for further CAN driver information. + if CAN config CAN_EXTID diff --git a/drivers/contactless/Kconfig b/drivers/contactless/Kconfig index 29281c06f0..9c36f81f9e 100644 --- a/drivers/contactless/Kconfig +++ b/drivers/contactless/Kconfig @@ -3,6 +3,12 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig DRIVERS_CONTACTLESS + bool "Contactless Device Support" + default n + ---help--- + Drivers for various contactless devices. + if DRIVERS_CONTACTLESS config CL_MFRC522 diff --git a/drivers/eeprom/Kconfig b/drivers/eeprom/Kconfig index 714b00b7c4..ac0de6fe31 100644 --- a/drivers/eeprom/Kconfig +++ b/drivers/eeprom/Kconfig @@ -3,6 +3,12 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig EEPROM + bool "EEPROM support" + default n + ---help--- + This directory holds implementations of EEPROM drivers. + if EEPROM config SPI_EE_25XX diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index 6cbc3db8b4..1de8b7f0d2 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -7,6 +7,13 @@ config ARCH_HAVE_I2CRESET bool default n +menuconfig I2C + bool "I2C Driver Support" + default n + ---help--- + This selection enables building of the "upper-half" I2C driver. + See include/nuttx/i2c/i2c_master.h for further I2C driver information. + if I2C config I2C_SLAVE diff --git a/drivers/i2s/Kconfig b/drivers/i2s/Kconfig index aaf5849c78..10576c165d 100644 --- a/drivers/i2s/Kconfig +++ b/drivers/i2s/Kconfig @@ -3,6 +3,14 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig I2S + bool "I2S Driver Support" + default n + ---help--- + This selection enables selection of common I2S options. This option + should be enabled by all platforms that support I2S interfaces. + See include/nuttx/audio/i2s.h for further I2S driver information. + if I2S config AUDIO_I2SCHAR diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig index 8cdf205023..3060753f70 100644 --- a/drivers/input/Kconfig +++ b/drivers/input/Kconfig @@ -3,6 +3,14 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig INPUT + bool "Input Device Support" + default n + ---help--- + This directory holds implementations of input device drivers. + This includes such things as touchscreen and keypad drivers. + See include/nuttx/input/*.h for registration information. + if INPUT config MOUSE diff --git a/drivers/mmcsd/Kconfig b/drivers/mmcsd/Kconfig index ad3bf87dec..b4332cb551 100644 --- a/drivers/mmcsd/Kconfig +++ b/drivers/mmcsd/Kconfig @@ -3,6 +3,8 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +# MMC/SD-related platform capabilities + config ARCH_HAVE_SDIO bool default n @@ -19,6 +21,14 @@ config ARCH_HAVE_SDIO_DELAYED_INVLDT bool default n +menuconfig MMCSD + bool "MMC/SD Driver Support" + default n + ---help--- + Support for MMC/SD block drivers. MMC/SD block drivers based on + SPI and SDIO/MCI interfaces are supported. See include/nuttx/mmcsd.h + and include/nuttx/sdio.h for further information. + if MMCSD config MMCSD_NSLOTS diff --git a/drivers/modem/Kconfig b/drivers/modem/Kconfig index 56424bed8a..1544a000c8 100644 --- a/drivers/modem/Kconfig +++ b/drivers/modem/Kconfig @@ -3,6 +3,12 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig MODEM + bool "Modem Support" + default n + ---help--- + Enable modem support. + if MODEM config MODEM_U_BLOX diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index 0e5f436263..364d446ed7 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig @@ -3,9 +3,20 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -if MTD +menuconfig MTD + bool "Memory Technology Device (MTD) Support" + default n + ---help--- + Memory Technology Device (MTD) drivers. Some simple drivers for + memory technologies like FLASH, EEPROM, NVRAM, etc. See + include/nuttx/mtd/mtd.h -comment "MTD Configuration" + (Note: This is a simple memory interface and should not be + confused with the "real" MTD developed at infradead.org. This + logic is unrelated; I just used the name MTD because I am not + aware of any other common way to refer to this class of devices). + +if MTD config MTD_PARTITION bool "Support MTD partitions" diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index e1647f7f48..980dc4f8e7 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -3,6 +3,22 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig NETDEVICES + bool "Network Device/PHY Support" + default n if !ARCH_HAVE_PHY + default y if ARCH_HAVE_PHY + depends on NET + ---help--- + Network interface driver and PHY selections. This options enables + selection of drivers for external Ethernet MAC chips. The majority + of MCUs, however, have built-in, internal Ethernet MAC peripherals + and that Ethernet support is selected in the MCU-specific + configuration menus. + + Most Ethernet MAC drivers, whether internal or external, will + require configuration of an external PHY device. That external PHY + device is also selected via this menu. + if NETDEVICES comment "General Ethernet MAC Driver Options" diff --git a/drivers/pipes/Kconfig b/drivers/pipes/Kconfig index 048b75d476..71fd6228bc 100644 --- a/drivers/pipes/Kconfig +++ b/drivers/pipes/Kconfig @@ -3,6 +3,13 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig PIPES + bool "FIFO and named pipe drivers" + default n + ---help--- + FIFO and named pipe drivers. Standard interfaces are declared + in include/unistd.h + if PIPES config DEV_PIPE_MAXSIZE diff --git a/drivers/rf/Kconfig b/drivers/rf/Kconfig index a22cb80511..1a51895177 100644 --- a/drivers/rf/Kconfig +++ b/drivers/rf/Kconfig @@ -3,6 +3,12 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig DRIVERS_RF + bool "RF Device Support" + default n + ---help--- + Drivers for various RF devices + if DRIVERS_RF config RF_DAT31R5SP diff --git a/drivers/rptun/Kconfig b/drivers/rptun/Kconfig index 9e9a7dd25e..9845f16839 100644 --- a/drivers/rptun/Kconfig +++ b/drivers/rptun/Kconfig @@ -3,6 +3,13 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig RPTUN + bool "Remote Proc Tunnel Driver Support" + default n + depends on OPENAMP + ---help--- + RPTUN driver is used for multi-cores' communication. + if RPTUN config RPTUN_PRIORITY diff --git a/drivers/sensors/Kconfig b/drivers/sensors/Kconfig index af0e707c62..f08951ffd6 100644 --- a/drivers/sensors/Kconfig +++ b/drivers/sensors/Kconfig @@ -3,6 +3,12 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig SENSORS + bool "Sensor Device Support" + default n + ---help--- + Drivers for various sensors + if SENSORS config SENSORS_APDS9960 diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 1d5133358e..b9de050aa6 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -7,6 +7,14 @@ config ARCH_HAVE_SERIAL_TERMIOS bool default n +menuconfig SERIAL + bool "Serial Driver Support" + default y + ---help--- + Front-end character drivers for chip-specific UARTs. This provide + some TTY-like functionality and are commonly used (but not required + for) the NuttX system console. See also include/nuttx/serial/serial.h + if SERIAL config DEV_LOWCONSOLE diff --git a/drivers/usbdev/Kconfig b/drivers/usbdev/Kconfig index 2e2299bc9e..8584cc554f 100644 --- a/drivers/usbdev/Kconfig +++ b/drivers/usbdev/Kconfig @@ -3,6 +3,12 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig USBDEV + bool "USB Device Driver Support" + default n + ---help--- + USB device drivers. See also include/nuttx/usb/usbdev.h + if USBDEV comment "USB Device Controller Driver Options" diff --git a/drivers/usbhost/Kconfig b/drivers/usbhost/Kconfig index 814cceb2dd..31248cf802 100644 --- a/drivers/usbhost/Kconfig +++ b/drivers/usbhost/Kconfig @@ -7,6 +7,12 @@ config USBHOST_HAVE_ASYNCH bool default n +menuconfig USBHOST + bool "USB Host Driver Support" + default n + ---help--- + USB host drivers. See also include/nuttx/usb/usbhost.h + if USBHOST config USBHOST_NPREALLOC diff --git a/drivers/usbmisc/Kconfig b/drivers/usbmisc/Kconfig index bec538e57b..bc5900de57 100644 --- a/drivers/usbmisc/Kconfig +++ b/drivers/usbmisc/Kconfig @@ -3,9 +3,13 @@ # see misc/tools/kconfig-language.txt. # -if USBMISC +menuconfig USBMISC + bool "USB Miscellaneous drivers" + default n + ---help--- + USB Miscellaneous drivers. -comment "USB Miscellaneous drivers" +if USBMISC config FUSB301 bool "On Semiconductor FUSB301 USB Type-C controller support" diff --git a/drivers/usbmonitor/Kconfig b/drivers/usbmonitor/Kconfig index 97a24923bd..59c1aedba5 100644 --- a/drivers/usbmonitor/Kconfig +++ b/drivers/usbmonitor/Kconfig @@ -7,6 +7,16 @@ config HAVE_USBTRACE bool default n +menuconfig USBMONITOR + bool "USB Monitor" + default n + depends on HAVE_USBTRACE + ---help--- + If USB device tracing (USBDEV_TRACE) AND/OR USB host tracing + (USBHOST_TRACE) are enabled then this option will select the USB + monitor. The USB monitor is a daemon that will periodically collect + the buffered USB trace data and dump it to the SYSLOG device. + if USBMONITOR config USBMONITOR_STACKSIZE diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 0cacc82ae0..66c90b6822 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -3,6 +3,12 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig DRIVERS_VIDEO + bool "Video Device Support" + default n + ---help--- + Enable support for video device drivers. + if DRIVERS_VIDEO config VIDEO_FB diff --git a/drivers/wireless/Kconfig b/drivers/wireless/Kconfig index 299b6648e9..3f85ba58bd 100644 --- a/drivers/wireless/Kconfig +++ b/drivers/wireless/Kconfig @@ -3,6 +3,12 @@ # see the file kconfig-language.txt in the NuttX tools repository. # +menuconfig DRIVERS_WIRELESS + bool "Wireless Device Support" + default n + ---help--- + Drivers for various wireless devices. + if DRIVERS_WIRELESS config WL_CC1101