arch: arm: tegra: ardbeg: Support Raydium Touch
Xiaohui Tao [Fri, 10 May 2013 03:27:40 +0000 (20:27 -0700)]
Add platform data and power rails needed for touch
support on ardbeg.

Bug 1256425

Change-Id: I6d40d83db44363242d078b0caa59d8111bfe1e58
Signed-off-by: Mitch Luban <mluban@nvidia.com>
Signed-off-by: Xiaohui Tao <xtao@nvidia.com>
Reviewed-on: http://git-master/r/227110
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Tested-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

arch/arm/boot/dts/tegra114-ardbeg.dts
arch/arm/mach-tegra/board-ardbeg-power.c
arch/arm/mach-tegra/board-ardbeg.c
arch/arm/mach-tegra/board-ardbeg.h

index bed08c7..2ac4211 100644 (file)
                clock-frequency = <100000>;
        };
 
+       i2c@7000c500 {
+               status = "okay";
+               clock-frequency = <400000>;
+       };
+
        i2c@7000c700 {
                status = "okay";
                clock-frequency = <100000>;
                clock-frequency = <400000>;
        };
 
+       spi@7000d400 {
+               status = "okay";
+               spi-max-frequency = <25000000>;
+               nvidia,dma-request-selector = <&apbdma 0>;
+       };
+
+       spi@7000d600 {
+               status = "okay";
+               spi-max-frequency = <25000000>;
+               nvidia,dma-request-selector = <&apbdma 0>;
+       };
+
+       spi@7000d800 {
+               status = "okay";
+               spi-max-frequency = <25000000>;
+               nvidia,dma-request-selector = <&apbdma 0>;
+       };
+
        spi@7000da00 {
                status = "okay";
                spi-max-frequency = <25000000>;
index ca0fab6..161574a 100644 (file)
@@ -174,7 +174,7 @@ static struct regulator_consumer_supply palmas_ldo12_supply[] = {
 };
 
 static struct regulator_consumer_supply palmas_ldo13_supply[] = {
-       REGULATOR_SUPPLY("vdd_ts_1v8b_dis", NULL),
+       REGULATOR_SUPPLY("dvdd", "spi0.0"),
 };
 
 static struct regulator_consumer_supply palmas_ldo14_supply[] = {
@@ -182,7 +182,7 @@ static struct regulator_consumer_supply palmas_ldo14_supply[] = {
 };
 
 static struct regulator_consumer_supply palmas_ldoln_supply[] = {
-       REGULATOR_SUPPLY("avdd_ts_dis", NULL),
+       REGULATOR_SUPPLY("avdd", "spi0.0"),
 };
 
 static struct regulator_consumer_supply palmas_ldousb_supply[] = {
@@ -318,9 +318,9 @@ PALMAS_PDATA_INIT(ldo9, 2800, 3000, palmas_rails(smps3), 1, 1, 0);
 PALMAS_PDATA_INIT(ldo10, 1800, 3300, NULL, 0, 0, 0);
 PALMAS_PDATA_INIT(ldo11, 3300, 3300, NULL, 0, 0, 0);
 PALMAS_PDATA_INIT(ldo12, 2800, 3000, palmas_rails(smps9), 1, 1, 0);
-PALMAS_PDATA_INIT(ldo13, 2800, 3000, palmas_rails(smps9), 1, 1, 0);
+PALMAS_PDATA_INIT(ldo13, 1800, 1800, palmas_rails(smps9), 1, 1, 1);
 PALMAS_PDATA_INIT(ldo14, 2800, 3000, NULL, 0, 0, 0);
-PALMAS_PDATA_INIT(ldoln, 2800, 3000, NULL, 1, 1, 0);
+PALMAS_PDATA_INIT(ldoln, 3300, 3300, NULL, 1, 1, 1);
 PALMAS_PDATA_INIT(ldousb, 2800, 3000, NULL, 0, 0, 0);
 PALMAS_PDATA_INIT(regen1, 3300, 3300, NULL, 1, 0, 0);
 PALMAS_PDATA_INIT(regen2, 5000, 5000, NULL, 1, 0, 0);
index afe669c..16b930e 100644 (file)
@@ -519,6 +519,51 @@ struct of_dev_auxdata ardbeg_auxdata_lookup[] __initdata = {
 };
 #endif
 
+static __initdata struct tegra_clk_init_table touch_clk_init_table[] = {
+       /* name         parent          rate            enabled */
+       { "extern2",    "pll_p",        41000000,       false},
+       { "clk_out_2",  "extern2",      40800000,       false},
+       { NULL,         NULL,           0,              0},
+};
+
+struct rm_spi_ts_platform_data rm31080ts_ardbeg_data = {
+       .gpio_reset = TOUCH_GPIO_RST_RAYDIUM_SPI,
+       .config = 0,
+       .platform_id = RM_PLATFORM_D010,
+       .name_of_clock = "clk_out_2",
+       .name_of_clock_con = "extern2",
+};
+
+static struct tegra_spi_device_controller_data dev_cdata = {
+       .rx_clk_tap_delay = 0,
+       .tx_clk_tap_delay = 16,
+};
+
+struct spi_board_info rm31080a_ardbeg_spi_board[1] = {
+       {
+               .modalias = "rm_ts_spidev",
+               .bus_num = TOUCH_SPI_ID,
+               .chip_select = TOUCH_SPI_CS,
+               .max_speed_hz = 12 * 1000 * 1000,
+               .mode = SPI_MODE_0,
+               .controller_data = &dev_cdata,
+               .platform_data = &rm31080ts_ardbeg_data,
+       },
+};
+
+static int __init ardbeg_touch_init(void)
+{
+       tegra_clk_init_from_table(touch_clk_init_table);
+       rm31080a_ardbeg_spi_board[0].irq =
+               gpio_to_irq(TOUCH_GPIO_IRQ_RAYDIUM_SPI);
+       touch_init_raydium(TOUCH_GPIO_IRQ_RAYDIUM_SPI,
+                               TOUCH_GPIO_RST_RAYDIUM_SPI,
+                               &rm31080ts_ardbeg_data,
+                               &rm31080a_ardbeg_spi_board[0],
+                               ARRAY_SIZE(rm31080a_ardbeg_spi_board));
+       return 0;
+}
+
 static void __init tegra_ardbeg_early_init(void)
 {
        tegra_clk_init_from_table(ardbeg_clk_init_table);
@@ -533,6 +578,7 @@ static void __init tegra_ardbeg_late_init(void)
        ardbeg_usb_init();
        ardbeg_modem_init();
        ardbeg_i2c_init();
+       ardbeg_spi_init();
        ardbeg_uart_init();
        platform_add_devices(ardbeg_devices, ARRAY_SIZE(ardbeg_devices));
        //tegra_ram_console_debug_init();
@@ -545,9 +591,7 @@ static void __init tegra_ardbeg_late_init(void)
        ardbeg_edp_init();
 #endif
        isomgr_init();
-#if 0
        ardbeg_touch_init();
-#endif
        ardbeg_panel_init();
        ardbeg_kbc_init();
 #if 0
index d8e9bd8..6dc6d2e 100644 (file)
@@ -32,6 +32,19 @@ int ardbeg_sensors_init(void);
 int ardbeg_regulator_init(void);
 int ardbeg_suspend_init(void);
 
+/* Touchscreen definitions */
+#ifdef CONFIG_ARCH_TEGRA_11x_SOC
+#define TOUCH_GPIO_IRQ_RAYDIUM_SPI     TEGRA_GPIO_PK2
+#define TOUCH_GPIO_RST_RAYDIUM_SPI     TEGRA_GPIO_PK4
+#define TOUCH_SPI_ID                   0       /*SPI 1 on ardbeg_interposer*/
+#define TOUCH_SPI_CS                   0       /*CS  0 on ardbeg_interposer*/
+#else
+#define TOUCH_GPIO_IRQ_RAYDIUM_SPI     TEGRA_GPIO_PK2
+#define TOUCH_GPIO_RST_RAYDIUM_SPI     TEGRA_GPIO_PK4
+#define TOUCH_SPI_ID                   0       /*SPI 1 on ardbeg_interposer*/
+#define TOUCH_SPI_CS                   0       /*CS  0 on ardbeg_interposer*/
+#endif
+
 #define PALMAS_TEGRA_GPIO_BASE TEGRA_NR_GPIOS
 #define PALMAS_TEGRA_IRQ_BASE  TEGRA_NR_IRQS