drivers: misc: grove_lcd: port to Devicetree

The driver was never migrated to Devicetree, this patch converts the
driver to a proper Devicetree based device.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-01-29 11:24:15 +01:00 committed by Marti Bolivar
commit 0bb486aa29
3 changed files with 20 additions and 11 deletions

View file

@ -1,9 +1,12 @@
/*
* Copyright (c) 2015 Intel Corporation
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#define DT_DRV_COMPAT seeed_grove_lcd_rgb
#include <errno.h>
#include <kernel.h>
#include <init.h>
@ -335,14 +338,6 @@ static struct glcd_data grove_lcd_driver = {
.function = 0,
};
/* Since device_get_binding() will not return any
* reference to a driver instance if driver_api
* is NULL and grove_lcd does not have any API struct,
* just populate it with some magic number
* so grove_lcd can be referenced.
* since grove_lcd_driver struct is available, populating with it
*/
DEVICE_DEFINE(grove_lcd, GROVE_LCD_NAME, glcd_initialize,
NULL, &grove_lcd_driver, &grove_lcd_config,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
(void *)&grove_lcd_driver);
DEVICE_DT_INST_DEFINE(0, glcd_initialize, NULL, &grove_lcd_driver,
&grove_lcd_config, POST_KERNEL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, NULL);