summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjay Singh Rawat <srawat@nvidia.com>2012-05-28 14:39:07 +0530
committerSimone Willett <swillett@nvidia.com>2012-05-31 12:36:04 -0700
commit9cc5f450a0a6806fc02d4de4e39b01daf94fb71c (patch)
treeff4ec1410b97bcef5f353bec6e7c69fcbf3eb901
parenteb2490a6a4788d7ed4f3b9c978ce828155afffac (diff)
ARM: tegra: ventana: get rid of gpio enable/disable calls
Gpio direction setting and freeing functions will do the needful now. Bug 984440 Change-Id: I598cfbda4ac1d8fe7a61fe070abc92c5179807e9 Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-on: http://git-master/r/104493 GVS: Gerrit_Virtual_Submit Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-ventana-panel.c8
-rw-r--r--arch/arm/mach-tegra/board-ventana-power.c12
-rw-r--r--arch/arm/mach-tegra/board-ventana-sdhci.c12
-rw-r--r--arch/arm/mach-tegra/board-ventana-sensors.c41
-rw-r--r--arch/arm/mach-tegra/board-ventana.c16
5 files changed, 19 insertions, 70 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-panel.c b/arch/arm/mach-tegra/board-ventana-panel.c
index f396557411b8..e848441ef7e0 100644
--- a/arch/arm/mach-tegra/board-ventana-panel.c
+++ b/arch/arm/mach-tegra/board-ventana-panel.c
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/board-ventana-panel.c
*
- * Copyright (c) 2010-2012, NVIDIA Corporation.
+ * Copyright (c) 2010-2012 NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -63,8 +63,6 @@ static int ventana_backlight_init(struct device *dev) {
ret = gpio_direction_output(ventana_bl_enb, 1);
if (ret < 0)
gpio_free(ventana_bl_enb);
- else
- tegra_gpio_enable(ventana_bl_enb);
return ret;
};
@@ -72,7 +70,6 @@ static int ventana_backlight_init(struct device *dev) {
static void ventana_backlight_exit(struct device *dev) {
gpio_set_value(ventana_bl_enb, 0);
gpio_free(ventana_bl_enb);
- tegra_gpio_disable(ventana_bl_enb);
}
static int ventana_backlight_notify(struct device *unused, int brightness)
@@ -392,13 +389,10 @@ int __init ventana_panel_init(void)
gpio_request(ventana_lvds_shutdown, "lvds_shdn");
gpio_direction_output(ventana_lvds_shutdown, 1);
- tegra_gpio_enable(ventana_lvds_shutdown);
- tegra_gpio_enable(ventana_hdmi_enb);
gpio_request(ventana_hdmi_enb, "hdmi_5v_en");
gpio_direction_output(ventana_hdmi_enb, 1);
- tegra_gpio_enable(ventana_hdmi_hpd);
gpio_request(ventana_hdmi_hpd, "hdmi_hpd");
gpio_direction_input(ventana_hdmi_hpd);
diff --git a/arch/arm/mach-tegra/board-ventana-power.c b/arch/arm/mach-tegra/board-ventana-power.c
index 2acfdfed28e4..987d0180e7ba 100644
--- a/arch/arm/mach-tegra/board-ventana-power.c
+++ b/arch/arm/mach-tegra/board-ventana-power.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2012 NVIDIA, Inc.
+ * Copyright (C) 2010-2012 NVIDIA Corporation.
*
* 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
@@ -47,7 +47,6 @@ int __init ventana_charge_init(void)
{
gpio_request(CHARGING_DISABLE, "chg_disable");
gpio_direction_output(CHARGING_DISABLE, 0);
- tegra_gpio_enable(CHARGING_DISABLE);
return 0;
}
@@ -255,14 +254,6 @@ static struct platform_device *fixed_voltage_regulators[] __initdata = {
int __init ventana_fixed_voltage_regulator_init(void)
{
- int i;
-
- for (i = 0; i < ARRAY_SIZE(fixed_voltage_regulators); ++i) {
- struct fixed_voltage_config *fixed_voltage_regulators_pdata =
- fixed_voltage_regulators[i]->dev.platform_data;
- if (fixed_voltage_regulators_pdata->gpio < TEGRA_NR_GPIOS)
- tegra_gpio_enable(fixed_voltage_regulators_pdata->gpio);
- }
return platform_add_devices(fixed_voltage_regulators,
ARRAY_SIZE(fixed_voltage_regulators));
}
@@ -317,7 +308,6 @@ static struct platform_device ventana_charger_device = {
int __init ventana_charger_init(void)
{
- tegra_gpio_enable(AC_PRESENT_GPIO);
platform_device_register(&ventana_charger_device);
return 0;
}
diff --git a/arch/arm/mach-tegra/board-ventana-sdhci.c b/arch/arm/mach-tegra/board-ventana-sdhci.c
index 188335ac98c5..aaf4948d5882 100644
--- a/arch/arm/mach-tegra/board-ventana-sdhci.c
+++ b/arch/arm/mach-tegra/board-ventana-sdhci.c
@@ -1,7 +1,6 @@
/*
- * arch/arm/mach-tegra/board-harmony-sdhci.c
- *
* Copyright (C) 2010 Google, Inc.
+ * Copyright (C) 2010-2012 NVIDIA Corporation.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -257,10 +256,6 @@ static int __init ventana_wifi_init(void)
gpio_request(VENTANA_WLAN_RST, "wlan_rst");
gpio_request(VENTANA_WLAN_WOW, "bcmsdh_sdmmc");
- tegra_gpio_enable(VENTANA_WLAN_PWR);
- tegra_gpio_enable(VENTANA_WLAN_RST);
- tegra_gpio_enable(VENTANA_WLAN_WOW);
-
gpio_direction_output(VENTANA_WLAN_PWR, 0);
gpio_direction_output(VENTANA_WLAN_RST, 0);
gpio_direction_input(VENTANA_WLAN_WOW);
@@ -274,11 +269,6 @@ static int __init ventana_wifi_init(void)
}
int __init ventana_sdhci_init(void)
{
- tegra_gpio_enable(tegra_sdhci_platform_data2.power_gpio);
- tegra_gpio_enable(tegra_sdhci_platform_data2.cd_gpio);
- tegra_gpio_enable(tegra_sdhci_platform_data2.wp_gpio);
- tegra_gpio_enable(tegra_sdhci_platform_data3.power_gpio);
-
platform_device_register(&tegra_sdhci_device3);
platform_device_register(&tegra_sdhci_device2);
platform_device_register(&tegra_sdhci_device0);
diff --git a/arch/arm/mach-tegra/board-ventana-sensors.c b/arch/arm/mach-tegra/board-ventana-sensors.c
index 574bdb25fc2a..be7c179dfad9 100644
--- a/arch/arm/mach-tegra/board-ventana-sensors.c
+++ b/arch/arm/mach-tegra/board-ventana-sensors.c
@@ -186,7 +186,6 @@ static struct ssl3250a_platform_data ventana_ssl3250a_pdata = {
static void ventana_isl29018_init(void)
{
- tegra_gpio_enable(ISL29018_IRQ_GPIO);
gpio_request(ISL29018_IRQ_GPIO, "isl29018");
gpio_direction_input(ISL29018_IRQ_GPIO);
}
@@ -194,7 +193,6 @@ static void ventana_isl29018_init(void)
#ifdef CONFIG_SENSORS_AK8975
static void ventana_akm8975_init(void)
{
- tegra_gpio_enable(AKM8975_IRQ_GPIO);
gpio_request(AKM8975_IRQ_GPIO, "akm8975");
gpio_direction_input(AKM8975_IRQ_GPIO);
}
@@ -202,7 +200,6 @@ static void ventana_akm8975_init(void)
static void ventana_nct1008_init(void)
{
- tegra_gpio_enable(NCT1008_THERM2_GPIO);
gpio_request(NCT1008_THERM2_GPIO, "temp_alert");
gpio_direction_input(NCT1008_THERM2_GPIO);
}
@@ -379,7 +376,6 @@ static void mpuirq_init(void)
#if (MPU_GYRO_TYPE == MPU_TYPE_MPU3050)
#if MPU_ACCEL_IRQ_GPIO
/* ACCEL-IRQ assignment */
- tegra_gpio_enable(MPU_ACCEL_IRQ_GPIO);
ret = gpio_request(MPU_ACCEL_IRQ_GPIO, MPU_ACCEL_NAME);
if (ret < 0) {
pr_err("%s: gpio_request failed %d\n", __func__, ret);
@@ -396,7 +392,6 @@ static void mpuirq_init(void)
#endif
/* MPU-IRQ assignment */
- tegra_gpio_enable(MPU_GYRO_IRQ_GPIO);
ret = gpio_request(MPU_GYRO_IRQ_GPIO, MPU_GYRO_NAME);
if (ret < 0) {
pr_err("%s: gpio_request failed %d\n", __func__, ret);
@@ -465,37 +460,35 @@ int __init ventana_sensors_init(void)
struct tegra_camera_gpios {
const char *name;
int gpio;
- bool tegra_internal_gpio;
int enabled;
};
-#define TEGRA_CAMERA_GPIO(_name, _gpio, _tegra_internal_gpio, _enabled) \
+#define TEGRA_CAMERA_GPIO(_name, _gpio, _enabled) \
{ \
.name = _name, \
.gpio = _gpio, \
- .tegra_internal_gpio = _tegra_internal_gpio, \
.enabled = _enabled, \
}
static struct tegra_camera_gpios ventana_camera_gpio_keys[] = {
- [0] = TEGRA_CAMERA_GPIO("camera_power_en", CAMERA_POWER_GPIO, true, 1),
- [1] = TEGRA_CAMERA_GPIO("camera_csi_sel", CAMERA_CSI_MUX_SEL_GPIO, true, 0),
- [2] = TEGRA_CAMERA_GPIO("torch_gpio_act", CAMERA_FLASH_ACT_GPIO, true, 0),
+ [0] = TEGRA_CAMERA_GPIO("camera_power_en", CAMERA_POWER_GPIO, 1),
+ [1] = TEGRA_CAMERA_GPIO("camera_csi_sel", CAMERA_CSI_MUX_SEL_GPIO, 0),
+ [2] = TEGRA_CAMERA_GPIO("torch_gpio_act", CAMERA_FLASH_ACT_GPIO, 0),
- [3] = TEGRA_CAMERA_GPIO("en_avdd_csi", AVDD_DSI_CSI_ENB_GPIO, false, 1),
- [4] = TEGRA_CAMERA_GPIO("cam_i2c_mux_rst_lo", CAM_I2C_MUX_RST_GPIO, false, 1),
+ [3] = TEGRA_CAMERA_GPIO("en_avdd_csi", AVDD_DSI_CSI_ENB_GPIO, 1),
+ [4] = TEGRA_CAMERA_GPIO("cam_i2c_mux_rst_lo", CAM_I2C_MUX_RST_GPIO, 1),
- [5] = TEGRA_CAMERA_GPIO("cam2_af_pwdn_lo", CAM2_AF_PWR_DN_L_GPIO, false, 0),
- [6] = TEGRA_CAMERA_GPIO("cam2_pwdn", CAM2_PWR_DN_GPIO, false, 0),
- [7] = TEGRA_CAMERA_GPIO("cam2_rst_lo", CAM2_RST_L_GPIO, false, 1),
+ [5] = TEGRA_CAMERA_GPIO("cam2_af_pwdn_lo", CAM2_AF_PWR_DN_L_GPIO, 0),
+ [6] = TEGRA_CAMERA_GPIO("cam2_pwdn", CAM2_PWR_DN_GPIO, 0),
+ [7] = TEGRA_CAMERA_GPIO("cam2_rst_lo", CAM2_RST_L_GPIO, 1),
- [8] = TEGRA_CAMERA_GPIO("cam3_af_pwdn_lo", CAM3_AF_PWR_DN_L_GPIO, false, 0),
- [9] = TEGRA_CAMERA_GPIO("cam3_pwdn", CAM3_PWR_DN_GPIO, false, 0),
- [10] = TEGRA_CAMERA_GPIO("cam3_rst_lo", CAM3_RST_L_GPIO, false, 1),
+ [8] = TEGRA_CAMERA_GPIO("cam3_af_pwdn_lo", CAM3_AF_PWR_DN_L_GPIO, 0),
+ [9] = TEGRA_CAMERA_GPIO("cam3_pwdn", CAM3_PWR_DN_GPIO, 0),
+ [10] = TEGRA_CAMERA_GPIO("cam3_rst_lo", CAM3_RST_L_GPIO, 1),
- [11] = TEGRA_CAMERA_GPIO("cam1_af_pwdn_lo", CAM1_AF_PWR_DN_L_GPIO, false, 0),
- [12] = TEGRA_CAMERA_GPIO("cam1_pwdn", CAM1_PWR_DN_GPIO, false, 0),
- [13] = TEGRA_CAMERA_GPIO("cam1_rst_lo", CAM1_RST_L_GPIO, false, 1),
+ [11] = TEGRA_CAMERA_GPIO("cam1_af_pwdn_lo", CAM1_AF_PWR_DN_L_GPIO, 0),
+ [12] = TEGRA_CAMERA_GPIO("cam1_pwdn", CAM1_PWR_DN_GPIO, 0),
+ [13] = TEGRA_CAMERA_GPIO("cam1_rst_lo", CAM1_RST_L_GPIO, 1),
};
int __init ventana_camera_late_init(void)
@@ -522,10 +515,6 @@ int __init ventana_camera_late_init(void)
i2c_new_device(i2c_get_adapter(3), ventana_i2c3_board_info_tca6416);
for (i = 0; i < ARRAY_SIZE(ventana_camera_gpio_keys); i++) {
-
- if (ventana_camera_gpio_keys[i].tegra_internal_gpio)
- tegra_gpio_enable(ventana_camera_gpio_keys[i].gpio);
-
ret = gpio_request(ventana_camera_gpio_keys[i].gpio,
ventana_camera_gpio_keys[i].name);
if (ret < 0) {
diff --git a/arch/arm/mach-tegra/board-ventana.c b/arch/arm/mach-tegra/board-ventana.c
index 779ffdba0f65..30c2d486b4f7 100644
--- a/arch/arm/mach-tegra/board-ventana.c
+++ b/arch/arm/mach-tegra/board-ventana.c
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/board-ventana.c
*
- * Copyright (c) 2010-2011, NVIDIA Corporation.
+ * Copyright (c) 2010-2011 NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -119,8 +119,6 @@ static struct platform_device ventana_bluesleep_device = {
static void __init ventana_setup_bluesleep(void)
{
platform_device_register(&ventana_bluesleep_device);
- tegra_gpio_enable(TEGRA_GPIO_PU6);
- tegra_gpio_enable(TEGRA_GPIO_PU1);
return;
}
@@ -342,14 +340,6 @@ static struct platform_device ventana_keys_device = {
.platform_data = &ventana_keys_platform_data,
},
};
-
-static void ventana_keys_init(void)
-{
- int i;
-
- for (i = 0; i < ARRAY_SIZE(ventana_keys); i++)
- tegra_gpio_enable(ventana_keys[i].gpio);
-}
#endif
static struct platform_device tegra_camera = {
@@ -625,10 +615,6 @@ static void __init tegra_ventana_init(void)
ventana_touch_init_panjit();
}
-#ifdef CONFIG_KEYBOARD_GPIO
- ventana_keys_init();
-#endif
-
ventana_usb_init();
ventana_gps_init();
ventana_panel_init();