dts: nrf: Remove ADC dts.fixup defines and use aliases instead.

Changed driver to use defines from aliases instead of fixup.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
This commit is contained in:
Mieszko Mierunski 2018-10-03 16:07:41 +02:00 committed by Carles Cufí
commit b370b2ba05
9 changed files with 15 additions and 13 deletions

View file

@ -253,7 +253,8 @@ static int init_adc(struct device *dev)
return -EBUSY;
}
IRQ_CONNECT(DT_ADC_0_IRQ, CONFIG_ADC_0_IRQ_PRI,
IRQ_CONNECT(DT_NORDIC_NRF_ADC_ADC_0_IRQ,
DT_NORDIC_NRF_ADC_ADC_0_IRQ_PRIORITY,
nrfx_isr, nrfx_adc_irq_handler, 0);
adc_context_unlock_unconditionally(&m_data.ctx);
@ -270,7 +271,7 @@ static const struct adc_driver_api adc_nrfx_driver_api = {
};
#ifdef CONFIG_ADC_0
DEVICE_AND_API_INIT(adc_0, CONFIG_ADC_0_NAME,
DEVICE_AND_API_INIT(adc_0, DT_NORDIC_NRF_ADC_ADC_0_LABEL,
init_adc, NULL, NULL,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&adc_nrfx_driver_api);

View file

@ -366,9 +366,10 @@ static int init_saadc(struct device *dev)
{
nrf_saadc_event_clear(NRF_SAADC_EVENT_END);
nrf_saadc_int_enable(NRF_SAADC_INT_END);
NRFX_IRQ_ENABLE(DT_ADC_0_IRQ);
NRFX_IRQ_ENABLE(DT_NORDIC_NRF_SAADC_ADC_0_IRQ);
IRQ_CONNECT(DT_ADC_0_IRQ, CONFIG_ADC_0_IRQ_PRI,
IRQ_CONNECT(DT_NORDIC_NRF_SAADC_ADC_0_IRQ,
DT_NORDIC_NRF_SAADC_ADC_0_IRQ_PRIORITY,
saadc_irq_handler, DEVICE_GET(adc_0), 0);
adc_context_unlock_unconditionally(&m_data.ctx);
@ -385,7 +386,7 @@ static const struct adc_driver_api adc_nrfx_driver_api = {
};
#ifdef CONFIG_ADC_0
DEVICE_AND_API_INIT(adc_0, CONFIG_ADC_0_NAME,
DEVICE_AND_API_INIT(adc_0, DT_NORDIC_NRF_SAADC_ADC_0_LABEL,
init_saadc, NULL, NULL,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&adc_nrfx_driver_api);

View file

@ -42,6 +42,7 @@
spi-0 = &spi0;
spi-1 = &spi1;
uart-0 = &uart0;
adc-0 = &adc;
};
soc {

View file

@ -39,6 +39,7 @@
i2c-0 = &i2c0;
spi-0 = &spi0;
uart-0 = &uart0;
adc-0 = &adc;
};
soc {

View file

@ -43,6 +43,7 @@
spi-1 = &spi1;
spi-2 = &spi2;
uart-0 = &uart0;
adc-0 = &adc;
};
soc {

View file

@ -45,6 +45,7 @@
spi-3 = &spi3;
uart-0 = &uart0;
uart-1 = &uart1;
adc-0 = &adc;
};
soc {

View file

@ -2,9 +2,7 @@
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
#define DT_ADC_0_IRQ DT_NORDIC_NRF_ADC_40007000_IRQ_0
#define CONFIG_ADC_0_IRQ_PRI DT_NORDIC_NRF_ADC_40007000_IRQ_0_PRIORITY
#define CONFIG_ADC_0_NAME DT_NORDIC_NRF_ADC_40007000_LABEL
#define DT_ADC_0_NAME DT_NORDIC_NRF_ADC_ADC_0_LABEL
#define DT_UART_0_NAME DT_NORDIC_NRF_UART_UART_0_LABEL

View file

@ -2,9 +2,7 @@
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
#define DT_ADC_0_IRQ DT_NORDIC_NRF_SAADC_40007000_IRQ_0
#define CONFIG_ADC_0_IRQ_PRI DT_NORDIC_NRF_SAADC_40007000_IRQ_0_PRIORITY
#define CONFIG_ADC_0_NAME DT_NORDIC_NRF_SAADC_40007000_LABEL
#define DT_ADC_0_NAME DT_NORDIC_NRF_SAADC_ADC_0_LABEL
#define DT_UART_0_NAME DT_NORDIC_NRF_UART_UART_0_LABEL
#define DT_UART_1_NAME DT_NORDIC_NRF_UART_UART_1_LABEL

View file

@ -20,7 +20,7 @@
#if defined(CONFIG_BOARD_NRF51_PCA10028)
#include <hal/nrf_adc.h>
#define ADC_DEVICE_NAME CONFIG_ADC_0_NAME
#define ADC_DEVICE_NAME DT_ADC_0_NAME
#define ADC_RESOLUTION 10
#define ADC_GAIN ADC_GAIN_1_3
#define ADC_REFERENCE ADC_REF_INTERNAL
@ -34,7 +34,7 @@
defined(CONFIG_BOARD_NRF52840_PCA10056)
#include <hal/nrf_saadc.h>
#define ADC_DEVICE_NAME CONFIG_ADC_0_NAME
#define ADC_DEVICE_NAME DT_ADC_0_NAME
#define ADC_RESOLUTION 10
#define ADC_GAIN ADC_GAIN_1_6
#define ADC_REFERENCE ADC_REF_INTERNAL