From: prabhu.annabathula Date: Fri, 18 Jun 2010 22:51:11 +0000 (-0500) Subject: [ARM] stingray board file: GPS board file changes for brcm 4750 X-Git-Tag: firefly_0821_release~9834^2~827 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e596a08ffb604d8cb31ebeae4df26f042194a891;p=firefly-linux-kernel-4.4.55.git [ARM] stingray board file: GPS board file changes for brcm 4750 Signed-off-by: prabhu.annabathula --- diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile index d0273a0bea3a..38841743bd79 100644 --- a/arch/arm/mach-tegra/Makefile +++ b/arch/arm/mach-tegra/Makefile @@ -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 index 000000000000..abad68d8fe16 --- /dev/null +++ b/arch/arm/mach-tegra/board-stingray-gps.c @@ -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 +#include +#include +#include +#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); +} diff --git a/arch/arm/mach-tegra/board-stingray-spi.c b/arch/arm/mach-tegra/board-stingray-spi.c index ab3974c344aa..3f4acc6aa984 100644 --- a/arch/arm/mach-tegra/board-stingray-spi.c +++ b/arch/arm/mach-tegra/board-stingray-spi.c @@ -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 = { diff --git a/arch/arm/mach-tegra/board-stingray.c b/arch/arm/mach-tegra/board-stingray.c index 3483faa74aa8..ed68cf00846a 100644 --- a/arch/arm/mach-tegra/board-stingray.c +++ b/arch/arm/mach-tegra/board-stingray.c @@ -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") diff --git a/arch/arm/mach-tegra/board-stingray.h b/arch/arm/mach-tegra/board-stingray.h index 544a9a3bf703..666bf71e9afe 100644 --- a/arch/arm/mach-tegra/board-stingray.h +++ b/arch/arm/mach-tegra/board-stingray.h @@ -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,