qmsi: adc: use built-in qmsi driver
Fix naming and use a global driver name for instance. Change-Id: I30a54cb9c20773e1b6fdc57b934aa564612a6c45 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
85b3c2c62a
commit
b3e02b406a
8 changed files with 26 additions and 28 deletions
|
@ -195,6 +195,10 @@ config AON_TIMER_IRQ_PRI
|
||||||
default 0
|
default 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if ADC
|
||||||
|
config ADC_QMSI
|
||||||
|
def_bool y
|
||||||
|
endif
|
||||||
|
|
||||||
if SPI_QMSI
|
if SPI_QMSI
|
||||||
config SPI_QMSI_PORT_0
|
config SPI_QMSI_PORT_0
|
||||||
|
|
|
@ -228,6 +228,11 @@ endif # SPI_QMSI
|
||||||
|
|
||||||
endif # SPI
|
endif # SPI
|
||||||
|
|
||||||
|
if ADC
|
||||||
|
config ADC_QMSI
|
||||||
|
def_bool y
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
if AIO_COMPARATOR
|
if AIO_COMPARATOR
|
||||||
config AIO_QMSI_COMPARATOR
|
config AIO_QMSI_COMPARATOR
|
||||||
|
|
|
@ -57,7 +57,7 @@ config ADC_TI_ADC108S102_INIT_PRIORITY
|
||||||
config ADC_TI_ADC108S102_DRV_NAME
|
config ADC_TI_ADC108S102_DRV_NAME
|
||||||
string "Driver's name"
|
string "Driver's name"
|
||||||
depends on ADC_TI_ADC108S102
|
depends on ADC_TI_ADC108S102
|
||||||
default "ADC"
|
default "ADC_0"
|
||||||
|
|
||||||
config ADC_TI_ADC108S102_SPI_PORT_NAME
|
config ADC_TI_ADC108S102_SPI_PORT_NAME
|
||||||
string "Master SPI port name"
|
string "Master SPI port name"
|
||||||
|
@ -98,9 +98,9 @@ menuconfig ADC_DW
|
||||||
|
|
||||||
if ADC_DW
|
if ADC_DW
|
||||||
|
|
||||||
config ADC_DW_NAME
|
config ADC_DW_DRV_NAME
|
||||||
string "Select a name to lookup the device"
|
string "Select a name to lookup the device"
|
||||||
default "ADC"
|
default "ADC_0"
|
||||||
depends on ADC_DW
|
depends on ADC_DW
|
||||||
|
|
||||||
config ADC_DW_RX_IRQ
|
config ADC_DW_RX_IRQ
|
||||||
|
@ -115,7 +115,7 @@ config ADC_DW_ERR_IRQ
|
||||||
depends on ADC_DW
|
depends on ADC_DW
|
||||||
default 18
|
default 18
|
||||||
|
|
||||||
config ADC_DW_PRI
|
config ADC_DW_IRQ_PRI
|
||||||
int
|
int
|
||||||
prompt "ADC interrupt priority"
|
prompt "ADC interrupt priority"
|
||||||
depends on ADC_DW
|
depends on ADC_DW
|
||||||
|
@ -216,25 +216,19 @@ endif
|
||||||
|
|
||||||
menuconfig ADC_QMSI
|
menuconfig ADC_QMSI
|
||||||
bool "QMSI ADC Driver"
|
bool "QMSI ADC Driver"
|
||||||
depends on QMSI_DRIVERS && ADC
|
depends on QMSI && ADC
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
Enable the driver implementation of the QMSI ADC IP.
|
Enable the driver implementation of the QMSI ADC IP.
|
||||||
|
|
||||||
if ADC_QMSI
|
if ADC_QMSI
|
||||||
|
|
||||||
config ADC_QMSI_NAME
|
config ADC_QMSI_0_DRV_NAME
|
||||||
string "Select a name to lookup the device"
|
string "Select a name to lookup the device"
|
||||||
default "ADC"
|
default "ADC_0"
|
||||||
depends on ADC_QMSI
|
depends on ADC_QMSI
|
||||||
|
|
||||||
config ADC_IRQ
|
config ADC_QMSI_0_IRQ_PRI
|
||||||
int
|
|
||||||
prompt "ADC interrupt request"
|
|
||||||
depends on ADC_QMSI
|
|
||||||
default 9
|
|
||||||
|
|
||||||
config ADC_PRI
|
|
||||||
int
|
int
|
||||||
prompt "ADC interrupt priority"
|
prompt "ADC interrupt priority"
|
||||||
depends on ADC_QMSI
|
depends on ADC_QMSI
|
||||||
|
|
|
@ -497,18 +497,18 @@ struct adc_config adc_config_dev = {
|
||||||
.config_func = adc_config_irq,
|
.config_func = adc_config_irq,
|
||||||
};
|
};
|
||||||
|
|
||||||
DEVICE_AND_API_INIT(adc_dw, CONFIG_ADC_DW_NAME, &adc_dw_init,
|
DEVICE_AND_API_INIT(adc_dw, CONFIG_ADC_DW_DRV_NAME, &adc_dw_init,
|
||||||
&adc_info_dev, &adc_config_dev,
|
&adc_info_dev, &adc_config_dev,
|
||||||
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||||
&api_funcs);
|
&api_funcs);
|
||||||
|
|
||||||
static void adc_config_irq(void)
|
static void adc_config_irq(void)
|
||||||
{
|
{
|
||||||
IRQ_CONNECT(CONFIG_ADC_DW_RX_IRQ, CONFIG_ADC_DW_PRI, adc_dw_rx_isr,
|
IRQ_CONNECT(CONFIG_ADC_DW_RX_IRQ, CONFIG_ADC_DW_IRQ_PRI, adc_dw_rx_isr,
|
||||||
DEVICE_GET(adc_dw), 0);
|
DEVICE_GET(adc_dw), 0);
|
||||||
irq_enable(CONFIG_ADC_DW_RX_IRQ);
|
irq_enable(CONFIG_ADC_DW_RX_IRQ);
|
||||||
|
|
||||||
IRQ_CONNECT(CONFIG_ADC_DW_ERR_IRQ, CONFIG_ADC_DW_PRI,
|
IRQ_CONNECT(CONFIG_ADC_DW_ERR_IRQ, CONFIG_ADC_DW_IRQ_PRI,
|
||||||
adc_dw_err_isr, DEVICE_GET(adc_dw), 0);
|
adc_dw_err_isr, DEVICE_GET(adc_dw), 0);
|
||||||
irq_enable(CONFIG_ADC_DW_ERR_IRQ);
|
irq_enable(CONFIG_ADC_DW_ERR_IRQ);
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,16 +270,16 @@ int adc_qmsi_init(struct device *dev)
|
||||||
|
|
||||||
struct adc_info adc_info_dev;
|
struct adc_info adc_info_dev;
|
||||||
|
|
||||||
DEVICE_INIT(adc_qmsi, CONFIG_ADC_QMSI_NAME, &adc_qmsi_init,
|
DEVICE_INIT(adc_qmsi, CONFIG_ADC_QMSI_0_DRV_NAME, &adc_qmsi_init,
|
||||||
&adc_info_dev, NULL,
|
&adc_info_dev, NULL,
|
||||||
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
||||||
|
|
||||||
static void adc_config_irq(void)
|
static void adc_config_irq(void)
|
||||||
{
|
{
|
||||||
IRQ_CONNECT(CONFIG_ADC_IRQ, CONFIG_ADC_PRI, qm_adc_0_isr,
|
IRQ_CONNECT(QM_IRQ_ADC_0, CONFIG_ADC_0_IRQ_PRI, qm_adc_0_isr,
|
||||||
NULL, (IOAPIC_LEVEL | IOAPIC_HIGH));
|
NULL, (IOAPIC_LEVEL | IOAPIC_HIGH));
|
||||||
|
|
||||||
irq_enable(CONFIG_ADC_IRQ);
|
irq_enable(QM_IRQ_ADC_0);
|
||||||
|
|
||||||
QM_SCSS_INT->int_adc_calib_mask &= ~BIT(0);
|
QM_SCSS_INT->int_adc_calib_mask &= ~BIT(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,3 +6,4 @@ obj-$(CONFIG_PWM_QMSI) += drivers/qm_pwm.o
|
||||||
obj-$(CONFIG_AIO_QMSI_COMPARATOR) += drivers/qm_comparator.o
|
obj-$(CONFIG_AIO_QMSI_COMPARATOR) += drivers/qm_comparator.o
|
||||||
obj-$(CONFIG_AON_COUNTER_QMSI) += drivers/qm_aon_counters.o
|
obj-$(CONFIG_AON_COUNTER_QMSI) += drivers/qm_aon_counters.o
|
||||||
obj-$(CONFIG_GPIO_QMSI) += drivers/qm_gpio.o
|
obj-$(CONFIG_GPIO_QMSI) += drivers/qm_gpio.o
|
||||||
|
obj-$(CONFIG_ADC_QMSI) += drivers/qm_adc.o
|
||||||
|
|
|
@ -33,11 +33,7 @@
|
||||||
#define SLEEPTIME 2
|
#define SLEEPTIME 2
|
||||||
#define SLEEPTICKS (SLEEPTIME * sys_clock_ticks_per_sec)
|
#define SLEEPTICKS (SLEEPTIME * sys_clock_ticks_per_sec)
|
||||||
|
|
||||||
#if defined(CONFIG_ADC_DW)
|
#define ADC_DEVICE_NAME "ADC_0"
|
||||||
#define ADC_DEVICE_NAME CONFIG_ADC_DW_NAME
|
|
||||||
#elif defined(CONFIG_ADC_TI_ADC108S102)
|
|
||||||
#define ADC_DEVICE_NAME CONFIG_ADC_TI_ADC108S102_DRV_NAME
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The analog input pin and channel number mapping
|
* The analog input pin and channel number mapping
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
[test]
|
[test]
|
||||||
build_only = true
|
build_only = true
|
||||||
tags = apps
|
tags = apps
|
||||||
|
platform_whitelist = galileo arduino_101_sss quark_d2000_crb
|
||||||
arch_whitelist = x86 arc
|
|
||||||
platform_whitelist = galileo arduino_101_sss
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue