diff options
author | Robert Collins <rcollins@nvidia.com> | 2012-12-06 22:08:30 -0800 |
---|---|---|
committer | Riham Haidar <rhaidar@nvidia.com> | 2013-01-24 16:16:44 -0800 |
commit | 1eaadfd926977c44c26f3b67cac2364cd03ecf84 (patch) | |
tree | 501ee433d66143fcc94a1c3864d2430e848118b3 /arch | |
parent | 9cf3e314099f1b5a415fd25431f14a6452094755 (diff) |
ARM: tegra: Roth: Implement touch infrastructure
Nvidia changes to add Roth board files.
Bug 1178869
Change-Id: I11d5fafe34f1e3c7eb9389887bff2352e4103608
Signed-off-by: Robert Collins <rcollins@nvidia.com>
Reviewed-on: http://git-master/r/171519
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: David Jung <djung@nvidia.com>
Tested-by: David Jung <djung@nvidia.com>
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-roth-power.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-roth.c | 98 |
2 files changed, 105 insertions, 9 deletions
diff --git a/arch/arm/mach-tegra/board-roth-power.c b/arch/arm/mach-tegra/board-roth-power.c index 12d581b03b49..3bd89e646518 100644 --- a/arch/arm/mach-tegra/board-roth-power.c +++ b/arch/arm/mach-tegra/board-roth-power.c @@ -210,6 +210,7 @@ static struct regulator_consumer_supply palmas_smps3_supply[] = { REGULATOR_SUPPLY("dbvdd", NULL), REGULATOR_SUPPLY("dvdd_lcd", NULL), REGULATOR_SUPPLY("vlogic", "0-0068"), + REGULATOR_SUPPLY("dvdd", "spi3.2"), }; static struct regulator_consumer_supply palmas_smps45_supply[] = { @@ -464,12 +465,6 @@ static struct regulator_consumer_supply fixed_reg_lcd_bl_en_supply[] = { REGULATOR_SUPPLY("vdd_lcd_bl_en", NULL), }; -/* Touch 3v3 GMI_AD13 */ -static struct regulator_consumer_supply fixed_reg_ts_3v3_supply[] = { - REGULATOR_SUPPLY("vdd_ts_3v3", NULL), - REGULATOR_SUPPLY("vdd_display", NULL), -}; - /* VDD_3V3_COM controled by Wifi */ static struct regulator_consumer_supply fixed_reg_com_3v3_supply[] = { REGULATOR_SUPPLY("vdd_wl_pa", "bcm4329_wlan.1"), @@ -489,6 +484,11 @@ static struct regulator_consumer_supply fixed_reg_sd_3v3_supply[] = { REGULATOR_SUPPLY("vddio_sd_slot", "sdhci-tegra.2"), }; +/* EN_3V3_TS From TEGRA_GPIO_PH5 */ +static struct regulator_consumer_supply fixed_reg_avdd_ts_supply[] = { + REGULATOR_SUPPLY("avdd", "spi3.2"), +}; + /* Macro for defining fixed regulator sub device data */ #define FIXED_SUPPLY(_name) "fixed_reg_"#_name #define FIXED_REG(_id, _var, _name, _in_supply, _always_on, _boot_on, \ @@ -539,7 +539,7 @@ FIXED_REG(2, lcd_bl_en, lcd_bl_en, NULL, 0, 0, TEGRA_GPIO_PH2, false, true, 0, 5000); -FIXED_REG(3, ts_3v3, ts_3v3, +FIXED_REG(3, avdd_ts, avdd_ts, palmas_rails(regen1), 0, 0, TEGRA_GPIO_PH5, false, true, 0, 3300); @@ -579,7 +579,7 @@ static struct platform_device *fixed_reg_devs_roth[] = { ADD_FIXED_REG(fan_5v0), ADD_FIXED_REG(vdd_hdmi_5v0), ADD_FIXED_REG(lcd_bl_en), - ADD_FIXED_REG(ts_3v3), + ADD_FIXED_REG(avdd_ts), ADD_FIXED_REG(com_3v3), ADD_FIXED_REG(sd_3v3), ADD_FIXED_REG(com_1v8), diff --git a/arch/arm/mach-tegra/board-roth.c b/arch/arm/mach-tegra/board-roth.c index 59cc217d0fdf..9e0765771eb4 100644 --- a/arch/arm/mach-tegra/board-roth.c +++ b/arch/arm/mach-tegra/board-roth.c @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/board-roth.c * - * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2012 - 2013, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -31,6 +31,9 @@ #include <linux/gpio.h> #include <linux/input.h> #include <linux/platform_data/tegra_usb.h> +#include <linux/spi/spi.h> +#include <linux/spi/rm31080a_ts.h> +#include <linux/spi-tegra.h> #include <linux/tegra_uart.h> #include <linux/memblock.h> #include <linux/rfkill-gpio.h> @@ -71,6 +74,7 @@ #include "pm.h" #include "common.h" #include "tegra-board-id.h" +#include "board-touch-raydium.h" #ifdef CONFIG_BT_BLUESLEEP static struct rfkill_gpio_platform_data roth_bt_rfkill_pdata = { @@ -594,6 +598,96 @@ static void roth_audio_init(void) } +static struct platform_device *roth_spi_devices[] __initdata = { + &tegra11_spi_device4, +}; + +struct spi_clk_parent spi_parent_clk_roth[] = { + [0] = {.name = "pll_p"}, +#ifndef CONFIG_TEGRA_PLLM_RESTRICTED + [1] = {.name = "pll_m"}, + [2] = {.name = "clk_m"}, +#else + [1] = {.name = "clk_m"}, +#endif +}; + +static struct tegra_spi_platform_data roth_spi_pdata = { + .is_dma_based = false, + .max_dma_buffer = 16 * 1024, + .is_clkon_always = false, + .max_rate = 25000000, +}; + +static void __init roth_spi_init(void) +{ + int i; + struct clk *c; + + for (i = 0; i < ARRAY_SIZE(spi_parent_clk_roth); ++i) { + c = tegra_get_clock_by_name(spi_parent_clk_roth[i].name); + if (IS_ERR_OR_NULL(c)) { + pr_err("Not able to get the clock for %s\n", + spi_parent_clk_roth[i].name); + continue; + } + spi_parent_clk_roth[i].parent_clk = c; + spi_parent_clk_roth[i].fixed_clk_rate = clk_get_rate(c); + } + roth_spi_pdata.parent_clk_list = spi_parent_clk_roth; + roth_spi_pdata.parent_clk_count = ARRAY_SIZE(spi_parent_clk_roth); + tegra11_spi_device4.dev.platform_data = &roth_spi_pdata; + platform_add_devices(roth_spi_devices, + ARRAY_SIZE(roth_spi_devices)); +} + +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_roth_data = { + .gpio_reset = 0, + .config = 0, + .platform_id = RM_PLATFORM_D010, + .name_of_clock = "clk_out_2", +}; + +static struct tegra_spi_device_controller_data dev_cdata = { + .rx_clk_tap_delay = 0, + .tx_clk_tap_delay = 16, +}; + +struct spi_board_info rm31080a_roth_spi_board[1] = { + { + .modalias = "rm_ts_spidev", + .bus_num = 3, + .chip_select = 2, + .max_speed_hz = 12 * 1000 * 1000, + .mode = SPI_MODE_0, + .controller_data = &dev_cdata, + .platform_data = &rm31080ts_roth_data, + }, +}; + +static int __init roth_touch_init(void) +{ + tegra_clk_init_from_table(touch_clk_init_table); + clk_enable(tegra_get_clock_by_name("clk_out_2")); + rm31080ts_roth_data.platform_id = RM_PLATFORM_R005; + mdelay(20); + rm31080a_roth_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_roth_data, + &rm31080a_roth_spi_board[0], + ARRAY_SIZE(rm31080a_roth_spi_board)); + return 0; +} + static void __init tegra_roth_init(void) { tegra_clk_init_from_table(roth_clk_init_table); @@ -602,6 +696,7 @@ static void __init tegra_roth_init(void) tegra_enable_pinmux(); roth_pinmux_init(); roth_i2c_init(); + roth_spi_init(); roth_usb_init(); roth_uart_init(); roth_audio_init(); @@ -613,6 +708,7 @@ static void __init tegra_roth_init(void) roth_suspend_init(); roth_emc_init(); roth_edp_init(); + roth_touch_init(); roth_panel_init(); roth_kbc_init(); roth_pmon_init(); |