Skip to content

Commit c276f83

Browse files
andysancarlescufi
authored andcommitted
drivers: uc81xx: Make it possible to override PLL/VDCS
Some custom refresh profiles need to set the PLL and VDCS registers. Add them as optional DT properties. Signed-off-by: Andreas Sandberg <[email protected]>
1 parent d571b31 commit c276f83

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

drivers/display/uc81xx.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ struct uc81xx_profile {
4646
bool override_cdi;
4747
uint8_t tcon;
4848
bool override_tcon;
49+
uint8_t pll;
50+
bool override_pll;
51+
uint8_t vdcs;
52+
bool override_vdcs;
4953

5054
const struct uc81xx_dt_array lutc;
5155
const struct uc81xx_dt_array lutww;
@@ -309,6 +313,20 @@ static int uc81xx_set_profile(const struct device *dev,
309313
return -EIO;
310314
}
311315

316+
if (p->override_pll) {
317+
LOG_DBG("PLL: %#hhx", p->pll);
318+
if (uc81xx_write_cmd_uint8(dev, UC81XX_CMD_PLL, p->pll)) {
319+
return -EIO;
320+
}
321+
}
322+
323+
if (p->override_vdcs) {
324+
LOG_DBG("VDCS: %#hhx", p->vdcs);
325+
if (uc81xx_write_cmd_uint8(dev, UC81XX_CMD_VDCS, p->vdcs)) {
326+
return -EIO;
327+
}
328+
}
329+
312330
if (p->override_tcon) {
313331
if (uc81xx_write_cmd_uint8(dev, UC81XX_CMD_TCON, p->tcon)) {
314332
return -EIO;
@@ -714,6 +732,10 @@ static struct display_driver_api uc81xx_driver_api = {
714732
.override_cdi = DT_NODE_HAS_PROP(n, cdi), \
715733
.tcon = DT_PROP_OR(n, tcon, 0), \
716734
.override_tcon = DT_NODE_HAS_PROP(n, tcon), \
735+
.pll = DT_PROP_OR(n, pll, 0), \
736+
.override_pll = DT_NODE_HAS_PROP(n, pll), \
737+
.vdcs = DT_PROP_OR(n, vdcs, 0), \
738+
.override_vdcs = DT_NODE_HAS_PROP(n, vdcs), \
717739
\
718740
.lutc = UC81XX_ASSIGN_ARRAY(n, lutc), \
719741
.lutww = UC81XX_ASSIGN_ARRAY(n, lutww), \

dts/bindings/display/ultrachip,uc81xx-common.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ child-binding:
7878
required: false
7979
description: TCON setting value
8080

81+
pll:
82+
type: int
83+
required: false
84+
description: PLL / frame rate control
85+
86+
vdcs:
87+
type: int
88+
required: false
89+
description: VCOM DC settings
90+
8191
lutc:
8292
type: uint8-array
8393
required: false

0 commit comments

Comments
 (0)