Skip to content

Commit 541d9bf

Browse files
minlexxstephan-gh
authored andcommitted
lk2nd: device: panel: support for replacing compatible
Add handling for new property, replace-compatible, which, if found, will result in not prepending the new panel compatible string, but completely replacing it. Signed-off-by: Alexey Minnekhanov <[email protected]> (cherry picked from commit fc9eb1c)
1 parent 635c6de commit 541d9bf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lk2nd/device/panel.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ static int lk2nd_panel_detect(const void *dtb, int node)
2323
struct lk2nd_panel *panel = &lk2nd_dev.panel;
2424
const char *old, *new, *ts;
2525
int old_len, new_len, ts_len;
26+
bool replace_mode;
2627

2728
/* Should have been set from parsed command line or display driver */
2829
if (!panel->name) {
@@ -34,6 +35,8 @@ static int lk2nd_panel_detect(const void *dtb, int node)
3435
if (!old || old_len < 0)
3536
return old_len;
3637

38+
replace_mode = !!fdt_getprop(dtb, node, "replace-compatible", NULL);
39+
3740
node = fdt_subnode_offset(dtb, node, panel->name);
3841
if (node < 0) {
3942
dprintf(CRITICAL, "Unsupported panel: %s\n", panel->name);
@@ -54,6 +57,9 @@ static int lk2nd_panel_detect(const void *dtb, int node)
5457
strlcpy((char *)panel->compatible, new, new_len);
5558
strlcpy((char *)panel->old_compatible, old, old_len);
5659

60+
if (replace_mode)
61+
panel->compatible_size = new_len;
62+
5763
ts = fdt_getprop(dtb, node, "touchscreen-compatible", &ts_len);
5864
if (ts && ts_len > 0)
5965
panel->ts_compatible = strndup(ts, ts_len);

0 commit comments

Comments
 (0)