aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-09-05power: supply: bq24735-charger: Request status GPIO with initial input setupPaul Kocialkowski2-31/+12
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-09-01power: supply: sbs-battery: Use gpio_desc and sleeping calls for battery detectPhil Reid2-71/+34
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-09-01power: supply: act8945a_charger: Add max current propertyWenyou Yang1-9/+80
Add the power supply's current max property, POWER_SUPPLY_PROP_CURRENT_MAX. Signed-off-by: Wenyou Yang <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-09-01power: supply: act8945a_charger: Add capacity level propertyWenyou Yang1-1/+78
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-31doc: bindings: power: act8945a-charger: Update properties.Wenyou Yang1-9/+22
Due the driver improvements, update the properties, - Remove "active-semi,check-battery-temperature" property. - Add the properties, "active-semi,irq_gpio" and "active-semi,lbo-gpios". - As act8945a-charger is regarded as a sub-device, update the compatible and examples. Signed-off-by: Wenyou Yang <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-31power: supply: act8945a_charger: Fix the power supply typeWenyou Yang1-9/+39
The power supply type property is varying as the external power supply changes. It is not a constant. Signed-off-by: Wenyou Yang <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-31power: supply: act8945a_charger: Add status change update supportWenyou Yang1-7/+88
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-31power: supply: act8945a_charger: Improve state handlingWenyou Yang1-16/+70
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 <[email protected]> Signed-off-by: Fengguang Wu <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-31power: supply: act8945a_charger: Remove "battery_temperature"Wenyou Yang1-9/+3
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-31power: supply: act8945a_charger: Achieve properties from its nodeWenyou Yang1-2/+2
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-31MAINTAINERS: Remove power-supply co-maintainersSebastian Reichel2-4/+4
This documents the status quo and keeps everyones cc/to-list a bit shorter. Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-31MAINTAINERS: update power-supply git-treeSebastian Reichel1-2/+2
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 <[email protected]>
2016-08-29power: bq24735-charger: Assume not charging when charger is missingPaul Kocialkowski1-1/+5
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-17power: supply: Change Krzysztof Kozlowski's email to kernel.orgKrzysztof Kozlowski3-8/+8
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16Merge tag 'for-v4.8-rc' into psy-nextSebastian Reichel4-8/+15
Power Supply Fixes for 4.8 cycle
2016-08-16power: ds2760_battery: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar1-1/+2
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16power: ab8500_fg: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar1-1/+1
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16power: ipaq_micro_battery: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar1-1/+1
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16power: ab8500_charger: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar1-2/+2
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16power: intel_mid_battery: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar1-2/+1
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16power: pm2301_charger: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar1-1/+2
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16power: ab8500_btemp: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar1-1/+1
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16power: abx500_chargalg: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar1-2/+2
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16power: axp288_charger: remove duplicated include from axp288_charger.cWei Yongjun1-1/+0
Remove duplicated include. Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16power: axp288_fuel_gauge: remove duplicated include from axp288_fuel_gauge.cWei Yongjun1-1/+0
Remove duplicated include. Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16power: z2_battery: remove .owner field for driverWei Yongjun1-1/+0
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16power: reset: syscon-reboot-mode: Use managed resource APIBjorn Andersson1-11/+1
Use the managed resource version of reboot_mode_register(). Signed-off-by: Bjorn Andersson <[email protected]> Tested-by: John Stultz <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-16power: reset: reboot-mode: Add managed resource APIBjorn Andersson3-0/+67
Provide managed resource version of reboot_mode_register() and reboot_mode_unregister() to simplify implementations. Signed-off-by: Bjorn Andersson <[email protected]> Tested-by: John Stultz <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-15sbs-battery: add ability to get battery capacityJoshua Clayton1-1/+22
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-15power_supply: tps65217-charger: fix missing platform_set_drvdata()Wei Yongjun1-0/+1
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-15power: sbs-battery: Use devm_power_supply_registerPhil Reid1-3/+1
Use devm_power_supply_register instead of power_supply_register. Remove call to power_supply_unregister. Signed-off-by: Phil Reid <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-15power: sbs-battery: Request threaded irq and fix dev callback cookiePhil Reid1-10/+4
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-15power: sbs-battery: Use devm_kzalloc to alloc dataPhil Reid1-6/+1
Use devm_kzalloc to allow memory to be freed automatically on driver probe failure or removal. Signed-off-by: Phil Reid <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-15power:bq27xxx: 27000/10 read FLAGS register as singleH. Nikolaus Schaller1-2/+3
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 <[email protected]> Acked-by: Pali Rohár <[email protected]> Acked-by: Andrew F. Davis <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-15power_supply: tps65217-charger: Add support for IRQsMarcin Niestroj1-7/+33
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-12power: reset: hisi-reboot: Unmap region obtained by of_iomapArvind Yadav1-1/+4
Free memory mapping, if probe is not successful. Fixes: 4a9b37371822 ("power: reset: move hisilicon reboot code") Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-12power: reset: reboot-mode: fix build error of missing ioremap/iounmap on UMAndy Yan1-1/+1
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 <[email protected]> Fixes: 4fcd504edbf7("power: reset: add reboot mode driver") Signed-off-by: Andy Yan <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-12power: supply: max17042_battery: fix model download bug.Sven Van Asbroeck1-6/+9
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 <[email protected]> Signed-off-by: Sven Van Asbroeck <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2016-08-11power/supply: unify DT documentationSebastian Reichel35-2/+1
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 <[email protected]>
2016-08-11power: move power supply drivers to power/supplySebastian Reichel81-616/+624
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 <[email protected]>
2016-08-07Linux 4.8-rc1Linus Torvalds1-2/+2
2016-08-07Merge branch 'for-linus' of git://git.kernel.dk/linux-blockLinus Torvalds62-213/+213
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
2016-08-07Merge tag 'drm-for-v4.8-zpos' of git://people.freedesktop.org/~airlied/linuxLinus Torvalds22-156/+334
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
2016-08-07block: rename bio bi_rw to bi_opfJens Axboe51-157/+158
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 <[email protected]>
2016-08-07target: iblock_execute_sync_cache() should use bio_set_op_attrs()Jens Axboe1-1/+1
The original commit missed this function, it needs to mark it a write flush. Cc: Mike Christie <[email protected]> Fixes: e742fc32fcb4 ("target: use bio op accessors") Signed-off-by: Jens Axboe <[email protected]>
2016-08-07mm: make __swap_writepage() use bio_set_op_attrs()Jens Axboe1-2/+3
Cleaner than manipulating bio->bi_rw flags directly. Signed-off-by: Jens Axboe <[email protected]>
2016-08-07block/mm: make bdev_ops->rw_page() take a bool for read/writeJens Axboe11-53/+51
Commit abf545484d31 changed it from an 'rw' flags type to the newer ops based interface, but now we're effectively leaking some bdev internals to the rest of the kernel. Since we only care about whether it's a read or a write at that level, just pass in a bool 'is_write' parameter instead. Then we can also move op_is_write() and friends back under CONFIG_BLOCK protection. Reviewed-by: Mike Christie <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2016-08-07Merge tag 'doc-4.8-fixes' of git://git.lwn.net/linuxLinus Torvalds16-34/+31
Pull documentation fixes from Jonathan Corbet: "Three fixes for the docs build, including removing an annoying warning on 'make help' if sphinx isn't present" * tag 'doc-4.8-fixes' of git://git.lwn.net/linux: DocBook: use DOCBOOKS="" to ignore DocBooks instead of IGNORE_DOCBOOKS=1 Documenation: update cgroup's document path Documentation/sphinx: do not warn about missing tools in 'make help'
2016-08-07Merge tag 'binfmt-for-linus' of ↵Linus Torvalds4-2/+67
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/binfmt_misc Pull binfmt_misc update from James Bottomley: "This update is to allow architecture emulation containers to function such that the emulation binary can be housed outside the container itself. The container and fs parts both have acks from relevant experts. To use the new feature you have to add an F option to your binfmt_misc configuration" From the docs: "The usual behaviour of binfmt_misc is to spawn the binary lazily when the misc format file is invoked. However, this doesn't work very well in the face of mount namespaces and changeroots, so the F mode opens the binary as soon as the emulation is installed and uses the opened image to spawn the emulator, meaning it is always available once installed, regardless of how the environment changes" * tag 'binfmt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/binfmt_misc: binfmt_misc: add F option description to documentation binfmt_misc: add persistent opened binary handler for containers fs: add filp_clone_open API
2016-08-07fs: return EPERM on immutable inodeEryu Guan4-4/+5
In most cases, EPERM is returned on immutable inode, and there're only a few places returning EACCES. I noticed this when running LTP on overlayfs, setxattr03 failed due to unexpected EACCES on immutable inode. So converting all EACCES to EPERM on immutable inode. Acked-by: Dave Chinner <[email protected]> Signed-off-by: Eryu Guan <[email protected]> Signed-off-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>