Age | Commit message (Collapse) | Author |
|
Setting the current limit directly and enabling the charger
isn't anyone's business except pcf50633 driver itself, so these
two functions should not be exported and become static.
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
Charger trigger stuff goes and asks for POWER_SUPPLY_PROP_STATUS
to figure out what the charger state is. But until now, we only
reported there what we found out from HDQ, and the HDQ registers
are not updated very often in the coulomb counter, it can be 4
or more second lag before it tells us about what it experiences.
When we react to USB insertion and only after 500ms debounce tell
power_supply stuff that something changed, it most times will
see old pre-USB-insertion state from bq27000 over HDQ at that time
and will report it ain't charging, buggering up the LED trigger
tracking.
This patch maintains distance between bq27000 and pcf50633 by
having platform callbacks in bq27000 that it can use to ask about
definitive charger "online" presence and "activity", whether the
charger says it is charging. If these callbacks are implemented
(and we implement them in this patch up in mach_gta02.c) then
this information is used in preference to what is found from
HDQ.
Result is if you set the LED trigger like this:
echo bat-charging > /sys/devices/platform/gta02-led.0/leds/gta02-aux:red/trigger
then it lights up properly on USB insertion now, goes away on
removal properly, as as far as I saw, when charging stops too.
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
My FreeRunner's load average was leveling off at 2.00 as a result of
these two kernel threads:
SDIO Helper D c02b4500 0 255 2
[<c02b4298>] (schedule+0x0/0x2d4) from [<c02b4040>] (__down+0x100/0x158)
[<c02b3f40>] (__down+0x0/0x158) from [<c02b3e2c>] (__down_failed+0xc/0x20)
r7:00000000 r6:c01fbd64 r5:c7cb7134 r4:c7d58000
[<c01fa6fc>] (CardDetectHelperFunction+0x0/0x1ac) from [<c01fbd80>] (HelperLaunch+0x1c/0x28)
r5:c7cb7134 r4:c7cb7134
[<c01fbd64>] (HelperLaunch+0x0/0x28) from [<c005bbd0>] (kthread+0x60/0x94)
r4:c7d58000
[<c005bb70>] (kthread+0x0/0x94) from [<c0048f7c>] (do_exit+0x0/0x744)
r6:00000000 r5:00000000 r4:00000000
SDIO Helper D c02b4500 0 259 2
[<c02b4298>] (schedule+0x0/0x2d4) from [<c02b4040>] (__down+0x100/0x158)
[<c02b3f40>] (__down+0x0/0x158) from [<c02b3e2c>] (__down_failed+0xc/0x20)
r7:c0382bb4 r6:c0382b34 r5:c7d5a000 r4:00000001
[<c01f9104>] (SDIOIrqHelperFunction+0x0/0x29c) from [<c01fbd80>] (HelperLaunch+0x1c/0x28)
r8:00000000 r7:00000000 r6:c01fbd64 r5:c0382bb4 r4:c0382bb4
[<c01fbd64>] (HelperLaunch+0x0/0x28) from [<c005bbd0>] (kthread+0x60/0x94)
r4:c7d5a000
[<c005bb70>] (kthread+0x0/0x94) from [<c0048f7c>] (do_exit+0x0/0x744)
r6:00000000 r5:00000000 r4:00000000
This fixes them to use interruptible sleep primitives while waiting in
their main loops, as is conventional for kernel threads. They can't
actually be interrupted since kernel threads ignore all signals, but
by sleeping this way they get classified as long term waiters, and
don't get counted as running for purposes of load average calculation.
This is intended as a minimal fix. In the longer term, it'd probably
make sense to replace the semaphores with completions or something,
and to do away with some of these StudlyCapped wrapper functions.
Signed-off-by: Jason Uhlenkott <jasonuhl@jasonuhl.org>
--
This is untested, but what could possibly go wrong? ;)
|
|
Subject: [PATCH] [pcf50633] Report more events to userspace using the default callback
Signed-Off-By: Holger Freyther <zecke@openmoko.org>
|
|
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.
|
|
Subject: [PATCH] [janitor] Make checkpatch happy on the header files
|
|
This patch introduces a new resume debugging concept: if we
get an OOPS inbetween starting suspend and finishing resume, it
uses a new "emergency spew" device similar to BUT NOT REQUIRING
CONFIG_DEBUG_LL to dump the syslog buffer and then the OOPS
on the debug device defined by the existing CONFIG_DEBUG_S3C_UART
index. But neither CONFIG_DEBUG_LL nor the S3C low level configs
are needed to use this feature.
Another difference between this feature and CONFIG_DEBUG_LL is that
it does not affect resume timing, ordering or UART traffic UNLESS
there is an OOPS during resume.
The patch adds three global exports, one to say if we are inside
suspend / resume, and two callbacks for printk() to use to init
and dump the emergency data. The callbacks are set in s3c serial
device init, but the whole structure is arch independent.
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
Reported-by: John Lee <john_lee@openmoko.com>
We don't reset the devices either at init or resume, where init
means use the BOOT bit to reload device calibration coefficients
from internal EEPROM. John Lee saw brain-damaged behaviour after
resume and sometimes after boot (since it may not have lost power
to force a BOOT itself that makes sense).
This patch
- adds a diagnostic dump feature down /sys
- forces BOOT action on init and resume, and waits for
completion
- makes sure XYZ capture is enabled on resume
- adds some constants in the .h and removes some magic numbers
in the code by using them
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
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>
|
|
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
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>
|
|
Glamo MCI has a resume order dependncy on pcf50633, it has to be able to
power the SD slot via it.
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
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>
|
|
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>
|
|
Adds resume dependency support to pcf50633
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
Defines a way for drivers to defer execution of resume callbacks
until one or more other driver they are dependent on has itself
resumed.
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
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>
|
|
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
Glamo "cmd mode" is modal, but nothing took care about locking.
Also cmd mode was entered recursively in rotate_lcd().
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
Add platform stuff to deal with going in and out of suspend
so the motion sensor IO is not driving high into unpowered sensors
Signed-off-by: Andy Green <andy@openmoko.com>
|
|
|
|
|
|
|
|
|
|
|
|
Modify GTA02 power manager for bluetooth.
1. Default power value isn't correct. Now we set pcf50633 LDO4 to 3.2 voltage.
2. Separate GTA01 and GTA02 source code.
3. Add pcf50633 API for enable register.
|
|
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>
|
|
|
|
This is a Linux driver for the STmicro LIS302DL 3-axis accelerometer.
Signed-off-by: Harald Welte <laforge@openmoko.org>
|
|
[ FIXME:
include/asm-arm/arch-s3c2410/irqs.h shouldn't contain device-specific
changes. ]
This is a Linux kernel driver for the Smedia Glamo336x / Glamo337x
multi-function peripheral device.
Signed-off-by: Harald Welte <laforge@openmoko.org>
|
|
|
|
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>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into rmk-next
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'cpus4096' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
cpumask: introduce new API, without changing anything, v3
cpumask: new API, v2
cpumask: introduce new API, without changing anything
|
|
Impact: cleanup
Clean up based on feedback from Andrew Morton and others:
- change to inline functions instead of macros
- add __init to bootmem method
- add a missing debug check
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
|
|
Currently, all existing users of cnt32_to_63() are fine since the CPU
architectures where it is used don't do read access reordering, and user
mode preemption is disabled already. It is nevertheless a good idea to
better elaborate usage requirements wrt preemption, and use an explicit
memory barrier on SMP to avoid different CPUs accessing the counter
value in the wrong order. On UP a simple compiler barrier is
sufficient.
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
PCI: fix range check on mmapped sysfs resource files
PCI: remove excess kernel-doc notation
PCI: annotate return value of pci_ioremap_bar with __iomem
PCI: fix VPD limit quirk for Broadcom 5708S
|
|
fine-tune the HT sched-domains parameters as well.
On a HT capable box, this increases lat_ctx performance from 23.87
usecs to 1.49 usecs:
# before
$ ./lat_ctx -s 0 2
"size=0k ovr=1.89
2 23.87
# after
$ ./lat_ctx -s 0 2
"size=0k ovr=1.84
2 1.49
Signed-off-by: Ingo Molnar <mingo@elte.hu>
|
|
Tune SD_MC_INIT the same way as SD_CPU_INIT:
unset SD_BALANCE_NEWIDLE, and set SD_WAKE_BALANCE.
This improves vmark by 5%:
vmark 132102 125968 125497 messages/sec avg 127855.66 .984
vmark 139404 131719 131272 messages/sec avg 134131.66 1.033
Signed-off-by: Mike Galbraith <efault@gmx.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
# *DOCUMENTATION*
|
|
- add cpumask_of()
- add free_bootmem_cpumask_var()
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
|
|
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
net: Fix recursive descent in __scm_destroy().
iwl3945: fix deadlock on suspend
iwl3945: do not send scan command if channel count zero
iwl3945: clear scanning bits upon failure
ath5k: correct handling of rx status fields
zd1211rw: Add 2 device IDs
Fix logic error in rfkill_check_duplicity
iwlagn: avoid sleep in softirq context
iwlwifi: clear scanning bits upon failure
Revert "ath5k: honor FIF_BCN_PRBRESP_PROMISC in STA mode"
tcp: Fix recvmsg MSG_PEEK influence of blocking behavior.
netfilter: netns ct: walk netns list under RTNL
ipv6: fix run pending DAD when interface becomes ready
net/9p: fix printk format warnings
net: fix packet socket delivery in rx irq handler
xfrm: Have af-specific init_tempsel() initialize family field of temporary selector
|
|
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
Block: use round_jiffies_up()
Add round_jiffies_up and related routines
block: fix __blkdev_get() for removable devices
generic-ipi: fix the smp_mb() placement
blk: move blk_delete_timer call in end_that_request_last
block: add timer on blkdev_dequeue_request() not elv_next_request()
bio: define __BIOVEC_PHYS_MERGEABLE
block: remove unused ll_new_mergeable()
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
sched: re-tune balancing
sched: fix buddies for group scheduling
sched: backward looking buddy
sched: fix fair preempt check
sched: cleanup fair task selection
|
|
__scm_destroy() walks the list of file descriptors in the scm_fp_list
pointed to by the scm_cookie argument.
Those, in turn, can close sockets and invoke __scm_destroy() again.
There is nothing which limits how deeply this can occur.
The idea for how to fix this is from Linus. Basically, we do all of
the fput()s at the top level by collecting all of the scm_fp_list
objects hit by an fput(). Inside of the initial __scm_destroy() we
keep running the list until it is empty.
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Fix the hrtimer_add_expires_ns() function. It should take a 'u64 ns' argument,
but rather takes an 'unsigned long ns' argument - which might only be 32-bits.
On FRV, this results in the kernel locking up because hrtimer_forward() passes
the result of a 64-bit multiplication to this function, for which the compiler
discards the top 32-bits - something that didn't happen when ktime_add_ns() was
called directly.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|