GPS PM: inconsistent pin usage?
Elrond
elrond+openmoko.org at samba-tng.org
Thu Feb 15 20:48:27 CET 2007
Hi,
I looked a bit at the PM kernel module, and came across
something, that at least looks inconsistent to me. Would be
nice, if someone could help me understand it.
Okay:
Index: linux-2.6.17.14-fic4.test/arch/arm/common/gta01_pm_gps.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.17.14-fic4.test/arch/arm/common/gta01_pm_gps.c 2007-02-07 20:42:24.000000000 +0100
...
+static int __init gta01_pm_gps_probe(struct platform_device *pdev)
+{
+
+ s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_PWRON, S3C2410_GPIO_OUTPUT);
+
+ switch (system_rev) {
+ case GTA01v3_SYSTEM_REV:
+ break;
+ case GTA01v4_SYSTEM_REV:
+ s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_RESET, S3C2410_GPIO_OUTPUT);
+ break;
+ case GTA01Bv3_SYSTEM_REV:
+ s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_EN_3V3, S3C2410_GPIO_OUTPUT);
+ /* fallthrough */
+ case GTA01Bv2_SYSTEM_REV:
+ s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_EN_2V8, S3C2410_GPIO_OUTPUT);
+ s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_EN_3V, S3C2410_GPIO_OUTPUT);
+ s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_RESET, S3C2410_GPIO_OUTPUT);
+ break;
+ default:
That part of the code suggests to me, that the
GTA01Bv3_SYSTEM_REV has the GTA01_GPIO_GPS_RESET pin wired
to the gps and is being used for this.
+/* 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:
+ 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:
+ if (s3c2410_gpio_getpin(GTA01_GPIO_GPS_RESET))
+ return 1;
+ break;
+ }
+
+ return 0;
+}
While this code deals with the GTA01_GPIO_GPS_RESET pin, it
misses the case for GTA01Bv3_SYSTEM_REV.
* If I'm just missing something simple, can someone please
clue me?
* If this is intended behaviour, I'd highly suggest to add
some comments to the source, WHY this is so.
* If this is really a "bug", can someone with the knowledge
of the hw-design please fix it?
Elrond
More information about the openmoko-kernel
mailing list