summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/Kconfig
AgeCommit message (Collapse)Author
2020-10-04power: supply: bq25980: Add support for the BQ259xx familyDan Murphy
Add support for the BQ25980, BQ25975 and BQ25960 family of flash chargers. Signed-off-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-03power: supply: max17040: Support compatible devicesIskren Chernev
The max17040 fuel gauge is part of a family of 8 chips that have very similar mode of operations and registers. This change adds: - compatible strings for all supported devices and handling for the minor differences between them; - handling for devices reporting double capacity via maxim,double-soc; The datasheets of the supported devices are linked [0] [1] [2] [3]. [0] https://datasheets.maximintegrated.com/en/ds/MAX17040-MAX17041.pdf [1] https://datasheets.maximintegrated.com/en/ds/MAX17043-MAX17044.pdf [2] https://datasheets.maximintegrated.com/en/ds/MAX17048-MAX17049.pdf [3] https://datasheets.maximintegrated.com/en/ds/MAX17058-MAX17059.pdf Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com> Tested-by: Jonathan Bakker <xc-racer2@live.ca> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-03power: supply: max17040: Use regmap i2cIskren Chernev
Rewrite i2c operations from i2c client read/write to regmap i2c. As a result, most private functions now accept the private driver data instead of an i2c client pointer. Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com> Tested-by: Jonathan Bakker <xc-racer2@live.ca> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-08-28power: supply: Add support for RN5T618/RC5T619 charger and fuel gaugeAndreas Kemnade
Both chips have charger and a fuel gauge. This adds basic support for displaying the state of the battery and the input power, settings are not modified. There are some defaults set via OTP. Charging also starts after plugging USB. Known issues of the fuel gauge: There are drivers in the wild which disable the fuel gauge at shutdown. If a kernel is booted without fuel gauge support, after such a driver has been used, the fuel gauge will stay off and decalibrate. If this driver is used after that, it might display wrong values for charge level. Signed-off-by: Andreas Kemnade <andreas@kemnade.info> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-08-25power: supply: smb347-charger: Support SMB345 and SMB358David Heidelberg
SMB345 tested on Nexus 7 2013. Based on: - https://patchwork.kernel.org/patch/4922431/ - https://patchwork.ozlabs.org/patch/666877/ Signed-off-by: David Heidelberg <david@ixit.cz> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-08-25power: supply: Add dependency to lego-ev3-battery Kconfig optionsAlex Dewar
This battery appears only to be used by a single board (DA850), so it makes sense to add this to the Kconfig file so that users don't build the module unnecessarily. It currently seems to be built for the x86 Arch Linux kernel where it's probably not doing much good. Signed-off-by: Alex Dewar <alex.dewar90@gmail.com> Acked-by: David Lechner <david@lechnology.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-07-21power: supply: bq25150 introduce the bq25150Ricardo Rivera-Matos
Introduce the bq2515x family of chargers. The BQ2515X family of devices are highly integrated battery management ICs that integrate the most common functions for wearable devices namely a charger, an output voltage rail, ADC for battery and system monitoring, and a push-button controller. Datasheets: bq25150 - http://www.ti.com/lit/ds/symlink/bq25150.pdf bq25155 - http://www.ti.com/lit/ds/symlink/bq25155.pdf Signed-off-by: Ricardo Rivera-Matos <r-rivera-matos@ti.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-05-28Merge tag 'tags/ib-mfd-iio-power-v5.8' into psy-nextSebastian Reichel
This merges the MP2629 battery charge management immutable branch between MFD, IIO and power-supply due for the v5.8 merge window into power-supply for-next branch. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-05-26power: supply: Add support for mps mp2629 battery chargerSaravanan Sekar
The mp2629 provides switching-mode battery charge management for single-cell Li-ion or Li-polymer battery. Driver supports the access/control input source and battery charging parameters. Signed-off-by: Saravanan Sekar <sravanhome@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2020-05-10power: supply: KConfig cleanup default nMatti Vaittinen
The "default n" is not needed as it is, well, default. Clean the KConfig by removing "default n". Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-05-10power: supply: Fix Kconfig help text indentiationMatti Vaittinen
Indent the help text as explained in Documentation/process/coding-style.rst Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-05-10power: supply: Support ROHM bd99954 chargerMatti Vaittinen
The ROHM BD99954 is a Battery Management LSI for 1-4 cell Lithium-Ion secondary battery intended to be used in space-constraint equipment such as Low profile Notebook PC, Tablets and other applications. BD99954 provides a Dual-source Battery Charger, two port BC1.2 detection and a Battery Monitor. Support ROHM BD99954 Charger IC. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-05-10power: supply: bd70528: use linear rangesMatti Vaittinen
Change the bd70528 to use common linear_range code instead of implementing a copy of it in this driver. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-05-03power: supply: add CellWise cw2015 fuel gauge driverTobias Schramm
This patch adds a driver for the CellWise cw2015 fuel gauge. The CellWise cw2015 is a shuntless, single-cell Li-Ion fuel gauge used in the pine64 Pinebook Pro laptop and some Raspberry Pi UPS HATs. Signed-off-by: Tobias Schramm <t.schramm@manjaro.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-04-13power: supply: bq24257_charger: Replace depends on REGMAP_I2C with selectEnric Balletbo i Serra
regmap is a library function that gets selected by drivers that need it. No driver modules should depend on it. Depending on REGMAP_I2C makes this driver only build if another driver already selected REGMAP_I2C, as the symbol can't be selected through the menu kernel configuration. Fixes: 2219a935963e ("power_supply: Add TI BQ24257 charger driver") Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-04-08Merge tag 'tag-chrome-platform-for-v5.7' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform updates from Benson Leung: cros-usbpd-notify and cros_ec_typec: - Add a new notification driver that handles and dispatches USB PD related events to other drivers. - Add a Type C connector class driver for cros_ec CrOS EC: - Introduce a new cros_ec_cmd_xfer_status helper Sensors/iio: - A series from Gwendal that adds Cros EC sensor hub FIFO support Wilco EC: - Fix a build warning. - Platform data shouldn't include kernel.h Misc: - i2c api conversion complete, with i2c_new_client_device instead of i2c_new_device in chromeos_laptop. - Replace zero-length array with flexible-array member in cros_ec_chardev and wilco_ec - Update new structure for SPI transfer delays in cros_ec_spi * tag 'tag-chrome-platform-for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: (34 commits) platform/chrome: cros_ec_spi: Wait for USECS, not NSECS iio: cros_ec: Use Hertz as unit for sampling frequency iio: cros_ec: Report hwfifo_watermark_max iio: cros_ec: Expose hwfifo_timeout iio: cros_ec: Remove pm function iio: cros_ec: Register to cros_ec_sensorhub when EC supports FIFO iio: expose iio_device_set_clock iio: cros_ec: Move function description to .c file platform/chrome: cros_ec_sensorhub: Add median filter platform/chrome: cros_ec_sensorhub: Add code to spread timestmap platform/chrome: cros_ec_sensorhub: Add FIFO support platform/chrome: cros_ec_sensorhub: Add the number of sensors in sensorhub platform/chrome: chromeos_laptop: make I2C API conversion complete platform/chrome: wilco_ec: event: Replace zero-length array with flexible-array member platform/chrome: cros_ec_chardev: Replace zero-length array with flexible-array member platform/chrome: cros_ec_typec: Update port info from EC platform/chrome: Add Type C connector class driver platform/chrome: cros_usbpd_notify: Pull PD_HOST_EVENT status platform/chrome: cros_usbpd_notify: Amend ACPI driver to plat platform/chrome: cros_usbpd_notify: Add driver data struct ...
2020-03-06power: supply: Allow charger manager can be built as a moduleBaolin Wang
Allow charger manager can be built as a module like other charger drivers. Signed-off-by: Baolin Wang <baolin.wang7@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-02-10power: supply: cros-ec-usbpd-charger: Fix host eventsJon Flatley
There's a bug on ACPI platforms where host events from the ECPD ACPI device never make their way to the cros-ec-usbpd-charger driver. This makes it so the only time the charger driver updates its state is when user space accesses its sysfs attributes. Now that these events have been unified into a single notifier chain on both ACPI and non-ACPI platforms, update the charger driver to use this new notifier. Reviewed-by: Benson Leung <bleung@chromium.org> Co-Developed-by: Prashant Malani <pmalani@chromium.org> Signed-off-by: Jon Flatley <jflat@chromium.org> Signed-off-by: Prashant Malani <pmalani@chromium.org> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Benson Leung <bleung@chromium.org>
2019-12-19power: supply: Fix Kconfig indentationKrzysztof Kozlowski
Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-10-18power: supply: ab8500_btemp: Convert to IIO ADCLinus Walleij
This switches the AB8500 battery temperature driver to using the standard IIO ADC channel lookup and conversion routines. Acked-by: Sebastian Reichel <sre@kernel.org> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-09-22Merge tag 'mips_5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linuxLinus Torvalds
Pull MIPS updates from Paul Burton: "Main MIPS changes: - boot_mem_map is removed, providing a nice cleanup made possible by the recent removal of bootmem. - Some fixes to atomics, in general providing compiler barriers for smp_mb__{before,after}_atomic plus fixes specific to Loongson CPUs or MIPS32 systems using cmpxchg64(). - Conversion to the new generic VDSO infrastructure courtesy of Vincenzo Frascino. - Removal of undefined behavior in set_io_port_base(), fixing the behavior of some MIPS kernel configurations when built with recent clang versions. - Initial MIPS32 huge page support, functional on at least Ingenic SoCs. - pte_special() is now supported for some configurations, allowing among other things generic fast GUP to be used. - Miscellaneous fixes & cleanups. And platform specific changes: - Major improvements to Ingenic SoC support from Paul Cercueil, mostly enabled by the inclusion of the new TCU (timer-counter unit) drivers he's spent a very patient year or so working on. Plus some fixes for X1000 SoCs from Zhou Yanjie. - Netgear R6200 v1 systems are now supported by the bcm47xx platform. - DT updates for BMIPS, Lantiq & Microsemi Ocelot systems" * tag 'mips_5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (89 commits) MIPS: Detect bad _PFN_SHIFT values MIPS: Disable pte_special() for MIPS32 with RiXi MIPS: ralink: deactivate PCI support for SOC_MT7621 mips: compat: vdso: Use legacy syscalls as fallback MIPS: Drop Loongson _CACHE_* definitions MIPS: tlbex: Remove cpu_has_local_ebase MIPS: tlbex: Simplify r3k check MIPS: Select R3k-style TLB in Kconfig MIPS: PCI: refactor ioc3 special handling mips: remove ioremap_cachable mips/atomic: Fix smp_mb__{before,after}_atomic() mips/atomic: Fix loongson_llsc_mb() wreckage mips/atomic: Fix cmpxchg64 barriers MIPS: Octeon: remove duplicated include from dma-octeon.c firmware: bcm47xx_nvram: Allow COMPILE_TEST firmware: bcm47xx_nvram: Correct size_t printf format MIPS: Treat Loongson Extensions as ASEs MIPS: Remove dev_err() usage after platform_get_irq() MIPS: dts: mscc: describe the PTP ready interrupt MIPS: dts: mscc: describe the PTP register range ...
2019-09-02mfd / platform: cros_ec: Move cros-ec core driver out from MFDEnric Balletbo i Serra
Now, the ChromeOS EC core driver has nothing related to an MFD device, so move that driver from the MFD subsystem to the platform/chrome subsystem. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Thierry Reding <thierry.reding@gmail.com> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> Acked-by: Chanwoo Choi <cw00.choi@samsung.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-07-30power/supply: Drop obsolete JZ4740 driverPaul Cercueil
It has been replaced with the more mature ingenic-battery driver. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Tested-by: Artur Rojek <contact@artur-rojek.eu> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Paul Burton <paul.burton@mips.com>
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-07-15Merge tag 'mfd-next-5.3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Set 'struct device' fwnode when registering a new device New Drivers: - Add support for ROHM BD70528 PMIC New Device Support: - Add support for LP87561 4-Phase Regulator to TI LP87565 PMIC - Add support for RK809 and RK817 to Rockchip RK808 - Add support for Lid Angle to ChromeOS core - Add support for CS47L15 CODEC to Madera core - Add support for CS47L92 CODEC to Madera core - Add support for ChromeOS (legacy) Accelerometers in ChromeOS core - Add support for Add Intel Elkhart Lake PCH to Intel LPSS New Functionality: - Provide regulator supply information when registering; madera-core - Additional Device Tree support; lp87565, madera, cros-ec, rohm,bd71837-pmic - Allow over-riding power button press via Device Tree; rohm-bd718x7 - Differentiate between running processors; cros_ec_dev Fix-ups: - Big header file update; cros_ec_commands.h - Split header per-subsystem; rohm-bd718x7 - Remove superfluous code; menelaus, cs5535-mfd, cs47lXX-tables - Trivial; sorting, coding style; intel-lpss-pci - Only remove Power Off functionality if set locally; rk808 - Make use for Power Off Prepare(); rk808 - Fix spelling mistake in header guards; stmfx - Properly free IDA resources - SPDX fixups; cs47lXX-tables, madera - Error path fixups; hi655x-pmic Bug Fixes: - Add missing break in case() statement - Repair undefined behaviour when not initialising variables; arizona-core, madera-core - Fix reference to Device Tree documentation; madera" * tag 'mfd-next-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (45 commits) mfd: hi655x-pmic: Fix missing return value check for devm_regmap_init_mmio_clk mfd: madera: Fixup SPDX headers mfd: madera: Remove some unused registers and fix some defaults mfd: intel-lpss: Release IDA resources mfd: intel-lpss: Add Intel Elkhart Lake PCH PCI IDs mfd: cs5535-mfd: Remove ifdef OLPC noise mfd: stmfx: Fix macro definition spelling dt-bindings: mfd: Add link to ROHM BD71847 Datasheet MAINAINERS: Swap words in INTEL PMIC MULTIFUNCTION DEVICE DRIVERS mfd: cros_ec_dev: Register cros_ec_accel_legacy driver as a subdevice mfd: rk808: Prepare rk805 for poweroff mfd: rk808: Check pm_power_off pointer mfd: cros_ec: differentiate SCP from EC by feature bit dt-bindings: Add binding for cros-ec-rpmsg mfd: madera: Add Madera core support for CS47L92 mfd: madera: Add Madera core support for CS47L15 mfd: madera: Update DT bindings to add additional CODECs mfd: madera: Add supply mapping for MICVDD mfd: madera: Fix potential uninitialised use of variable mfd: madera: Fix bad reference to pinctrl.txt file ...
2019-07-14Merge tag 'platform-drivers-x86-v5.3-1' of ↵Linus Torvalds
git://git.infradead.org/linux-platform-drivers-x86 Pull x86 platform driver updates from Andy Shevchenko: "Gathered a bunch of x86 platform driver changes. It's rather big, since includes two big refactors and completely new driver: - ASUS WMI driver got a big refactoring in order to support the TUF Gaming laptops. Besides that, the regression with backlight being permanently off on various EeePC laptops has been fixed. - Accelerometer on HP ProBook 450 G0 shows wrong measurements due to X axis being inverted. This has been fixed. - Intel PMC core driver has been extended to be ACPI enumerated if the DSDT provides device with _HID "INT33A1". This allows to convert the driver to be pure platform and support new hardware purely based on ACPI DSDT. - From now on the Intel Speed Select Technology is supported thru a corresponding driver. This driver provides an access to the features of the ISST, such as Performance Profile, Core Power, Base frequency and Turbo Frequency. - Mellanox platform drivers has been refactored and now extended to support more systems, including new coming ones. - The OLPC XO-1.75 platform is now supported. - CB4063 Beckhoff Automation board is using PMC clocks, provided via pmc_atom driver, for ethernet controllers in a way that they can't be managed by the clock driver. The quirk has been extended to cover this case. - Touchscreen on Chuwi Hi10 Plus tablet has been enabled. Meanwhile the information of Chuwi Hi10 Air has been fixed to cover more models based on the same platform. - Xiaomi notebooks have WMI interface enabled. Thus, the driver to support it has been provided. It required some extension of the generic WMI library, which allows to propagate opaque context to the ->probe() of the individual drivers. This release includes debugfs clean up from Greg KH for several drivers that drop return code check and make debugfs absence or failure non-fatal. Also miscellaneous fixes here and there, mostly for Acer WMI and various Intel drivers" * tag 'platform-drivers-x86-v5.3-1' of git://git.infradead.org/linux-platform-drivers-x86: (74 commits) platform/x86: Fix PCENGINES_APU2 Kconfig warning tools/power/x86/intel-speed-select: Add .gitignore file platform/x86: mlx-platform: Fix error handling in mlxplat_init() platform/x86: intel_pmc_core: Attach using APCI HID "INT33A1" platform/x86: intel_pmc_core: transform Pkg C-state residency from TSC ticks into microseconds platform/x86: asus-wmi: Use dev_get_drvdata() Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces platform/x86: mlx-platform: Add more reset cause attributes platform/x86: mlx-platform: Modify DMI matching order platform/x86: mlx-platform: Add regmap structure for the next generation systems platform/x86: mlx-platform: Change API for i2c-mlxcpld driver activation platform/x86: mlx-platform: Move regmap initialization before all drivers activation MAINTAINERS: Update for Intel Speed Select Technology tools/power/x86: A tool to validate Intel Speed Select commands platform/x86: ISST: Restore state on resume platform/x86: ISST: Add Intel Speed Select PUNIT MSR interface platform/x86: ISST: Add Intel Speed Select mailbox interface via MSRs platform/x86: ISST: Add Intel Speed Select mailbox interface via PCI platform/x86: ISST: Add Intel Speed Select mmio interface platform/x86: ISST: Add IOCTL to Translate Linux logical CPU to PUNIT CPU number ...
2019-07-05power_supply: wilco_ec: Add charging config driverNick Crews
Add a driver to control the charging algorithm used on Wilco devices. See Documentation/ABI/testing/sysfs-class-power-wilco for the userspace interface and other info. Signed-off-by: Nick Crews <ncrews@chromium.org> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-06-27power: supply: Initial support for ROHM BD70528 PMIC charger blockMatti Vaittinen
ROHM BD70528 PMIC includes battery charger block. Support charger staus queries and doing few basic settings like input current limit and charging current. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-06-23power: supply: Add HWMON compatibility layerAndrey Smirnov
Add code implementing HWMON adapter/compatibility layer to allow expositing various sensors present on power supply devices via HWMON subsystem. This is done in order to allow userspace to use single ABI/library(libsensors) to access/manipulate all of the sensors of the system. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Chris Healy <cphealy@gmail.com> Cc: Chris Healy <cphealy@gmail.com> Cc: Cory Tusar <cory.tusar@zii.aero> Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Sebastian Reichel <sre@kernel.org> Cc: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-20power: supply: olpc_battery: Allow building the driver on non-x86Lubomir Rintel
With the recent changes to the driver and addition of OLPC XO-1.75 EC driver it is possible to use this driver on ARM-based XO laptops as well. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-05-15Merge tag 'for-v5.2' 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 over-current health state - Add standard, adaptive and custom charge types - Add new properties for start/end charge threshold New Drivers / Hardware: - UCS1002 Programmable USB Port Power Controller - Ingenic JZ47xx Battery Fuel Gauge - AXP20x USB Power: Add AXP813 support - AT91 poweroff: Add SAM9X60 support - OLPC battery: Add XO-1.5 and XO-1.75 support Misc Changes: - syscon-reboot: support mask property - AXP288 fuel gauge: Blacklist ACEPC T8/T11. Looks like some vendor thought it's a good idea to build a desktop system with a fuel gauge, that slowly "discharges"... - cpcap-battery: Fix calculation errors - misc fixes" * tag 'for-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (54 commits) power: supply: olpc_battery: force the le/be casts power: supply: ucs1002: Fix build error without CONFIG_REGULATOR power: supply: ucs1002: Fix wrong return value checking power: supply: Add driver for Microchip UCS1002 dt-bindings: power: supply: Add bindings for Microchip UCS1002 power: supply: core: Add POWER_SUPPLY_HEALTH_OVERCURRENT constant power: supply: core: fix clang -Wunsequenced power: supply: core: Add missing documentation for CHARGE_CONTROL_* properties power: supply: core: Add CHARGE_CONTROL_{START_THRESHOLD,END_THRESHOLD} properties power: supply: core: Add Standard, Adaptive, and Custom charge types power: supply: axp288_fuel_gauge: Add ACEPC T8 and T11 mini PCs to the blacklist power: supply: bq27xxx_battery: Notify also about status changes power: supply: olpc_battery: Have the framework register sysfs files for us power: supply: olpc_battery: Add OLPC XO 1.75 support power: supply: olpc_battery: Avoid using platform_info power: supply: olpc_battery: Use devm_power_supply_register() power: supply: olpc_battery: Move priv data to a struct power: supply: olpc_battery: Use DT to get battery version x86/platform/olpc: Use a correct version when making up a battery node x86/platform/olpc: Trivial code move in DT fixup ...
2019-05-10power: supply: ucs1002: Fix build error without CONFIG_REGULATORYueHaibing
Fix gcc build error while CONFIG_REGULATOR is not set drivers/power/supply/ucs1002_power.o: In function `ucs1002_probe': drivers/power/supply/ucs1002_power.c:593: undefined reference to `devm_regulator_register' drivers/power/supply/ucs1002_power.o:(.rodata+0x3b8): undefined reference to `regulator_enable_regmap' drivers/power/supply/ucs1002_power.o:(.rodata+0x3c0): undefined reference to `regulator_disable_regmap' drivers/power/supply/ucs1002_power.o:(.rodata+0x3c8): undefined reference to `regulator_is_enabled_regmap' Add Kconfig dependency to CONFIG_REGULATOR. Reported-by: Hulk Robot <hulkci@huawei.com> Fixes: 9a2688e42638 ("power: supply: Add driver for Microchip UCS1002") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-05-08power: supply: max77650: Add support for battery chargerBartosz Golaszewski
Add basic support for the battery charger for max77650 PMIC. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-05-03power: supply: Add driver for Microchip UCS1002Andrey Smirnov
Add driver for Microchip UCS1002 Programmable USB Port Power Controller with Charger Emulation. The driver exposed a power supply device to control/monitor various parameter of the device as well as a regulator to allow controlling VBUS line. Signed-off-by: Enric Balletbo Serra <enric.balletbo@collabora.com> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Cc: Chris Healy <cphealy@gmail.com> Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-04-18power: supply: add Ingenic JZ47xx battery driver.Artur Rojek
Add a driver for battery present on Ingenic JZ47xx SoCs. Signed-off-by: Artur Rojek <contact@artur-rojek.eu> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-04-10power: supply: ltc3651-charger: Fix device nameMichael Hennerich
There never was a device called LTC3651, it always was just LT3651. This circumstance makes it pretty difficult to identify what this driver is meant to control.channges since Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-11-13power/supply: fix sc27xx_fuel_gauge build errorsRandy Dunlap
Fix build errors when FUEL_GUAGE_SC27XX is enabled but IIO is either not enabled or IIO=m and FUEL_GUAGE_SC27XX=y. ld: drivers/power/supply/sc27xx_fuel_gauge.o: in function `sc27xx_fgu_get_temp': sc27xx_fuel_gauge.c:(.text+0x1d2): undefined reference to `iio_read_channel_processed' ld: drivers/power/supply/sc27xx_fuel_gauge.o: in function `sc27xx_fgu_probe': sc27xx_fuel_gauge.c:(.text+0x97f): undefined reference to `devm_iio_channel_get' Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: linux-pm@vger.kernel.org Acked-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-11-09power: supply: Add Spreadtrum SC27XX fuel gauge unit driverBaolin Wang
This patch adds the Spreadtrum SC27XX serial PMICs fuel gauge support, which is used to calculate the battery capacity. Original-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-09-20power: supply: Add Spreadtrum SC2731 charger supportBaolin Wang
This patch adds the SC2731 PMIC switch charger support. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-07-22Merge tag 'ds2760-for-v4.19-signed' into psy-nextSebastian Reichel
Immutable branch for moving ds2760 driver from w1 to power supply Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-07-11power: supply: ds2760_battery: merge ds2760 supply driver with its w1 slave ↵Daniel Mack
companion This patch removes the w1 slave driver that used to register the w1 family and instanciate a platform device at runtime. The code now lives in the supply driver instead to avoid that level of indirection. The old device name "ds2760-battery.0" is preserved, so userspace applications can access the same virtual device nodes as before. Note that because the w1 core does not currently have a framework for suspend/resume, the driver now registers a PM notifier callback. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-07-06adp5061: New driver for ADP5061 I2C battery chargerStefan Popa
This patch adds basic support for Analog Devices I2C programmable linear battery charger. With this driver, some parameters can be read and configured such as: * trickle charge current level (PRECHARGE_CURRENT) * trickle charge voltage threshold (VOLTAGE_MIN) * weak charge threshold (VOLTAGE_AVG) * constant current (CONSTANT_CHARGE_CURRENT) * constant charge voltage limit (CONSTANT_CHARGE_VOLTAGE_MAX) * battery full (CAPACITY_LEVEL) * input current limit (INPUT_CURRENT_LIMIT) * charger status (STATUS) * battery status (CAPACITY_LEVEL) * termination current (CHARGE_TERM_CURRENT) Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/ADP5061.pdf Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2018-07-05power: supply: add cros-ec USBPD charger driver.Sameer Nanda
This driver gets various bits of information about what is connected to USB PD ports from the EC and converts that into power_supply properties. Signed-off-by: Sameer Nanda <snanda@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-11-15Merge branch 'for-linus' of ↵Linus Torvalds
ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina: "The usual rocket-science from trivial tree for 4.15" * 'for-linus' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: MAINTAINERS: relinquish kconfig MAINTAINERS: Update my email address treewide: Fix typos in Kconfig kfifo: Fix comments init/Kconfig: Fix module signing document location misc: ibmasm: Return error on error path HID: logitech-hidpp: fix mistake in printk, "feeback" -> "feedback" MAINTAINERS: Correct path to uDraw PS3 driver tracing: Fix doc mistakes in trace sample tracing: Kconfig text fixes for CONFIG_HWLAT_TRACER MIPS: Alchemy: Remove reverted CONFIG_NETLINK_MMAP from db1xxx_defconfig mm/huge_memory.c: fixup grammar in comment lib/xz: Add fall-through comments to a switch statement
2017-10-28power: supply: sbs-manager: Add alert callback and battery change notificationPhil Reid
This adds smb alert support via the smbus_alert driver to generate power_supply_changed notifications when either external power is removed / applied or a battery inserted / removed. Use the i2c alert callback to notify the attached battery driver that a change has occurred. Signed-off-by: Phil Reid <preid@electromag.com.au> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-10-28power: Adds support for Smart Battery System ManagerKarl-Heinz Schneider
This patch adds support for Smart Battery System Manager. A SBSM is a device listening at I2C/SMBus address 0x0a and is capable of communicating up to four I2C smart battery devices. All smart battery devices are listening at address 0x0b, so the SBSM muliplexes between them. The driver makes use of the I2C-Mux framework to allow smart batteries to be bound via device tree, i.e. the sbs-battery driver. Via sysfs interface the online state and charge type are presented. If the driver is bound as ltc1760 (an implementation of a Dual Smart Battery System Manager) the charge type can also be changed from trickle to fast. Signed-off-by: Karl-Heinz Schneider <karl-heinz@schneider-inet.de> Signed-off-by: Phil Reid <preid@electromag.com.au> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-10-12treewide: Fix typos in KconfigMasanari Iida
This patch fixes some spelling typos found in Kconfig files. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-07-25Merge branch 'psy-w1-for-v4.14-immutable' into for-nextSebastian Reichel
Merge immutable branch moving bq27000 driver from w1 subsystem into power-supply subsystem. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-07-25power: supply: move HDQ interface for bq27xxx from w1 to power/supplyAndrew F. Davis
The HDQ interface driver should be in this folder just like the I2C interface driver. Move this driver out of drivers/w1/slave and into drivers/power/supply. Signed-off-by: Andrew F. Davis <afd@ti.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>