Age | Commit message (Collapse) | Author |
|
If chgmod == BATFULL, setting chgena has no effect. Datasheet says we
need to set resume instead but when autoresume is used resume doesn't
work. Clear and set chgena instead.
This enables a user to force charging by re-plugging USB even when the
charger entered Battery Full mode, might be handy before a long trip.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
After reaching Battery Full condition MBC state machine switches back
into charging mode when the battery voltage falls below 96% of a
battery float voltage. The voltage drop in Li-Ion batteries is
marginal (1-2%) till about 80% of its capacity - which means, after a
BATFULL, charging won't be restarted until 75-80%.
That is a desired behaviour recommended by battery manufacturers,
don't mess with it.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
Current implementation is prone to races, this patch attempts to remove all
but one (in pcf50633_adc_sync_read).
The idea is that we need to guard the queue access only on inserting and
removing items. If we insert and there're no more items in the queue it
means that the last irq already happened and we need to trigger ADC
manually. If not, then the next conversion will be triggered by the irq
handler upon completion of the previous.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
Using the default kernel "events" workqueue causes problems with
synchronous adc readings if initiated from some task on the same
workqueue.
I had a deadlock trying to use pcf50633_adc_sync_read from a
power_supply class driver because the reading was initiated from the
workqueue and it waited for the irq processing to complete (to get the
result) and that was put on the same workqueue.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
Some userspace (notably Enlightment's batget) ignores "capacity"
completely if there're no other properties. Expose a fake value
(850mAh, typical for BL-5C) to make them happy.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
Check if machine-specific hooks exist before calling, this allows to use
this driver with gta02 or any other device that is able to provide battery
voltage readings.
Report an estimate of capacity percentage left, based on discharge curves.
Strictly speaking, this is a violation of power_supply class specs but
since this is the only driver for dumb batteries and userspace lacks any
library to do the estimation itself, we have to stuff it here.
Please keep in mind that this estimation is by no means accurate, usually
cell phones have only 5 bars to represent charge status.
Credit goes to Joerg Reisenweber and SpeedEvil for helping with gathering
and analysing the data.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
Driver data must be properly registered after allocation
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
If the battery is not present hdq_read will always return an error.
If the drivers knows that the battery is not present the correct thing to do is
to return -ENODEV instead of passing the error on.
Do this for all properties except POWER_SUPPLY_PROP_PRESENT.
The power supply sysfs expects us to do so, else it won't generate a proper
uevent file.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
|
|
This just alters some formatting and removes old code.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Conflicts:
drivers/mfd/glamo/glamo-cmdq.c
drivers/mfd/glamo/glamo-cmdq.h
drivers/mfd/glamo/glamo-drm-drv.c
drivers/mfd/glamo/glamo-drm-private.h
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
.. or re-bodge them, depending on your perspective. This makes mode->clock
contain a value in Hz, in line with the KMS convention. This is at the expense
of more calculations when generating the mode from the mach_info and when
setting the mode.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Just a little bit more debug information
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
This increases the amount of memory exposed via the framebuffer.
This should eventually allow an fbdev-based DDX or a KMS DDX to
run on the same kernel, albeit suboptimally.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
This removes a bogus check of var->pixclock. With KMS, this value
is not relevant.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
This seems to fix the kernel-level suspend/resume. There remains a problem
which causes Xorg to crash on resume.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Doesn't work yet...
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Fix a whitespace error introduced by the earlier debug stuff.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Fix trailing whitespace
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
This uses the "stopgap" method implemented earlier.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
...because the clock(s) must be running while we talk to the chip.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Finished with these now.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
This fixes the scanout timing conversion so that it works.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
This adds a stopgap measure to permit manipulation of the LCD controller
chip in the absence of an fb notifier chain. It also adds some messing
around with the DPMS stuff.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
This adds some register debugging watchpoints
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Well, duh.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
This was uninitialised before.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
This also alters some debug lines.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
This adds some missing bits and pieces to make most of the KMS
initialisation flow work.`
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
pdev -> platform_dev
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
F4t discovered that his freerunner panics on connect to his windows box.
This crude hack workarounds the problem.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
That wasn't the right way to go about this. And it didn't compile.
This reverts commit d8e4b9ff4dc8bf57e53fa174f977c8fb00ec4e90.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Nearly there...
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
This adds some bits which were missed out before, necessary to
(amongst other things) get the DRM driver's "load" callback to
get called.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
Clean up debugging messages so that we don't see any output with loglevel=4
(default for Qi). This avoids slowing down suspend/resume by slow fb
output.
Checkpatch barks on this patch but i guess most of that debugging would
have to be changed prior to upstream submission anyway.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
This makes the GEM "info" ioctl produce an object handle which can be used to refer
to the front buffer (i.e. screen pixmap) in Xorg or otherwise. This is unfortunately
necessary since this memory is allocated in the kernel by the framebuffer driver, and
is not available to DRM until we move to KMS.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
This is because of commit
1f06c28eaa6e77384a366c3d2ab1ccdbb8a807e0
The BQ27000 Battery requires HDQ.
Otherwise the battery is not available at all.
Signed-off-by: Luca Capello <luca@pca.it>
|
|
As discussed on the ML, currently headset button reports "KEY_PAUSE
released" on press and "pressed" on release. For "pause" semantics it makes
sense but if someone thinks of that as of just another button, it'd be good
to have "pressed/released" events consistent with button press/release.
Luca Capello <luca@pca.it> suggested to change the button event to KEY_PLAY
and to invert the state to make it more consistent.
This trivial patch inverts button events for GTA03 KEY_PLUS and KEY_MINUS,
i'm not sure how undesirable that is. I can prepare an alternative that
preserves current behaviour on GTA03 per request.
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
|
|
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
|
|
|
|
|
|
The rest_size was treated like the count of words instead of
bytes. This code also switches to memcpy_toio.
Signed-off-by: Andreas Pokorny <andreas.pokorny@gmail.com>
|
|
Removed the isr and everything interrupt related. IRQ is not
needed for basic operation on the glamo cmdq. This code directly
updates the write pointer of the queue without any waits.
Signed-off-by: Andreas Pokorny <andreas.pokorny@gmail.com>
|