]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: tegra210: hawkeye: add support for display uC
authorDaniel Solomon <daniels@nvidia.com>
Thu, 24 Sep 2015 00:54:29 +0000 (17:54 -0700)
committermobile promotions <svcmobile_promotions@nvidia.com>
Tue, 3 Nov 2015 16:41:29 +0000 (08:41 -0800)
Add support for the Cypress microcontroller used to
control display power sequences on Hawkeye A04.

Bug 1679724

Change-Id: I1437420bec07b755690d5aaa4deb20751372e975
Signed-off-by: Daniel Solomon <daniels@nvidia.com>
Reviewed-on: http://git-master/r/804157
(cherry picked from commit 5e92670cbab1e7824b4b3eac305ca23be3e45904)
Reviewed-on: http://git-master/r/818546
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Reviewed-by: Aly Hirani <ahirani@nvidia.com>
arch/arm/mach-tegra/panel-s-wuxga-8-0.c
arch/arm64/boot/dts/tegra210-hawkeye-p2290-3304-a04-00.dts
arch/arm64/boot/dts/tegra210-hawkeye-p2290-3306-a04-00.dts

index ff3dc01586eca22e5090ae322da5ce6dc2830eaa..0a5b231cb8feac22c5f98a346453f7873ecefd3b 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/delay.h>
 #include <linux/gpio.h>
 #include <linux/regulator/consumer.h>
+#include <linux/platform/tegra/panel-cy8c.h>
 #include "board.h"
 #include "board-panel.h"
 #include "devices.h"
@@ -83,6 +84,16 @@ static int dsi_s_wuxga_8_0_enable(struct device *dev)
 {
        int err = 0;
 
+       err = cy8c_panel_set_state(true);
+       if (!err)
+               goto success;
+       else if (err == -ENODEV)
+               err = 0; /* no cy8c, enable rails normally */
+       else {
+               pr_err("cy8c detected but panel enable failed\n");
+               goto fail;
+       }
+
        err = dsi_s_wuxga_8_0_regulator_get(dev);
        if (err < 0) {
                pr_err("dsi regulator get failed\n");
@@ -164,6 +175,7 @@ static int dsi_s_wuxga_8_0_enable(struct device *dev)
                }
        }
 #endif
+success:
        dc_dev = dev;
        return 0;
 fail:
@@ -172,6 +184,18 @@ fail:
 
 static int dsi_s_wuxga_8_0_disable(struct device *dev)
 {
+       int err;
+
+       err = cy8c_panel_set_state(false);
+       if (!err)
+               goto end;
+       else if (err == -ENODEV)
+               err = 0; /* no cy8c, disable rails normally */
+       else {
+               pr_err("cy8c detected but panel disable failed\n");
+               goto end;
+       }
+
        if (gpio_is_valid(en_panel_rst)) {
                /* Wait for 50ms before triggering panel reset */
                msleep(50);
@@ -202,8 +226,9 @@ static int dsi_s_wuxga_8_0_disable(struct device *dev)
         * the panel on too soon after power off */
        msleep(140);
 
+end:
        dc_dev = NULL;
-       return 0;
+       return err;
 }
 
 static int dsi_s_wuxga_8_0_postsuspend(void)
index 4935a4d457c7c4405dc9ac1ffc46fcccc0c36ec9..f8257bc4b6c9306bb57d685bcc280d4970d3a084 100644 (file)
        nvidia,dtsfilename = __FILE__;
        nvidia,boardids = "2290:3304:A04";
        nvidia,proc-boardid = "2290:3304:A04";
+
+       i2c@7000c000 {
+               cy8c_panel@09 {
+                       compatible = "nvidia,cy8c_panel";
+                       reg = <0x09>;
+                       enable-gpio = <&gpio TEGRA_GPIO(K, 1) 0>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+       };
+
+       /* On A04 the cy8c microcontroller is used to enabled
+       * the panel. This is done in part by by using the GPIO
+       * that was formerly used to enable the vdd_lcd_1v8
+       * regulator. Disable this regulator now, so that there's
+       * no contention for the GPIO */
+       regulators {
+               vdd_lcd_1v8: regulator@5 {
+                       status = "disabled";
+               };
+       };
 };
index 2e02296b77b45cb44357fbbf9cffc280fdabb16e..0506fe3956debbbddbba5ee870b07171a1c7d0e7 100644 (file)
        nvidia,dtsfilename = __FILE__;
        nvidia,boardids = "2290:3306:A04";
        nvidia,proc-boardid = "2290:3306:A04";
+
+       i2c@7000c000 {
+               cy8c_panel@09 {
+                       compatible = "nvidia,cy8c_panel";
+                       reg = <0x09>;
+                       enable-gpio = <&gpio TEGRA_GPIO(K, 1) 0>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+       };
+
+       /* On A04 the cy8c microcontroller is used to enabled
+       * the panel. This is done in part by by using the GPIO
+       * that was formerly used to enable the vdd_lcd_1v8
+       * regulator. Disable this regulator now, so that there's
+       * no contention for the GPIO */
+       regulators {
+               vdd_lcd_1v8: regulator@5 {
+                       status = "disabled";
+               };
+       };
 };