From bdb773c1c43596b0e661d0f38c34d9b9f1192af2 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 16 Dec 2020 06:51:32 -0600 Subject: [PATCH] drivers: display: Convert drivers to new DT device macros Convert display drivers from: DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE DEVICE_DEFINE -> DEVICE_DT_INST_DEFINE DEVICE_GET -> DEVICE_DT_INST_GET etc.. Signed-off-by: Kumar Gala --- drivers/display/display_ili9xxx.c | 4 ++-- drivers/display/display_mcux_elcdif.c | 5 +++-- drivers/display/display_st7789v.c | 2 +- drivers/display/gd7965.c | 2 +- drivers/display/ssd1306.c | 2 +- drivers/display/ssd16xx.c | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/display/display_ili9xxx.c b/drivers/display/display_ili9xxx.c index 3055a48b7f..31fed255f7 100644 --- a/drivers/display/display_ili9xxx.c +++ b/drivers/display/display_ili9xxx.c @@ -477,8 +477,8 @@ static const struct display_driver_api ili9xxx_api = { \ static struct ili9xxx_data ili9xxx_data_##n; \ \ - DEVICE_AND_API_INIT(ili9xxx_##n, DT_LABEL(INST_DT_ILI9XXX(n, t)), \ - ili9xxx_init, &ili9xxx_data_##n, \ + DEVICE_DT_DEFINE(INST_DT_ILI9XXX(n, t), ili9xxx_init, \ + device_pm_control_nop, &ili9xxx_data_##n, \ &ili9xxx_config_##n, POST_KERNEL, \ CONFIG_APPLICATION_INIT_PRIORITY, &ili9xxx_api); diff --git a/drivers/display/display_mcux_elcdif.c b/drivers/display/display_mcux_elcdif.c index 24b5417aee..746a3230f1 100644 --- a/drivers/display/display_mcux_elcdif.c +++ b/drivers/display/display_mcux_elcdif.c @@ -256,8 +256,9 @@ 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_LABEL(0), +DEVICE_DT_INST_DEFINE(0, &mcux_elcdif_init, + device_pm_control_nop, &mcux_elcdif_data_1, &mcux_elcdif_config_1, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &mcux_elcdif_api); @@ -266,7 +267,7 @@ static void mcux_elcdif_config_func_1(const struct device *dev) { IRQ_CONNECT(DT_INST_IRQN(0), DT_INST_IRQ(0, priority), - mcux_elcdif_isr, DEVICE_GET(mcux_elcdif_1), 0); + mcux_elcdif_isr, DEVICE_DT_INST_GET(0), 0); irq_enable(DT_INST_IRQN(0)); } diff --git a/drivers/display/display_st7789v.c b/drivers/display/display_st7789v.c index 6d20071394..aea617d06a 100644 --- a/drivers/display/display_st7789v.c +++ b/drivers/display/display_st7789v.c @@ -460,6 +460,6 @@ static struct st7789v_data st7789v_data = { .y_offset = DT_INST_PROP(0, y_offset), }; -DEVICE_DEFINE(st7789v, DT_INST_LABEL(0), &st7789v_init, +DEVICE_DT_INST_DEFINE(0, &st7789v_init, st7789v_pm_control, &st7789v_data, NULL, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY, &st7789v_api); diff --git a/drivers/display/gd7965.c b/drivers/display/gd7965.c index 9d0f4fb3d5..b10fe9518b 100644 --- a/drivers/display/gd7965.c +++ b/drivers/display/gd7965.c @@ -466,7 +466,7 @@ static struct display_driver_api gd7965_driver_api = { }; -DEVICE_AND_API_INIT(gd7965, DT_INST_LABEL(0), gd7965_init, +DEVICE_DT_INST_DEFINE(0, gd7965_init, device_pm_control_nop, &gd7965_driver, NULL, POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY, &gd7965_driver_api); diff --git a/drivers/display/ssd1306.c b/drivers/display/ssd1306.c index 47079e7693..08b447e3b7 100644 --- a/drivers/display/ssd1306.c +++ b/drivers/display/ssd1306.c @@ -455,7 +455,7 @@ static struct display_driver_api ssd1306_driver_api = { .set_orientation = ssd1306_set_orientation, }; -DEVICE_AND_API_INIT(ssd1306, DT_INST_LABEL(0), ssd1306_init, +DEVICE_DT_INST_DEFINE(0, ssd1306_init, device_pm_control_nop, &ssd1306_driver, NULL, POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY, &ssd1306_driver_api); diff --git a/drivers/display/ssd16xx.c b/drivers/display/ssd16xx.c index d23e34d7cf..9f1d1de74c 100644 --- a/drivers/display/ssd16xx.c +++ b/drivers/display/ssd16xx.c @@ -717,7 +717,7 @@ static struct display_driver_api ssd16xx_driver_api = { }; -DEVICE_AND_API_INIT(ssd16xx, DT_INST_LABEL(0), ssd16xx_init, +DEVICE_DT_INST_DEFINE(0, ssd16xx_init, device_pm_control_nop, &ssd16xx_driver, NULL, POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY, &ssd16xx_driver_api);