diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/kexecboot/linux-kexecboot-2.6.24/tosa/0062-tosa-bat-fix-charging.patch | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/kexecboot/linux-kexecboot-2.6.24/tosa/0062-tosa-bat-fix-charging.patch')
-rw-r--r-- | recipes/kexecboot/linux-kexecboot-2.6.24/tosa/0062-tosa-bat-fix-charging.patch | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/recipes/kexecboot/linux-kexecboot-2.6.24/tosa/0062-tosa-bat-fix-charging.patch b/recipes/kexecboot/linux-kexecboot-2.6.24/tosa/0062-tosa-bat-fix-charging.patch new file mode 100644 index 0000000000..e3a6b74772 --- /dev/null +++ b/recipes/kexecboot/linux-kexecboot-2.6.24/tosa/0062-tosa-bat-fix-charging.patch @@ -0,0 +1,78 @@ +From 0b9f80ab540b2e51f6e86f6a1adec67761f9368d Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov <dbaryshkov@gmail.com> +Date: Fri, 8 Feb 2008 00:50:03 +0300 +Subject: [PATCH 62/64] tosa-bat-fix-charging + +Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> +--- + drivers/power/tosa_battery.c | 28 +++++++++++++++++++++------- + 1 files changed, 21 insertions(+), 7 deletions(-) + +diff --git a/drivers/power/tosa_battery.c b/drivers/power/tosa_battery.c +index 008e791..2db9116 100644 +--- a/drivers/power/tosa_battery.c ++++ b/drivers/power/tosa_battery.c +@@ -153,39 +153,53 @@ static irqreturn_t tosa_bat_full_isr(int irq, void *data) + return IRQ_HANDLED; + } + ++static char *status_text[] = { ++ [POWER_SUPPLY_STATUS_UNKNOWN] = "Unknown", ++ [POWER_SUPPLY_STATUS_CHARGING] = "Charging", ++ [POWER_SUPPLY_STATUS_DISCHARGING] = "Discharging", ++ [POWER_SUPPLY_STATUS_NOT_CHARGING] = "Not charging", ++ [POWER_SUPPLY_STATUS_FULL] = "Full", ++}; ++ + static void tosa_bat_update(struct tosa_bat *bat) + { +- int old = bat->status; ++ int old; + struct power_supply *psy = &bat->psy; + + mutex_lock(&bat->work_lock); + ++ old = bat->status; ++ + if (bat->is_present && !bat->is_present(bat)) { +- printk(KERN_DEBUG "%s not present\n", psy->name); ++ printk(KERN_NOTICE "%s not present\n", psy->name); + bat->status = POWER_SUPPLY_STATUS_NOT_CHARGING; + bat->full_chrg = -1; + } else if (power_supply_am_i_supplied(psy)) { ++ if (bat->status == POWER_SUPPLY_STATUS_DISCHARGING) { ++ gpio_set_value(bat->gpio_charge_off, 0); ++ mdelay(15); ++ } + if (gpio_get_value(bat->gpio_full)) { +- printk(KERN_DEBUG "%s full\n", psy->name); +- + if (old == POWER_SUPPLY_STATUS_CHARGING || bat->full_chrg == -1) + bat->full_chrg = tosa_read_bat(bat); + + gpio_set_value(bat->gpio_charge_off, 1); + bat->status = POWER_SUPPLY_STATUS_FULL; + } else { +- printk(KERN_ERR "%s charge\n", psy->name); + gpio_set_value(bat->gpio_charge_off, 0); + bat->status = POWER_SUPPLY_STATUS_CHARGING; + } + } else { +- printk(KERN_ERR "%s discharge\n", psy->name); + gpio_set_value(bat->gpio_charge_off, 1); + bat->status = POWER_SUPPLY_STATUS_DISCHARGING; + } + +- if (old != bat->status) ++ if (old != bat->status) { ++ printk(KERN_NOTICE "%s %s -> %s\n", psy->name, ++ status_text[old], ++ status_text[bat->status]); + power_supply_changed(psy); ++ } + + mutex_unlock(&bat->work_lock); + } +-- +1.5.3.8 + |