summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/max14656_charger_detector.c
AgeCommit message (Collapse)Author
2019-07-15Merge tag 'for-v5.3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: "Core: - add HWMON compat layer - new properties: - input power limit - input voltage limit Drivers: - qcom-pon: add gen2 support - new driver for storing reboot move in NVMEM - new driver for Wilco EC charger configuration - simplify getting the adapter of a client" * tag 'for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power: reset: nvmem-reboot-mode: add CONFIG_OF dependency power_supply: wilco_ec: Add charging config driver power: supply: cros: allow to set input voltage and current limit power: supply: add input power and voltage limit properties power: supply: fix semicolon.cocci warnings power: reset: nvmem-reboot-mode: use NVMEM as reboot mode write interface dt-bindings: power: reset: add document for NVMEM based reboot-mode reset: qcom-pon: Add support for gen2 pon dt-bindings: power: reset: qcom: Add qcom,pm8998-pon compatibility line power: supply: Add HWMON compatibility layer power: supply: sbs-manager: simplify getting the adapter of a client power: supply: rt9455_charger: simplify getting the adapter of a client power: supply: rt5033_battery: simplify getting the adapter of a client power: supply: max17042_battery: simplify getting the adapter of a client power: supply: max17040_battery: simplify getting the adapter of a client power: supply: max14656_charger_detector: simplify getting the adapter of a client power: supply: bq25890_charger: simplify getting the adapter of a client power: supply: bq24257_charger: simplify getting the adapter of a client power: supply: bq24190_charger: simplify getting the adapter of a client
2019-06-23power: supply: max14656_charger_detector: simplify getting the adapter of a ↵Wolfram Sang
client We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 455Thomas Gleixner
Based on 1 normalized pattern(s): this package is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 and only version 2 as published by the free software foundation extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 1 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Enrico Weigelt <info@metux.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081201.371541790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-05power: supply: max14656: fix potential use-after-freeSven Van Asbroeck
Explicitly cancel/sync the irq_work delayed work, otherwise there's a chance that it will run after the device is removed, which would result in a use-after-free. Note that cancel/sync should happen: - after irq's have been disabled, as the isr re-schedules the work - before the power supply is unregistered, because the work func uses the power supply handle. Cc: Alexander Kurz <akurz@blala.de> Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-04-05power: supply: max14656: fix potential use-before-allocSven Van Asbroeck
Call order on probe(): - max14656_hw_init() enables interrupts on the chip - devm_request_irq() starts processing interrupts, isr could be called immediately - isr: schedules delayed work (irq_work) - irq_work: calls power_supply_changed() - devm_power_supply_register() registers the power supply Depending on timing, it's possible that power_supply_changed() is called on an unregistered power supply structure. Fix by registering the power supply before requesting the irq. Cc: Alexander Kurz <akurz@blala.de> Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2017-01-29power: supply: max14656: Export I2C and OF device ID as module aliasesJavier Martinez Canillas
If the driver is built as a module, I2C module alias information is not filled so the module won't be autoloaded. Export the I2C and OF devices ID to the module by using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/power/supply/max14656_charger_detector.ko | grep alias $ After this patch: $ modinfo drivers/power/supply/max14656_charger_detector.ko | grep alias alias: i2c:max14656 alias: of:N*T*Cmaxim,max14656C* alias: of:N*T*Cmaxim,max14656 Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2017-01-17power: supply: max14656: fix platform_no_drv_owner.cocci warningskbuild test robot
drivers/power/supply/max14656_charger_detector.c:317:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci CC: Alexander Kurz <akurz@blala.de> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
2017-01-16power: supply: Add support for MAX14656 USB charger detectorAlexander Kurz
The MAX14656 USB charger detector, also known as "AL32" is used to detect the presence and capabilities of attached USB chargers. The device is attached via I2C plus one interrupt line to signalize events. The device can be found in LG smartphones like LS665 and LS770, compatible devices are present in 4th/5th generation Amazon Kindle readers referenced in source code packages as "Maxim AL32". The initial version of this driver has been extracted from LG source code package LGLS665_Android_Lollipop_LS665ZV3, enriched with information from the Kindle_src_4.1.3 source code package and adapted to the current power class sysfs interface. Non-Standard Apple chargers which the device may detect are mapped to the USB Battery Charging Specification Revision 1.2 class USB_DCP. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sebastian Reichel <sre@kernel.org>