31 Aug, 2016
6 commits
-
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
Signed-off-by: Sebastian Reichel -
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
Signed-off-by: Fengguang Wu
Signed-off-by: Sebastian Reichel -
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
Signed-off-by: Sebastian Reichel -
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
Signed-off-by: Sebastian Reichel -
This documents the status quo and keeps everyones
cc/to-list a bit shorter.Signed-off-by: Sebastian Reichel
-
When I took over the power-supply tree, its git tree was
hosted on git.infradead.org. Since a few kernel releases I
also maintain a copy of the repository on git.kernel.org,
that is prefered by Linus, so let's switch over officially.Signed-off-By: Sebastian Reichel
29 Aug, 2016
1 commit
-
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
Signed-off-by: Sebastian Reichel
17 Aug, 2016
1 commit
-
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
Signed-off-by: Sebastian Reichel
16 Aug, 2016
21 commits
-
Power Supply Fixes for 4.8 cycle
-
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
Signed-off-by: Sebastian Reichel -
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
Signed-off-by: Sebastian Reichel -
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
Signed-off-by: Sebastian Reichel -
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
Signed-off-by: Sebastian Reichel -
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
Signed-off-by: Sebastian Reichel -
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
Signed-off-by: Sebastian Reichel -
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
Signed-off-by: Sebastian Reichel -
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
Signed-off-by: Sebastian Reichel -
Remove duplicated include.
Signed-off-by: Wei Yongjun
Acked-by: Chen-Yu Tsai
Signed-off-by: Sebastian Reichel -
Remove duplicated include.
Signed-off-by: Wei Yongjun
Acked-by: Chen-Yu Tsai
Signed-off-by: Sebastian Reichel -
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
Signed-off-by: Sebastian Reichel -
Use the managed resource version of reboot_mode_register().
Signed-off-by: Bjorn Andersson
Tested-by: John Stultz
Signed-off-by: Sebastian Reichel -
Provide managed resource version of reboot_mode_register() and
reboot_mode_unregister() to simplify implementations.Signed-off-by: Bjorn Andersson
Tested-by: John Stultz
Signed-off-by: Sebastian Reichel -
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
Signed-off-by: Sebastian Reichel -
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: 3636859b280c ("power_supply: Add support for tps65217-charger")
Signed-off-by: Wei Yongjun
Signed-off-by: Sebastian Reichel -
Use devm_power_supply_register instead of power_supply_register.
Remove call to power_supply_unregister.Signed-off-by: Phil Reid
Signed-off-by: Sebastian Reichel -
Currently the battery detect gpio can not be used with a chained interrupt
controller that requires threaded irq handlers. Use threaded irq instead.
In addition this was not going to be working at present because
chip->power_supply is assigned after the request irq call.Signed-off-by: Phil Reid
Signed-off-by: Sebastian Reichel -
Use devm_kzalloc to allow memory to be freed automatically on
driver probe failure or removal.Signed-off-by: Phil Reid
Signed-off-by: Sebastian Reichel -
The bq27000 and bq27010 have a single byte FLAGS register.
Other gauges have 16 bit FLAGS registers.For reading the FLAGS register it is sufficient to read the single
register instead of reading RSOC at the next higher address as
well and then ignore the high byte.This does not change functionality but optimizes i2c and hdq
traffic.Signed-off-by: H. Nikolaus Schaller
Acked-by: Pali Rohár
Acked-by: Andrew F. Davis
Signed-off-by: Sebastian Reichel -
Make use of IRQ resources defined in tps65217 mfd code. If they are valid
we use them instead separate poll task, in order to define AC power state.Signed-off-by: Marcin Niestroj
Signed-off-by: Sebastian Reichel
13 Aug, 2016
3 commits
-
Free memory mapping, if probe is not successful.
Fixes: 4a9b37371822 ("power: reset: move hisilicon reboot code")
Signed-off-by: Arvind Yadav
Signed-off-by: Sebastian Reichel -
commit 4fcd504edbf7 ("power: reset: add reboot mode driver") uses api from
syscon, and syscon uses ioremap/iounmap which depends on HAS_IOMEM, so
let's depend on MFD_SYSCON instead of selecting it directly to avoid the
um-allyesconfig like build error on archs that without iomem:drivers/mfd/syscon.c: In function 'of_syscon_register':
drivers/mfd/syscon.c:67:9: error: implicit declaration of function 'ioremap' [-Werror=implicit-function-declaration]
base = ioremap(res.start, resource_size(&res));
^
drivers/mfd/syscon.c:67:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
base = ioremap(res.start, resource_size(&res));
^
drivers/mfd/syscon.c:109:2: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
iounmap(base);
^Reported-by: Kbuild test robot
Fixes: 4fcd504edbf7("power: reset: add reboot mode driver")
Signed-off-by: Andy Yan
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Sebastian Reichel -
The device's model download function returns the model data as
an array of u32s, which is later compared to the reference
model data. However, since the latter is an array of u16s,
the comparison does not happen correctly, and model verification
fails. This in turn breaks the POR initialization sequence.Fixes: 39e7213edc4f3 ("max17042_battery: Support regmap to access device's registers")
Reported-by: Dan Carpenter
Signed-off-by: Sven Van Asbroeck
Reviewed-by: Krzysztof Kozlowski
Signed-off-by: Sebastian Reichel
11 Aug, 2016
2 commits
-
Currently the power supply device tree documentation is spread
in .../bindings/power_supply and .../bindings/power. This
unifies the files for chargers and battery fuel gauges in
.../bindings/power/supply and the ones for system reset/shutdown
in .../bindings/power/reset (same structure as used for the
drivers itself).Signed-off-by: Sebastian Reichel
-
This moves all power supply drivers from drivers/power/
to drivers/power/supply/. The intention is a cleaner
source tree, since drivers/power/ also contains frameworks
unrelated to power supply, like adaptive voltage scaling.Signed-off-by: Sebastian Reichel
08 Aug, 2016
6 commits
-
Pull more block fixes from Jens Axboe:
"As mentioned in the pull the other day, a few more fixes for this
round, all related to the bio op changes in this series.Two fixes, and then a cleanup, renaming bio->bi_rw to bio->bi_opf. I
wanted to do that change right after or right before -rc1, so that
risk of conflict was reduced. I just rebased the series on top of
current master, and no new ->bi_rw usage has snuck in"* 'for-linus' of git://git.kernel.dk/linux-block:
block: rename bio bi_rw to bi_opf
target: iblock_execute_sync_cache() should use bio_set_op_attrs()
mm: make __swap_writepage() use bio_set_op_attrs()
block/mm: make bdev_ops->rw_page() take a bool for read/write -
Pull drm zpos property support from Dave Airlie:
"This tree was waiting on some media stuff I hadn't had time to get a
stable branchpoint off, so I just waited until it was all in your tree
first.It's been around a bit on the list and shouldn't affect anything
outside adding the generic API and moving some ARM drivers to using
it"* tag 'drm-for-v4.8-zpos' of git://people.freedesktop.org/~airlied/linux:
drm: rcar: use generic code for managing zpos plane property
drm/exynos: use generic code for managing zpos plane property
drm: sti: use generic zpos for plane
drm: add generic zpos property -
Since commit 63a4cc24867d, bio->bi_rw contains flags in the lower
portion and the op code in the higher portions. This means that
old code that relies on manually setting bi_rw is most likely
going to be broken. Instead of letting that brokeness linger,
rename the member, to force old and out-of-tree code to break
at compile time instead of at runtime.No intended functional changes in this commit.
Signed-off-by: Jens Axboe
-
The original commit missed this function, it needs to mark it a
write flush.Cc: Mike Christie
Fixes: e742fc32fcb4 ("target: use bio op accessors")
Signed-off-by: Jens Axboe -
Cleaner than manipulating bio->bi_rw flags directly.
Signed-off-by: Jens Axboe