drivers: counter: Refactor mcux gpt driver to use generated dts macros
Refactors the mcux gpt driver to use generated device tree macros directly. Removes now unused dts fixup macros from i.mx rt socs. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
parent
9e14543c19
commit
b8ad9969ef
3 changed files with 7 additions and 14 deletions
|
@ -202,7 +202,7 @@ static const struct counter_driver_api mcux_gpt_driver_api = {
|
|||
static struct mcux_gpt_data mcux_gpt_data_ ## n; \
|
||||
\
|
||||
static const struct mcux_gpt_config mcux_gpt_config_ ## n = { \
|
||||
.base = (void *)DT_COUNTER_MCUX_GPT_ ## n ## _BASE_ADDRESS, \
|
||||
.base = (void *)DT_NXP_IMX_GPT_COUNTER_ ## n ## _BASE_ADDRESS, \
|
||||
.clock_source = kCLOCK_PerClk, \
|
||||
.info = { \
|
||||
.max_top_value = UINT32_MAX, \
|
||||
|
@ -214,7 +214,7 @@ static const struct counter_driver_api mcux_gpt_driver_api = {
|
|||
\
|
||||
static int mcux_gpt_## n ##_init(struct device *dev); \
|
||||
DEVICE_AND_API_INIT(mcux_gpt ## n, \
|
||||
DT_COUNTER_MCUX_GPT_ ## n ## _NAME, \
|
||||
DT_NXP_IMX_GPT_COUNTER_ ## n ## _LABEL, \
|
||||
mcux_gpt_## n ##_init, \
|
||||
&mcux_gpt_data_ ## n, \
|
||||
&mcux_gpt_config_ ## n, \
|
||||
|
@ -223,10 +223,10 @@ static const struct counter_driver_api mcux_gpt_driver_api = {
|
|||
\
|
||||
static int mcux_gpt_## n ##_init(struct device *dev) \
|
||||
{ \
|
||||
IRQ_CONNECT(DT_COUNTER_MCUX_GPT_## n ##_IRQ, \
|
||||
DT_COUNTER_MCUX_GPT_## n ##_IRQ_PRI, \
|
||||
IRQ_CONNECT(DT_NXP_IMX_GPT_COUNTER_## n ##_IRQ_0, \
|
||||
DT_NXP_IMX_GPT_COUNTER_## n ##_IRQ_0_PRIORITY, \
|
||||
mcux_gpt_isr, DEVICE_GET(mcux_gpt ## n), 0); \
|
||||
irq_enable(DT_COUNTER_MCUX_GPT_## n ##_IRQ); \
|
||||
irq_enable(DT_NXP_IMX_GPT_COUNTER_## n ##_IRQ_0); \
|
||||
return mcux_gpt_init(dev); \
|
||||
} \
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
/ {
|
||||
aliases {
|
||||
counter-1 = &gpt1;
|
||||
counter-2 = &gpt2;
|
||||
eth = ð
|
||||
gpio-1 = &gpio1;
|
||||
gpio-2 = &gpio2;
|
||||
|
|
|
@ -13,16 +13,7 @@
|
|||
#define DT_MCUX_CCM_BASE_ADDRESS DT_NXP_IMX_CCM_400FC000_BASE_ADDRESS
|
||||
#define DT_MCUX_CCM_NAME DT_NXP_IMX_CCM_400FC000_LABEL
|
||||
|
||||
#define DT_COUNTER_MCUX_GPT_1_BASE_ADDRESS DT_NXP_IMX_GPT_401EC000_BASE_ADDRESS
|
||||
#define DT_COUNTER_MCUX_GPT_1_IRQ DT_NXP_IMX_GPT_401EC000_IRQ_0
|
||||
#define DT_COUNTER_MCUX_GPT_1_IRQ_PRI DT_NXP_IMX_GPT_401EC000_IRQ_0_PRIORITY
|
||||
#define DT_COUNTER_MCUX_GPT_1_NAME DT_NXP_IMX_GPT_401EC000_LABEL
|
||||
#define DT_RTC_0_NAME DT_COUNTER_MCUX_GPT_1_NAME
|
||||
|
||||
#define DT_COUNTER_MCUX_GPT_2_BASE_ADDRESS DT_NXP_IMX_GPT_401F0000_BASE_ADDRESS
|
||||
#define DT_COUNTER_MCUX_GPT_2_IRQ DT_NXP_IMX_GPT_401F0000_IRQ_0
|
||||
#define DT_COUNTER_MCUX_GPT_2_IRQ_PRI DT_NXP_IMX_GPT_401F0000_IRQ_0_PRIORITY
|
||||
#define DT_COUNTER_MCUX_GPT_2_NAME DT_NXP_IMX_GPT_401F0000_LABEL
|
||||
#define DT_RTC_1_NAME DT_COUNTER_MCUX_GPT_2_NAME
|
||||
|
||||
#define DT_ETH_MCUX_0_NAME DT_NXP_KINETIS_ETHERNET_402D8000_LABEL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue