From 4a922dc8ab2915b61ff6adfe8e0a01069893b52b Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 21 Nov 2008 16:40:58 +0000 Subject: MERGE-via-balaji-tracking-balaji-updates Signed-off-by: Andy Green --- drivers/misc/neo1973_pm_host.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'drivers/misc') diff --git a/drivers/misc/neo1973_pm_host.c b/drivers/misc/neo1973_pm_host.c index caa302eeb91..bc2a82c3b6d 100644 --- a/drivers/misc/neo1973_pm_host.c +++ b/drivers/misc/neo1973_pm_host.c @@ -21,21 +21,29 @@ #ifdef CONFIG_MACH_NEO1973_GTA02 #include -#include +#include static ssize_t pm_host_read(struct device *dev, struct device_attribute *attr, char *buf) { return sprintf(buf, "%d\n", - pcf50633_gpio_get(gta02_pcf_pdata.pcf, PCF50633_GPO)); + pcf50633_gpio_get(gta02_pcf_pdata.pcf, PCF50633_GPO) + == PCF50633_GPOCFG_GPOSEL_1); } static ssize_t pm_host_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { unsigned long on = simple_strtoul(buf, NULL, 10); + u8 val; - pcf50633_gpio_set(gta02_pcf_pdata.pcf, PCF50633_GPO, on); + if (on) + val = PCF50633_GPOCFG_GPOSEL_1; + else + val = PCF50633_GPOCFG_GPOSEL_0; + + + pcf50633_gpio_set(gta02_pcf_pdata.pcf, PCF50633_GPO, val); return count; } -- cgit v1.2.3