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:
parent
61b83c88b8
commit
9824721680
5 changed files with 17 additions and 0 deletions
|
@ -178,6 +178,7 @@ arduino_serial: &lpuart3 {
|
||||||
data-buswidth = "16-bit";
|
data-buswidth = "16-bit";
|
||||||
pinctrl-0 = <&pinmux_lcdif>;
|
pinctrl-0 = <&pinmux_lcdif>;
|
||||||
pinctrl-names = "default";
|
pinctrl-names = "default";
|
||||||
|
backlight-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
|
||||||
port {
|
port {
|
||||||
lcd_panel_out: endpoint {
|
lcd_panel_out: endpoint {
|
||||||
remote-endpoint = <&lcd_panel_in>;
|
remote-endpoint = <&lcd_panel_in>;
|
||||||
|
|
|
@ -163,6 +163,7 @@ arduino_serial: &lpuart3 {
|
||||||
data-buswidth = "16-bit";
|
data-buswidth = "16-bit";
|
||||||
pinctrl-0 = <&pinmux_lcdif>;
|
pinctrl-0 = <&pinmux_lcdif>;
|
||||||
pinctrl-names = "default";
|
pinctrl-names = "default";
|
||||||
|
backlight-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
|
||||||
port {
|
port {
|
||||||
lcd_panel_out: endpoint {
|
lcd_panel_out: endpoint {
|
||||||
remote-endpoint = <&lcd_panel_in>;
|
remote-endpoint = <&lcd_panel_in>;
|
||||||
|
|
|
@ -139,6 +139,7 @@ arduino_i2c: &lpi2c1 {};
|
||||||
data-buswidth = "16-bit";
|
data-buswidth = "16-bit";
|
||||||
pinctrl-0 = <&pinmux_lcdif>;
|
pinctrl-0 = <&pinmux_lcdif>;
|
||||||
pinctrl-names = "default";
|
pinctrl-names = "default";
|
||||||
|
backlight-gpios = <&gpio2 31 GPIO_ACTIVE_HIGH>;
|
||||||
port {
|
port {
|
||||||
lcd_panel_out: endpoint {
|
lcd_panel_out: endpoint {
|
||||||
remote-endpoint = <&lcd_panel_in>;
|
remote-endpoint = <&lcd_panel_in>;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <drivers/display.h>
|
#include <drivers/display.h>
|
||||||
#include <drivers/pinctrl.h>
|
#include <drivers/pinctrl.h>
|
||||||
|
#include <drivers/gpio.h>
|
||||||
#include <fsl_elcdif.h>
|
#include <fsl_elcdif.h>
|
||||||
|
|
||||||
#ifdef CONFIG_HAS_MCUX_CACHE
|
#ifdef CONFIG_HAS_MCUX_CACHE
|
||||||
|
@ -32,6 +33,7 @@ struct mcux_elcdif_config {
|
||||||
elcdif_rgb_mode_config_t rgb_mode;
|
elcdif_rgb_mode_config_t rgb_mode;
|
||||||
uint8_t pixel_format;
|
uint8_t pixel_format;
|
||||||
const struct pinctrl_dev_config *pincfg;
|
const struct pinctrl_dev_config *pincfg;
|
||||||
|
const struct gpio_dt_spec backlight_gpio;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mcux_mem_block {
|
struct mcux_mem_block {
|
||||||
|
@ -196,6 +198,11 @@ static int mcux_elcdif_init(const struct device *dev)
|
||||||
return err;
|
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;
|
elcdif_rgb_mode_config_t rgb_mode = config->rgb_mode;
|
||||||
|
|
||||||
/* Shift the polarity bits to the appropriate location in the register */
|
/* 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), \
|
.pixel_format = DT_INST_ENUM_IDX(id, pixel_format), \
|
||||||
.pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(id), \
|
.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; \
|
static struct mcux_elcdif_data mcux_elcdif_data_##id; \
|
||||||
DEVICE_DT_INST_DEFINE(id, \
|
DEVICE_DT_INST_DEFINE(id, \
|
||||||
|
|
|
@ -102,3 +102,9 @@ properties:
|
||||||
- "24-bit"
|
- "24-bit"
|
||||||
description:
|
description:
|
||||||
LCD data bus width. The default is set to the reset value of 16-bit
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue