Julius Werner has submitted this change. ( https://review.coreboot.org/c/coreboot/+/52663 )
Change subject: trogdor: Add backlight support for sn65dsi86bridge for Homestar ......................................................................
trogdor: Add backlight support for sn65dsi86bridge for Homestar
Add backlight support in sn65dsi86bridge through the AUX channel using eDP DPCD registers, which is needed on the GOOGLE_HOMESTAR board.
Change-Id: Ie700080f1feabe2d3397c38088a64cff27bfbe55 Signed-off-by: Vinod Polimera vpolimer@codeaurora.org Signed-off-by: Julius Werner jwerner@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/52663 Reviewed-by: Douglas Anderson dianders@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c M src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.h M src/mainboard/google/trogdor/Kconfig M src/mainboard/google/trogdor/mainboard.c 4 files changed, 31 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Douglas Anderson: Looks good to me, approved
diff --git a/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c b/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c index 1cbf6fd..2ba0977 100644 --- a/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c +++ b/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c @@ -31,6 +31,14 @@ #define DP_MAX_SUPPORTED_RATES 8 /* 16-bit little-endian */ #define DP_LANE_COUNT_MASK 0xf
+/* Backlight configuration */ +#define DP_BACKLIGHT_MODE_SET 0x721 +#define DP_BACKLIGHT_CONTROL_MODE_MASK 0x3 +#define DP_BACKLIGHT_CONTROL_MODE_DPCD 0x2 +#define DP_DISPLAY_CONTROL_REGISTER 0x720 +#define DP_BACKLIGHT_ENABLE 0x1 +#define DP_BACKLIGHT_BRIGHTNESS_MSB 0x722 + /* link configuration */ #define DP_LINK_BW_SET 0x100 #define DP_LINK_BW_1_62 0x06 @@ -497,6 +505,20 @@ printk(BIOS_ERR, "ERROR: Link training failed 10 times\n"); }
+void sn65dsi86_backlight_enable(uint8_t bus, uint8_t chip) +{ + uint8_t val = DP_BACKLIGHT_CONTROL_MODE_DPCD; + sn65dsi86_bridge_aux_request(bus, chip, DP_BACKLIGHT_MODE_SET, 1, DPCD_WRITE, &val); + + val = 0xff; + sn65dsi86_bridge_aux_request(bus, chip, DP_BACKLIGHT_BRIGHTNESS_MSB, 1, + DPCD_WRITE, &val); + + val = DP_BACKLIGHT_ENABLE; + sn65dsi86_bridge_aux_request(bus, chip, DP_DISPLAY_CONTROL_REGISTER, 1, + DPCD_WRITE, &val); +} + static void sn65dsi86_bridge_assr_config(uint8_t bus, uint8_t chip, int enable) { if (enable) diff --git a/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.h b/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.h index 83b940b..0f03080 100644 --- a/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.h +++ b/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.h @@ -18,5 +18,6 @@ struct edid *edid, uint32_t num_of_lines, uint32_t dsi_bpp); enum cb_err sn65dsi86_bridge_read_edid(uint8_t bus, uint8_t chip, struct edid *out); +void sn65dsi86_backlight_enable(uint8_t bus, uint8_t chip);
#endif diff --git a/src/mainboard/google/trogdor/Kconfig b/src/mainboard/google/trogdor/Kconfig index 5538205..4a2630d 100644 --- a/src/mainboard/google/trogdor/Kconfig +++ b/src/mainboard/google/trogdor/Kconfig @@ -7,6 +7,11 @@ config TROGDOR_REV0 def_bool n
+config TROGDOR_HAS_BRIDGE_BACKLIGHT + bool + default y if BOARD_GOOGLE_HOMESTAR + default n + config TROGDOR_HAS_FINGERPRINT bool default y if BOARD_GOOGLE_COACHZ diff --git a/src/mainboard/google/trogdor/mainboard.c b/src/mainboard/google/trogdor/mainboard.c index 61a64f8..864bd6d 100644 --- a/src/mainboard/google/trogdor/mainboard.c +++ b/src/mainboard/google/trogdor/mainboard.c @@ -83,6 +83,9 @@ return;
sn65dsi86_bridge_configure(BRIDGE_BUS, BRIDGE_CHIP, edid, lanes, dsi_bpp); + if (CONFIG(TROGDOR_HAS_BRIDGE_BACKLIGHT)) + sn65dsi86_backlight_enable(BRIDGE_BUS, BRIDGE_CHIP); + mdp_dsi_video_config(edid); mdss_dsi_video_mode_config(edid, dsi_bpp); mdp_dsi_video_on();