From a95f9f92e2953d5829a29e95644dc4c4bc93f590 Mon Sep 17 00:00:00 2001 From: mirko Date: Sat, 13 Dec 2008 01:54:56 +0000 Subject: change prefix for kernelpatchbase 2.6.26 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13619 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ...3-only-do-platform-callback-once-per-even.patch | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100755 target/linux/s3c24xx/patches-2.6.26/1222-fix-pcf50633-only-do-platform-callback-once-per-even.patch (limited to 'target/linux/s3c24xx/patches-2.6.26/1222-fix-pcf50633-only-do-platform-callback-once-per-even.patch') diff --git a/target/linux/s3c24xx/patches-2.6.26/1222-fix-pcf50633-only-do-platform-callback-once-per-even.patch b/target/linux/s3c24xx/patches-2.6.26/1222-fix-pcf50633-only-do-platform-callback-once-per-even.patch new file mode 100755 index 000000000..c2b249bd8 --- /dev/null +++ b/target/linux/s3c24xx/patches-2.6.26/1222-fix-pcf50633-only-do-platform-callback-once-per-even.patch @@ -0,0 +1,74 @@ +From 91536c74c12a312e9d2e045daf4f7345ba6f2362 Mon Sep 17 00:00:00 2001 +From: Andy Green +Date: Fri, 25 Jul 2008 23:06:21 +0100 +Subject: [PATCH] fix-pcf50633-only-do-platform-callback-once-per-event.patch + Reported-by: Holger Freyther + +We harmlessly repeated PMU platform callbacks about charging state twice. +Clean it up and leave it to pcf50633_charge_enable() to report once. + +Also tidies the sequencing so we set current limit before we enable +charger now. + +Signed-off-by: Andy Green +--- + drivers/i2c/chips/pcf50633.c | 27 ++++++++++++++------------- + 1 files changed, 14 insertions(+), 13 deletions(-) + +diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c +index a5efb4e..01ffa1d 100644 +--- a/drivers/i2c/chips/pcf50633.c ++++ b/drivers/i2c/chips/pcf50633.c +@@ -1391,6 +1391,7 @@ static DEVICE_ATTR(voltage_hcldo, S_IRUGO | S_IWUSR, show_vreg, set_vreg); + static void pcf50633_usb_curlim_set(struct pcf50633_data *pcf, int ma) + { + u_int8_t bits; ++ int active = 0; + + pcf->last_curlim_set = ma; + +@@ -1406,17 +1407,16 @@ static void pcf50633_usb_curlim_set(struct pcf50633_data *pcf, int ma) + else + bits = PCF50633_MBCC7_USB_SUSPEND; + +- DEBUGPC("pcf50633_usb_curlim_set -> %dmA\n", ma); +- +- if (!pcf->pdata->cb) +- goto set_it; ++ /* set the nearest charging limit */ ++ reg_set_bit_mask(pcf, PCF50633_REG_MBCC7, PCF56033_MBCC7_USB_MASK, ++ bits); + ++ /* with this charging limit, is charging actually meaningful? */ + switch (bits) { +- case PCF50633_MBCC7_USB_100mA: +- case PCF50633_MBCC7_USB_SUSPEND: +- /* no charging is gonna be happening */ +- pcf->pdata->cb(&pcf->client.dev, +- PCF50633_FEAT_MBC, PMU_EVT_CHARGER_IDLE); ++ case PCF50633_MBCC7_USB_500mA: ++ case PCF50633_MBCC7_USB_1000mA: ++ /* yes with this charging limit, we can do real charging */ ++ active = 1; + break; + default: /* right charging context that if there is power, we charge */ + if (pcf->flags & PCF50633_F_USB_PRESENT) +@@ -1424,10 +1424,11 @@ static void pcf50633_usb_curlim_set(struct pcf50633_data *pcf, int ma) + PCF50633_FEAT_MBC, PMU_EVT_CHARGER_ACTIVE); + break; + } +- +-set_it: +- reg_set_bit_mask(pcf, PCF50633_REG_MBCC7, PCF56033_MBCC7_USB_MASK, +- bits); ++ /* ++ * enable or disable charging according to current limit -- this will ++ * also throw a platform notification callback about it ++ */ ++ pcf50633_charge_enable(pcf50633_global, active); + + /* clear batfull */ + reg_set_bit_mask(pcf, PCF50633_REG_MBCC1, +-- +1.5.6.3 + -- cgit v1.2.3