drivers: mcux: Convert MCUX drivers to new DT_INST macros

Convert older DT_INST_ macro use in MCUX drivers to the new
include/devicetree.h DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-03-24 14:11:52 -05:00 committed by Kumar Gala
commit 4b9fe8a24e
18 changed files with 277 additions and 241 deletions

View file

@ -4,6 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT fsl_imx6sx_lcdif
#include <drivers/display.h>
#include <fsl_elcdif.h>
@ -226,7 +228,7 @@ static const struct display_driver_api mcux_elcdif_api = {
static void mcux_elcdif_config_func_1(struct device *dev);
static struct mcux_elcdif_config mcux_elcdif_config_1 = {
.base = (LCDIF_Type *) DT_INST_0_FSL_IMX6SX_LCDIF_BASE_ADDRESS,
.base = (LCDIF_Type *) DT_INST_REG_ADDR(0),
.irq_config_func = mcux_elcdif_config_func_1,
#ifdef CONFIG_MCUX_ELCDIF_PANEL_RK043FN02H
.rgb_mode = {
@ -252,7 +254,7 @@ static struct mcux_elcdif_config mcux_elcdif_config_1 = {
static struct mcux_elcdif_data mcux_elcdif_data_1;
DEVICE_AND_API_INIT(mcux_elcdif_1, DT_INST_0_FSL_IMX6SX_LCDIF_LABEL,
DEVICE_AND_API_INIT(mcux_elcdif_1, DT_INST_LABEL(0),
&mcux_elcdif_init,
&mcux_elcdif_data_1, &mcux_elcdif_config_1,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
@ -260,9 +262,9 @@ DEVICE_AND_API_INIT(mcux_elcdif_1, DT_INST_0_FSL_IMX6SX_LCDIF_LABEL,
static void mcux_elcdif_config_func_1(struct device *dev)
{
IRQ_CONNECT(DT_INST_0_FSL_IMX6SX_LCDIF_IRQ_0,
DT_INST_0_FSL_IMX6SX_LCDIF_IRQ_0_PRIORITY,
IRQ_CONNECT(DT_INST_IRQN(0),
DT_INST_IRQ(0, priority),
mcux_elcdif_isr, DEVICE_GET(mcux_elcdif_1), 0);
irq_enable(DT_INST_0_FSL_IMX6SX_LCDIF_IRQ_0);
irq_enable(DT_INST_IRQN(0));
}