diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2014-01-08 15:22:19 +0530 |
---|---|---|
committer | Laxman Dewangan <ldewangan@nvidia.com> | 2014-01-09 21:31:47 -0800 |
commit | b0d5f466c4cac1a95d46272f4e196b83acbf1092 (patch) | |
tree | 6ef46de4a726b206dcf1454736929f5e2218e560 /arch/arm/mach-tegra/board-vcm30_t124-power.c | |
parent | 9fa8151f295d0673d79e0f5f6fe9bd267550ab71 (diff) |
ARM: tegra: move pinmux table to DT for vcm30-t124
Move pinmux table to DT for vcm30-t124.
Also move the pca registration to board-vcm30_t124-power.c
to get rid of file board-vcm30_t124-pinmux.c.
Change-Id: I4f526ad96c4e87127a8d7145fff1077ae6b92a59
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/353245
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'arch/arm/mach-tegra/board-vcm30_t124-power.c')
-rw-r--r-- | arch/arm/mach-tegra/board-vcm30_t124-power.c | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-vcm30_t124-power.c b/arch/arm/mach-tegra/board-vcm30_t124-power.c index 174d90ef5912..c3c93e8a4e81 100644 --- a/arch/arm/mach-tegra/board-vcm30_t124-power.c +++ b/arch/arm/mach-tegra/board-vcm30_t124-power.c @@ -20,6 +20,8 @@ #include <linux/mfd/max77663-core.h> #include <linux/regulator/max77663-regulator.h> #include <linux/regulator/max15569-regulator.h> +#include <linux/gpio.h> +#include <linux/i2c/pca953x.h> #include <mach/edp.h> @@ -378,3 +380,77 @@ int __init vcm30_t124_soctherm_init(void) */ return tegra11_soctherm_init(&vcm30_t124_soctherm_data); } + + +/* + * GPIO init table for PCA9539 MISC IO GPIOs + * that have to be brought up to a known good state + * except for WiFi as it is handled via the + * WiFi stack. + */ +static struct gpio vcm30_t124_system_gpios[] = { + {MISCIO_BT_WAKEUP_GPIO, GPIOF_OUT_INIT_HIGH, "bt_wk"}, + {MISCIO_ABB_RST_GPIO, GPIOF_OUT_INIT_HIGH, "ebb_rst"}, + {MISCIO_USER_LED2_GPIO, GPIOF_OUT_INIT_LOW, "usr_led2"}, + {MISCIO_USER_LED1_GPIO, GPIOF_OUT_INIT_LOW, "usr_led1"}, +}; + +static int __init vcm30_t124_system_gpio_init(void) +{ + int ret, pin_count = 0; + struct gpio *gpios_info = NULL; + gpios_info = vcm30_t124_system_gpios; + pin_count = ARRAY_SIZE(vcm30_t124_system_gpios); + + /* Set required system GPIOs to initial bootup values */ + ret = gpio_request_array(gpios_info, pin_count); + + if (ret) + pr_err("%s gpio_request_array failed(%d)\r\n", + __func__, ret); + + /* Export the LED GPIOs to userland for any check */ + gpio_export(MISCIO_USER_LED2_GPIO, false); + gpio_export(MISCIO_USER_LED1_GPIO, false); + + return ret; +} + +/* + * TODO: Check for the correct pca953x before invoking client + * init functions + */ +static int pca953x_client_setup(struct i2c_client *client, + unsigned gpio, unsigned ngpio, + void *context) +{ + int ret = 0; + + ret = vcm30_t124_system_gpio_init(); + if (ret < 0) + goto fail; + + return 0; +fail: + pr_err("%s failed(%d)\r\n", __func__, ret); + return ret; +} + +static struct pca953x_platform_data vcm30_t124_miscio_pca9539_data = { + .gpio_base = PCA953X_MISCIO_GPIO_BASE, + .setup = pca953x_client_setup, +}; + +static struct i2c_board_info vcm30_t124_i2c2_board_info_pca9539[] = { + { + I2C_BOARD_INFO("pca9539", PCA953X_MISCIO_ADDR), + .platform_data = &vcm30_t124_miscio_pca9539_data, + }, +}; + +int __init vcm30_t124_pca953x_init(void) +{ + i2c_register_board_info(1, vcm30_t124_i2c2_board_info_pca9539, + ARRAY_SIZE(vcm30_t124_i2c2_board_info_pca9539)); + return 0; +} |