aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:11:01 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:11:01 +0000
commit2105065cd9220517b7c64a598730c1a53bcce098 (patch)
tree232f527ad36ff8bcefe3eff6249b20b46fd40ef0 /arch
parent3767ec58d7d51c47705559f8d2bcd65df6be2ed8 (diff)
fix-build-without-gta01-enabled.patch
Problems building with GTA01 disabled in config come down to not selecting the common CONFIG for GTAXX with GTA02, and GTA01-specific gps stuff. Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-s3c2440/Kconfig1
-rw-r--r--arch/arm/plat-s3c24xx/neo1973_pm_gps.c109
2 files changed, 65 insertions, 45 deletions
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index d7f1a740a85..709c58fbf3a 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -89,6 +89,7 @@ config MACH_NEO1973_GTA02
select SENSORS_PCF50633
select POWER_SUPPLY
select GTA02_HDQ
+ select MACH_NEO1973
help
Say Y here if you are using the FIC Neo1973 GSM Phone
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gps.c b/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
index 57f1695b32b..3c307c7626a 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
@@ -45,6 +45,8 @@ int neo1973_pm_gps_is_on(void)
}
EXPORT_SYMBOL_GPL(neo1973_pm_gps_is_on);
+#ifdef CONFIG_MACH_NEO1973_GTA01
+
/* This is the 2.8V supply for the RTC crystal, the mail clock crystal and
* the input to VDD_RF */
static void gps_power_2v8_set(int on)
@@ -267,6 +269,7 @@ static int gps_power_1v5_get(void)
return ret;
}
+#endif
/* This is the POWERON pin */
static void gps_pwron_set(int on)
@@ -319,52 +322,22 @@ static int gps_pwron_get(void)
return -1;
}
-/* This is the nRESET pin */
-static void gps_rst_set(int on)
-{
- switch (system_rev) {
- case GTA01v3_SYSTEM_REV:
- pcf50606_gpo0_set(pcf50606_global, on);
- break;
- case GTA01v4_SYSTEM_REV:
- case GTA01Bv2_SYSTEM_REV:
- case GTA01Bv3_SYSTEM_REV:
- case GTA01Bv4_SYSTEM_REV:
- s3c2410_gpio_setpin(GTA01_GPIO_GPS_RESET, on);
- break;
- }
-}
-
-static int gps_rst_get(void)
-{
- switch (system_rev) {
- case GTA01v3_SYSTEM_REV:
- if (pcf50606_gpo0_get(pcf50606_global))
- return 1;
- break;
- case GTA01v4_SYSTEM_REV:
- case GTA01Bv2_SYSTEM_REV:
- case GTA01Bv3_SYSTEM_REV:
- case GTA01Bv4_SYSTEM_REV:
- if (s3c2410_gpio_getpin(GTA01_GPIO_GPS_RESET))
- return 1;
- break;
- }
-
- return 0;
-}
static ssize_t power_gps_read(struct device *dev,
struct device_attribute *attr, char *buf)
{
int ret = 0;
- if (!strcmp(attr->attr.name, "power_tcxo_2v8")) {
- ret = gps_power_2v8_get();
+ if (!strcmp(attr->attr.name, "pwron"))
+#ifdef CONFIG_MACH_NEO1973_GTA01
+ {
+#endif
+ ret = gps_pwron_get();
+#ifdef CONFIG_MACH_NEO1973_GTA01
} else if (!strcmp(attr->attr.name, "power_avdd_3v")) {
ret = gps_power_3v_get();
- } else if (!strcmp(attr->attr.name, "pwron")) {
- ret = gps_pwron_get();
+ } else if (!strcmp(attr->attr.name, "power_tcxo_2v8")) {
+ ret = gps_power_2v8_get();
} else if (!strcmp(attr->attr.name, "reset")) {
ret = gps_rst_get();
} else if (!strcmp(attr->attr.name, "power_lp_io_3v3")) {
@@ -375,7 +348,7 @@ static ssize_t power_gps_read(struct device *dev,
!strcmp(attr->attr.name, "power_vdd_core_1v5")) {
ret = gps_power_1v5_get();
}
-
+#endif
if (ret)
return strlcpy(buf, "1\n", 3);
else
@@ -388,12 +361,16 @@ static ssize_t power_gps_write(struct device *dev,
{
unsigned long on = simple_strtoul(buf, NULL, 10);
- if (!strcmp(attr->attr.name, "power_tcxo_2v8")) {
- gps_power_2v8_set(on);
+ if (!strcmp(attr->attr.name, "pwron"))
+#ifdef CONFIG_MACH_NEO1973_GTA01
+{
+#endif
+ gps_pwron_set(on);
+#ifdef CONFIG_MACH_NEO1973_GTA01
} else if (!strcmp(attr->attr.name, "power_avdd_3v")) {
gps_power_3v_set(on);
- } else if (!strcmp(attr->attr.name, "pwron")) {
- gps_pwron_set(on);
+ } else if (!strcmp(attr->attr.name, "power_tcxo_2v8")) {
+ gps_power_2v8_set(on);
} else if (!strcmp(attr->attr.name, "reset")) {
gps_rst_set(on);
} else if (!strcmp(attr->attr.name, "power_lp_io_3v3")) {
@@ -404,10 +381,49 @@ static ssize_t power_gps_write(struct device *dev,
!strcmp(attr->attr.name, "power_vdd_core_1v5")) {
gps_power_1v5_set(on);
}
-
+#endif
return count;
}
+
+#ifdef CONFIG_MACH_NEO1973_GTA01
+
+/* This is the nRESET pin */
+static void gps_rst_set(int on)
+{
+ switch (system_rev) {
+ case GTA01v3_SYSTEM_REV:
+ pcf50606_gpo0_set(pcf50606_global, on);
+ break;
+ case GTA01v4_SYSTEM_REV:
+ case GTA01Bv2_SYSTEM_REV:
+ case GTA01Bv3_SYSTEM_REV:
+ case GTA01Bv4_SYSTEM_REV:
+ s3c2410_gpio_setpin(GTA01_GPIO_GPS_RESET, on);
+ break;
+ }
+}
+
+static int gps_rst_get(void)
+{
+ switch (system_rev) {
+ case GTA01v3_SYSTEM_REV:
+ if (pcf50606_gpo0_get(pcf50606_global))
+ return 1;
+ break;
+ case GTA01v4_SYSTEM_REV:
+ case GTA01Bv2_SYSTEM_REV:
+ case GTA01Bv3_SYSTEM_REV:
+ case GTA01Bv4_SYSTEM_REV:
+ if (s3c2410_gpio_getpin(GTA01_GPIO_GPS_RESET))
+ return 1;
+ break;
+ }
+
+ return 0;
+}
+
+
static void gps_power_sequence_up(void)
{
/* According to PMB2520 Data Sheet, Rev. 2006-06-05,
@@ -488,7 +504,6 @@ static ssize_t power_sequence_write(struct device *dev,
static DEVICE_ATTR(power_tcxo_2v8, 0644, power_gps_read, power_gps_write);
static DEVICE_ATTR(power_avdd_3v, 0644, power_gps_read, power_gps_write);
-static DEVICE_ATTR(pwron, 0644, power_gps_read, power_gps_write);
static DEVICE_ATTR(reset, 0644, power_gps_read, power_gps_write);
static DEVICE_ATTR(power_lp_io_3v3, 0644, power_gps_read, power_gps_write);
static DEVICE_ATTR(power_pll_core_2v5, 0644, power_gps_read, power_gps_write);
@@ -496,6 +511,7 @@ static DEVICE_ATTR(power_core_1v5, 0644, power_gps_read, power_gps_write);
static DEVICE_ATTR(power_vdd_core_1v5, 0644, power_gps_read, power_gps_write);
static DEVICE_ATTR(power_sequence, 0644, power_sequence_read,
power_sequence_write);
+#endif
#ifdef CONFIG_PM
static int gta01_pm_gps_suspend(struct platform_device *pdev,
@@ -537,6 +553,9 @@ static int gta01_pm_gps_resume(struct platform_device *pdev)
#define gta01_pm_gps_resume NULL
#endif
+static DEVICE_ATTR(pwron, 0644, power_gps_read, power_gps_write);
+
+
#ifdef CONFIG_MACH_NEO1973_GTA01
static struct attribute *gta01_gps_sysfs_entries[] = {
&dev_attr_power_avdd_3v.attr,