ARM: exynos: snow: Get DP_PD_N & DP_RST_N from dt
authorSean Paul <seanpaul@chromium.org>
Fri, 20 Jul 2012 18:37:45 +0000 (11:37 -0700)
committerGerrit <chrome-bot@google.com>
Sat, 21 Jul 2012 02:17:11 +0000 (19:17 -0700)
Add a new node in the device tree which contains entries for DP_PD_N and
DP_RST_N. These values will be fixed up by u-boot to reflect the correct
values for the current board.

BUG=chrome-os-partner:11315
TEST=Tested on snow, ensure the gpio was being correctly harvested and
set

Change-Id: I71b7367c3cbff1407a8d84e0f2a4d7c133ae8ded
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28036
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
arch/arm/boot/dts/exynos5250-snow.dts
arch/arm/mach-exynos/mach-exynos5-dt.c

index a4b1951..a40bb55 100644 (file)
                samsung,arbitration-gpios = <&gpf0 3 1 0 0>,
                        <&gpe0 4 0 3 0>;
        };
+       i2c@12CD0000 {
+               dp_bridge@20 {
+                       compatible = "nxp,ptn3460";
+                       reg = <0x20>;
+                       pd_n_gpio = <&gpy2 5 0 0 0>;
+                       rst_n_gpio = <&gpx1 5 0 0 0>;
+               };
+       };
 };
index 753eb81..2a23e28 100644 (file)
@@ -10,6 +10,7 @@
 */
 
 #include <linux/gpio.h>
+#include <linux/of_gpio.h>
 #include <linux/of_platform.h>
 #include <linux/platform_data/dwc3-exynos.h>
 #include <linux/regulator/fixed.h>
@@ -916,6 +917,8 @@ static void __init exynos5250_dt_machine_init(void)
                dsim_lcd_info.lcd_size.width = 1366;
                dsim_lcd_info.lcd_size.height = 768;
        } else if (of_machine_is_compatible("google,snow")) {
+               int pd_n_gpio = -1, rst_n_gpio = -1;
+
 #ifdef CONFIG_DRM_EXYNOS_FIMD
                for (i = 0;i < ARRAY_SIZE(snow_fb_window);i++)
                        smdk5250_lcd1_pdata.panel[i].timing = snow_fb_window[i];
@@ -924,9 +927,22 @@ static void __init exynos5250_dt_machine_init(void)
                smdk5250_lcd1_pdata.clock_rate = 267 * 1000 * 1000;
                smdk5250_lcd1_pdata.vidcon1 = 0;
 #endif
-               ret = gpio_request_one(EXYNOS5_GPX1(5), GPIOF_OUT_INIT_HIGH,
-                                       "DP_PD_N");
-               WARN_ON(ret);
+
+               np = of_find_compatible_node(NULL, NULL, "nxp,ptn3460");
+               if (np) {
+                       pd_n_gpio = of_get_named_gpio(np, "pd_n_gpio", 0);
+                       rst_n_gpio = of_get_named_gpio(np, "rst_n_gpio", 0);
+               }
+               if (pd_n_gpio >= 0) {
+                       ret = gpio_request_one(pd_n_gpio, GPIOF_OUT_INIT_HIGH,
+                                               "DP_PD_N");
+                       WARN_ON(ret);
+               }
+               if (rst_n_gpio >= 0) {
+                       ret = gpio_request_one(rst_n_gpio, GPIOF_OUT_INIT_HIGH,
+                                               "DP_RST_N");
+                       WARN_ON(ret);
+               }
        }
 
        if (gpio_request_one(EXYNOS5_GPX2(6), GPIOF_OUT_INIT_HIGH,