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>
#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"
{
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");
}
}
#endif
+success:
dc_dev = dev;
return 0;
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);
* 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)
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";
+ };
+ };
};
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";
+ };
+ };
};