Skip to content

Commit 9414612

Browse files
Andy Yansuperna9999
authored andcommitted
drivers/panel: raydium-rm67200: Make reset-gpio optional
Although the datasheet of the panel module describes that it has a reset pin, in the actual hardware design, we often use an RC circuit to control the reset, and rarely use GPIO to control the reset. This is the way it is done on our numerous development boards (such as RK3568/RK3576 EVB). So make the reset-gpio optional. Signed-off-by: Andy Yan <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7513437 commit 9414612

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

drivers/gpu/drm/panel/panel-raydium-rm67200.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ static inline struct raydium_rm67200 *to_raydium_rm67200(struct drm_panel *panel
3636

3737
static void raydium_rm67200_reset(struct raydium_rm67200 *ctx)
3838
{
39-
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
40-
msleep(60);
41-
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
42-
msleep(60);
43-
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
44-
msleep(60);
39+
if (ctx->reset_gpio) {
40+
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
41+
msleep(60);
42+
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
43+
msleep(60);
44+
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
45+
msleep(60);
46+
}
4547
}
4648

4749
static void raydium_rm67200_write(struct mipi_dsi_multi_context *ctx,
@@ -409,7 +411,7 @@ static int raydium_rm67200_probe(struct mipi_dsi_device *dsi)
409411
if (ret < 0)
410412
return ret;
411413

412-
ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
414+
ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
413415
if (IS_ERR(ctx->reset_gpio))
414416
return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
415417
"Failed to get reset-gpios\n");

0 commit comments

Comments
 (0)