aboutsummaryrefslogtreecommitdiff
path: root/drivers/power/supply/Kconfig
AgeCommit message (Collapse)AuthorFilesLines
2024-07-23Merge tag 'for-v6.11' of ↵Linus Torvalds1-0/+21
git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: "Power-supply core: - new charging_orange_full_green RGB LED trigger - simplify and cleanup power-supply LED trigger code - expose power information via hwmon compatibility layer New hardware support: - enable battery support for Qualcomm Snapdragon X Elite - new battery driver for Maxim MAX17201/MAX17205 - new battery driver for Lenovo Yoga C630 laptop (custom EC) Cleanups: - cleanup 'struct i2c_device_id' initializations - misc small battery driver cleanups and fixes" * tag 'for-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power: supply: sysfs: use power_supply_property_is_writeable() power: supply: qcom_battmgr: Enable battery support on x1e80100 power: supply: add support for MAX1720x standalone fuel gauge dt-bindings: power: supply: add support for MAX17201/MAX17205 fuel gauge power: reset: piix4: add missing MODULE_DESCRIPTION() macro power: supply: samsung-sdi-battery: Constify struct power_supply_maintenance_charge_table power: supply: samsung-sdi-battery: Constify struct power_supply_vbat_ri_table power: supply: lenovo_yoga_c630_battery: add Lenovo C630 driver power: supply: ingenic: Fix some error handling paths in ingenic_battery_get_property() power: supply: ab8500: Clean some error messages power: supply: ab8500: Use iio_read_channel_processed_scale() power: supply: ab8500: Fix error handling when calling iio_read_channel_processed() power: supply: hwmon: Add support for power sensors power: supply: ab8500: remove unused struct 'inst_curr_result_list' power: supply: bd99954: remove unused struct 'battery_data' power: supply: leds: Add activate() callback to triggers power: supply: leds: Share trig pointer for online and charging_full power: supply: leds: Add power_supply_[un]register_led_trigger() power: supply: Drop explicit initialization of struct i2c_device_id::driver_data to 0
2024-07-04power: supply: add support for MAX1720x standalone fuel gaugeDimitri Fedrau1-0/+12
The MAX17201 monitors a single cell pack. The MAX17205 monitors and balances a 2S or 3S pack or monitors a multiple-series cell pack. Both devices use a I2C interface. Signed-off-by: Dimitri Fedrau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2024-07-01power: supply: add ChromeOS EC based charge control driverThomas Weißschuh1-0/+12
The ChromeOS Embedded Controller implements a command to control charge thresholds and behaviour. Use it to implement the standard Linux charge_control_start_threshold, charge_control_end_threshold and charge_behaviour sysfs UAPIs. The driver is designed to be probed via the cros_ec mfd device. Acked-by: Sebastian Reichel <[email protected]> Signed-off-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
2024-06-26power: supply: lenovo_yoga_c630_battery: add Lenovo C630 driverDmitry Baryshkov1-0/+9
On the Lenovo Yoga C630 WOS laptop the EC provides access to the adapter and battery status. Add the driver to read power supply status on the laptop. Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2024-02-12power: supply: mm8013: select REGMAP_I2CThomas Weißschuh1-0/+1
The driver uses regmap APIs so it should make sure they are available. Fixes: c75f4bf6800b ("power: supply: Introduce MM8013 fuel gauge driver") Cc: <[email protected]> Signed-off-by: Thomas Weißschuh <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2023-10-21Merge power-supply fixes for 6.6 cycleSebastian Reichel1-0/+1
Merge power-supply fixes for the 6.6 cycle, so that changes to the vexpress driver apply cleanly. Signed-off-by: Sebastian Reichel <[email protected]>
2023-09-19power: supply: pm8916_lbc: observe EXTCON config settingRandy Dunlap1-0/+1
When CONFIG_EXTCON=m and CONFIG_CHARGER_PM8916_LBC=y, there are build errors. Fix them by having CHARGER_PM8916_LBC depend on the setting of EXTCON. aarch64-linux-ld: drivers/power/supply/pm8916_lbc.o: in function `pm8916_lbc_charger_state_changed_irq': pm8916_lbc.c:(.text+0xe8): undefined reference to `extcon_set_state_sync' aarch64-linux-ld: drivers/power/supply/pm8916_lbc.o: in function `pm8916_lbc_charger_probe': pm8916_lbc.c:(.text+0x638): undefined reference to `devm_extcon_dev_allocate' aarch64-linux-ld: pm8916_lbc.c:(.text+0x650): undefined reference to `devm_extcon_dev_register' aarch64-linux-ld: pm8916_lbc.c:(.text+0x688): undefined reference to `extcon_set_state_sync' Fixes: f8d7a3d21160 ("power: supply: Add driver for pm8916 lbc") Signed-off-by: Randy Dunlap <[email protected]> Cc: Nikita Travkin <[email protected]> Cc: Sebastian Reichel <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2023-09-15power: supply: Add driver for pm8916 lbcNikita Travkin1-0/+11
pm8916 LBC is a Linear Battery Charger hardware block in pm8916 PMIC. This block implements simple CC/CV charging for Li-Po batteries. The hardware has internal state machine to switch between modes and works mostly autonomously, only needing the limits and targets to be set to operate. This driver allows setting limits and enabling the LBC block, monitoring it's state. Signed-off-by: Nikita Travkin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2023-09-15power: supply: Add pm8916 VM-BMS supportNikita Travkin1-0/+11
This driver adds basic support for VM-BMS found in pm8916. VM-BMS is a very basic fuel-gauge hardware block that is, sadly, incapable of any gauging. The hardware supports measuring OCV in sleep mode, where the battery is not in use, or measuring average voltage over time when the device is active. This driver implements basic value readout from this block. Signed-off-by: Nikita Travkin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2023-09-15power: supply: Introduce MM8013 fuel gauge driverKonrad Dybcio1-0/+9
Add a driver for the Mitsumi MM8013 fuel gauge. The driver is a vastly cleaned up and improved version of the one that shipped in some obscure Lenovo downstream kernel [1], with some register definitions borrowed from ChromeOS EC platform code [2]. [1] https://github.com/adazem009/kernel_lenovo_bengal/commit/b6b346427a871715709bd22aae449b9383f3b66b [2] https://chromium.googlesource.com/chromiumos/platform/ec/+/master/driver/battery/mm8013.h Signed-off-by: Konrad Dybcio <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2023-09-14power: max17040: get thermal data from adc if availableSvyatoslav Ryhel1-1/+1
Since fuel gauge does not support thermal monitoring, some vendors may couple this fuel gauge with thermal/adc sensor to monitor battery cell exact temperature. Add this feature by adding optional iio thermal channel. Signed-off-by: Svyatoslav Ryhel <[email protected]> Reviewed-by: Iskren Chernev <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2023-09-12power: supply: rt5033_charger: recognize EXTCON settingRandy Dunlap1-0/+1
CHARGER_RT5033 should honor the EXTCON setting to prevent these build errors: riscv64-linux-ld: drivers/power/supply/rt5033_charger.o: in function `.L33': rt5033_charger.c:(.text.rt5033_charger_probe+0x578): undefined reference to `extcon_find_edev_by_node' riscv64-linux-ld: drivers/power/supply/rt5033_charger.o: in function `.L0 ': rt5033_charger.c:(.text.rt5033_charger_probe+0x64e): undefined reference to `devm_extcon_register_notifier_all' riscv64-linux-ld: drivers/power/supply/rt5033_charger.o: in function `.L96': rt5033_charger.c:(.text.rt5033_charger_extcon_work+0x32): undefined reference to `extcon_get_state' Fixes: 12cc585f36b8 ("power: supply: rt5033_charger: Add cable detection and USB OTG supply") Signed-off-by: Randy Dunlap <[email protected]> Cc: Jakob Hauser <[email protected]> Cc: Sebastian Reichel <[email protected]> Cc: Lee Jones <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2023-07-03Merge tag 'for-v6.5' of ↵Linus Torvalds1-0/+9
git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: - Add new Qualcomm PMI8998/PM660 SMB2 charger - bq256xx: support systems without thermistors - cros_pchg: fix peripheral device status after system resume - axp20x_usb_power: add support for AXP192 - qcom-pon: add support for pm8941 - at91-reset: prepare to expose reset reason to sysfs - switch all I2C drivers back to use .probe instead of .probe_new - convert some more DT bindings to YAML - misc cleanups * tag 'for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (28 commits) MAINTAINERS: add documentation file for Microchip SAMA5D2 shutdown controller dt-bindings: power: reset: atmel,sama5d2-shdwc: convert to yaml dt-bindings: power: reset: atmel,at91sam9260-shdwc: convert to yaml power: reset: at91-reset: change the power on reason prototype power: reset: qcom-pon: add support for pm8941-pon dt-bindings: power: reset: qcom-pon: define pm8941-pon power: supply: add Qualcomm PMI8998 SMB2 Charger driver dt-bindings: power: supply: qcom,pmi8998-charger: add bindings for smb2 driver power: supply: rt9467: Make charger-enable control as logic level power: supply: Switch i2c drivers back to use .probe() power: reset: add HAS_IOPORT dependencies dt-bindings: power: supply: axp20x: Add AXP192 compatible power: supply: axp20x_usb_power: Add support for AXP192 power: supply: axp20x_usb_power: Remove variant IDs from VBUS polling check power: supply: axp20x_usb_power: Use regmap field for VBUS disabling power: supply: axp20x_usb_power: Use regmap fields for USB BC feature power: supply: axp20x_usb_power: Use regmap fields for VBUS monitor feature power: supply: axp20x_usb_power: Simplify USB current limit handling power: supply: hwmon: constify pointers to hwmon_channel_info power: supply: twl4030_madc_battery: Refactor twl4030_madc_bat_ext_changed() ...
2023-06-15Merge branches 'tb-mfd-clk-input-pinctrl-power-rtc-sound-6.5', ↵Lee Jones1-0/+8
'ib-mfd-tps6594-core-6.5', 'ib-mfd-regulator-max5970-6.5', 'ib-mfd-regulator-6.5' and 'ib-mfd-power-6.5' into ibs-for-mfd-merged
2023-06-09power: supply: add Qualcomm PMI8998 SMB2 Charger driverCaleb Connolly1-0/+9
Add a driver for the SMB2 charger block found in the Qualcomm PMI8998 and PM660. This driver is capable of utilising Qualcomm's Automatic Power Source Detection (APSD) BC1.2 implementation, as well as Automatic Input Current Limiting (AICL) to configure the maximum input current limit of DCP (wall) chargers. Quick Charge is not currently supported. Most devices using the smb2 charger have a secondary dedicated charger chip which is used in parallel to enable faster charger without overheating. However, not all do, as a result to ensure safety until these are supported, the maximum current is limited to ~1A via the FAST_CHARGE_CURRENT_CFG register. Signed-off-by: Caleb Connolly <[email protected]> Tested-by: Joel Selvaraj <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2023-06-08power: supply: rt5033_charger: Add RT5033 charger device driverJakob Hauser1-0/+8
This patch adds device driver of Richtek RT5033 PMIC. The driver supports switching charger. rt5033 charger provides three charging modes. The charging modes are pre-charge mode, fast charge mode and constant voltage mode. They vary in charge rate, the charge parameters can be controlled by i2c interface. Tested-by: Raymond Hackley <[email protected]> Signed-off-by: Jakob Hauser <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Acked-by: Sebastian Reichel <[email protected]> Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/9556d4ebb30fd321e37aa0eb343554122e4720c9.1684182964.git.jahau@rocketmail.com
2023-05-15mfd: rk808: Split into core and i2cSebastian Reichel1-1/+1
Split rk808 into a core and an i2c part in preparation for SPI support. Acked-by: Alexandre Belloni <[email protected]> # for RTC Tested-by: Diederik de Haas <[email protected]> # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll <[email protected]> # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
2023-02-27Merge tag 'soc-drivers-6.3' of ↵Linus Torvalds1-0/+9
git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC driver updates from Arnd Bergmann: "As usual, there are lots of minor driver changes across SoC platforms from NXP, Amlogic, AMD Zynq, Mediatek, Qualcomm, Apple and Samsung. These usually add support for additional chip variations in existing drivers, but also add features or bugfixes. The SCMI firmware subsystem gains a unified raw userspace interface through debugfs, which can be used for validation purposes. Newly added drivers include: - New power management drivers for StarFive JH7110, Allwinner D1 and Renesas RZ/V2M - A driver for Qualcomm battery and power supply status - A SoC device driver for identifying Nuvoton WPCM450 chips - A regulator coupler driver for Mediatek MT81xxv" * tag 'soc-drivers-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (165 commits) power: supply: Introduce Qualcomm PMIC GLINK power supply soc: apple: rtkit: Do not copy the reg state structure to the stack soc: sunxi: SUN20I_PPU should depend on PM memory: renesas-rpc-if: Remove redundant division of dummy soc: qcom: socinfo: Add IDs for IPQ5332 and its variant dt-bindings: arm: qcom,ids: Add IDs for IPQ5332 and its variant dt-bindings: power: qcom,rpmpd: add RPMH_REGULATOR_LEVEL_LOW_SVS_L1 firmware: qcom_scm: Move qcom_scm.h to include/linux/firmware/qcom/ MAINTAINERS: Update qcom CPR maintainer entry dt-bindings: firmware: document Qualcomm SM8550 SCM dt-bindings: firmware: qcom,scm: add qcom,scm-sa8775p compatible soc: qcom: socinfo: Add Soc IDs for IPQ8064 and variants dt-bindings: arm: qcom,ids: Add Soc IDs for IPQ8064 and variants soc: qcom: socinfo: Add support for new field in revision 17 soc: qcom: smd-rpm: Add IPQ9574 compatible soc: qcom: pmic_glink: remove redundant calculation of svid soc: qcom: stats: Populate all subsystem debugfs files dt-bindings: soc: qcom,rpmh-rsc: Update to allow for generic nodes soc: qcom: pmic_glink: add CONFIG_NET/CONFIG_OF dependencies soc: qcom: pmic_glink: Introduce altmode support ...
2023-02-24Merge tag 'for-v6.3' of ↵Linus Torvalds1-0/+35
git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: "Nothing special for the power-supply subystem this time. - power-supply core: remove faulty cooling logic - convert all sysfs show() handlers from *printf() use sysfs_emit() - bq25890: add dual-charger support required by Lenovo Yoga Tab 3 Pro - bq27xxx: fix reporting critical level - syscon-reboot: add priority property support - new rt9467 charger driver - new rt9471 charger driver - new Odroid Go Ultra poweroff driver - misc minor fixes and cleanups" * tag 'for-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (32 commits) power: reset: odroid-go-ultra: fix I2C dependency power: supply: leds: explicitly include linux/leds.h dt-bindings: power: supply: pm8941-coincell: Don't require charging properties dt-bindings: power: supply: pm8941-coincell: Add PM8998 compatible power: reset: add Odroid Go Ultra poweroff driver power: supply: rt9467: Fix spelling mistake "attache" -> "attach" power: supply: rt9471: fix using wrong ce_gpio in rt9471_probe() power: supply: max77650: Make max77650_charger_disable() return void Documentation: power: rt9467: Document exported sysfs entries power: supply: rt9467: Add Richtek RT9467 charger driver dt-bindings: power: supply: Add Richtek RT9467 battery charger Documentation: power: rt9471: Document exported sysfs entries power: supply: rt9471: Add Richtek RT9471 charger driver dt-bindings: power: supply: Add Richtek RT9471 battery charger power: supply: max1721x: Use strscpy() is more robust and safer power: supply: test-power: use strscpy() instead of strncpy() power: supply: bq27xxx: fix reporting critical level power: supply: bq256xx: Init ichg/vbat value with chip default value power: supply: collie_battery: Convert to GPIO descriptors (part 2) power: supply: remove faulty cooling logic ...
2023-02-13power: supply: Introduce Qualcomm PMIC GLINK power supplyBjorn Andersson1-0/+9
The PMIC GLINK service, running on a coprocessor of modern Qualcomm platforms, deals with battery charging and fuel gauging, as well as reporting status of AC and wireless power supplies. As this is just one of the functionalities provided by the PMIC GLINK service, this power supply driver is implemented as an auxilirary bus driver, spawned by the main "pmic glink" driver when the PMIC GLINK service is detected. Signed-off-by: Bjorn Andersson <[email protected]> Tested-by: Konrad Dybcio <[email protected]> # SM8350 PDX215 Reviewed-by: Neil Armstrong <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8550-MTP & SM8450-HDK Signed-off-by: Bjorn Andersson <[email protected]> Acked-by: Sebastian Reichel <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2023-02-03power: supply: rt9467: Add Richtek RT9467 charger driverChiaEn Wu1-0/+19
RT9467 is a switch-mode single cell Li-Ion/Li-Polymer battery charger for portable applications. It integrates a synchronous PWM controller, power MOSFETs, input current sensing and regulation, high-accuracy voltage regulation, and charge termination. The charge current is regulated through integrated sensing resistors. The RT9467 also features USB On-The-Go (OTG) support. It also integrates D+/D- pin for USB host/charging port detection. Co-developed-by: ChiYuan Huang <[email protected]> Signed-off-by: ChiYuan Huang <[email protected]> Signed-off-by: ChiaEn Wu <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2023-02-03power: supply: rt9471: Add Richtek RT9471 charger driverChiYuan Huang1-0/+16
Add support for the RT9471 3A 1-Cell Li+ battery charger. The RT9471 is a highly-integrated 3A switch mode battery charger with low impedance power path to better optimize the charging efficiency. Co-developed-by: Alina Yu <[email protected]> Signed-off-by: Alina Yu <[email protected]> Signed-off-by: ChiYuan Huang <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2023-02-01power: remove pda_power supply driverArnd Bergmann1-9/+0
This driver was used for a couple of Intel PXA and Samsung S3C24xx based PDAs, but all of those are now removed from the kernel, so the driver itself is no longer useful. Cc: Anton Vorontsov <[email protected]> Cc: [email protected] Acked-by: Sebastian Reichel <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
2023-01-20power: remove tosa_battery driverArnd Bergmann1-7/+0
The PXA tosa machine is removed, so this driver is no longer in use. Cc: [email protected] Acked-by: Sebastian Reichel <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
2023-01-20power: remove z2_battery driverArnd Bergmann1-6/+0
The PXA z2 platform is gone, and this driver is now orphaned. Cc: [email protected] Cc: Peter Edwards <[email protected]> Acked-by: Sebastian Reichel <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
2023-01-16power: remove s3c adc battery driverArnd Bergmann1-6/+0
The s3c-adc driver is removed along with the s3c24xx platform, so the battery driver is no longer needed either. Reviewed-by: Krzysztof Kozlowski <[email protected]> Acked-by: Sebastian Reichel <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
2022-10-07Merge tag 'for-v6.1' of ↵Linus Torvalds1-0/+15
git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: - new maintenance charging documentation - mt6370: new charger driver - bq25890: support input current limit - added Qualcomm PMK8350 PON support - misc minor fixes * tag 'for-v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (22 commits) power: supply: ab8500: remove unused static local variable power: supply: mt6370: Fix return value check in mt6370_chg_probe() power: supply: ab8500: Remove unused struct ab8500_chargalg_sysfs_entry power: supply: mt6370: uses IIO interfaces, depends on IIO power: supply: max1721x: Fix spelling mistake "Gauage" -> "Gauge" power: supply: mt6370: Add MediaTek MT6370 charger driver dt-bindings: power: supply: Add MediaTek MT6370 Charger lib: add linear range index macro power: supply: bq25890: Fix enum conversion in bq25890_power_supply_set_property() power: supply: bq27xxx: fix NULL vs 0 warnings power: supply: bq27xxx: fix __be16 warnings power: supply: bq25890: Add support for setting IINLIM power: supply: bq25890: Disable PUMPX_EN on errors power: supply: Fix repeated word in comments power: supply: adp5061: show unknown capacity_level as text power: supply: adp5061: fix out-of-bounds read in adp5061_get_chg_type() power: supply: tps65217: Fix comments typo power: reset: qcom-pon: add support for qcom,pmk8350-pon compatible string dt-bindings: power: reset: qcom-pon: Add new compatible "qcom,pmk8350-pon" power: supply: cw2015: Use device managed API to simplify the code ...
2022-10-01power: supply: mt6370: uses IIO interfaces, depends on IIORandy Dunlap1-0/+1
The mt6370-charger driver uses IIO interfaces and produces build errors when CONFIG_IIO is not set, so it should depend on IIO. ERROR: modpost: "iio_read_channel_processed" [drivers/power/supply/mt6370-charger.ko] undefined! ERROR: modpost: "devm_iio_channel_get_all" [drivers/power/supply/mt6370-charger.ko] undefined! Fixes: 233cb8a47d65 ("power: supply: mt6370: Add MediaTek MT6370 charger driver") Signed-off-by: Randy Dunlap <[email protected]> Cc: ChiaEn Wu <[email protected]> Cc: Sebastian Reichel <[email protected]> Cc: [email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2022-09-28power: supply: Add charger driver for Rockchip RK817Chris Morgan1-0/+6
Add support for the Rockchip rk817 battery charger integrated into the rk817 PMIC. Signed-off-by: Chris Morgan <[email protected]> Signed-off-by: Maya Matuszczyk <[email protected]> Acked-by: Sebastian Reichel <[email protected]> Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2022-09-16power: supply: mt6370: Add MediaTek MT6370 charger driverChiaEn Wu1-0/+14
MediaTek MT6370 is a SubPMIC consisting of a single cell battery charger with ADC monitoring, RGB LEDs, dual channel flashlight, WLED backlight driver, display bias voltage supply, one general purpose LDO, and the USB Type-C & PD controller complies with the latest USB Type-C and PD standards. Add support for the MediaTek MT6370 Charger driver. The charger module of MT6370 supports High-Accuracy Voltage/Current Regulation, Average Input Current Regulation, Battery Temperature Sensing, Over-Temperature Protection, DPDM Detection for BC1.2. Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: ChiaEn Wu <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2022-03-04power: supply: Add a driver for Injoinic power bank ICsSamuel Holland1-0/+8
This driver supports several chip variants which all share the same I2C register interface. Since the chip will turn off and become inaccessible under conditions outside of software control (e.g. upon button press or input voltage removal), some special handling is needed to delay the initialization of the IC until it is accessible. Signed-off-by: Samuel Holland <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2022-03-04power: supply: Static data for Samsung batteriesLinus Walleij1-0/+6
If we detect a Samsung SDI battery, we return a static struct power_supply_battery_info and avoid looking further. Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2022-02-25power: supply: axp288_fuel_gauge: Use acpi_quirk_skip_acpi_ac_and_battery()Hans de Goede1-1/+1
Normally the native AXP288 fg/charger drivers are preferred but one some devices the ACPI drivers should be used instead. The ACPI battery/ac drivers use the acpi_quirk_skip_acpi_ac_and_battery() helper to determine if they should skip loading because native fuel-gauge/ charger drivers like the AXP288 drivers will be used. The new acpi_quirk_skip_acpi_ac_and_battery() helper includes a list of exceptions for boards where the ACPI drivers should be used instead. Use this new helper to avoid loading on such boards. Note this requires adding a Kconfig dependency on ACPI, this is not a problem because ACPI should be enabled on all boards with an AXP288 PMIC anyways. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2022-02-25power: supply: axp288_charger: Use acpi_quirk_skip_acpi_ac_and_battery()Hans de Goede1-1/+1
Normally the native AXP288 fg/charger drivers are preferred but one some devices the ACPI drivers should be used instead. The ACPI battery/ac drivers use the acpi_quirk_skip_acpi_ac_and_battery() helper to determine if they should skip loading because native fuel-gauge/ charger drivers like the AXP288 drivers will be used. The new acpi_quirk_skip_acpi_ac_and_battery() helper includes a list of exceptions for boards where the ACPI drivers should be used instead. Use this new helper to avoid loading on such boards. Note this requires adding a Kconfig dependency on ACPI, this is not a problem because ACPI should be enabled on all boards with an AXP288 PMIC anyways. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2022-02-11power: supply: ab8500: Integrate thermal zoneLinus Walleij1-0/+2
Instead of providing our own homebrewn thermal measurement code for an NTC and passing tables, we put the NTC thermistor into the device tree, create a passive thermal zone, and poll this thermal zone for the temperature. Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2022-02-11power: supply: ug3105_battery: Add driver for uPI uG3105 battery monitorHans de Goede1-0/+15
Add a new battery driver for the uPI uG3105 battery monitor. Note the uG3105 is not a full-featured autonomous fuel-gauge. Instead it is expected to be use in combination with some always on microcontroller reading its coulomb-counter before it can wrap (must be read every 400 seconds!). Since Linux does not monitor coulomb-counter changes while the device is off or suspended, the coulomb counter is not used atm. So far this driver is only used on x86/ACPI (non devicetree) devs (also note there is no of_match table). Therefor there is no devicetree bindings documentation for this driver's "upisemi,rsns-microohm" property since this is not used in actual devicetree files and the dt bindings maintainers have requested properties with no actual dt users to _not_ be added to the dt bindings. The property's name has been chosen so that it should not need to be changed if/when devicetree enumeration support gets added later, as it mirrors "maxim,rsns-microohm" from the "maxim,max17042" bindings. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-11-16power: supply: max77976: add Maxim MAX77976 charger driverLuca Ceresoli1-0/+12
Add support for the MAX77976 3.5/5.5A 1-Cell Li+ Battery Charger. This is a simple implementation enough to be used as a simple battery charger without OTG and boost. Signed-off-by: Luca Ceresoli <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-10-18power: supply: axp288-charger: Add depends on IOSF_MBIO to KconfigHans de Goede1-1/+1
Add "depends on IOSF_MBI" to CONFIG_AXP288_CHARGER as the changes from commit ed229454856e ("power: supply: axp288-charger: Optimize register reading method") use symbols which are only defined when IOSF_MBI support is enabled. Depending on this is ok since IOSF_MBI support should always be enabled on devices which use the AXP288 PMIC. Fixes: ed229454856e ("power: supply: axp288-charger: Optimize register reading method") Reported-by: kernel test robot <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-09-24power: supply: max17042: extend help/descriptionKrzysztof Kozlowski1-3/+6
Reorganize the Kconfig driver description and mention all supported models. This helps when choosing drivers for given system. Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-09-24power: supply: max17040: extend help/descriptionKrzysztof Kozlowski1-5/+7
Reorganize the Kconfig driver description and mention all supported models. This helps when choosing drivers for given system. Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-08-16power: supply: smb347-charger: Implement USB VBUS regulatorDmitry Osipenko1-0/+1
SMB347 can supply power to USB VBUS, implement the USB VBUS regulator. USB VBUS needs to be powered for switching OTG-cable USB port into host mode. Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-08-13Merge tag 'ib-mt6360-for-5.15-signed' into psy-nextSebastian Reichel1-0/+11
Immutable branch between regulator and power-supply for for 5.15 This immutable branch introduces the MT6360 charger driver, which requires a new linear range helper. Signed-off-by: Sebastian Reichel <[email protected]>
2021-08-13power: supply: rn5t618: Add voltage_now propertyAndreas Kemnade1-0/+2
Read voltage_now via IIO and provide the property. Signed-off-by: Andreas Kemnade <[email protected]> Reported-by: kernel test robot <[email protected]> # missing depends on IIO Acked-by: Jonathan Cameron <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-08-13power: supply: mt6360_charger: add MT6360 charger supportGene Chen1-0/+11
Add basic support for the battery charger for MT6360 PMIC Signed-off-by: Gene Chen <[email protected]> Reviewed-by: Matti Vaittinen <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-08-05power: supply: axp288_fuel_gauge: Refresh all registers in one goAndrejus Basovas1-1/+1
The I2C-bus to the XPower AXP288 is shared between the Linux kernel and the SoCs P-Unit. The P-Unit has a semaphore which the kernel must "lock" before it may use the bus and while the kernel holds the semaphore the CPU and GPU power-states must not be changed otherwise the system will freeze. This is a complex process, which is quite expensive. This is all done by iosf_mbi_block_punit_i2c_access(). To ensure that no unguarded I2C-bus accesses happen, iosf_mbi_block_punit_i2c_access() gets called by the I2C-bus-driver for every I2C transfer. Because this is so expensive it is allowed to call iosf_mbi_block_punit_i2c_access() in a nested fashion, so that higher-level code which does multiple I2C-transfers can call it once for a group of transfers, turning the calls done by the I2C-bus-driver into no-ops. Userspace power-supply API users typically will read all provided properties in one go, refreshing the last read values when power_supply_changed() is called by the driver and/or periodically (e.g. every 2 minutes). The reading of all properties in one go causes the P-Unit semaphore to quickly be taken and released multiple times in a row. Certain PMIC registers like AXP20X_FG_RES are even used in multiple properties so they get read multiple times, leading to a P-Unit take + release each time the register is read. As already mentioned the taking of the P-Unit semaphore is a quite expensive operation and it has also been reported that the "hammering" of the P-Unit semaphore done by the axp288_fuel_gauge driver can even cause stability issues with the system as a whole. Switch over to a scheme where the axp288_fuel_gauge driver keeps a local copy of all the registers which it uses for properties and make it only refresh its copy of the registers if the values are older then 1 minute; or when a fuel-gauge interrupt has triggered since the last read. This not only reduces the amount of reads, it also makes the code do all the reads in one go, rather then reading specific registers based on which property is being queried. This allows calling iosf_mbi_block_punit_i2c_access() once before doing all the reads, so that we now only take the P-Unit semaphore once per update. Tested-by: Andrejus Basovas <[email protected]> Signed-off-by: Andrejus Basovas <[email protected]> Co-developed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-07-16power: supply: PCHG: Peripheral device chargerDaisuke Nojiri1-0/+10
This patch adds a driver for PCHG (Peripheral CHarGer). PCHG is a framework managing power supplies for peripheral devices. This driver creates a sysfs node for each peripheral charge port: /sys/class/power_supply/peripheral<n> where <n> is the index of a charge port. For example, when a stylus is connected to a NFC/WLC port, the node returns: /sys/class/power_supply/peripheral0/ capacity=50 charge_type=Standard scope=Device status=Charging type=Battery Signed-off-by: Daisuke Nojiri <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-06-04power: supply: rt5033_battery: Fix device tree enumerationStephan Gerhold1-1/+2
The fuel gauge in the RT5033 PMIC has its own I2C bus and interrupt line. Therefore, it is not actually part of the RT5033 MFD and needs its own of_match_table to probe properly. Also, given that it's independent of the MFD, there is actually no need to make the Kconfig depend on MFD_RT5033. Although the driver uses the shared <linux/mfd/rt5033.h> header, there is no compile or runtime dependency on the RT5033 MFD driver. Cc: Beomho Seo <[email protected]> Cc: Chanwoo Choi <[email protected]> Fixes: b847dd96e659 ("power: rt5033_battery: Add RT5033 Fuel gauge device driver") Signed-off-by: Stephan Gerhold <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-06-04power: supply: Drop BD70528 supportMatti Vaittinen1-9/+0
The only known BD70528 use-cases are such that the PMIC is controlled from separate MCU which is not running Linux. I am not aware of any Linux driver users. Furthermore, it seems there is no demand for this IC. Let's ease the maintenance burden and drop the driver. We can always add it back if there is sudden need for it. Signed-off-by: Matti Vaittinen <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-04-08power: supply: Add AC driver for Surface Aggregator ModuleMaximilian Luz1-0/+16
On newer Microsoft Surface models (specifically 7th-generation, i.e. Surface Pro 7, Surface Book 3, Surface Laptop 3, and Surface Laptop Go), battery and AC status/information is no longer handled via standard ACPI devices, but instead directly via the Surface System Aggregator Module (SSAM), i.e. the embedded controller on those devices. While on previous generation models, AC status is also handled via SSAM, an ACPI shim was present to translate the standard ACPI AC interface to SSAM requests. The SSAM interface itself, which is modeled closely after the ACPI interface, has not changed. This commit introduces a new SSAM client device driver to support AC status/information via the aforementioned interface on said Surface models. Signed-off-by: Maximilian Luz <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2021-04-08power: supply: Add battery driver for Surface Aggregator ModuleMaximilian Luz1-0/+16
On newer Microsoft Surface models (specifically 7th-generation, i.e. Surface Pro 7, Surface Book 3, Surface Laptop 3, and Surface Laptop Go), battery and AC status/information is no longer handled via standard ACPI devices, but instead directly via the Surface System Aggregator Module (SSAM), i.e. the embedded controller on those devices. While on previous generation models, battery status is also handled via SSAM, an ACPI shim was present to translate the standard ACPI battery interface to SSAM requests. The SSAM interface itself, which is modeled closely after the ACPI interface, has not changed. This commit introduces a new SSAM client device driver to support battery status/information via the aforementioned interface on said Surface models. It is in parts based on the standard ACPI battery driver. Signed-off-by: Maximilian Luz <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>