aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c
AgeCommit message (Collapse)Author
2008-11-19debug-move-dev-info-to-dbg.patchAndy Green
Suggested-by: Sean McNeil <sean@mcneil.com> To see if some subtle race is involved, Sean has tried removing syslog traffic during resume and found he was not seeing the resume crash any more. We're giving it a try to see if it changes the behaviour for anyone else. It would mean we have a pretty fine race in there somewhere. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19change-backlight-level-not-forced-up-on-resume.patchAndy Green
We at least always enabled backlight on resume, this patch changes us to set backlight back to last requested backlight brightness level on resume. Note it means that you can resume with screen blanked, but it should come back if that happened with touchscreen action as usual. /sys/class/backlight/pcf50633-bl/actual_brightness and /sys/class/backlight/pcf50633-bl/brightness seem to agree after resume when reportedly they didn't before. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19add-pcf50633-allow-force-charger-type.patchAndy Green
This patch adds a sysfs node: /sys/class/i2c-adapter/i2c-0/0-0073/force_usb_limit_dangerous it allows to force the charging limit regardless of the one chosen by pcf50633 kernel driver. As such, if you write a charging limit here that is not suitable for the power source, and the power source is not current limited on its side, it could draw more current than your power source can handle, burn down you house, etc. If you're certain that your power supply can handle it, you can use this on your own responsibility to make the amount drawn by the PMU match what you believed your power supply could handle. Example usage, in case where you have a dumb 500mA USB charger that does not have the ID resistor: # cat /sys/class/i2c-adapter/i2c-0/0-0073/charger_type host/500mA usb mode 100mA <=== dumb charger does not ennumerate us # echo 500 > /sys/class/i2c-adapter/i2c-0/0-0073/force_usb_limit_dangerous # cat /sys/class/i2c-adapter/i2c-0/0-0073/charger_type host/500mA usb mode 500mA Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-mask-second-on-resume.patchAndy Green
We leave SECOND unmasked on resume, it's like the situation at probe() time, but there it makes us turn SECOND off after coldplug action. So we need to act like after that has happened, not exactly like what we do at probe / init time. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19From cede5c6c9b06ecbb0f7f2df7b7070092b87ddaf8 Mon Sep 17 00:00:00 2001Holger Freyther
Subject: [PATCH] [pcf50633] Avoid ooops on start with inserted usb cable The pcf50633_global might not be initialized when we get the first usb interrupt. We would oops inside the dev_err because we made up a struct device. Signed-Off-By: Holger Freyther <zecke@openmoko.org>
2008-11-19From c221bb27c8e22daa451e26353140777223d397d2 Mon Sep 17 00:00:00 2001Holger Freyther
Subject: [PATCH] [pcf50633] Report more events to userspace using the default callback Signed-Off-By: Holger Freyther <zecke@openmoko.org>
2008-11-19From 5718bde77ed1a75e0fd2cdf5e099e66121d10c0a Mon Sep 17 00:00:00 2001Holger Freyther
Subject: [PATCH] [battery] Make the bq27000 send an uevent when the charging state possible changed Remove the todo entries from the pcf50633, make the mach-gta02 call the bq27000 driver from the pmu callback.
2008-11-19From 000450f1ad2c713d2345a872fdf44f5dd3702e1b Mon Sep 17 00:00:00 2001Holger Freyther
Subject: [PATCH] [janitor] make checkpatch.pl happy
2008-11-19tracking-2.6.26-rc7-repeat-cdev-removal-pcf50633.patchAndy Green
Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-use-pcf-not-data-in-probe-for-context.patchAndy Green
Everywhere in the sources except the probe function the context pointer is called "pcf"... in there it's called "data" for some reason. This stops confusion by changing it to be "pcf" in there as well. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-migrate-gta02-peripherals-out.patchAndy Green
pcf50633.c shouldn't know GTAxx at all. Move to using a platform callback to allow definition of platform devices with pcf50633 as parent device (good for enforcing suspend / resume ordering). Remove all code references to GTAxx from the sources (one string left for compatability). Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-platform-backlight-resume-ramp-setting.patchAndy Green
Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-really-defer-backlight-on-resume.patchAndy Green
Backlight wasn't off by default on resume, so it was never really deferred (until LCM is initialized). This fixes that and so removes the brief white screen between pcf50633 resume and LCM init. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-disable-irq-from-suspend-until-resume.patchAndy Green
Disable pcf interrupt (not for wake, just as interrupt) in suspend, re-enable it again just before we force-call the workqueue function at end of pcf resume, which leads to pcf interrupt source registers getting cleared so it can signal an interrupt normally again. This change ends the uncontrolled appearance of pcf interrupts during resume time which previously caused the work to attempt to use the I2C stuff before i2c host device had itself resumed. Now the isr work is only queued, and the isr work function called, definitively after pcf resume completes. In suspend time, the work function may have been queued some time before and be pending, and it could still show up at a bad time. Therefore if the work function sees that it is coming since the start of pcf50633 suspend function, it aborts without attempting to read the pcf interrupt regs, leaving them for resume to take care of. USB current limit and no battery work functions are also made aware of suspend state and act accordingly. Lastly I noticed that in early resume, i2c_get_clientdata(&pcf->client) returns NULL, presumably because i2c device is still suspended. This could easily make trouble for async events like interrupt work, since pcf pointer is the client data. Disabling appearance of the work until after pcf50633 resume will also avoid that. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-suspend-state-as-enum.patchAndy Green
Use an enum to define pcf50633 suspend / resume state. Add PCF50633_SS_RESUMING_BUT_NOT_US_YET to be the state early in resume: add platform driver resume function just to set this state so we can differentiate between early resume and late suspend. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19debug-i2c-s3c2410-dump-stack-on-suspended-tranfer.patchAndy Green
Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-kill-white-splash-of-death-on-suspend.patchAndy Green
mach-gta02 meddles with the regulator platform struct after it is defined, leading to LCM power getting lost in suspend despite I set it to be left up. Fixing this finally removes the incredibly stubborn white LCM on suspend "flash". This is also going to be implicated in Sean McNeil's experience of monochromatic LCM after resume, which was previously attacked by resetting and re-initing the LCM from scratch. In addition, I realized that we take down core_1v3 in pcf50633 suspend action, this is happening near the start of suspend, so we are in a meta-race to finish suspend in a controlled way before the caps on core_1v3 run out (I only saw 23.3uF total). If it's true, this is where the weirdo sensitivity to timing during suspend is coming from. Therefore in this patch we also remove sleeps and dev_info() etc (which have to flush on serial console) from the pc50633 isr workqueue if we are in pcf50633 driver suspend state 1, ie, suspending... because we don't have time for it. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-add-back-gratuitous-isr-work-call-in-resume.patchAndy Green
Sean McNeil reports that he doesn't get pcf50633 interrupts any more after resume. This adds back the call to ISR work in the resume, removal of which is probably to do with it. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-require-resume-level-3-for-irq-work.patchAndy Green
Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-usb-curlim-workqueue-migration.patchAndy Green
pcf50633 needs to take responsibility for managing current limit changes asycnhrnously, ie, from USB stack enumeration. It's a feature of pcf50633 not mach-gta02.c, and we can do better with taking care about keeping it from firing at a bad time in there too. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-use-i2c-bulk-autoincrement.patchAndy Green
Simplify and speed up bulk sequential I2C actions in pcf50633 the time savings are pretty considerable and so is the simplification Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-rtc-i2c-bulk-autoincrement-simplify.patchAndy Green
More pcf50633 major time saving by using i2c bulk autoincrement. Code reduction too by using array for time elements. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-interrupt-work-enforce-wait-on-resume-completion.patchAndy Green
Improve pcf50633 interrupt service scheduling to enforce only servicing when resume action is completed Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-glamo-mci-relationship-with-pcf50633-suspend-resume.patchAndy Green
After protecting pcf50633 read and write primitives against operation after suspend or before resume (by blowing a stack_trace()) I saw glamo-mci was trying to use pcf50633 at these bad times on its own suspend and resume. Since that part was already done via platform callback, I added an export in pcf50633 that tells you if it is ready or busy, and used it to defer (resume power on case) or ignore (suspend power off case, since pcf50633 already did it) the mci power call. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-pcf50633-suspend-resume-onehit-i2c-other-meddling.patchAndy Green
- speed up suspend and resume by using one hit i2c bulk transactions - don't bother storing int mask set on suspend, the default one is what we use anyway - put stack_trace() on pcf50633 low level access that fire if we try to touch them before we resumed - cosmetic source cleanup - reduces resume time for pcf50633 from 450ms to 255ms Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19The following is a minor cleanup of backlight resume:Sean McNeil
2008-11-19add-use-pcf50633-resume-callback-jbt6k74.patchAndy Green
Adds the resume callback stuff to glamo, then changes jbt6k74 to no longer use a sleeping workqueue, but to make its resume actions dependent on pcf50633 and glamo resume (for backlight and communication to LCM respectively) Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19introduce-pcf50633-resume-dependency-list.patchAndy Green
Adds resume dependency support to pcf50633 Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19introduce-charging-led-behaviour.patchAndy Green
Creates a new behaviour requested by Will that the red LED on GTA02 is lit during battery charging.and goes out when the battery is full. This is done by leveraging the PMU interrupts, but in one scenario there is no interrupt that occurs, when the battery is replaced after being removed with the USB power in all the while. So a sleepy work function is started under those circumstances to watch for battery reinsertion or USB cable pull. 100mA limit was not being observed under some conditions so this was fixed and tested with a USB cable with D+/D- disconnected. 1A charger behaviour was also tested. Showing the charging action exposes some inconsistency in pcf50633 charging action. If your battery is nearly full, it will keep charging it at decreasing current even after it thinks it is at 100% capacity for a long while. But if you pull that same battery and re-insert it, the charger state machine in pcf50633 believe it is full and won't charge it. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19Fix possible null pointer dereference in s3c24xx_i2c_resumeHolger Freyther
From 0b9bae6aed5268707b348e48a01411ba420844e1 Mon Sep 17 00:00:00 2001 From: Holger Freyther <zecke@openmoko.org> Date: Tue, 27 May 2008 14:41:35 +0200 Subject: [PATCH] [janitor] Fix possible null pointer dereference Judging by the control flow of the resume method i2c->suspended++ could lead to a null pointer dereference.
2008-11-19fix-reduce-wake-reasons-in-pcf50633.patchAndy Green
Currently we are willing to wake from sleep from pcf50633 interrupts we don't actually do anything about even when we wake (somewhat puzzled). Let's disable some of these wake sources. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19add-resume-reason-sysfs.patchAndy Green
If you have U-Boot with uboot-add-find-wake-reason.patch, this patch will get you a wake reason report from cat /sys/devices/platform/neo1973-resume.0/resume_reason it looks like this: EINT00_ACCEL1 EINT01_GSM EINT02_BLUETOOTH EINT03_DEBUGBRD EINT04_JACK EINT05_WLAN EINT06_AUXKEY EINT07_HOLDKEY EINT08_ACCEL2 * EINT09_PMU adpins adprem usbins usbrem rtcalarm second onkeyr onkeyf exton1r exton1f exton2r exton2f exton3r exton3f * batfull chghalt thlimon thlimoff usblimon usblimoff adcrdy onkey1s lowsys lowbat hightmp autopwrfail dwn1pwrfail dwn2pwrfail ledpwrfail ledovp ldo1pwrfail ldo2pwrfail ldo3pwrfail ldo4pwrfail ldo5pwrfail ldo6pwrfail hcidopwrfail hcidoovl EINT10_NULL EINT11_NULL EINT12_GLAMO EINT13_NULL EINT14_NULL EINT15_NULL This shows a problem, false wake from suspend due to battery full Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-suspend-backlight-timing-pm-debug.patchAndy Green
This patch improves the smoothness of suspend and resume action. Taking out CONFIG_PM_DEBUG allows much more rapid resume (the low level serial traffic appears to be synchronous) Added a platform callback in jbt driver and support in pcf50633 so we can defer bringing up the backlight until the LCM is able to process video again (which must happen after the glamo is up and producing video beacuse the LCM is hooked to glamo SPI) GTA01 should not be affected by all this as the callback will default to null and it is on pcf50606 Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19tracking-2.6.25-struct-bus-type-loses-devices-member.patchAndy Green
I don't know what device the symlink should be linked against on GTA01, somebody that does know needs to edit it in where it says "FIXME"... I think the supplied method can work OK otherwise. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19tracking-2.6.25-input_dev-cdev-union-removed.patchAndy Green
struct input_dev in include/linux/input.h used to have a union cdev which contained the associated device struct pointer. This got simplified out in 2.6.25, so this patch removes cdev from our drivers that used it before. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-gta01-pmu-irq-edge-lost-on-resume.patchMike Wester
GTA01 -only Restore power button functionality after resume operation Per Werner's suggestion, run the PMU interrupt handler immediately after resume to clear/handle any pending interrupts from that device. This appears to resolve the dead-powerbutton-after-resume problem. This is not well-tested; need feedback to see if there are any side-effects or other problems. From BZ 1313 Signed-off-by: Mike Wester <mwester@dis.net>
2008-11-19OpenMoko => OpenmokoHolger Freyther
Signed-Off-By: Holger Freyther <zecke@openmoko.org>
2008-11-19add-pcf50633-06-RTC_AIE-ioctlHolger Hans Peter Freyther
Hey, the legacy application 'atd' from Russ Nelson/Nils Faerber, used by Qtopia, to schedule alarms currently fails to start as the the above ioctl is failing. The other drivers in drivers/rtc implement the above ioctl and we can implement it too. The code to mask/unmask the RTC alarm is copied from the set_alarm routine and adapted to use the reg_set_bit_mask and reg_set_clear_mask. It is compiling, so it must work. Please welcome me the lkml way ;) Signed-Off-by: Holger Hans Peter Freyther <zecke@openmoko.org>
2008-11-19fix-charging-deassert-host-power-1a-detect.patchAndy Green
We don't take care to stop driving generated USB host power even when we have a 1A charger connected on the same pins. Signed-off-by: Andy Green <andy@openmoko.com>
2008-11-19fix-s3c2410_timer_setup-resume-BUG.patchwarmcat
2008-11-19contrib-fix-chgstate-array-bloat.patchMike Montour
--- linux-2.6.22/drivers/i2c/chips/pcf50606.c.orig 2008-01-17 22:30:16.000000000 -0800 +++ linux-2.6.22/drivers/i2c/chips/pcf50606.c 2008-01-17 22:31:43.000000000 -0800 @@ -71,12 +71,19 @@ I2C_CLIENT_INSMOD_1(pcf50606); -#define PCF50606_F_CHG_FAST 0x00000001 /* Charger Fast allowed */ -#define PCF50606_F_CHG_PRESENT 0x00000002 /* Charger present */ -#define PCF50606_F_CHG_FOK 0x00000004 /* Fast OK for battery */ -#define PCF50606_F_CHG_ERR 0x00000008 /* Charger Error */ -#define PCF50606_F_CHG_PROT 0x00000010 /* Charger Protection */ -#define PCF50606_F_CHG_READY 0x00000020 /* Charging completed */ +#define PCF50606_B_CHG_FAST 0 /* Charger Fast allowed */ +#define PCF50606_B_CHG_PRESENT 1 /* Charger present */ +#define PCF50606_B_CHG_FOK 2 /* Fast OK for battery */ +#define PCF50606_B_CHG_ERR 3 /* Charger Error */ +#define PCF50606_B_CHG_PROT 4 /* Charger Protection */ +#define PCF50606_B_CHG_READY 5 /* Charging completed */ + +#define PCF50606_F_CHG_FAST (1<<PCF50606_B_CHG_FAST) /* Charger Fast allowed */ +#define PCF50606_F_CHG_PRESENT (1<<PCF50606_B_CHG_PRESENT) /* Charger present */ +#define PCF50606_F_CHG_FOK (1<<PCF50606_B_CHG_FOK) /* Fast OK for battery */ +#define PCF50606_F_CHG_ERR (1<<PCF50606_B_CHG_ERR) /* Charger Error */ +#define PCF50606_F_CHG_PROT (1<<PCF50606_B_CHG_PROT) /* Charger Protection */ +#define PCF50606_F_CHG_READY (1<<PCF50606_B_CHG_READY) /* Charging completed */ #define PCF50606_F_CHG_MASK 0x000000fc #define PCF50606_F_PWR_PRESSED 0x00000100 @@ -1026,12 +1033,12 @@ static DEVICE_ATTR(chgmode, S_IRUGO | S_IWUSR, show_chgmode, set_chgmode); static const char *chgstate_names[] = { - [PCF50606_F_CHG_FAST] = "fast_enabled", - [PCF50606_F_CHG_PRESENT] = "present", - [PCF50606_F_CHG_FOK] = "fast_ok", - [PCF50606_F_CHG_ERR] = "error", - [PCF50606_F_CHG_PROT] = "protection", - [PCF50606_F_CHG_READY] = "ready", + [PCF50606_B_CHG_FAST] = "fast_enabled", + [PCF50606_B_CHG_PRESENT] = "present", + [PCF50606_B_CHG_FOK] = "fast_ok", + [PCF50606_B_CHG_ERR] = "error", + [PCF50606_B_CHG_PROT] = "protection", + [PCF50606_B_CHG_READY] = "ready", }; static ssize_t show_chgstate(struct device *dev, struct device_attribute *attr,
2008-11-19suspend-prelim1.patchmokopatches
2008-11-19fix-pcf50633-LOWBAT-kill-init.patchmokopatches
2008-11-19fix-pcf50606-LOWBAT-kill-init.patchmokopatches
2008-11-19pcf506xx.patchmokopatches
Moved shared PMU code from pcf50606.h and pcf50633.h (which prevented inclusion of both at the same time) to pcf506xx.h - include/linux/pcf50606.h (struct pmu_voltage_rail, enum pmu_event, pmu_cb): moved to pcf506xx.h - include/linux/pcf50633.h (struct pmu_voltage_rail, enum pmu_event, pmu_cb): moved to pcf506xx.h Signed off-by: Werner Almesberger <werner@openmoko.org>
2008-11-19pcf50633-suspend-hacks.patchmokopatches
2008-11-19pcf50633.patchmokopatches
2008-11-19i2c-permit_invalid_addrs.patchmokopatches
We need this stupid workaround since our amplifier chip uses a 'reserved' I2C address Signed-off-by: Harald Welte <laforge@openmoko.org>
2008-11-19gta01-pcf50606.patchmokopatches
This is a NXP PCF50606 power management unit driver. The PCF50606 is used in the FIC/OpenMoko Neo1973 GTA01 GSM phone. Signed-off-by: Harald Welte <laforge@openmoko.org>
2008-11-19fix-i2c-s3c2410-resume-race.patchmokopatches
fix-i2c-s3c2410-resume-race.patch There is a nasty race between i2c-s3c2410 resume and resume of I2C driver and the client drivers -- the watchdog device actually gets to use the dead I2C bus before it is reinitialized by the I2C driver resume! This patch makes sure any customers get turned away until the shopkeeper has woken up. Signed-off-by: Andy Green <andy@openmoko.com>