Skip to content

Commit 3a63ef6

Browse files
affenull2345notro
authored andcommitted
drm/tiny: panel-mipi-dbi: Allow sharing the D/C GPIO
Displays that are connected to the same SPI bus may share the D/C GPIO. Use GPIOD_FLAGS_BIT_NONEXCLUSIVE to allow access to the same GPIO for multiple panel-mipi-dbi instances. Exclusive access to the GPIO during transfers is ensured by the locking in drm_mipi_dbi.c. Signed-off-by: Otto Pflüger <[email protected]> Signed-off-by: Noralf Trønnes <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 8cc8ccb commit 3a63ef6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/tiny/panel-mipi-dbi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ static int panel_mipi_dbi_spi_probe(struct spi_device *spi)
307307
if (IS_ERR(dbi->reset))
308308
return dev_err_probe(dev, PTR_ERR(dbi->reset), "Failed to get GPIO 'reset'\n");
309309

310-
dc = devm_gpiod_get_optional(dev, "dc", GPIOD_OUT_LOW);
310+
/* Multiple panels can share the "dc" GPIO, but only if they are on the same SPI bus! */
311+
dc = devm_gpiod_get_optional(dev, "dc", GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
311312
if (IS_ERR(dc))
312313
return dev_err_probe(dev, PTR_ERR(dc), "Failed to get GPIO 'dc'\n");
313314

0 commit comments

Comments
 (0)