diff options
author | tim.niemeyer@mastersword.de <tim.niemeyer@mastersword.de> | 2009-03-24 11:11:21 +0100 |
---|---|---|
committer | Werner Almesberger <werner@openmoko.org> | 2009-03-26 02:44:17 -0300 |
commit | c010bd7b90814dad534eb5544479f4316e83b712 (patch) | |
tree | c234e5a39d73bea87c8b0a18eb247620ee2bce04 | |
parent | 5a12be896397cec664cae250a39a4c8847e28294 (diff) |
retain gllin compatibility
added bus link from neo1973-pm-gps.0 to gta01-pm-gps.0
added pwron attr wich is the same as power_on
also one typo fixed (3V instead of 3V3 in gps_power_3v_set)
[ Werner: Documentation/CodingStyle line 83, don't ignore the error if
sysfs_create_group fails. ]
Signed-off-by: Tim Niemeyer <reddog@mastersword.de>
Signed-off-by: Werner Almesberger <werner@openmoko.org>
-rw-r--r-- | arch/arm/plat-s3c24xx/neo1973_pm_gps.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gps.c b/arch/arm/plat-s3c24xx/neo1973_pm_gps.c index f1f5de1689c..b5322f200b4 100644 --- a/arch/arm/plat-s3c24xx/neo1973_pm_gps.c +++ b/arch/arm/plat-s3c24xx/neo1973_pm_gps.c @@ -130,7 +130,7 @@ static void gps_power_3v_set(int on) regulator_enable(regulator); else regulator_disable(regulator); - neo1973_gps.regulator_state[GTA01_GPS_REG_3V3] = on; + neo1973_gps.regulator_state[GTA01_GPS_REG_3V] = on; break; case GTA01Bv2_SYSTEM_REV: case GTA01Bv3_SYSTEM_REV: @@ -359,7 +359,8 @@ static ssize_t power_gps_read(struct device *dev, { int ret = 0; - if (!strcmp(attr->attr.name, "power_on")) { + if (!strcmp(attr->attr.name, "power_on") || + !strcmp(attr->attr.name, "pwron")) { ret = gps_pwron_get(); #ifdef CONFIG_PM } else if (!strcmp(attr->attr.name, "keep_on_in_suspend")) { @@ -393,7 +394,8 @@ static ssize_t power_gps_write(struct device *dev, { unsigned long on = simple_strtoul(buf, NULL, 10); - if (!strcmp(attr->attr.name, "power_on")) { + if (!strcmp(attr->attr.name, "power_on") || + !strcmp(attr->attr.name, "pwron")) { gps_pwron_set(on); neo1973_gps.power_was_on = !!on; #ifdef CONFIG_PM @@ -593,10 +595,12 @@ static DEVICE_ATTR(keep_on_in_suspend, 0644, power_gps_read, power_gps_write); #endif static DEVICE_ATTR(power_on, 0644, power_gps_read, power_gps_write); +static DEVICE_ATTR(pwron, 0644, power_gps_read, power_gps_write); static struct attribute *gta01_gps_sysfs_entries[] = { &dev_attr_power_on.attr, + &dev_attr_pwron.attr, #ifdef CONFIG_MACH_NEO1973_GTA01 &dev_attr_power_avdd_3v.attr, &dev_attr_reset.attr, @@ -629,6 +633,7 @@ static struct attribute_group gta02_gps_attr_group = { static int __init gta01_pm_gps_probe(struct platform_device *pdev) { + int ret; #ifdef CONFIG_MACH_NEO1973_GTA01 int entries = ARRAY_SIZE(gta01_gps_sysfs_entries); #endif @@ -695,8 +700,12 @@ static int __init gta01_pm_gps_probe(struct platform_device *pdev) break; } #endif - return sysfs_create_group(&pdev->dev.kobj, + ret = sysfs_create_group(&pdev->dev.kobj, >a01_gps_attr_group); + if (ret) + return ret; + return bus_create_device_link(&platform_bus_type, + &pdev->dev.kobj, "gta01-pm-gps.0"); } if (machine_is_neo1973_gta02()) { |