aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>2023-01-17 01:09:00 +0000
committerBryan O'Donoghue <bryan.odonoghue@linaro.org>2023-01-23 01:20:49 +0000
commitb004dd3194622f29e2b037cf45493fef7f9b2799 (patch)
tree0721cc0e640c3324eb2c5476e41566ad5eb3d707
parentcb3dbc1e0c218aae2f4867ee859c2af3b1adbe47 (diff)
drm/panel-sony-tulip-truly-nt35521: Make backlight GPIO optionallinux-next-23-01-23-msm8939-nocpr
The documentation for this driver says the backlight is controlled by the DSC. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
-rw-r--r--drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c b/drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c
index ee5d20ecc577..ece265c41170 100644
--- a/drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c
+++ b/drivers/gpu/drm/panel/panel-sony-tulip-truly-nt35521.c
@@ -331,7 +331,8 @@ static int truly_nt35521_unprepare(struct drm_panel *panel)
if (ret < 0)
dev_err(dev, "Failed to un-initialize panel: %d\n", ret);
- gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ if (ctx->blen_gpio)
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
regulator_bulk_disable(ARRAY_SIZE(ctx->supplies),
ctx->supplies);
@@ -346,7 +347,8 @@ static int truly_nt35521_enable(struct drm_panel *panel)
if (ctx->enabled)
return 0;
- gpiod_set_value_cansleep(ctx->blen_gpio, 1);
+ if (ctx->blen_gpio)
+ gpiod_set_value_cansleep(ctx->blen_gpio, 1);
ctx->enabled = true;
return 0;
@@ -475,7 +477,7 @@ static int truly_nt35521_probe(struct mipi_dsi_device *dsi)
return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
"Failed to get reset-gpios\n");
- ctx->blen_gpio = devm_gpiod_get(dev, "backlight", GPIOD_OUT_LOW);
+ ctx->blen_gpio = devm_gpiod_get_optional(dev, "backlight", GPIOD_OUT_LOW);
if (IS_ERR(ctx->blen_gpio))
return dev_err_probe(dev, PTR_ERR(ctx->blen_gpio),
"Failed to get backlight-gpios\n");