drivers: display: display_mcux_elcdif: add backlight-gpios property

Add backlight gpios property to mcux display driver, so that the driver
can correctly initialize the backlight gpio control.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
Daniel DeGrasse 2022-03-22 22:57:04 -05:00 committed by David Leach
commit 9824721680
5 changed files with 17 additions and 0 deletions

View file

@ -178,6 +178,7 @@ arduino_serial: &lpuart3 {
data-buswidth = "16-bit";
pinctrl-0 = <&pinmux_lcdif>;
pinctrl-names = "default";
backlight-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
port {
lcd_panel_out: endpoint {
remote-endpoint = <&lcd_panel_in>;

View file

@ -163,6 +163,7 @@ arduino_serial: &lpuart3 {
data-buswidth = "16-bit";
pinctrl-0 = <&pinmux_lcdif>;
pinctrl-names = "default";
backlight-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
port {
lcd_panel_out: endpoint {
remote-endpoint = <&lcd_panel_in>;

View file

@ -139,6 +139,7 @@ arduino_i2c: &lpi2c1 {};
data-buswidth = "16-bit";
pinctrl-0 = <&pinmux_lcdif>;
pinctrl-names = "default";
backlight-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
port {
lcd_panel_out: endpoint {
remote-endpoint = <&lcd_panel_in>;

View file

@ -8,6 +8,7 @@
#include <drivers/display.h>
#include <drivers/pinctrl.h>
#include <drivers/gpio.h>
#include <fsl_elcdif.h>
#ifdef CONFIG_HAS_MCUX_CACHE
@ -32,6 +33,7 @@ struct mcux_elcdif_config {
elcdif_rgb_mode_config_t rgb_mode;
uint8_t pixel_format;
const struct pinctrl_dev_config *pincfg;
const struct gpio_dt_spec backlight_gpio;
};
struct mcux_mem_block {
@ -196,6 +198,11 @@ static int mcux_elcdif_init(const struct device *dev)
return err;
}
err = gpio_pin_configure_dt(&config->backlight_gpio, GPIO_OUTPUT_ACTIVE);
if (err) {
return err;
}
elcdif_rgb_mode_config_t rgb_mode = config->rgb_mode;
/* Shift the polarity bits to the appropriate location in the register */
@ -273,6 +280,7 @@ static const struct display_driver_api mcux_elcdif_api = {
}, \
.pixel_format = DT_INST_ENUM_IDX(id, pixel_format), \
.pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(id), \
.backlight_gpio = GPIO_DT_SPEC_INST_GET(id, backlight_gpios), \
}; \
static struct mcux_elcdif_data mcux_elcdif_data_##id; \
DEVICE_DT_INST_DEFINE(id, \

View file

@ -102,3 +102,9 @@ properties:
- "24-bit"
description:
LCD data bus width. The default is set to the reset value of 16-bit
backlight-gpios:
type: phandle-array
required: true
description:
LCB backlight control gpio. Driver will initialize this GPIO to active high