Commit 05370366 authored by Maxime Ripard's avatar Maxime Ripard

Merge remote-tracking branch 'drm-misc/drm-misc-next-fixes' into drm-misc-fixes

We have a few leftovers from the merge window period in
drm-misc-next-fixes, let's bring them into drm-misc-fixes
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
parents 3650b228 2580a493
...@@ -37,6 +37,9 @@ properties: ...@@ -37,6 +37,9 @@ properties:
reset-gpios: true reset-gpios: true
'mantix,tp-rstn-gpios':
description: second reset line that triggers DSI config load
backlight: true backlight: true
required: required:
...@@ -63,6 +66,7 @@ examples: ...@@ -63,6 +66,7 @@ examples:
avee-supply = <&reg_avee>; avee-supply = <&reg_avee>;
vddi-supply = <&reg_1v8_p>; vddi-supply = <&reg_1v8_p>;
reset-gpios = <&gpio1 29 GPIO_ACTIVE_LOW>; reset-gpios = <&gpio1 29 GPIO_ACTIVE_LOW>;
mantix,tp-rstn-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
backlight = <&backlight>; backlight = <&backlight>;
}; };
}; };
......
...@@ -26,7 +26,9 @@ ...@@ -26,7 +26,9 @@
struct mantix { struct mantix {
struct device *dev; struct device *dev;
struct drm_panel panel; struct drm_panel panel;
struct gpio_desc *reset_gpio; struct gpio_desc *reset_gpio;
struct gpio_desc *tp_rstn_gpio;
struct regulator *avdd; struct regulator *avdd;
struct regulator *avee; struct regulator *avee;
...@@ -124,6 +126,10 @@ static int mantix_unprepare(struct drm_panel *panel) ...@@ -124,6 +126,10 @@ static int mantix_unprepare(struct drm_panel *panel)
{ {
struct mantix *ctx = panel_to_mantix(panel); struct mantix *ctx = panel_to_mantix(panel);
gpiod_set_value_cansleep(ctx->tp_rstn_gpio, 1);
usleep_range(5000, 6000);
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
regulator_disable(ctx->avee); regulator_disable(ctx->avee);
regulator_disable(ctx->avdd); regulator_disable(ctx->avdd);
/* T11 */ /* T11 */
...@@ -165,13 +171,10 @@ static int mantix_prepare(struct drm_panel *panel) ...@@ -165,13 +171,10 @@ static int mantix_prepare(struct drm_panel *panel)
return ret; return ret;
} }
/* T3+T5 */ /* T3 + T4 + time for voltage to become stable: */
usleep_range(10000, 12000); usleep_range(6000, 7000);
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
usleep_range(5150, 7000);
gpiod_set_value_cansleep(ctx->reset_gpio, 0); gpiod_set_value_cansleep(ctx->reset_gpio, 0);
gpiod_set_value_cansleep(ctx->tp_rstn_gpio, 0);
/* T6 */ /* T6 */
msleep(50); msleep(50);
...@@ -204,7 +207,7 @@ static int mantix_get_modes(struct drm_panel *panel, ...@@ -204,7 +207,7 @@ static int mantix_get_modes(struct drm_panel *panel,
if (!mode) { if (!mode) {
dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n",
default_mode.hdisplay, default_mode.vdisplay, default_mode.hdisplay, default_mode.vdisplay,
drm_mode_vrefresh(mode)); drm_mode_vrefresh(&default_mode));
return -ENOMEM; return -ENOMEM;
} }
...@@ -236,12 +239,18 @@ static int mantix_probe(struct mipi_dsi_device *dsi) ...@@ -236,12 +239,18 @@ static int mantix_probe(struct mipi_dsi_device *dsi)
if (!ctx) if (!ctx)
return -ENOMEM; return -ENOMEM;
ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(ctx->reset_gpio)) { if (IS_ERR(ctx->reset_gpio)) {
dev_err(dev, "cannot get reset gpio\n"); dev_err(dev, "cannot get reset gpio\n");
return PTR_ERR(ctx->reset_gpio); return PTR_ERR(ctx->reset_gpio);
} }
ctx->tp_rstn_gpio = devm_gpiod_get(dev, "mantix,tp-rstn", GPIOD_OUT_HIGH);
if (IS_ERR(ctx->tp_rstn_gpio)) {
dev_err(dev, "cannot get tp-rstn gpio\n");
return PTR_ERR(ctx->tp_rstn_gpio);
}
mipi_dsi_set_drvdata(dsi, ctx); mipi_dsi_set_drvdata(dsi, ctx);
ctx->dev = dev; ctx->dev = dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment