drm/bridge/sii8620: fix reset line logic
authorAndrzej Hajda <a.hajda@samsung.com>
Wed, 19 Oct 2016 11:23:30 +0000 (13:23 +0200)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:53:56 +0000 (13:53 +0900)
Reset line is active in low state, previous configuration was incorrect,
but it worked because logic was also inverted in the driver.
The patch fixes it. To keep bisectability both changes are put into one patch.
The patch adjusts also delays.

Change-Id: I07d08f763fa5ed4805eb638c1d2bb1ddd3328680
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
arch/arm64/boot/dts/exynos/exynos5433-tm2.dts
arch/arm64/boot/dts/exynos/exynos5433-tm2e.dts
drivers/gpu/drm/bridge/sii8620.c

index e4b8da5..e116054 100644 (file)
@@ -11,6 +11,7 @@
 
 /dts-v1/;
 #include "exynos5433.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 
 / {
                iovcc18-supply = <&ldo34_reg>;
                interrupt-parent = <&gpf0>;
                interrupts = <2 0>;
-               reset-gpio = <&gpv7 0 0>;
+               reset-gpios = <&gpv7 0 GPIO_ACTIVE_LOW>;
                clocks = <&pmu_system_controller 0>;
                clock-names = "xtal";
                assigned-clocks = <&pmu_system_controller 0>;
index 421e977..7ba5c72 100644 (file)
@@ -11,6 +11,7 @@
 
 /dts-v1/;
 #include "exynos5433.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 
 / {
                iovcc18-supply = <&ldo34_reg>;
                interrupt-parent = <&gpf0>;
                interrupts = <2 0>;
-               reset-gpio = <&gpv7 0 0>;
+               reset-gpios = <&gpv7 0 GPIO_ACTIVE_LOW>;
                clocks = <&pmu_system_controller 0>;
                clock-names = "xtal";
                assigned-clocks = <&pmu_system_controller 0>;
index 261589f..f4b3056 100644 (file)
@@ -620,27 +620,24 @@ static int sii8620_hw_on(struct sii8620 *ctx)
        if (ret)
                return ret;
 
-       gpiod_set_value(ctx->gpio_reset, 1);
-
        return 0;
 }
 
 static int sii8620_hw_off(struct sii8620 *ctx)
 {
-       gpiod_set_value(ctx->gpio_reset, 0);
-
+       gpiod_set_value(ctx->gpio_reset, 1);
        return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
 }
 
 static void sii8620_hw_reset(struct sii8620 *ctx)
 {
        usleep_range(10000, 20000);
-       gpiod_set_value(ctx->gpio_reset, 1);
-       usleep_range(5000, 20000);
        gpiod_set_value(ctx->gpio_reset, 0);
-       usleep_range(10000, 20000);
+       usleep_range(5000, 20000);
        gpiod_set_value(ctx->gpio_reset, 1);
-       msleep(30);
+       usleep_range(10000, 20000);
+       gpiod_set_value(ctx->gpio_reset, 0);
+       msleep(300);
 }
 
 static void sii8620_cbus_reset(struct sii8620 *ctx)