arm: tegra: cardhu: use 55hz only for old boards
Jon Mayo [Mon, 8 Aug 2011 17:11:52 +0000 (10:11 -0700)]
Use different display refresh rates for some boards that are more
sensitive to touch screen interference.

Bug 861062

Original-Change-Id: I76a31107b2111d4a0d6d5f072ead877a35cd59a0
Reviewed-on: http://git-master/r/45874
Tested-by: Jonathan Mayo <jmayo@nvidia.com>
Reviewed-by: Jonathan Mayo <jmayo@nvidia.com>

Rebase-Id: R5605962a8d026d775af9f7d166daa697c5e6d4d5

arch/arm/mach-tegra/board-cardhu-panel.c
arch/arm/mach-tegra/board-cardhu.h

index 4e34118..1c45afb 100644 (file)
@@ -439,6 +439,23 @@ static struct resource cardhu_disp2_resources[] = {
 #ifndef CONFIG_TEGRA_CARDHU_DSI
 static struct tegra_dc_mode cardhu_panel_modes[] = {
        {
+               /* 1366x768@60Hz */
+               .pclk = 74180000,
+               .h_ref_to_sync = 1,
+               .v_ref_to_sync = 1,
+               .h_sync_width = 30,
+               .v_sync_width = 5,
+               .h_back_porch = 52,
+               .v_back_porch = 20,
+               .h_active = 1366,
+               .v_active = 768,
+               .h_front_porch = 64,
+               .v_front_porch = 25,
+       },
+};
+
+static struct tegra_dc_mode cardhu_panel_modes_55hz[] = {
+       {
                /* 1366x768p 55Hz */
                .pclk = 68000000,
                .h_ref_to_sync = 0,
@@ -961,6 +978,14 @@ int __init cardhu_panel_init(void)
        cardhu_carveouts[1].base = tegra_carveout_start;
        cardhu_carveouts[1].size = tegra_carveout_size;
 
+       if (board_info.board_id == BOARD_E1291 &&
+               ((board_info.sku & SKU_TOUCHSCREEN_MECH_FIX) == 0)) {
+               /* use 55Hz panel timings to reduce noise on sensitive touch */
+               printk("Using cardhu_panel_modes_55hz\n");
+               cardhu_disp1_out.modes = cardhu_panel_modes_55hz;
+               cardhu_disp1_out.n_modes = ARRAY_SIZE(cardhu_panel_modes_55hz);
+       }
+
        if (board_info.board_id == BOARD_PM269) {
                gpio_request(pm269_lvds_shutdown, "lvds_shutdown");
                gpio_direction_output(pm269_lvds_shutdown, 1);
index 711fadb..3ee3fe6 100644 (file)
@@ -38,6 +38,7 @@
 #define SKU_DCDC_TPS62361_SUPPORT      0x1
 #define SKU_SLT_ULPI_SUPPORT           0x2
 #define SKU_T30S_SUPPORT               0x4
+#define SKU_TOUCHSCREEN_MECH_FIX       0x10
 
 #define SKU_MEMORY_TYPE_BIT            0x4
 #define SKU_MEMORY_TYPE_MASK           0x3