[ARM] stingray board file: GPS board file changes for brcm 4750
authorprabhu.annabathula <prabhu.annabathula@motorola.com>
Fri, 18 Jun 2010 22:51:11 +0000 (17:51 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:11 +0000 (16:33 -0700)
Signed-off-by: prabhu.annabathula <prabhu.annabathula@motorola.com>
arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/board-stingray-gps.c [new file with mode: 0755]
arch/arm/mach-tegra/board-stingray-spi.c
arch/arm/mach-tegra/board-stingray.c
arch/arm/mach-tegra/board-stingray.h

index d0273a0bea3a532486a6d900e6a6a5459c8ffea0..38841743bd791983d1b3011babdaaa5b00ccddb9 100644 (file)
@@ -63,3 +63,4 @@ obj-${CONFIG_MACH_STINGRAY}             += board-stingray-wlan_nvs.o
 obj-${CONFIG_MACH_STINGRAY}             += board-stingray-touch.o
 obj-${CONFIG_MACH_STINGRAY}             += board-stingray-spi.o
 obj-${CONFIG_MACH_STINGRAY}             += board-stingray-rfkill.o
+obj-${CONFIG_MACH_STINGRAY}             += board-stingray-gps.o
diff --git a/arch/arm/mach-tegra/board-stingray-gps.c b/arch/arm/mach-tegra/board-stingray-gps.c
new file mode 100755 (executable)
index 0000000..abad68d
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2010 Motorola, Inc.
+ *
+ * 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
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA
+ */
+
+#include <linux/gpio.h>
+#include <linux/gps-gpio-brcm4750.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include "gpio-names.h"
+
+#define STINGRAY_GPS_RESET     TEGRA_GPIO_PH0
+#define STINGRAY_GPS_STANDBY  TEGRA_GPIO_PH1
+
+static void stingray_gps_reset_gpio(unsigned int gpio_val)
+{
+       pr_info("%s: setting GPS Reset GPIO to %d", __func__, gpio_val);
+       gpio_set_value(STINGRAY_GPS_RESET, gpio_val);
+}
+
+static void stingray_gps_standby_gpio(unsigned int gpio_val)
+{
+       pr_info("%s: setting GPS standby GPIO to %d", __func__, gpio_val);
+       gpio_set_value(STINGRAY_GPS_STANDBY, gpio_val);
+}
+
+static void stingray_gps_gpio_release(void)
+{
+       gpio_free(STINGRAY_GPS_RESET);
+       gpio_free(STINGRAY_GPS_STANDBY);
+}
+
+static void stingray_gps_gpio_init(void)
+{
+       tegra_gpio_enable(STINGRAY_GPS_RESET);
+       gpio_request(STINGRAY_GPS_RESET, "gps_rst");
+       gpio_direction_output(STINGRAY_GPS_RESET, 0);
+
+       tegra_gpio_enable(STINGRAY_GPS_STANDBY);
+       gpio_request(STINGRAY_GPS_STANDBY, "gps_stdby");
+       gpio_direction_output(STINGRAY_GPS_STANDBY, 0);
+}
+
+struct gps_gpio_brcm4750_platform_data stingray_gps_gpio_data = {
+       .set_reset_gpio = stingray_gps_reset_gpio,
+       .set_standby_gpio = stingray_gps_standby_gpio,
+       .free_gpio = stingray_gps_gpio_release,
+};
+
+static struct platform_device stingray_gps_device = {
+       .name   = GPS_GPIO_DRIVER_NAME,
+       .id             = -1,
+       .dev    = {
+       .platform_data = &stingray_gps_gpio_data,
+       },
+};
+
+void __init stingray_gps_init(void)
+{
+       stingray_gps_gpio_init();
+       platform_device_register(&stingray_gps_device);
+}
index ab3974c344aa762f74ef70a1755f9bade1d70bac..3f4acc6aa984de2bd2211a78db6c9da083aed810 100644 (file)
@@ -365,6 +365,9 @@ struct regulator_consumer_supply cpcap_vaudio_consumers[] = {
        REGULATOR_CONSUMER("vaudio", NULL /* mic opamp */),
 };
 
+struct regulator_consumer_supply cpcap_vdig_consumers[] = {
+       REGULATOR_CONSUMER("vdig", NULL /* gps */),
+};
 static struct regulator_init_data cpcap_regulator[CPCAP_NUM_REGULATORS] = {
        [CPCAP_SW2] = {
                .constraints = {
@@ -428,10 +431,14 @@ static struct regulator_init_data cpcap_regulator[CPCAP_NUM_REGULATORS] = {
        },
        [CPCAP_VDIG] = {
                .constraints = {
-                       .min_uV                 = 1200000,
+                       .min_uV                 = 1875000,
                        .max_uV                 = 1875000,
                        .valid_ops_mask         = 0,
+                       .always_on              = 1,
+                       .apply_uV               = 1,
                },
+               .num_consumer_supplies  = ARRAY_SIZE(cpcap_vdig_consumers),
+               .consumer_supplies      = cpcap_vdig_consumers,
        },
        [CPCAP_VFUSE] = {
                .constraints = {
index 3483faa74aa82cc78d4e2c59c326823d2317216a..ed68cf00846a3d075ef7330889a977c079215e99 100644 (file)
@@ -552,6 +552,7 @@ static void __init tegra_stingray_init(void)
        stingray_w1_init();
        stingray_sensors_init();
        stingray_wlan_init();
+       stingray_gps_init();
 }
 
 MACHINE_START(STINGRAY, "stingray")
index 544a9a3bf703fe36db4dad677f3adb58482bf972..666bf71e9afee40f1dc85442b6f4e4a4dfca2f87 100644 (file)
@@ -25,6 +25,7 @@ int stingray_sensors_init(void);
 int stingray_touch_init(void);
 int stingray_spi_init(void);
 int stingray_revision(void);
+void stingray_gps_init(void);
 
 enum {
        STINGRAY_REVISION_UNKNOWN,