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:
parent
9a00b99884
commit
0bb486aa29
3 changed files with 20 additions and 11 deletions
|
@ -1,9 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015 Intel Corporation
|
* Copyright (c) 2015 Intel Corporation
|
||||||
|
* Copyright (c) 2022 Nordic Semiconductor ASA
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define DT_DRV_COMPAT seeed_grove_lcd_rgb
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <kernel.h>
|
#include <kernel.h>
|
||||||
#include <init.h>
|
#include <init.h>
|
||||||
|
@ -335,14 +338,6 @@ static struct glcd_data grove_lcd_driver = {
|
||||||
.function = 0,
|
.function = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Since device_get_binding() will not return any
|
DEVICE_DT_INST_DEFINE(0, glcd_initialize, NULL, &grove_lcd_driver,
|
||||||
* reference to a driver instance if driver_api
|
&grove_lcd_config, POST_KERNEL,
|
||||||
* is NULL and grove_lcd does not have any API struct,
|
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, NULL);
|
||||||
* 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);
|
|
||||||
|
|
8
dts/bindings/misc/seeed,grove-lcd-rgb.yaml
Normal file
8
dts/bindings/misc/seeed,grove-lcd-rgb.yaml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Copyright (c) 2022 Nordic Semiconductor ASA
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
description: Seeed Grove LCD RGB
|
||||||
|
|
||||||
|
compatible: "seeed,grove-lcd-rgb"
|
||||||
|
|
||||||
|
include: i2c-device.yaml
|
|
@ -28,4 +28,10 @@
|
||||||
/delete-property/ current-speed;
|
/delete-property/ current-speed;
|
||||||
/delete-property/ rxpo;
|
/delete-property/ rxpo;
|
||||||
/delete-property/ txpo;
|
/delete-property/ txpo;
|
||||||
|
|
||||||
|
glcd: glcd@3e {
|
||||||
|
compatible = "seeed,grove-lcd-rgb";
|
||||||
|
label = "GLCD";
|
||||||
|
reg = <0x3e>;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue