bdk: display: use a scratch reg for backlight
Spare registers normally have hidden hw config usage, so avoid them just in case.
This commit is contained in:
@@ -606,7 +606,7 @@ void display_backlight(bool enable)
|
||||
|
||||
static void _display_dsi_backlight_brightness(u32 duty)
|
||||
{
|
||||
if (DISPLAY_A(DC_DISP_BACKLIGHT_DUTY) == duty)
|
||||
if (DISPLAY_A(DC_DCS_BACKLIGHT_LEVEL) == duty)
|
||||
return;
|
||||
|
||||
// Convert duty to candela.
|
||||
@@ -619,7 +619,7 @@ static void _display_dsi_backlight_brightness(u32 duty)
|
||||
if (!duty)
|
||||
usleep(100000);
|
||||
|
||||
DISPLAY_A(DC_DISP_BACKLIGHT_DUTY) = duty;
|
||||
DISPLAY_A(DC_DCS_BACKLIGHT_LEVEL) = duty;
|
||||
}
|
||||
|
||||
static void _display_pwm_backlight_brightness(u32 duty, u32 step_delay)
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
#define DC_D_WINBUF_DD_SCRATCH_REGISTER_1 0xEE
|
||||
#define DC_T_WINBUF_TD_SCRATCH_REGISTER_0 0x16D
|
||||
#define DC_T_WINBUF_TD_SCRATCH_REGISTER_1 0x16E
|
||||
#define DC_COM_SCRATCH_REGISTER_A 0x325
|
||||
#define DC_COM_SCRATCH_REGISTER_B 0x326
|
||||
#define DC_COM_SCRATCH_REGISTER_A 0x325
|
||||
#define DC_COM_SCRATCH_REGISTER_B 0x326
|
||||
#define DC_A_WINBUF_AD_SCRATCH_REGISTER_0 0xBED
|
||||
#define DC_A_WINBUF_AD_SCRATCH_REGISTER_1 0xBEE
|
||||
#define DC_B_WINBUF_BD_SCRATCH_REGISTER_0 0xDED
|
||||
@@ -308,9 +308,8 @@
|
||||
#define DC_DISP_SD_BL_CONTROL 0x4DC
|
||||
#define DC_DISP_BLEND_BACKGROUND_COLOR 0x4E4
|
||||
|
||||
#define DC_DISP_DISPLAY_SPARE0 0x4F7 // Used by SW.
|
||||
#define DC_DISP_DISPLAY_SPARE0 0x4F7 // Used by SW/HW.
|
||||
#define DC_DISP_DISPLAY_SPARE1 0x4F8
|
||||
#define DC_DISP_BACKLIGHT_DUTY DC_DISP_DISPLAY_SPARE1
|
||||
|
||||
#define DC_WINC_COLOR_PALETTE 0x500
|
||||
#define COLOR_PALETTE_IDX(off) (DC_WINC_COLOR_PALETTE + (off))
|
||||
@@ -469,6 +468,9 @@
|
||||
|
||||
#define DC_WINBUF_MEMFETCH_CONTROL 0x82B
|
||||
|
||||
/* Scratch register to store DCS backlight level (custom). */
|
||||
#define DC_DCS_BACKLIGHT_LEVEL DC_COM_SCRATCH_REGISTER_B
|
||||
|
||||
/*! Display serial interface registers. */
|
||||
#define DSI_INCR_SYNCPT_CNTRL 0x1
|
||||
#define DSI_INCR_SYNCPT_SOFT_RESET BIT(0)
|
||||
|
||||
Reference in New Issue
Block a user