Skip to content

Commit d9ace6d

Browse files
drm/sitronix/st7571-i2c: Add an indirection level to parse DT
Other Sitronix display controllers might need a different parsing DT logic, so lets add a .parse_dt callback to struct st7571_panel_data. Suggested-by: Thomas Zimmermann <[email protected]> Reviewed-by: Marcus Folkesson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Javier Martinez Canillas <[email protected]>
1 parent 720799d commit d9ace6d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpu/drm/sitronix/st7571-i2c.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ struct st7571_panel_constraints {
9292

9393
struct st7571_panel_data {
9494
int (*init)(struct st7571_device *st7571);
95+
int (*parse_dt)(struct st7571_device *st7571);
9596
struct st7571_panel_constraints constraints;
9697
};
9798

@@ -881,7 +882,7 @@ static int st7571_probe(struct i2c_client *client)
881882
i2c_set_clientdata(client, st7571);
882883
st7571->pdata = device_get_match_data(&client->dev);
883884

884-
ret = st7571_parse_dt(st7571);
885+
ret = st7571->pdata->parse_dt(st7571);
885886
if (ret)
886887
return ret;
887888

@@ -964,6 +965,7 @@ static void st7571_remove(struct i2c_client *client)
964965

965966
struct st7571_panel_data st7571_config = {
966967
.init = st7571_lcd_init,
968+
.parse_dt = st7571_parse_dt,
967969
.constraints = {
968970
.min_nlines = 1,
969971
.max_nlines = 128,

0 commit comments

Comments
 (0)