diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 9d18dcf492..9cf29983f4 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -3072,4 +3072,7 @@ TI PGA112/3/6/7 amplifier/multiplexer parts. * configs/mirtoo/README.txt, nsh/defconfig, and nxffs/defconfig: Add support for the PGA117 on the Mirtoo module. + * drivers/analog/pga11x.c and include/nuttx/analog/pga11x.h: These belong in + the analog subdirectories, not input. + diff --git a/nuttx/configs/mirtoo/README.txt b/nuttx/configs/mirtoo/README.txt index 41d101228c..7934ea7e45 100644 --- a/nuttx/configs/mirtoo/README.txt +++ b/nuttx/configs/mirtoo/README.txt @@ -828,9 +828,9 @@ Where is one of the following: The Mirtoo's PGA117 amplifier/multipexer is not used by this configuration but can be enabled by setting: - CONFIG_INPUT=y : Enable support for INPUT devices - CONFIG_SPI_OWNBUS=y : If the PGA117 is the only device on the bus - CONFIG_INPUT_PGA11X=y : Enable support for the PGA117 + CONFIG_ADC=y : Enable support for analog input devices + CONFIG_SPI_OWNBUS=y : If the PGA117 is the only device on the bus + CONFIG_ADC_PGA11X=y : Enable support for the PGA117 nxffs: ====== @@ -914,7 +914,7 @@ Where is one of the following: The Mirtoo's PGA117 amplifier/multipexer is not used by this configuration but can be enabled by setting: - CONFIG_INPUT=y : Enable support for INPUT devices - CONFIG_SPI_OWNBUS=n : The PGA117 is *not* the only device on the bus - CONFIG_INPUT_PGA11X=y : Enable support for the PGA117 + CONFIG_ADC=y : Enable support for anlog input devices + CONFIG_SPI_OWNBUS=n : The PGA117 is *not* the only device on the bus + CONFIG_ADC_PGA11X=y : Enable support for the PGA117 diff --git a/nuttx/configs/mirtoo/nsh/defconfig b/nuttx/configs/mirtoo/nsh/defconfig index b4eb54f112..779398a20b 100644 --- a/nuttx/configs/mirtoo/nsh/defconfig +++ b/nuttx/configs/mirtoo/nsh/defconfig @@ -750,10 +750,10 @@ CONFIG_USBMSC_REMOVABLE=y # PGA117 support # # Prerequisites: -# CONFIG_INPUT=y is needed to enable support for INPUT devices +# CONFIG_ADC=y is needed to enable support for analog input devices # -# CONFIG_INPUT_PGA11X -# Enables support for the PGA11X driver (Needs CONFIG_INPUT) +# CONFIG_ADC_PGA11X +# Enables support for the PGA11X driver (Needs CONFIG_ADC) # CONFIG_PGA11X_SPIFREQUENCY # SPI frequency. Default 1MHz # CONFIG_PGA11X_DAISYCHAIN @@ -773,11 +773,11 @@ CONFIG_USBMSC_REMOVABLE=y # CONFIG_DEBUG_SPI -- With CONFIG_DEBUG and CONFIG_DEBUG_VERBOSE, # this will enable debug output from the PGA117 driver. # -CONFIG_INPUT=n +CONFIG_ADC=n CONFIG_SPI_OWNBUS=y CONFIG_DEBUG_SPI=n -CONFIG_INPUT_PGA11X=n +CONFIG_ADC_PGA11X=n #CONFIG_PGA11X_SPIFREQUENCY CONFIG_PGA11X_DAISYCHAIN=n CONFIG_PGA11X_SPIMODE=1 diff --git a/nuttx/configs/mirtoo/nxffs/defconfig b/nuttx/configs/mirtoo/nxffs/defconfig index fb9be8e0c1..334d9d5e42 100644 --- a/nuttx/configs/mirtoo/nxffs/defconfig +++ b/nuttx/configs/mirtoo/nxffs/defconfig @@ -750,10 +750,10 @@ CONFIG_USBMSC_REMOVABLE=y # PGA117 support # # Prerequisites: -# CONFIG_INPUT=y is needed to enable support for INPUT devices +# CONFIG_ADC=y is needed to enable support for analog input devices # -# CONFIG_INPUT_PGA11X -# Enables support for the PGA11X driver (Needs CONFIG_INPUT) +# CONFIG_ADC_PGA11X +# Enables support for the PGA11X driver (Needs CONFIG_ADC) # CONFIG_PGA11X_SPIFREQUENCY # SPI frequency. Default 1MHz # CONFIG_PGA11X_DAISYCHAIN @@ -776,11 +776,11 @@ CONFIG_USBMSC_REMOVABLE=y # CONFIG_DEBUG_SPI -- With CONFIG_DEBUG and CONFIG_DEBUG_VERBOSE, # this will enable debug output from the PGA117 driver. # -CONFIG_INPUT=n +CONFIG_ADC=n CONFIG_SPI_OWNBUS=y CONFIG_DEBUG_SPI=n -CONFIG_INPUT_PGA11X=n +CONFIG_ADC_PGA11X=n #CONFIG_PGA11X_SPIFREQUENCY CONFIG_PGA11X_DAISYCHAIN=n CONFIG_PGA11X_SPIMODE=1 diff --git a/nuttx/drivers/analog/Make.defs b/nuttx/drivers/analog/Make.defs index 8c868a84f0..10b0db4785 100644 --- a/nuttx/drivers/analog/Make.defs +++ b/nuttx/drivers/analog/Make.defs @@ -58,6 +58,12 @@ ifeq ($(CONFIG_ADC),y) CSRCS += adc.c +# Amplifiers/multiplexers + +ifeq ($(CONFIG_ADC_PGA11X),y) + CSRCS += pga11x.c +endif + # Include ADC device drivers ifeq ($(CONFIG_ADC_ADS125X),y) diff --git a/nuttx/drivers/input/pga11x.c b/nuttx/drivers/analog/pga11x.c similarity index 99% rename from nuttx/drivers/input/pga11x.c rename to nuttx/drivers/analog/pga11x.c index e2edb4f3d0..18dcfc5ba0 100644 --- a/nuttx/drivers/input/pga11x.c +++ b/nuttx/drivers/analog/pga11x.c @@ -1,5 +1,5 @@ /**************************************************************************** - * drivers/input/pga11x.c + * drivers/analog/pga11x.c * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -48,9 +48,9 @@ #include #include -#include +#include -#if defined(CONFIG_INPUT) && defined(CONFIG_INPUT_PGA11X) +#if defined(CONFIG_ADC) && defined(CONFIG_ADC_PGA11X) /**************************************************************************** * Pre-processor Definitions @@ -576,5 +576,5 @@ int pga11x_enable(PGA11X_HANDLE handle) return OK; } -#endif /* CONFIG_INPUT && CONFIG_INPUT_PGA11X */ +#endif /* CONFIG_ADC && CONFIG_ADC_PGA11X */ diff --git a/nuttx/drivers/input/Make.defs b/nuttx/drivers/input/Make.defs index cd91740874..aaf08b8270 100644 --- a/nuttx/drivers/input/Make.defs +++ b/nuttx/drivers/input/Make.defs @@ -63,10 +63,6 @@ ifneq ($(CONFIG_INPUT_STMPE811_TEMP_DISABLE),y) endif endif -ifeq ($(CONFIG_INPUT_PGA11X),y) - CSRCS += pga11x.c -endif - # Include input device driver build support DEPPATH += --dep-path input diff --git a/nuttx/include/nuttx/input/pga11x.h b/nuttx/include/nuttx/analog/pga11x.h similarity index 93% rename from nuttx/include/nuttx/input/pga11x.h rename to nuttx/include/nuttx/analog/pga11x.h index f60d7830d5..1d26feff45 100644 --- a/nuttx/include/nuttx/input/pga11x.h +++ b/nuttx/include/nuttx/analog/pga11x.h @@ -1,5 +1,5 @@ /**************************************************************************** - * include/nuttx/input/pga11x.h + * include/nuttx/analog/pga11x.h * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt @@ -38,8 +38,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_NUTTX_INPUT_PGA11X_H -#define __INCLUDE_NUTTX_INPUT_PGA11X_H +#ifndef __INCLUDE_NUTTX_ANALOG_PGA11X_H +#define __INCLUDE_NUTTX_ANALOG_PGA11X_H /**************************************************************************** * Included Files @@ -48,16 +48,17 @@ #include #include -#if defined(CONFIG_INPUT) && defined(CONFIG_INPUT_PGA11X) +#if defined(CONFIG_ADC) && defined(CONFIG_ADC_PGA11X) /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ /* Configuration ************************************************************/ -/* Prerequisites: CONFIG_INPUT=y +/* Prerequisites: + * CONFIG_ADC=y is needed to enable support for analog input devices * - * CONFIG_INPUT_PGA11X - * Enables support for the PGA11X driver (Needs CONFIG_INPUT) + * CONFIG_ADC_PGA11X + * Enables support for the PGA11X driver (Needs CONFIG_ADC) * CONFIG_PGA11X_SPIFREQUENCY * SPI frequency. Default 1MHz * CONFIG_PGA11X_DAISYCHAIN @@ -71,7 +72,11 @@ * device will require a customized SPI interface to distinguish them * When SPI_SELECT is called with devid=SPIDEV_MUX. * - * Other settings that effect the driver: CONFIG_SPI_OWNBUS, CONFIG_DEBUG_SPI. + * Other settings that effect the driver: + * CONFIG_SPI_OWNBUS -- If the PGA117 is enabled, this must be set to 'y' + * if the PGA117 is the only device on the SPI bus; + * CONFIG_DEBUG_SPI -- With CONFIG_DEBUG and CONFIG_DEBUG_VERBOSE, +* this will enable debug output from the PGA117 driver. */ #ifndef CONFIG_PGA11X_SPIFREQUENCY @@ -288,5 +293,5 @@ EXTERN int pga11x_enable(PGA11X_HANDLE handle); } #endif -#endif /* CONFIG_INPUT && CONFIG_INPUT_PGA11X */ -#endif /* __INCLUDE_NUTTX_INPUT_PGA11X_H */ +#endif /* CONFIG_ADC && CONFIG_ADC_PGA11X */ +#endif /* __INCLUDE_NUTTX_ANALOG_PGA11X_H */