1
0
Fork 0
Commit Graph

1346 Commits (57154f0302cd39a7ff5f3f4ceef23bda4112c77e)

Author SHA1 Message Date
Liam Breck e7b34f4a74 power: supply: bq24190_charger: Handle fault before status on interrupt
commit ba52e75718 upstream.

Reading both fault and status registers and logging any fault should
take priority over handling status register update.

Fix by moving the status handling to later in interrupt routine.

Fixes: d7bf353fd0 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 14:00:15 +02:00
Liam Breck 7f2b4ad9c0 power: supply: bq24190_charger: Don't read fault register outside irq_handle_thread()
commit 68abfb8015 upstream.

Caching the fault register after a single I2C read may not keep an accurate
value.

Fix by doing two reads in irq_handle_thread() and using the cached value
elsewhere. If a safety timer fault later clears itself, we apparently don't get
an interrupt (INT), however other interrupts would refresh the register cache.

From the data sheet: "When a fault occurs, the charger device sends out INT
 and keeps the fault state in REG09 until the host reads the fault register.
 Before the host reads REG09 and all the faults are cleared, the charger
 device would not send any INT upon new faults. In order to read the
 current fault status, the host has to read REG09 two times consecutively.
 The 1st reads fault register status from the last read [1] and the 2nd reads
 the current fault register status."

[1] presumably a typo; should be "last fault"

Fixes: d7bf353fd0 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 14:00:15 +02:00
Liam Breck 4b7dac0a23 power: supply: bq24190_charger: Call power_supply_changed() for relevant component
commit 2d9fee6a42 upstream.

We wrongly get uevents for bq24190-charger and bq24190-battery on every
register change.

Fix by checking the association with charger and battery before
emitting uevent(s).

Fixes: d7bf353fd0 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 14:00:14 +02:00
Liam Breck 63e1acc84d power: supply: bq24190_charger: Install irq_handler_thread() at end of probe()
commit d62acc5ef0 upstream.

The device specific data is not fully initialized on
request_threaded_irq(). This may cause a crash when the IRQ handler
tries to reference them.

Fix the issue by installing IRQ handler at the end of the probe.

Fixes: d7bf353fd0 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 14:00:14 +02:00
Liam Breck 20e448f225 power: supply: bq24190_charger: Call set_mode_host() on pm_resume()
commit e05ad7e074 upstream.

pm_resume() does a register_reset() which clears charger host mode.

Fix by calling set_mode_host() after the reset.

Fixes: d7bf353fd0 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 14:00:14 +02:00
Liam Breck d8d6aedd54 power: supply: bq24190_charger: Fix irq trigger to IRQF_TRIGGER_FALLING
commit 767eee362f upstream.

The interrupt signal is TRIGGER_FALLING. This is is specified in the
data sheet PIN FUNCTIONS: "The INT pin sends active low, 256us
pulse to host to report charger device status and fault."

Also the direction can be seen in the data sheet Figure 37 "BQ24190
with D+/D- Detection and USB On-The-Go (OTG)" which shows a 10k
pull-up resistor installed for the sample configurations.

Fixes: d7bf353fd0 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 14:00:14 +02:00
Giedrius Statkevičius 4f39fcce99 power: supply: lp8788: prevent out of bounds array access
commit bdd9968d35 upstream.

val might become 7 in which case stime[7] (array of length 7) would be
accessed during the scnprintf call later and that will cause issues.
Obviously, string concatenation is not intended here so just a comma needs
to be added to fix the issue.

Fixes: 98a2766493 ("power_supply: Add new lp8788 charger driver")
Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Acked-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 14:00:14 +02:00
Alexandre Belloni 206af3d97f power: reset: at91-poweroff: timely shutdown LPDDR memories
commit 0b0408745e upstream.

LPDDR memories can only handle up to 400 uncontrolled power off. Ensure the
proper power off sequence is used before shutting down the platform.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-12 06:41:45 +01:00
Andrew F. Davis cb50d45c3d power: supply: bq27xxx_battery: Fix register map for BQ27510 and BQ27520
commit 3bee9ea1de upstream.

The BQ27510 and BQ27520 use a slightly different register map than the
BQ27500, add a new type enum and add these gauges to it.

Fixes: d74534c277 ("power: bq27xxx_battery: Add support for additional bq27xxx family devices")
Based-on-patch-by: Kenneth R. Crudup <kenny@panix.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19 20:18:07 +01:00
Tony Lindgren df386a0c28 bq24190_charger: Fix PM runtime use for bq24190_battery_set_property
commit 075eb5719d upstream.

There's a typo, it should do pm_runtime_get_sync, not put.

Fixes: d7bf353fd0 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Cc: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19 20:18:07 +01:00
Linus Torvalds 021723e6c5 power supply and reset changes for the v4.9 series
* move power supply drivers to drivers/power/supply
  * unify location of power supply DT documentation
  * tps65217-charger: IRQ support
  * act8945a-charger: misc. cleanups & improvements
  * sbs-battery cleanup
  * fix users of deprecated create_singlethread_workqueue()
  * misc fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCgAGBQJX8j3bAAoJENju1/PIO/qavlcP/Rq5LeMol2KYQfYOLrVKmS9N
 sqJpOM1wnQS25Dw+KQf+bNOLuBY/w44SnINFYswV2Vw5DQ2ODt1IzvqoaPBwznpq
 BeLN/NLvYY2vIAPxmHxvdB0mnPEhRJOgZkHXUkonIqX98qnzbIorQtHBhAZ3h2v6
 nz5ltO3GXiAyzPE6Zhx9OWWTZRLi1YKCuPZstRU6SY6uGwEMyEVMcu6Rv3XFizBj
 kng9nOCWRE3723UaGQx3LumI2EIsJ1m7RDHIx0ZPOIRlUEd5bawhxdhfT1pQAEZS
 y7GSs4FE86QuGN4M+zcxr4u1vSmYsK2c7FGFRnBcwG4Hkmy4O4h1yBjmrMby8eWo
 V0JxsGkkN+R/6/cAKqXRL0T5gU4rKf4LAj84kSOHGZDiQk0D29wGNZuBtlQw/2sB
 CLABJvpn11aQ3NIkNttr1ur8S15C9tAEMKmjrK7bbvtzBUp2BoVguYQtkP909s0U
 19exP0yslM95t0cRT6lCpZUPFUvoEDs7iIDwv7QBFJSB2ZDMUFfGy6ouM6gHnfKL
 ZkiCi2gmhTqHCpGvD/yi8FhuDFBZ7Ujcotzn3bE07GSTeG7FmzhR+6khedq9DIYQ
 xJbDdPwmwhbrOe99O0wk/qFCBcvgmkXaE4O23fBPS10oCs70FFseYFfb15qAljsE
 4ydoaCMwFUgH49SpDQC6
 =HpLI
 -----END PGP SIGNATURE-----

Merge tag 'for-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply and reset updates from Sebastian Reichel:
 - move power supply drivers to drivers/power/supply
 - unify location of power supply DT documentation
 - tps65217-charger: IRQ support
 - act8945a-charger: misc. cleanups & improvements
 - sbs-battery cleanup
 - fix users of deprecated create_singlethread_workqueue()
 - misc fixes.

* tag 'for-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (46 commits)
  power: supply: bq27xxx_battery: allow kernel poll_interval parameter runtime update
  power: supply: sbs-battery: Cleanup removal of chip->pdata
  power: reset: st: Remove obsolete platforms from dt doc
  power: reset: st-poweroff: Remove obsolete platforms.
  power: reset: zx-reboot: Unmap region obtained by of_iomap
  power: reset: xgene-reboot: Unmap region obtained by of_iomap
  power: supply: ab8500: cleanup with list_first_entry_or_null()
  power: reset: add in missing white space in error message text
  sbs-battery: make writes to ManufacturerAccess optional
  power: bq24257: Fix use of uninitialized pointer bq->charger
  power: supply: sbs-battery: simplify DT parsing
  power: supply: bq24735-charger: Request status GPIO with initial input setup
  power: supply: sbs-battery: Use gpio_desc and sleeping calls for battery detect
  power: supply: act8945a_charger: Add max current property
  power: supply: act8945a_charger: Add capacity level property
  doc: bindings: power: act8945a-charger: Update properties.
  power: supply: act8945a_charger: Fix the power supply type
  power: supply: act8945a_charger: Add status change update support
  power: supply: act8945a_charger: Improve state handling
  power: supply: act8945a_charger: Remove "battery_temperature"
  ...
2016-10-06 18:21:15 -07:00
Matt Ranostay 1d72706f04 power: supply: bq27xxx_battery: allow kernel poll_interval parameter runtime update
Fix issue with poll_interval being not updated till the previous
interval expired.

Cc: Tony Lindgren <tony@atomide.com>
Cc: Liam Breck <liam@networkimprov.net>
Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-21 02:08:04 +02:00
Phil Reid 389958bb6b power: supply: sbs-battery: Cleanup removal of chip->pdata
There where still a few lingering references to pdata after commit
power: supply: sbs-battery: simplify DT parsing.

Remove pdata from struct·sbs_info and conditional checks to ser if this
was set from the i2c read / write functions.
Instead of call max in each function for incrementing poll_retry_count
do it once in the probe function.
Fixup null pointer dereference in to pdata in sbs_external_power_changed.
Change retry counts to u32 to avoid need for max.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-21 02:04:47 +02:00
Peter Griffin 8ad5d85efd power: reset: st-poweroff: Remove obsolete platforms.
This patch removes support for STiH415/6 SoC's from the
st-poweroff driver, as support for these platforms is
being removed from the kernel.

Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
Cc: <linux-pm@vger.kernel.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-19 21:32:22 +02:00
Arvind Yadav 7531be5cdf power: reset: zx-reboot: Unmap region obtained by of_iomap
Free memory mapping, if probe is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-19 21:25:41 +02:00
Arvind Yadav 896af83ef6 power: reset: xgene-reboot: Unmap region obtained by of_iomap
Free memory mapping, if probe is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-19 21:24:06 +02:00
Masahiro Yamada f04f7aef7f power: supply: ab8500: cleanup with list_first_entry_or_null()
The combo of list_empty() check and return list_first_entry()
can be replaced with list_first_entry_or_null().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-19 21:22:10 +02:00
Colin Ian King 1dff6ce026 power: reset: add in missing white space in error message text
A dev_err message spans two lines and the literal string is missing
a white space between words. Add the white space.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-19 21:19:46 +02:00
Guenter Roeck 17c6d3979e sbs-battery: make writes to ManufacturerAccess optional
According to the Smart Battery Data Specification, the use
of ManufacturerAcess (register 0x0) is implementation-defined.
It appears that some batteries use writes to this register
in order to implement certain functionality, but others may
simply NAK all writes to it. As a result, write failures to
ManufacturerAccess should not be used as an indicator of
battery presence, nor as a failure to enter sleep mode.

The failed write access was seen with SANYO AP13J3K.

Cc: Brian Norris <briannorris@chromium.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-19 21:02:17 +02:00
Georges Savoundararadj 0610735928 power: bq24257: Fix use of uninitialized pointer bq->charger
bq->charger is initialized in bq24257_power_supply_init.
Therefore, bq24257_power_supply_init should be called before the
registration of the IRQ handler bq24257_irq_handler_thread that calls
power_supply_changed(bq->charger).

Signed-off-by: Georges Savoundararadj <savoundg@gmail.com>
Cc: Aurelien Chanot <chanot.a@gmail.com>
Cc: Andreas Dannenberg <dannenberg@ti.com>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Fixes: 2219a93596 ("power_supply: Add TI BQ24257 charger driver")
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-19 20:56:22 +02:00
Joe Perches e2cdeaa123 PM / AVS: SmartReflex: Neaten logging
Use a more common logging style.

Miscellanea:

o Use pr_warn
o Coalesce formats adding missing spaces
o Argument alignment
o Remove unnecessary OOM messages as k.alloc does stack dumps

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Nishanth Menon <nm@ti.com>
[khilman: update shortlog]
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-09-13 02:43:05 +02:00
Arnd Bergmann 9edeaada19 power: supply: sbs-battery: simplify DT parsing
After the change to use the gpio descriptor interface, we get a warning if
-Wmaybe-uninitialized is added back to the build flags (it is currently
disabled:

drivers/power/supply/sbs-battery.c: In function 'sbs_probe':
drivers/power/supply/sbs-battery.c:760:28: error: 'pdata' may be used uninitialized in this function [-Werror=maybe-uninitialized]

The problem is that if neither the DT properties nor a platform_data
pointer are provided, the chip->pdata pointer gets set to an uninitialized
value.

Looking at the code some more, I found that the sbs_of_populate_pdata
function is more complex than necessary and has confusing calling
conventions of possibly returning a valid pointer, a NULL pointer
or an ERR_PTR pointer (in addition to the uninitialized pointer).

To fix all of that, this gets rid of the chip->pdata pointer and
simply moves the two integers into the sbs_info structure. This
makes it much clearer from reading sbs_probe() what the precedence
of the three possible values are (pdata, DT, hardcoded defaults)
and completely avoids the #ifdef CONFIG_OF guards as
of_property_read_u32() gets replaced with a compile-time stub
when that is disabled, and returns an error if passed a NULL of_node
pointer.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 3b5dd3a494 ("power: supply: sbs-battery: Use gpio_desc and sleeping calls for battery detect")
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-07 01:46:59 +02:00
Paul Kocialkowski c65a8b5112 power: supply: bq24735-charger: Request status GPIO with initial input setup
This requests the status GPIO with initial input setup. It is required
to read the GPIO status at probe time and thus correctly avoid sending
I2C messages when AC is not plugged.

When requesting the GPIO without initial input setup, it always reads 0
which causes probe to fail as it assumes the charger is connected, sends
I2C messages and fails.

While at it, this switches the driver over to gpiod API.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-05 12:59:49 +02:00
Phil Reid 3b5dd3a494 power: supply: sbs-battery: Use gpio_desc and sleeping calls for battery detect
Switch to using new gpio_desc interface and devm gpio get calls to
automatically manage gpio resource. Use gpiod_get_value which handles
active high / low calls.

If gpio_detect is set then force loading of the driver as it is
reasonable to assume that the battery may not be present.

Update the is_present flag immediately in the IRQ.

Remove legacy gpio specification from platform data.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-01 16:06:14 +02:00
Wenyou Yang 528e350412 power: supply: act8945a_charger: Add max current property
Add the power supply's current max property,
POWER_SUPPLY_PROP_CURRENT_MAX.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-01 13:55:55 +02:00
Wenyou Yang 369eba0986 power: supply: act8945a_charger: Add capacity level property
Add the power supply capacity level property, it corresponds to
POWER_SUPPLY_CAPACITY_LEVEL_*.

It also utilizes the precision voltage detector function module
to catch the low battery voltage.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-09-01 13:55:52 +02:00
Wenyou Yang 10ca08b07b power: supply: act8945a_charger: Fix the power supply type
The power supply type property is varying as the external power
supply changes. It is not a constant.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-31 16:47:01 +02:00
Wenyou Yang a09209acd6 power: supply: act8945a_charger: Add status change update support
Add the charger status change interrupt support, it will report
the power supply changed event.

This interrupt is generated by one of the conditions as below:
 - the state machine jumps out of or into the EOC state
 - the CHGIN input voltage goes out of or into the valid range.
 - the battery temperature goes out of or into the valid range.
 - the PRECHARGE time-out occurs.
 - the total charge time-out occurs.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-31 16:46:57 +02:00
Wenyou Yang 1f0ba4067a power: supply: act8945a_charger: Improve state handling
When get the property, first check the charger state machine,
then check the status bit to decide what value is assigned to
the corresponding property.

Retain the SUSCHG bit of REG 0x71 when configure the timers to
avoid losting the charger suspending info after boot.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-31 16:46:54 +02:00
Wenyou Yang 6b021fc910 power: supply: act8945a_charger: Remove "battery_temperature"
Remove "battery_temperature" member, it is redundant, it is the
hardware's responsibility to handle TH pin properly.
It is unnecessary to use the dt property to check if there is
a battery temperature monitor or not.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-31 16:46:50 +02:00
Wenyou Yang 5da643b26d power: supply: act8945a_charger: Achieve properties from its node
Since the act8945a_charger is regarded as a sub-device, all properties will
be assigned to its own device node. All properties can be achieved from its
own node, instead of from its parent device.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-31 16:46:43 +02:00
Paul Kocialkowski ae0f74be6e power: bq24735-charger: Assume not charging when charger is missing
When the charger is missing (disconnected), it is safe to assume that
the charger chip is no charging.

This is especially relevant when a status GPIO is present and the
charger is getting disconnected. bq24735_charger_is_charging will be
triggered due to the interrupt then, it will attempt to read whether it
is charging through i2c, which will fail as the charger is disconnected.

This also fixes that specific issue.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-29 02:39:06 +02:00
Krzysztof Kozlowski 1c4593edbd power: supply: Change Krzysztof Kozlowski's email to kernel.org
Change my email address to kernel.org instead of Samsung one for the
purpose of any future contact. The copyrights remain untouched and are
attributed to Samsung.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-17 14:15:58 +02:00
Sebastian Reichel f7c8f1de03 Power Supply Fixes for 4.8 cycle
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCgAGBQJXsk2BAAoJENju1/PIO/qa0E4P/0rsS4Kzv+B61BJsoCIoXYOp
 p347gy6fS7QEJxSlHG430uVV74zlXQE3JTiBrjIdX2TKRA6EvD0RyM3/h+vfQU1c
 GviBJ53UwNlq1bBuJD1jkIHCvIW274FjX1h45Tytuzsi/8rLWas15oumnRFuOtyA
 UtgTbPtualYab01XgQyivv/dY4Dfb3d0aNPl3Nq77hAJMTVc9s1DLVqRMudqc0Zc
 e489mw+8l31L2pJs7CPxzNXqlS4YvMz4/mwbGCsqtEJTNHyzyrVH5VfCpMUNfGr4
 rZdqtF/nj/9c/DTIO6GvhoOVjja4MCEf3WpGCxrz2KUmhvxVTeBqsPStjE1xnC8u
 rNDDpRAwtjgpiw8fiEw+CXB5XsDMPmMSJi1KaOLz1q9O2GxHzoz2tgfjCh9V73qj
 J5pq1cQY2V6AkB+10WQ7afCnN3Zn2qDUoWXj2cvkd8yuvyfjTuC53Gd1sGpNk1dj
 f+euFLm6YYMvLv37vDCQDaxvzmud1Z60bgJy/uvbaVhcCABLUdbfwJpRf/3tWjp3
 rU3Lw43p5MPfBWHkZrzpQO33GEzO6FSrIkTr3YfVJiwAoViXgt5WEknbVde/pZDz
 Acn8UTE+6KeLrmrwA66pF++ewKjA7GgUzW50Ubju15rWujnwu5QVg/T+UVpGrB4k
 OYmwCtd5i2/OjnC+APnK
 =hK7R
 -----END PGP SIGNATURE-----

Merge tag 'for-v4.8-rc' into psy-next

Power Supply Fixes for 4.8 cycle
2016-08-16 01:17:42 +02:00
Bhaktipriya Shridhar b732ace40a power: ds2760_battery: Remove deprecated create_singlethread_workqueue
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces
deprecated create_singlethread_workqueue(). This is the identity
conversion.

The workqueue "monitor_wqueue" is used to monitor the battery
status. It has been identity converted.

It queues multiple work items viz &di->monitor_work,
&di->set_charged_work, which require execution ordering.
Hence, alloc_workqueue has been used to replace the
deprecated create_singlethread_workqueue instance.

WQ_MEM_RECLAIM flag has been set to ensure forward progress under
memory pressure.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:54:37 +02:00
Bhaktipriya Shridhar 1c53f3709c power: ab8500_fg: Remove deprecated create_singlethread_workqueue
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces
deprecated create_singlethread_workqueue(). This is the identity
conversion.

The workqueue "fg_wq" is used for running the FG algorithm periodically.
It has been identity converted.

It has multiple work items viz fg_periodic_work, fg_low_bat_work,
fg_reinit_work, fg_work, fg_acc_cur_work and fg_check_hw_failure_work,
which require execution ordering. Hence, a dedicated ordered workqueue
has been used here.

The WQ_MEM_RECLAIM flag has been set to guarantee forward progress under
memory pressure.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:54:37 +02:00
Bhaktipriya Shridhar 829f0e97cc power: ipaq_micro_battery: Remove deprecated create_singlethread_workqueue
The workqueue "wq" is used for handling battery related tasks.

It has a single work item viz &mb->update and hence it doesn't require
execution ordering. Hence, alloc_workqueue has been used to replace the
deprecated create_singlethread_workqueue instance.

The WQ_MEM_RECLAIM flag has been set to ensure forward progress under
memory pressure.

Since there is a single work item, explicit concurrency
limit is unnecessary here.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:54:37 +02:00
Bhaktipriya Shridhar 9df8262826 power: ab8500_charger: Remove deprecated create_singlethread_workqueue
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces
deprecated create_singlethread_workqueue(). This is the identity
conversion.

The workqueue "charger_wq" is used for the IRQs and checking HW state of
the charger. It has been identity converted.

It has multiple work items viz usb_charger_attached_work, kick_wd_work,
check_vbat_work, check_hw_failure_work, usb_charger_attached_work,
ac_work, ac_charger_attached_work, attach_work and check_usbchgnotok_work,
which require execution ordering. Hence, a dedicated ordered workqueue
has been used here.

The WQ_MEM_RECLAIM flag has also been set to ensure
forward progress under memory pressure.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:54:37 +02:00
Bhaktipriya Shridhar 87f818b35c power: intel_mid_battery: Remove deprecated create_singlethread_workqueue
The workqueue "monitor_wqueue" is used to monitor the PMIC battery status.
It queues a single work item (pbi->monitor_battery) and hence doesn't
require ordering. Hence, alloc_workqueue has been used to replace the
deprecated create_singlethread_workqueue instance.

Since PMIC battery status needs to be monitored for any change, the
WQ_MEM_RECLAIM flag has been set to ensure forward progress under memory
pressure.

Since there is a single work item, explicit concurrency
limit is unnecessary here.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:54:37 +02:00
Bhaktipriya Shridhar d8a69251fb power: pm2301_charger: Remove deprecated create_singlethread_workqueue
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces
deprecated create_singlethread_workqueue(). This is the identity
conversion.

The workqueue "charger_wq" is used for running all the charger related
tasks. This involves charger detection, checking for HW failure and HW
status. This workqueue has been identity converted.

It queues multiple workitems viz &pm2->check_main_thermal_prot_work,
&pm2->check_hw_failure_work, &pm2->ac_work. Hence, the deprecated
create_singlethread_workqueue() instance has been replaced with a
dedicated ordered workqueue.

The WQ_MEM_RECLAIM flag has been set to ensure forward progress under
memory pressure.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:54:37 +02:00
Bhaktipriya Shridhar a8dd5b6868 power: ab8500_btemp: Remove deprecated create_singlethread_workqueue
The workqueue "btemp_wq" is used for measuring the temperature
periodically. It queues a single workitem (btemp_periodic_work) and
hence doesn't require ordering. Thus, the deprecated
create_singlethread_workqueue() instance has been replaced with
alloc_workqueue().

The WQ_MEM_RECLAIM flag has been set to ensure forward progress under
memory pressure.

Since there is a single work item, explicit concurrency
limit is unnecessary here.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:54:37 +02:00
Bhaktipriya Shridhar 0b9992f76f power: abx500_chargalg: Remove deprecated create_singlethread_workqueue
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set replaces
deprecated create_singlethread_workqueue(). This is the identity
conversion.

The workqueue "chargalg_wq" is used for running the charging algorithm.
It has multiple workitems viz &di->chargalg_periodic_work,
&di->chargalg_wd_work, &di->chargalg_work per abx500_chargalg, which
require ordering. It has been identity converted.

Also, WQ_MEM_RECLAIM has been set to ensure forward progress under
memory pressure.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:54:37 +02:00
Wei Yongjun 2ee565c934 power: axp288_charger: remove duplicated include from axp288_charger.c
Remove duplicated include.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:36:37 +02:00
Wei Yongjun ad7656c75f power: axp288_fuel_gauge: remove duplicated include from axp288_fuel_gauge.c
Remove duplicated include.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:36:27 +02:00
Wei Yongjun 1bbd3d2825 power: z2_battery: remove .owner field for driver
Remove .owner field if calls are used which set it automatically.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:36:06 +02:00
Bjorn Andersson 8dfdd2a842 power: reset: syscon-reboot-mode: Use managed resource API
Use the managed resource version of reboot_mode_register().

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:29:34 +02:00
Bjorn Andersson c1a9634f1a power: reset: reboot-mode: Add managed resource API
Provide managed resource version of reboot_mode_register() and
reboot_mode_unregister() to simplify implementations.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-16 00:29:22 +02:00
Joshua Clayton 957cb72051 sbs-battery: add ability to get battery capacity
Battery capacity level is a standard feature of sbs battery
That can be used to tell what the remainig battery capacity is, and
can tell if the battery has not been calibrated/initialized, which makes
the capacity and charging/discharging percentages invalid.

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-15 23:14:55 +02:00
Wei Yongjun 33e7664a0a power_supply: tps65217-charger: fix missing platform_set_drvdata()
Add missing platform_set_drvdata() in tps65217_charger_probe(), otherwise
calling platform_get_drvdata() in remove returns NULL.

This is detected by Coccinelle semantic patch.

Fixes: 3636859b28 ("power_supply: Add support for tps65217-charger")
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-15 23:10:44 +02:00
Phil Reid 492ff9d8f5 power: sbs-battery: Use devm_power_supply_register
Use devm_power_supply_register instead of power_supply_register.
Remove call to power_supply_unregister.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
2016-08-15 21:51:30 +02:00