arm: tegra: ardbeg: support hdmi
Seema Khowala [Thu, 27 Jun 2013 23:35:13 +0000 (16:35 -0700)]
hdmi support for E1733 AMS power tree

Bug 1284834

Change-Id: Ia6667b88292258d05355c99dd4cea40992f0fa27
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: http://git-master/r/243158

arch/arm/mach-tegra/board-ardbeg-panel.c
arch/arm/mach-tegra/board-ardbeg-power.c

index 264c63f..a9ec277 100644 (file)
@@ -250,6 +250,48 @@ static int ardbeg_hdmi_hotplug_init(struct device *dev)
        return 0;
 }
 
+/* Electrical characteristics for HDMI, all modes must be declared here */
+struct tmds_config ardbeg_tmds_config[] = {
+       { /* 480p : 27 MHz and below */
+               .pclk = 27000000,
+               .pll0 = 0x01003010,
+               .pll1 = 0x00301b00,
+               .drive_current = 0x23232323,
+               .pe_current = 0x00000000,
+               .peak_current = 0x00000000,
+       },
+       { /* 720p : 74.25MHz modes */
+               .pclk = 74250000,
+               .pll0 = 0x01003110,
+               .pll1 = 0x00301b00,
+               .drive_current = 0x25252525,
+               .pe_current = 0x00000000,
+               .peak_current = 0x03030303,
+       },
+       { /* 1080p : 148.5MHz modes */
+               .pclk = 148500000,
+               .pll0 = 0x01003310,
+               .pll1 = 0x00301b00,
+               .drive_current = 0x27272727,
+               .pe_current = 0x00000000,
+               .peak_current = 0x03030303,
+       },
+       { /* 4K : 297MHz modes */
+               .pclk = INT_MAX,
+               .pll0 = 0x01003f10,
+               .pll1 = 0x00300f00,
+               .drive_current = 0x303f3f3f,
+               .pe_current = 0x00000000,
+               .peak_current = 0x040f0f0f,
+       },
+};
+
+struct tegra_hdmi_out ardbeg_hdmi_out = {
+       .tmds_config = ardbeg_tmds_config,
+       .n_tmds_config = ARRAY_SIZE(ardbeg_tmds_config),
+};
+
+
 static struct tegra_dc_out ardbeg_disp2_out = {
        .type           = TEGRA_DC_OUT_HDMI,
        .flags          = TEGRA_DC_OUT_HOTPLUG_HIGH,
@@ -257,6 +299,7 @@ static struct tegra_dc_out ardbeg_disp2_out = {
 
        .dcc_bus        = 3,
        .hotplug_gpio   = ardbeg_hdmi_hpd,
+       .hdmi_out       = &ardbeg_hdmi_out,
 
        /* TODO: update max pclk to POR */
        .max_pixclock   = KHZ2PICOS(297000),
index 22cfea4..e8b69b9 100644 (file)
@@ -148,6 +148,8 @@ static struct regulator_consumer_supply as3722_sd2_supply[] = {
 };
 
 static struct regulator_consumer_supply as3722_sd4_supply[] = {
+       REGULATOR_SUPPLY("avdd_hdmi","tegradc.1"),
+       REGULATOR_SUPPLY("avdd_hdmi_pll", "tegradc.1"),
        REGULATOR_SUPPLY("avdd_pex_pll", "tegra-pcie"),
        REGULATOR_SUPPLY("avddio_pex", "tegra-pcie"),
        REGULATOR_SUPPLY("dvddio_pex", "tegra-pcie"),
@@ -1118,8 +1120,6 @@ static struct regulator_consumer_supply fixed_reg_en_as3722_gpio2_supply[] = {
        REGULATOR_SUPPLY("avdd_usb_pll", "tegra-xhci"),
 #endif
        REGULATOR_SUPPLY("vddio_sd_slot", "sdhci-tegra.3"),
-       REGULATOR_SUPPLY("avdd_hdmi", "tegradc.1"),
-       REGULATOR_SUPPLY("avdd_hdmi_pll", "tegradc.1"),
        REGULATOR_SUPPLY("avdd_pex", "tegra-pcie"),
 };
 
@@ -1144,7 +1144,6 @@ static struct regulator_consumer_supply fixed_reg_en_e1733_cdc_1v2_supply[] = {
 };
 
 static struct regulator_consumer_supply fixed_reg_en_vdd_sys_5v0_supply[] = {
-       REGULATOR_SUPPLY("vdd_hdmi_5v0", "tegradc.1"),
        REGULATOR_SUPPLY("vdd_spk_5v0", NULL),
        REGULATOR_SUPPLY("spkvdd", "tegra-snd-rt5639"),
        REGULATOR_SUPPLY("spkvdd", "tegra-snd-rt5645"),
@@ -1280,13 +1279,13 @@ FIXED_REG(5,    vdd_dis_3v3a,   vdd_dis_3v3a,
        0);
 
 #ifdef CONFIG_ARCH_TEGRA_11x_SOC
-FIXED_REG(6,   vdd_hdmi_5v0,   vdd_hdmi_5v0,
+FIXED_REG(12,  vdd_hdmi_5v0,   vdd_hdmi_5v0,
        NULL,   0,      0,
-       TEGRA_GPIO_PH7, true,   true,   0,      5000,   5000);
+       TEGRA_GPIO_PH7, false,  true,   0,      5000,   5000);
 #else
-FIXED_REG(6,   vdd_hdmi_5v0,   vdd_hdmi_5v0,
+FIXED_REG(12,  vdd_hdmi_5v0,   vdd_hdmi_5v0,
        NULL,   0,      0,
-       TEGRA_GPIO_PK6, true,   true,   0,      5000,   5000);
+       TEGRA_GPIO_PK6, false,  true,   0,      5000,   5000);
 #endif
 
 /*
@@ -1295,6 +1294,7 @@ FIXED_REG(6,      vdd_hdmi_5v0,   vdd_hdmi_5v0,
 #define ADD_FIXED_REG(_name)    (&fixed_reg_en_##_name##_dev)
 #define ARDBEG_E1733_COMMON_FIXED_REG  \
        ADD_FIXED_REG(battery_e1733),           \
+       ADD_FIXED_REG(vdd_hdmi_5v0),            \
        ADD_FIXED_REG(usb0_vbus),               \
        ADD_FIXED_REG(usb1_vbus),               \
        ADD_FIXED_REG(usb2_vbus),               \