diff options
author | Rakesh Goyal <rgoyal@nvidia.com> | 2011-11-08 02:00:31 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:49:54 -0800 |
commit | 164b0c30949873f3465a06339afc4f7ec3900fc2 (patch) | |
tree | 3a6ecf65504496aab20f6e46185025989d869636 | |
parent | 2f0ac6e54b5cd2eb92bd8ddc92a80aebe94a48cd (diff) |
arm: tegra: enterprise: cardhu: pn544 nfc support
1) configuring pinmux
2) create pn544_i2c_platform_data
3) register i2c device info using i2c_register_board_info
Bug 846684
Bug 873017
Change-Id: I6cc370d3ee6cc5df6b75db19bb719275e465f344
Reviewed-on: http://git-master/r/62746
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Rebase-Id: R334a9cc8f86c90214b2415b3b855d5f234ad7a11
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-pinmux.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise-pinmux.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise.c | 21 |
4 files changed, 50 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-pinmux.c b/arch/arm/mach-tegra/board-cardhu-pinmux.c index c07d8d5be280..8d0912f28f69 100644 --- a/arch/arm/mach-tegra/board-cardhu-pinmux.c +++ b/arch/arm/mach-tegra/board-cardhu-pinmux.c @@ -462,6 +462,10 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux_cardhu_a03[] = { static __initdata struct tegra_pingroup_config cardhu_pinmux_e1291_a04[] = { DEFAULT_PINMUX(GMI_AD15, NAND, PULL_DOWN, NORMAL, OUTPUT), + DEFAULT_PINMUX(ULPI_DATA5, UARTA, PULL_UP, NORMAL, INPUT), + DEFAULT_PINMUX(ULPI_DATA6, UARTA, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(SPI2_MOSI, SPI6, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP3_SCLK, RSVD1, NORMAL, NORMAL, OUTPUT), }; static __initdata struct tegra_pingroup_config cardhu_pinmux_e1198[] = { diff --git a/arch/arm/mach-tegra/board-cardhu.c b/arch/arm/mach-tegra/board-cardhu.c index 1b8db209fd89..8c9dab0e2bef 100644 --- a/arch/arm/mach-tegra/board-cardhu.c +++ b/arch/arm/mach-tegra/board-cardhu.c @@ -51,6 +51,7 @@ #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <mach/usb_phy.h> +#include <linux/nfc/pn544.h> #include "board.h" #include "clock.h" @@ -206,6 +207,19 @@ static __initdata struct tegra_clk_init_table cardhu_clk_init_table[] = { { NULL, NULL, 0, 0}, }; +static struct pn544_i2c_platform_data nfc_pdata = { + .irq_gpio = TEGRA_GPIO_PX0, + .ven_gpio = TEGRA_GPIO_PP3, + .firm_gpio = TEGRA_GPIO_PO7, + }; + +static struct i2c_board_info __initdata cardhu_i2c_bus3_board_info[] = { + { + I2C_BOARD_INFO("pn544", 0x28), + .platform_data = &nfc_pdata, + .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PX0), + }, +}; static struct tegra_i2c_platform_data cardhu_i2c1_platform_data = { .adapter_nr = 0, .bus_count = 1, @@ -297,6 +311,7 @@ static void cardhu_i2c_init(void) platform_device_register(&tegra_i2c_device1); i2c_register_board_info(4, &wm8903_board_info, 1); + i2c_register_board_info(2, cardhu_i2c_bus3_board_info, 1); } static struct platform_device *cardhu_uart_devices[] __initdata = { @@ -763,6 +778,13 @@ static void cardhu_gps_init(void) tegra_gpio_enable(TEGRA_GPIO_PU3); } +static void cardhu_nfc_init(void) +{ + tegra_gpio_enable(TEGRA_GPIO_PX0); + tegra_gpio_enable(TEGRA_GPIO_PP3); + tegra_gpio_enable(TEGRA_GPIO_PO7); +} + static struct baseband_power_platform_data tegra_baseband_power_data = { .baseband_type = BASEBAND_XMM, .modem = { @@ -899,6 +921,7 @@ static void __init tegra_cardhu_init(void) cardhu_pins_state_init(); cardhu_emc_init(); tegra_release_bootloader_fb(); + cardhu_nfc_init(); } static void __init tegra_cardhu_reserve(void) diff --git a/arch/arm/mach-tegra/board-enterprise-pinmux.c b/arch/arm/mach-tegra/board-enterprise-pinmux.c index 44a33aa9eb18..4bc7a92320f9 100644 --- a/arch/arm/mach-tegra/board-enterprise-pinmux.c +++ b/arch/arm/mach-tegra/board-enterprise-pinmux.c @@ -216,7 +216,7 @@ static __initdata struct tegra_pingroup_config enterprise_pinmux[] = { DEFAULT_PINMUX(LCD_D19, DISPLAYA, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(LCD_D20, DISPLAYA, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(LCD_D21, DISPLAYA, NORMAL, NORMAL, INPUT), - DEFAULT_PINMUX(LCD_D22, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D22, RSVD1, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(LCD_D23, DISPLAYA, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(LCD_CS1_N, DISPLAYA, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(LCD_M1, DISPLAYA, NORMAL, NORMAL, OUTPUT), @@ -268,6 +268,7 @@ static __initdata struct tegra_pingroup_config enterprise_pinmux[] = { DEFAULT_PINMUX(KB_ROW2, KBC, PULL_UP, NORMAL, INPUT), DEFAULT_PINMUX(KB_ROW3, KBC, PULL_UP, NORMAL, INPUT), DEFAULT_PINMUX(KB_ROW10, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW12, KBC, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(KB_COL0, KBC, PULL_UP, NORMAL, INPUT), DEFAULT_PINMUX(KB_COL1, KBC, PULL_UP, NORMAL, INPUT), DEFAULT_PINMUX(KB_COL2, KBC, PULL_UP, NORMAL, INPUT), diff --git a/arch/arm/mach-tegra/board-enterprise.c b/arch/arm/mach-tegra/board-enterprise.c index 5ab37958e062..b8cad28833bb 100644 --- a/arch/arm/mach-tegra/board-enterprise.c +++ b/arch/arm/mach-tegra/board-enterprise.c @@ -37,6 +37,7 @@ #include <linux/fsl_devices.h> #include <linux/i2c/atmel_mxt_ts.h> +#include <linux/nfc/pn544.h> #include <sound/max98088.h> #include <mach/clk.h> @@ -334,6 +335,12 @@ static struct max98088_pdata enterprise_max98088_pdata = { .receiver_mode = 0, /* 0 = amplifier, 1 = line output */ }; +static struct pn544_i2c_platform_data nfc_pdata = { + .irq_gpio = TEGRA_GPIO_PS4, + .ven_gpio = TEGRA_GPIO_PM6, + .firm_gpio = 0, +}; + static struct i2c_board_info __initdata max98088_board_info = { I2C_BOARD_INFO("max98088", 0x10), @@ -341,6 +348,12 @@ static struct i2c_board_info __initdata max98088_board_info = { .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_HP_DET), }; +static struct i2c_board_info __initdata nfc_board_info = { + I2C_BOARD_INFO("pn544", 0x28), + .platform_data = &nfc_pdata, + .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PS4), +}; + static void enterprise_i2c_init(void) { tegra_i2c_device1.dev.platform_data = &enterprise_i2c1_platform_data; @@ -356,6 +369,7 @@ static void enterprise_i2c_init(void) platform_device_register(&tegra_i2c_device1); i2c_register_board_info(0, &max98088_board_info, 1); + i2c_register_board_info(0, &nfc_board_info, 1); } static struct platform_device *enterprise_uart_devices[] __initdata = { @@ -673,6 +687,12 @@ static void enterprise_baseband_init(void) } } +static void enterprise_nfc_init(void) +{ + tegra_gpio_enable(TEGRA_GPIO_PS4); + tegra_gpio_enable(TEGRA_GPIO_PM6); +} + static void __init tegra_enterprise_init(void) { tegra_clk_init_from_table(enterprise_clk_init_table); @@ -698,6 +718,7 @@ static void __init tegra_enterprise_init(void) enterprise_sensors_init(); enterprise_suspend_init(); tegra_release_bootloader_fb(); + enterprise_nfc_init(); } static void __init tegra_enterprise_reserve(void) |