diff options
-rw-r--r-- | nuttx/ChangeLog | 3 | ||||
-rw-r--r-- | nuttx/configs/mirtoo/README.txt | 12 | ||||
-rw-r--r-- | nuttx/configs/mirtoo/nsh/defconfig | 10 | ||||
-rw-r--r-- | nuttx/configs/mirtoo/nxffs/defconfig | 10 | ||||
-rw-r--r-- | nuttx/drivers/analog/Make.defs | 6 | ||||
-rw-r--r-- | nuttx/drivers/analog/pga11x.c (renamed from nuttx/drivers/input/pga11x.c) | 8 | ||||
-rw-r--r-- | nuttx/drivers/input/Make.defs | 4 | ||||
-rw-r--r-- | nuttx/include/nuttx/analog/pga11x.h (renamed from nuttx/include/nuttx/input/pga11x.h) | 25 |
8 files changed, 44 insertions, 34 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 9d18dcf49..9cf29983f 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 41d101228..7934ea7e4 100644 --- a/nuttx/configs/mirtoo/README.txt +++ b/nuttx/configs/mirtoo/README.txt @@ -828,9 +828,9 @@ Where <subdir> 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 <subdir> 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 b4eb54f11..779398a20 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 fb9be8e0c..334d9d5e4 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 8c868a84f..10b0db478 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 index e2edb4f3d..18dcfc5ba 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 <gnutt@nuttx.org> @@ -48,9 +48,9 @@ #include <errno.h> #include <debug.h> -#include <nuttx/input/pga11x.h> +#include <nuttx/analog/pga11x.h> -#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 cd9174087..aaf08b827 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 index f60d7830d..1d26feff4 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 <gnutt@nuttx.org> @@ -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 <nuttx/config.h> #include <nuttx/spi.h> -#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 */ |