aboutsummaryrefslogtreecommitdiff
path: root/drivers/power
AgeCommit message (Collapse)AuthorFilesLines
2020-01-14power: supply: axp20x_usb_power: Remove unused device_nodeSamuel Holland1-2/+0
This member of struct axp20x_usb_power is not used anywhere. Remove it. Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Samuel Holland <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2020-01-14power: supply: axp20x_ac_power: Add wakeup controlSamuel Holland1-17/+74
The AC power supply input can be used as a wakeup source. Hook up the ACIN_PLUGIN IRQ to trigger wakeup based on userspace configuration. To do this, we must remember the list of IRQs for the life of the device. To know how much space to allocate for the flexible array member, we switch from using a NULL sentinel to using an array length. Because we now depend on the specific order of the IRQs (we assume ACIN_PLUGIN is first and always present), failing to acquire an IRQ during probe must be a fatal error. To avoid spuriously waking up the system when the AC power supply is not configured as a wakeup source, we must explicitly disable all non- wake IRQs during system suspend. This is because the SoC's NMI input is shared among all IRQs on the AXP PMIC. Due to the use of regmap-irq, the individual IRQs within the PMIC are nested threaded interrupts, and are therefore not automatically disabled during system suspend. The upshot is that if any other device within the MFD (such as the power key) is an enabled wakeup source, all enabled IRQs within the PMIC will cause wakeup. We still need to call enable_irq_wake() when we *do* want wakeup, in case those other wakeup sources on the PMIC are all disabled. Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Samuel Holland <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2020-01-14power: supply: axp20x_ac_power: Allow offliningSamuel Holland1-1/+8
AXP803/AXP813 have a flag that enables/disables the AC power supply input. Allow control of this flag via the ONLINE property on those variants. Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Samuel Holland <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2020-01-14power: supply: axp20x_ac_power: Fix reporting online statusSamuel Holland1-6/+25
AXP803/AXP813 have a flag that enables/disables the AC power supply input. This flag does not affect the status bits in PWR_INPUT_STATUS. Its effect can be verified by checking the battery charge/discharge state (bit 2 of PWR_INPUT_STATUS), or by examining the current draw on the AC input. Take this flag into account when getting the ONLINE property of the AC input, on PMICs where this flag is present. Fixes: 7693b5643fd2 ("power: supply: add AC power supply driver for AXP813") Cc: [email protected] Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2020-01-08power: avs: qcom-cpr: remove duplicated include from qcom-cpr.cYueHaibing1-1/+0
Remove duplicated include. Signed-off-by: YueHaibing <[email protected]> Acked-by: Niklas Cassel <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2020-01-07cros_ec: treewide: Remove 'include/linux/mfd/cros_ec.h'Enric Balletbo i Serra1-1/+0
This header file now only includes the cros_ec_dev struct, however, is the 'include/linux/platform_data/cros_ec_proto.h' who contains the definition of all the Chrome OS EC related structs. There is no reason to have a separate include for this struct so move to the place where other structs are defined. That way, we can remove the include itself, but also simplify the common pattern #include <linux/mfd/cros_ec.h> #include <linux/platform_data/cros_ec_proto.h> for a single include #include <linux/platform_data/cros_ec_proto.h> The changes to remove the cros_ec.h include were generated with the following shell script: git grep -l "<linux/mfd/cros_ec.h>" | xargs sed -i '/<linux\/mfd\/cros_ec.h>/d' Signed-off-by: Enric Balletbo i Serra <[email protected]> Acked-by: Lee Jones <[email protected]> Acked-by: Alexandre Belloni <[email protected]> Acked-by: Jonathan Cameron <[email protected]> Acked-by: Sebastian Reichel <[email protected]> Acked-by: Hans Verkuil <[email protected]>
2020-01-07power: avs: fix uninitialized error return on failed cpr_read_fuse_uV() callColin Ian King1-1/+1
Currently when the call cpr_read_fuse_uV returns an error the value in the uninitialized variable ret is returned. Fix this by instread returning the error value in the variable uV. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: bf6910abf548 ("power: avs: Add support for CPR (Core Power Reduction)") Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2019-12-29power: avs: qcom-cpr: make cpr_get_opp_hz_for_req() staticNiklas Cassel1-2/+2
drivers/power/avs/qcom-cpr.c:1081:15: warning: no previous prototype for ‘cpr_get_opp_hz_for_req’ Detected when running make with W=1. Signed-off-by: Niklas Cassel <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2019-12-29power: avs: qcom-cpr: remove set but unused variableNiklas Cassel1-2/+2
drivers/power/avs/qcom-cpr.c:896:35: warning: variable ‘prev’ set but not used Detected when running make with W=1. Signed-off-by: Niklas Cassel <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2019-12-29power: avs: qcom-cpr: make sure that regmap is availableNiklas Cassel1-0/+1
drivers/power/avs/qcom-cpr.c:402:4: error: implicit declaration of function ‘regmap_multi_reg_write’ Signed-off-by: Niklas Cassel <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2019-12-29power: avs: qcom-cpr: fix unsigned expression compared with zeroNiklas Cassel1-3/+5
drivers/power/avs/qcom-cpr.c:1539:5-21: warning: unsigned expression compared with zero: drv->num_corners < 0 Reported-by: kbuild test robot <[email protected]> Reported-by: Julia Lawall <[email protected]> Signed-off-by: Niklas Cassel <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2019-12-29power: avs: qcom-cpr: fix invalid printk specifier in debug printNiklas Cassel1-1/+1
drivers/power/avs/qcom-cpr.c:838:15: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 6 has type ‘ssize_t’ Reported-by: kbuild test robot <[email protected]> Signed-off-by: Niklas Cassel <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2019-12-20power: avs: Add support for CPR (Core Power Reduction)Niklas Cassel3-0/+1808
CPR (Core Power Reduction) is a technology that reduces core power on a CPU or other device. It reads voltage settings in efuse from product test process as initial settings. Each OPP corresponds to a "corner" that has a range of valid voltages for a particular frequency. While the device is running at a particular frequency, CPR monitors dynamic factors such as temperature, etc. and adjusts the voltage for that frequency accordingly to save power and meet silicon characteristic requirements. This driver is based on an RFC by Stephen Boyd[1], which in turn is based on work by others on codeaurora.org[2]. [1] https://lkml.org/lkml/2015/9/18/833 [2] https://source.codeaurora.org/quic/la/kernel/msm-4.14/tree/drivers/regulator/cpr-regulator.c?h=msm-4.14 Co-developed-by: Jorge Ramirez-Ortiz <[email protected]> Signed-off-by: Jorge Ramirez-Ortiz <[email protected]> Signed-off-by: Niklas Cassel <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Reviewed-by: Ulf Hansson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2019-12-19power: supply: abx500_chargalg: Remove unneeded semicolonMa Feng1-1/+1
Fixes coccicheck warning: drivers/power/supply/abx500_chargalg.c:1826:2-3: Unneeded semicolon Reported-by: Hulk Robot <[email protected]> Signed-off-by: Ma Feng <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: ab8500_charger: Remove unneeded semicolonMa Feng1-3/+3
Fixes coccicheck warning: drivers/power/supply/ab8500_charger.c:1082:2-3: Unneeded semicolon drivers/power/supply/ab8500_charger.c:792:2-3: Unneeded semicolon drivers/power/supply/ab8500_charger.c:2430:2-3: Unneeded semicolon Reported-by: Hulk Robot <[email protected]> Signed-off-by: Ma Feng <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: ab8500: Remove unneeded semicolonMa Feng1-7/+7
Fixes coccicheck warning: drivers/power/supply/ab8500_fg.c:2224:5-6: Unneeded semicolon drivers/power/supply/ab8500_fg.c:2227:4-5: Unneeded semicolon drivers/power/supply/ab8500_fg.c:2334:3-4: Unneeded semicolon drivers/power/supply/ab8500_fg.c:2342:3-4: Unneeded semicolon drivers/power/supply/ab8500_fg.c:2350:3-4: Unneeded semicolon drivers/power/supply/ab8500_fg.c:2358:3-4: Unneeded semicolon drivers/power/supply/ab8500_fg.c:2366:3-4: Unneeded semicolon Reported-by: Hulk Robot <[email protected]> Signed-off-by: Ma Feng <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: sbs-battery: fix CAPACITY_MODE bit namingJean-Francois Dagenais1-15/+16
"Battery mode" is the name of the register, the bit manipulated by this code is "CAPACITY_MODE" (Smart Battery System Specifications). Signed-off-by: Jean-Francois Dagenais <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: sbs-battery: use octal permissions on module paramJean-Francois Dagenais1-1/+1
Symbolic permissions 'S_IRUSR | S_IRGRP | S_IROTH' are not preferred. Use octal permissions '0444'. Signed-off-by: Jean-Francois Dagenais <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: reset: Fix Kconfig indentationKrzysztof Kozlowski1-8/+8
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: cros_usbpd: Remove dev_err() getting the number of portsEnric Balletbo i Serra1-8/+2
When a device has no support to get the charger number of ports, it doesn't have to result in a dev_err(), print saying "Could not get charger port count" using a dev_info() would suffice. In such case, the dev_info() message is already printed but the dev_err() is annoying, specially, on those devices that doesn't support the command. So remove the dev_err(). Signed-off-by: Enric Balletbo i Serra <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: max17040: Send uevent in SOC and status changeMatheus Castello1-0/+9
Notify core through power_supply_changed() in case of changes in state of charge and power supply status. This is useful for user-space to efficiently update current battery level. Signed-off-by: Matheus Castello <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: max17040: Config alert SOC low level threshold from FDTMatheus Castello1-1/+51
For configuration of fuel gauge alert for a low level state of charge interrupt we add a function to config level threshold and a device tree binding property to set it in flatned device tree node. Now we can use "maxim,alert-low-soc-level" property with the values from 1% up to 32% to configure alert interrupt threshold. Signed-off-by: Matheus Castello <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: max17040: Add IRQ handler for low SOC alertMatheus Castello1-5/+68
According datasheet max17040 has a pin for alert host for low SOC. This pin can be used as external interrupt, so we need to check for interrupts assigned for device and handle it. In handler we are checking and storing fuel gauge registers values and send an uevent to notificate user space, so user space can decide save work or turn off since the alert demonstrate that the battery may no have the power to keep the system turned on for much longer. Signed-off-by: Matheus Castello <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: sc27xx: Calibrate the resistance of coulomb counterBaolin Wang1-1/+16
There are some deviations between the real resistance and the ideal resistance of coulomb counter, which will affect the accuracy of the coulomb counter, thus calibrate the real resistance of coulomb counter to improve the accuracy. Signed-off-by: Baolin Wang <[email protected]> Signed-off-by: Baolin Wang <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: sc27xx: Optimize the battery resistance with measuring ↵Yuanjiang Yu1-2/+30
temperature Optimize the battery internal resistance in a certain temerature to get a accurate battery internal resistance. Signed-off-by: Yuanjiang Yu <[email protected]> Signed-off-by: Baolin Wang <[email protected]> Signed-off-by: Baolin Wang <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: core: Add battery internal resistance temperature table supportBaolin Wang1-1/+66
Since the battery internal resistance can be changed with the temperature changes, thus add a resistance temperature table support to look up the accurate battery internal resistance in a certain temperature. Signed-off-by: Baolin Wang <[email protected]> Signed-off-by: Baolin Wang <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: max77650: add of_match tableBartosz Golaszewski1-0/+7
We need the of_match table if we want to use the compatible string in the pmic's child node and get the charger driver loaded automatically. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: max17042: add MAX17055 supportAngus Ainslie (Purism)1-3/+14
The MAX17055 is very similar to the MAX17042 so extend the driver. Signed-off-by: Angus Ainslie (Purism) <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: suppy: ucs1002: disable power when max current is 0Lucas Stach1-4/+38
For some devices userspace needs the ability to completely cut the power to the USB devices connected to the charge controller. An easy way to achieve this is by allowing 0 as a valid max current and forcibly disable the output in that case, as well as enable it again if the regulator is in use and a non-0 max current is set. Signed-off-by: Lucas Stach <[email protected]> Tested-by: Chris Healy <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: Fix Kconfig indentationKrzysztof Kozlowski1-15/+15
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 <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power/supply: ingenic-battery: Don't change scale if there's only onePaul Cercueil1-4/+11
The ADC in the JZ4740 can work either in high-precision mode with a 2.5V range, or in low-precision mode with a 7.5V range. The code in place in this driver will select the proper scale according to the maximum voltage of the battery. The JZ4770 however only has one mode, with a 6.6V range. If only one scale is available, there's no need to change it (and nothing to change it to), and trying to do so will fail with -EINVAL. Fixes: fb24ccfbe1e0 ("power: supply: add Ingenic JZ47xx battery driver.") Signed-off-by: Paul Cercueil <[email protected]> Acked-by: Artur Rojek <[email protected]> Cc: [email protected] Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-19power: supply: pda_power: add missed usb_unregister_notifierChuhong Yuan1-0/+4
The driver forgets to unregister the notifier in remove. Add the call to fix it. Signed-off-by: Chuhong Yuan <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-18power: reset: gpio-restart: don't error on deferralChris Packham1-3/+5
Don't generate an error message when devm_gpiod_get fails with -EPROBE_DEFER. Signed-off-by: Chris Packham <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-12-10drivers: soc: atmel: select POWER_RESET_AT91_SAMA5D2_SHDWC for sam9x60Claudiu Beznea1-1/+1
Select POWER_RESET_AT91_SAMA5D2_SHDWC for SAM9X60 SoC. Signed-off-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2019-12-10power: reset: Kconfig: select POWER_RESET_AT91_RESET for sam9x60Claudiu Beznea1-1/+1
Select POWER_RESET_AT91_RESET for SAM9X60 SoC. Signed-off-by: Claudiu Beznea <[email protected]> Acked-by: Sebastian Reichel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2019-12-04Merge tag 'pm-5.5-rc1-2' of ↵Linus Torvalds1-6/+6
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull additional power management updates from Rafael Wysocki: "These fix an ACPI EC driver bug exposed by the recent rework of the suspend-to-idle code flow, reintroduce frequency constraints into device PM QoS (in preparation for adding QoS support to devfreq), drop a redundant field from struct cpuidle_state and clean up Kconfig in some places. Specifics: - Avoid a race condition in the ACPI EC driver that may cause systems to be unable to leave suspend-to-idle (Rafael Wysocki) - Drop the "disabled" field, which is redundant, from struct cpuidle_state (Rafael Wysocki) - Reintroduce device PM QoS frequency constraints (temporarily introduced and than dropped during the 5.4 cycle) in preparation for adding QoS support to devfreq (Leonard Crestez) - Clean up indentation (in multiple places) and the cpuidle drivers help text in Kconfig (Krzysztof Kozlowski, Randy Dunlap)" * tag 'pm-5.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: PM: s2idle: Rework ACPI events synchronization ACPI: EC: Rework flushing of pending work PM / devfreq: Add missing locking while setting suspend_freq PM / QoS: Restore DEV_PM_QOS_MIN/MAX_FREQUENCY PM / QoS: Reorder pm_qos/freq_qos/dev_pm_qos structs PM / QoS: Initial kunit test PM / QoS: Redefine FREQ_QOS_MAX_DEFAULT_VALUE to S32_MAX power: avs: Fix Kconfig indentation cpufreq: Fix Kconfig indentation cpuidle: minor Kconfig help text fixes cpuidle: Drop disabled field from struct cpuidle_state cpuidle: Fix Kconfig indentation
2019-12-01Merge tag 'mfd-next-5.5' of ↵Linus Torvalds3-0/+108
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Add support for a "resource managed strongly uncachable ioremap" call - Provide a collection of MFD helper macros - Remove mfd_clone_cell() from MFD core - Add NULL de-reference protection in MFD core - Remove superfluous function fd_platform_add_cell() from MFD core - Honour Device Tree's request to disable a device New Drivers: - Add support for MediaTek MT6323 PMIC New Device Support: - Add support for Gemini Lake to Intel LPSS PCI - Add support for Cherry Trail Crystal Cover PMIC to Intel SoC PMIC CRC - Add support for PM{I}8950 to Qualcomm SPMI PMIC - Add support for U8420 to ST-Ericsson DB8500 - Add support for Comet Lake PCH-H to Intel LPSS PCI New Functionality: - Add support for requested supply clocks; madera-core Fix-ups: - Lower interrupt priority; rk808 - Use provided helpers (macros, group functions, defines); rk808, ipaq-micro, ab8500-core, db8500-prcmu, mt6397-core, cs5535-mfd - Only allocate IRQs on request; max77620 - Use simplified API; arizona-core - Remove redundant and/or duplicated code; wm8998-tables, arizona, syscon - Device Tree binding fix-ups; madera, max77650, max77693 - Remove mfd_cell->id abuse hack; cs5535-mfd - Remove only user of mfd_clone_cell(); cs5535-mfd - Make resources static; rohm-bd70528 Bug Fixes: - Fix product ID for RK818; rk808 - Fix Power Key; rk808 - Fix booting on the BananaPi; mt6397-core - Endian fix-ups; twl.h - Fix static error checker warnings; ti_am335x_tscadc" * tag 'mfd-next-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (47 commits) Revert "mfd: syscon: Set name of regmap_config" mfd: ti_am335x_tscadc: Fix static checker warning mfd: bd70528: Staticize bit value definitions mfd: mfd-core: Honour Device Tree's request to disable a child-device dt-bindings: mfd: max77693: Fix missing curly brace mfd: intel-lpss: Add Intel Comet Lake PCH-H PCI IDs mfd: db8500-prcmu: Support U8420-sysclk firmware dt-bindings: mfd: max77650: Convert the binding document to yaml mfd: mfd-core: Move pdev->mfd_cell creation back into mfd_add_device() mfd: mfd-core: Remove usage counting for .{en,dis}able() call-backs x86: olpc-xo1-sci: Remove invocation of MFD's .enable()/.disable() call-backs x86: olpc-xo1-pm: Remove invocation of MFD's .enable()/.disable() call-backs mfd: mfd-core: Remove mfd_clone_cell() mfd: mfd-core: Protect against NULL call-back function pointer mfd: cs5535-mfd: Register clients using their own dedicated MFD cell entries mfd: cs5535-mfd: Request shared IO regions centrally mfd: cs5535-mfd: Remove mfd_cell->id hack mfd: cs5535-mfd: Use PLATFORM_DEVID_* defines and tidy error message mfd: intel_soc_pmic_crc: Add "cht_crystal_cove_pmic" cell to CHT cells mfd: madera: Add support for requesting the supply clocks ...
2019-11-29power: avs: Fix Kconfig indentationKrzysztof Kozlowski1-6/+6
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 <[email protected]> Acked-by: Kevin Hilman <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2019-11-27Merge tag 'for-v5.5' of ↵Linus Torvalds12-127/+642
git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: - test_power: add support for current and charge_counter - cpcap-charger: improve charge calculation and limit default charge voltage - ab8500: convert to IIO - misc small fixes all over drivers * tag 'for-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (29 commits) power: supply: bd70528: Add MODULE_ALIAS to allow module auto loading power: supply: ab8500_charger: Fix inconsistent IS_ERR and PTR_ERR power: supply: cpcap-charger: cpcap_charger_voltage_to_regval() can be static power: supply: cpcap-battery: Add basic coulomb counter calibrate support power: supply: cpcap-battery: Read and save integrator register CCI power: supply: cpcap-battery: Simplify short term power average calculation power: supply: cpcap-battery: Simplify coulomb counter calculation with div_s64 power: supply: cpcap-battery: Move coulomb counter units per lsb to ddata power: supply: cpcap-charger: Allow changing constant charge voltage power: supply: cpcap-battery: Fix handling of lowered charger voltage power: supply: cpcap-charger: Improve battery detection power: supply: cpcap-battery: Check voltage before orderly_poweroff power: supply: cpcap-charger: Limit voltage to 4.2V for battery power: supply: ab8500: Handle invalid IRQ from platform_get_irq_byname() power: supply: ab8500_fg: Do not free non-requested IRQs in probe's error path power: supply: ab8500: Cleanup probe in reverse order power: reset: at91: fix __le32 cast in reset code power: supply: abx500_chargalg: Fix code indentation mfd: Switch the AB8500 GPADC to IIO iio: adc: New driver for the AB8500 GPADC ...
2019-11-13power: avs: smartreflex: Remove superfluous cast in debugfs_create_file() callGeert Uytterhoeven1-1/+1
There is no need to cast a typed pointer to a void pointer when calling a function that accepts the latter. Remove it, as the cast prevents further compiler checks. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2019-10-27power: supply: bd70528: Add MODULE_ALIAS to allow module auto loadingMatti Vaittinen1-0/+1
The bd70528 charger driver is probed by MFD driver. Add MODULE_ALIAS in order to allow udev to load the module when MFD sub-device cell for charger is added. Fixes: f8c7f7ddd8ef0 ("power: supply: Initial support for ROHM BD70528 PMIC charger block") Signed-off-by: Matti Vaittinen <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-10-27power: supply: ab8500_charger: Fix inconsistent IS_ERR and PTR_ERRGustavo A. R. Silva1-1/+1
Fix inconsistent IS_ERR and PTR_ERR in ab8500_charger_probe(). The proper pointer to be passed as argument is di->adc_main_charger_c This bug was detected with the help of Coccinelle. Fixes: 97ab78bac5d0 ("power: supply: ab8500_charger: Convert to IIO ADC") Signed-off-by: Gustavo A. R. Silva <[email protected]> Reviewed-by: Signed-off-by: Wei Yongjun <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-10-24power: reset: add driver for mt6323 poweroffJosef Friedl3-0/+108
add poweroff driver for mt6323 and make Makefile and Kconfig-Entries Suggested-by: Frank Wunderlich <[email protected]> Signed-off-by: Josef Friedl <[email protected]> Signed-off-by: Frank Wunderlich <[email protected]> Acked-by: Sebastian Reichel <[email protected]> Acked-by: Sean Wang <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2019-10-21power: supply: cpcap-charger: cpcap_charger_voltage_to_regval() can be statickbuild test robot1-1/+1
Add 'static' keyword to internal function as reported by sparse using the following configuration: make ARCH=x86_64 allmodconfig make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' Fixes: d4ee021c410f ("power: supply: cpcap-charger: Limit voltage to 4.2V for battery") Signed-off-by: kbuild test robot <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-10-20power: supply: cpcap-battery: Add basic coulomb counter calibrate supportTony Lindgren1-8/+88
This patch adds support for the coulomb counter calibration on init. We do this by polling for now, and only add partial calibration done interrupt support. Then later on when we know for sure we have the calibration done interrupt available in the device tree, we can switch to using the calibration done interrupt. Cc: Merlijn Wajer <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Acked-by: Pavel Machek <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-10-20power: supply: cpcap-battery: Read and save integrator register CCITony Lindgren1-1/+9
We can simplify code in the later patches by reading and saving the integrator register CCI. Let's also fix a comment typo for register range naming while at it. Cc: Merlijn Wajer <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Acked-by: Pavel Machek <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-10-20power: supply: cpcap-battery: Simplify short term power average calculationTony Lindgren1-13/+10
We can use sign_extend32() here to simplify things. And let's fix the comment for CCM register, that contains the calibration offset. Cc: Merlijn Wajer <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Acked-by: Pavel Machek <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-10-20power: supply: cpcap-battery: Simplify coulomb counter calculation with div_s64Tony Lindgren1-18/+5
We can simplify cpcap_battery_cc_raw_div() with div_s64. Cc: Merlijn Wajer <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Acked-by: Pavel Machek <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-10-20power: supply: cpcap-battery: Move coulomb counter units per lsb to ddataTony Lindgren1-14/+14
We can simplify cpcap_battery_cc_raw_div() a bit by moving the units per lsb to ddata. Cc: Merlijn Wajer <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Acked-by: Pavel Machek <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
2019-10-20power: supply: cpcap-charger: Allow changing constant charge voltageTony Lindgren1-0/+83
Let's allow reconfiguring the cpcap-charger max charge voltage and default to 4.2V that should be safe for the known users. This allows the users to use 4.35V for the extra capacity if really needed at a cost of probably shorter battery life. We check the constant charge voltage limit set by the battery. Some pieces of the property setting code is based on an earlier patch from Pavel Machek <[email protected]> but limited to configuring the charge voltage for now. Cc: Merlijn Wajer <[email protected]> Cc: Pavel Machek <[email protected]> Acked-by: Pavel Machek <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>