adc : ti : only one instance
There can only be one instance of an ADC, but we have code setup for multiple. Change-Id: I94eae2450bdc6b138ebad66f80a7c451cefe32a9 Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
This commit is contained in:
parent
e97507a034
commit
9ccd5ce785
4 changed files with 25 additions and 34 deletions
|
|
@ -51,13 +51,11 @@ endif
|
|||
if ADC
|
||||
config ADC_TI_ADC108S102
|
||||
def_bool y
|
||||
config ADC_TI_ADC108S102_0
|
||||
def_bool y
|
||||
config ADC_TI_ADC108S102_0_SPI_PORT_NAME
|
||||
config ADC_TI_ADC108S102_SPI_PORT_NAME
|
||||
default "SPI0"
|
||||
config ADC_TI_ADC108S102_0_SPI_CONFIGURATION
|
||||
config ADC_TI_ADC108S102_SPI_CONFIGURATION
|
||||
default 0x81
|
||||
config ADC_TI_ADC108S102_0_SPI_MAX_FREQ
|
||||
config ADC_TI_ADC108S102_SPI_MAX_FREQ
|
||||
default 0x20000000
|
||||
endif
|
||||
|
||||
|
|
|
|||
|
|
@ -52,42 +52,35 @@ config ADC_TI_ADC108S102_INIT_PRIORITY
|
|||
Device is connected to SPI bus, it has to
|
||||
be initialized after SPI driver.
|
||||
|
||||
config ADC_TI_ADC108S102_0
|
||||
bool "First instance of TI's adc108s102 chip"
|
||||
depends on ADC_TI_ADC108S102
|
||||
default n
|
||||
help
|
||||
Enalbe first instance of adc108s102 driver.
|
||||
|
||||
config ADC_TI_ADC108S102_0_DRV_NAME
|
||||
config ADC_TI_ADC108S102_DRV_NAME
|
||||
string "Driver's name"
|
||||
depends on ADC_TI_ADC108S102_0
|
||||
default "adc108s102_0"
|
||||
depends on ADC_TI_ADC108S102
|
||||
default "adc108s102"
|
||||
|
||||
config ADC_TI_ADC108S102_0_SPI_PORT_NAME
|
||||
config ADC_TI_ADC108S102_SPI_PORT_NAME
|
||||
string "Master SPI port name"
|
||||
depends on ADC_TI_ADC108S102_0
|
||||
depends on ADC_TI_ADC108S102
|
||||
default ""
|
||||
help
|
||||
Master SPI port name through which adc108s102 chip is accessed.
|
||||
|
||||
config ADC_TI_ADC108S102_0_SPI_CONFIGURATION
|
||||
config ADC_TI_ADC108S102_SPI_CONFIGURATION
|
||||
hex "Master SPI port configuration"
|
||||
depends on ADC_TI_ADC108S102_0
|
||||
depends on ADC_TI_ADC108S102
|
||||
default 0x0
|
||||
help
|
||||
Master SPI port configuration flags used to access adc108s102 chip.
|
||||
|
||||
config ADC_TI_ADC108S102_0_SPI_MAX_FREQ
|
||||
config ADC_TI_ADC108S102_SPI_MAX_FREQ
|
||||
hex "Master SPI port max frequency"
|
||||
depends on ADC_TI_ADC108S102_0
|
||||
depends on ADC_TI_ADC108S102
|
||||
default 0x0
|
||||
help
|
||||
Master SPI port maximum frequency used to access adc108s102 chip.
|
||||
|
||||
config ADC_TI_ADC108S102_0_SPI_SLAVE
|
||||
config ADC_TI_ADC108S102_SPI_SLAVE
|
||||
int "SPI slave slot"
|
||||
depends on ADC_TI_ADC108S102_0
|
||||
depends on ADC_TI_ADC108S102
|
||||
default 0
|
||||
help
|
||||
adc108s102 chip's SPI slave number on master SPI port.
|
||||
|
|
|
|||
|
|
@ -232,20 +232,20 @@ int ti_adc108s102_init(struct device *dev)
|
|||
return DEV_OK;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ADC_TI_ADC108S102_0
|
||||
#ifdef CONFIG_ADC_TI_ADC108S102
|
||||
|
||||
struct ti_adc108s102_data adc108s102_0_data;
|
||||
struct ti_adc108s102_data adc108s102_data;
|
||||
|
||||
struct ti_adc108s102_config adc108s102_0_config = {
|
||||
.spi_port = CONFIG_ADC_TI_ADC108S102_0_SPI_PORT_NAME,
|
||||
.spi_config_flags = CONFIG_ADC_TI_ADC108S102_0_SPI_CONFIGURATION,
|
||||
.spi_freq = CONFIG_ADC_TI_ADC108S102_0_SPI_MAX_FREQ,
|
||||
.spi_slave = CONFIG_ADC_TI_ADC108S102_0_SPI_SLAVE,
|
||||
struct ti_adc108s102_config adc108s102_config = {
|
||||
.spi_port = CONFIG_ADC_TI_ADC108S102_SPI_PORT_NAME,
|
||||
.spi_config_flags = CONFIG_ADC_TI_ADC108S102_SPI_CONFIGURATION,
|
||||
.spi_freq = CONFIG_ADC_TI_ADC108S102_SPI_MAX_FREQ,
|
||||
.spi_slave = CONFIG_ADC_TI_ADC108S102_SPI_SLAVE,
|
||||
};
|
||||
|
||||
DEVICE_INIT(adc108s102_0, CONFIG_ADC_TI_ADC108S102_0_DRV_NAME,
|
||||
DEVICE_INIT(adc108s102, CONFIG_ADC_TI_ADC108S102_DRV_NAME,
|
||||
ti_adc108s102_init,
|
||||
&adc108s102_0_data, &adc108s102_0_config,
|
||||
&adc108s102_data, &adc108s102_config,
|
||||
SECONDARY, CONFIG_ADC_TI_ADC108S102_INIT_PRIORITY);
|
||||
|
||||
#endif /* CONFIG_ADC_TI_ADC108S102_0 */
|
||||
#endif /* CONFIG_ADC_TI_ADC108S102 */
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
#ifdef CONFIG_SOC_QUARK_SE_SS
|
||||
#define ADC_DEVICE_NAME CONFIG_ADC_DW_NAME
|
||||
#elif CONFIG_BOARD_GALILEO
|
||||
#define ADC_DEVICE_NAME CONFIG_ADC_TI_ADC108S102_0_DRV_NAME
|
||||
#define ADC_DEVICE_NAME CONFIG_ADC_TI_ADC108S102_DRV_NAME
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue