aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-12-13power: supply: Fix a typo in warning messageMasanari Iida1-1/+1
This patch fix a warning messages in power_supply_sysfs.c Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-12-13power: reset: new driver regulator-poweroffMichael Klein3-0/+90
This driver registers a pm_power_off function to turn off the board by force-disabling a devicetree-defined regulator. Signed-off-by: Michael Klein <michael@fossekall.de> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-12-12power: supply: ab8500: Use dev_err_probe() for IIO channelsLinus Walleij3-34/+24
The code obtaining the ADC channels is outdated: it is trying to work around the IIO subsystem not returning the right -EPROBE_DEFER error code. Fix this up by using the dev_err_probe() helper so we defer silently where appropriate and not bail out if the IIO core returns -EPROBE_DEFER as happens now. Cc: Marcus Cooper <codekipper@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-12-12power: supply: ab8500_fg: Request all IRQs as threadedLinus Walleij1-36/+11
Since these IRQs are cascaded from a nested IRQ, the generic IRQ system detects this and refuse to deliver a fastpath IRQ in response to request_irq(): nested = irq_settings_is_nested_thread(desc); if (nested) { if (!new->thread_fn) { ret = -EINVAL; goto out_mput; } (...) Threaded IRQs work just as well so let's just request threaded IRQs. One of the IRQs are alread requested as threaded anyways. Cc: Marcus Cooper <codekipper@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-12-12power: supply: ab8500_charger: Oneshot threaded IRQsLinus Walleij1-1/+1
Make sure the threaded IRQs requested by the charger are flagged as "oneshot". Usually this is what you want, and since the interrupts are shared with the USB phy on the AB8500 we will get a conflict like this if we don't, since the phy request them threaded oneshot: genirq: Flags mismatch irq 83. 00004084 (USB_LINK_STATUS vs. 00006084 (usb-link-status) ab8500-charger ab8500-charger.0: failed to request USB_LINK_STATUS IRQ 83: -16 Cc: Marcus Cooper <codekipper@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-12-12power: supply: ab8500: Convert to dev_pm_opsLinus Walleij4-48/+28
Switch over to using generic dev_pm_ops since these drivers aren't even using the special power state passed to the legacy call. Cc: Marcus Cooper <codekipper@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-12-12power: supply: ab8500: Use local helperLinus Walleij3-67/+64
Use a local "dev" helper variable to make the probe() code easier to read in the ab8500 subdrivers. Drop out-of-memory messages as these should come from the slab core. Cc: Marcus Cooper <codekipper@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: wm831x_power: remove unneeded breakTom Rix1-1/+0
A break is not needed if it is preceded by a goto. Signed-off-by: Tom Rix <trix@redhat.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: bq24735: Drop unused includeLinus Walleij1-1/+0
The driver include <linux/gpio.h> but actually only use <linux/gpio/consumer.h> which is includes below. Drop the surplus legacy header include. Cc: Peter Rosin <peda@axentia.se> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: bq24190_charger: Drop unused includeLinus Walleij1-1/+0
The driver includes <linux/gpio.h> but fails to use any symbols from the file. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: generic-adc-battery: Use GPIO descriptorsLinus Walleij1-20/+11
This driver uses platform data to pass GPIO lines using the deprecated global GPIO numbers. There are no in-tree users of this platform data. Any out-of-tree or coming users of this driver can easily be migrated to use machine descriptor tables as described in Documentation/driver-api/gpio/board.rst section "platform data". Cc: Anish Kumar <anish198519851985@gmail.com> Cc: H. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: collie_battery: Convert to GPIO descriptorsLinus Walleij1-42/+109
This converts the Collie battery driver to use GPIO descriptors. We use a mixture of 3 GPIOs defined in the machine and 3 GPIOs requested directly from the ucb1x00 chip. Cc: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: bq24190_charger: fix reference leakZhang Qilong1-5/+15
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to call pm_runtime_put_noidle will result in reference leak in callers(bq24190_sysfs_show, bq24190_charger_get_property, bq24190_charger_set_property, bq24190_battery_get_property, bq24190_battery_set_property), so we should fix it. Fixes: f385e6e2a1532 ("power: bq24190_charger: Use PM runtime autosuspend") Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: s3c-adc-battery: Convert to GPIO descriptorsLinus Walleij1-28/+29
This converts the S3C ADC battery to use GPIO descriptors instead of a global GPIO number for the charging completed GPIO. Using the pattern from the GPIO charger we name this GPIO line "charge-status" in the board file. Cc: linux-samsung-soc@vger.kernel.org Cc: Sergiy Kibrik <sakib@darkstar.site> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: reset: Use printk format symbol resolverHelge Deller2-12/+4
Instead of looking up a symbol name by hand, use the %ps printk format specifier. Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: axp20x_usb_power: Use power efficient workqueue for debounceYangtao Li1-4/+4
The debounce timeout is generally quite long and the work not performance critical so allow the scheduler to run the work anywhere rather than in the normal per-CPU workqueue. Signed-off-by: Yangtao Li <frank@allwinnertech.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: axp20x_usb_power: fix typoYangtao Li1-1/+1
s/on on/on Signed-off-by: Yangtao Li <frank@allwinnertech.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: max8997-charger: Improve getting charger statusTimon Baetz1-17/+35
Detect charging and discharging state. Ported from downstream Samsung Galaxy S2 (i9100) kernel fork. Signed-off-by: Timon Baetz <timon.baetz@protonmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: max8997-charger: Fix platform data retrievalTimon Baetz1-1/+1
Use pdata field of max8998_dev struct to obtain platform data. Signed-off-by: Timon Baetz <timon.baetz@protonmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: max8997-charger: Use module_platform_driver()Timon Baetz1-12/+1
Replace register and unregister function calls with module_platform_driver(). Signed-off-by: Timon Baetz <timon.baetz@protonmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: pm2301_charger: remove unnecessary variableNigel Christian1-2/+1
The variable "ret" is initialized to zero and then returned. Remove it and return zero. Signed-off-by: Nigel Christian <nigel.l.christian@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: Fix missing IRQF_ONESHOT as only threaded handlerTian Tao1-1/+1
Coccinelle noticed: drivers/power/supply/ab8500_btemp.c:1107:8-28: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: axp288_charger: Fix HP Pavilion x2 10 DMI matchingHans de Goede1-11/+17
Commit 9c80662a74cd ("power: supply: axp288_charger: Add special handling for HP Pavilion x2 10") added special handling for HP Pavilion x2 10 models which use the weird combination of a Type-C connector and the non Type-C aware AXP288 PMIC. This special handling was activated by a DMI match a the product-name of "HP Pavilion x2 Detachable". Recently I've learned that there are also older "HP Pavilion x2 Detachable" models with an AXP288 PMIC + a micro-usb connector where we should not activate the special handling for the Type-C connectors. Extend the matching to also match on the DMI board-name and match on the 2 boards (one Bay Trail based one Cherry Trail based) of which we are certain that they use the AXP288 + Type-C connector combination. Note the DSDT code from these older (AXP288 + micro-USB) models contains some AML code (which never runs under Linux) which reads the micro-USB connector id-pin and if it is pulled to ground, which would normally mean the port is in host mode!, then it sets the input-current-limit to 3A, it seems HP is using the micro-USB port as a charging only connector and identifies their own 3A capable charger though this hack which is a major violation of the USB specs. Note HP also hardcodes a 2A limit when the id-pin is not pulled to ground, which is also in violation of the specs. I've no intention to add support for HP's hack to support 3A charging on these older models. By making the DMI matches for the Type-C equipped models workaround more tighter, these older models will be treated just like any other AXP288 + micro-USB equipped device and the input-current limit will follow the BC 1.2 spec (using the defacto standard values there where the BC 1.2 spec defines a range). Fixes: 9c80662a74cd ("power: supply: axp288_charger: Add special handling for HP Pavilion x2 10") BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1896924 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: max17042_battery: Export charge termination current propertySebastian Krzyszkowiak1-0/+9
The value is there, so let's export it. Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: max17042_battery: Take r_sns value into account in charge_counterSebastian Krzyszkowiak1-1/+2
The default r_sns value was hardcoded there, so let's change it to the actually configured one. Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: max17042_battery: Improve accuracy of current_now and current_avg readingsSebastian Krzyszkowiak1-4/+4
Dividing 1562500 by r_sns value usually doesn't result in an integer. Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-30power: supply: max17042_battery: Fix current_{avg,now} hiding with no current senseSebastian Krzyszkowiak1-1/+2
When current sense is disabled, max17042_no_current_sense_psy_desc gets used which ignores two last properties from the list. Fixes: 21b01cc879cc ("power: supply: max17042_battery: Add support for the TTE_NOW prop") Reported-by: Timon Baetz <timon.baetz@protonmail.com> Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-29power: supply: bq25890: Use the correct range for IILIM registerSebastian Krzyszkowiak1-1/+1
I've checked bq25890, bq25892, bq25895 and bq25896 datasheets and they all define IILIM to be between 100mA-3.25A with 50mA steps. Fixes: 478efc79ee32 ("power: bq25890: implement INPUT_CURRENT_LIMIT property") Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm> Reviewed-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-11-29power: reset: ocelot: Add support 2 other MIPS based SoCsGregory CLEMENT1-3/+27
This adds reset support for Luton and Jaguar2 in the ocelot-reset driver. They are both MIPS based belonging to the Vcore III family. Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-24Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/socLinus Torvalds1-1/+1
Pull ARM SoC platform updates from Olof Johansson: "SoC changes, a substantial part of this is cleanup of some of the older platforms that used to have a bunch of board files. In particular: - Remove non-DT i.MX platforms that haven't seen activity in years, it's time to remove them. - A bunch of cleanup and removal of platform data for TI/OMAP platforms, moving over to genpd for power/reset control (yay!) - Major cleanup of Samsung S3C24xx and S3C64xx platforms, moving them closer to multiplatform support (not quite there yet, but getting close). There are a few other changes too, smaller fixlets, etc. For new platform support, the primary ones are: - New SoC: Hisilicon SD5203, ARM926EJ-S platform. - Cpufreq support for i.MX7ULP" * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (121 commits) ARM: mstar: Select MStar intc ARM: stm32: Replace HTTP links with HTTPS ones ARM: debug: add UART early console support for SD5203 ARM: hisi: add support for SD5203 SoC ARM: omap3: enable off mode automatically clk: imx: imx35: Remove mx35_clocks_init() clk: imx: imx31: Remove mx31_clocks_init() clk: imx: imx27: Remove mx27_clocks_init() ARM: imx: Remove unused definitions ARM: imx35: Retrieve the IIM base address from devicetree ARM: imx3: Retrieve the AVIC base address from devicetree ARM: imx3: Retrieve the CCM base address from devicetree ARM: imx31: Retrieve the IIM base address from devicetree ARM: imx27: Retrieve the CCM base address from devicetree ARM: imx27: Retrieve the SYSCTRL base address from devicetree ARM: s3c64xx: bring back notes from removed debug-macro.S ARM: s3c24xx: fix Wunused-variable warning on !MMU ARM: samsung: fix PM debug build with DEBUG_LL but !MMU MAINTAINERS: mark linux-samsung-soc list non-moderated ARM: imx: Remove remnant board file support pieces ...
2020-10-23Merge tag 'pm-5.10-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pmLinus Torvalds7-3506/+0
Pull more power management updates from Rafael Wysocki: "First of all, the adaptive voltage scaling (AVS) drivers go to new platform-specific locations as planned (this part was reported to have merge conflicts against the new arm-soc updates in linux-next). In addition to that, there are some fixes (intel_idle, intel_pstate, RAPL, acpi_cpufreq), the addition of on/off notifiers and idle state accounting support to the generic power domains (genpd) code and some janitorial changes all over. Specifics: - Move the AVS drivers to new platform-specific locations and get rid of the drivers/power/avs directory (Ulf Hansson). - Add on/off notifiers and idle state accounting support to the generic power domains (genpd) framework (Ulf Hansson, Lina Iyer). - Ulf will maintain the PM domain part of cpuidle-psci (Ulf Hansson). - Make intel_idle disregard ACPI _CST if it cannot use the data returned by that method (Mel Gorman). - Modify intel_pstate to avoid leaving useless sysfs directory structure behind if it cannot be registered (Chen Yu). - Fix domain detection in the RAPL power capping driver and prevent it from failing to enumerate the Psys RAPL domain (Zhang Rui). - Allow acpi-cpufreq to use ACPI _PSD information with Family 19 and later AMD chips (Wei Huang). - Update the driver assumptions comment in intel_idle and fix a kerneldoc comment in the runtime PM framework (Alexander Monakov, Bean Huo). - Avoid unnecessary resets of the cached frequency in the schedutil cpufreq governor to reduce overhead (Wei Wang). - Clean up the cpufreq core a bit (Viresh Kumar). - Make assorted minor janitorial changes (Daniel Lezcano, Geert Uytterhoeven, Hubert Jasudowicz, Tom Rix). - Clean up and optimize the cpupower utility somewhat (Colin Ian King, Martin Kaistra)" * tag 'pm-5.10-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (23 commits) PM: sleep: remove unreachable break PM: AVS: Drop the avs directory and the corresponding Kconfig PM: AVS: qcom-cpr: Move the driver to the qcom specific drivers PM: runtime: Fix typo in pm_runtime_set_active() helper comment PM: domains: Fix build error for genpd notifiers powercap: Fix typo in Kconfig "Plance" -> "Plane" cpufreq: schedutil: restore cached freq when next_f is not changed acpi-cpufreq: Honor _PSD table setting on new AMD CPUs PM: AVS: smartreflex Move driver to soc specific drivers PM: AVS: rockchip-io: Move the driver to the rockchip specific drivers PM: domains: enable domain idle state accounting PM: domains: Add curly braces to delimit comment + statement block PM: domains: Add support for PM domain on/off notifiers for genpd powercap/intel_rapl: enumerate Psys RAPL domain together with package RAPL domain powercap/intel_rapl: Fix domain detection intel_idle: Ignore _CST if control cannot be taken from the platform cpuidle: Remove pointless stub intel_idle: mention assumption that WBINVD is not needed MAINTAINERS: Add section for cpuidle-psci PM domain cpufreq: intel_pstate: Delete intel_pstate sysfs if failed to register the driver ...
2020-10-22PM: AVS: Drop the avs directory and the corresponding KconfigUlf Hansson4-4/+0
All avs drivers have now been moved to their corresponding soc specific directories. Additionally, they don't depend on the POWER_AVS Kconfig anymore. Therefore, let's simply drop the drivers/power/avs directory altogether. Cc: Nishanth Menon <nm@ti.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Nishanth Menon <nm@ti.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-10-22PM: AVS: qcom-cpr: Move the driver to the qcom specific driversUlf Hansson3-1805/+0
The avs drivers are all SoC specific drivers that doesn't share any code. Instead they are located in a directory, mostly to keep similar functionality together. From a maintenance point of view, it makes better sense to collect SoC specific drivers like these, into the SoC specific directories. Therefore, let's move the qcom-cpr driver to the qcom directory. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org> Acked-by: Niklas Cassel <nks@flawful.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-10-20Merge tag 'for-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supplyLinus Torvalds32-1156/+3391
Pull power supply and reset updates from Sebastian Reichel: "Power-supply core: - add wireless type - properly document current direction Battery/charger driver changes: - new fuel-gauge/charger driver for RN5T618/RN5T619 - new charger driver for BQ25980, BQ25975 and BQ25960 - bq27xxx-battery: add support for TI bq34z100 - gpio-charger: convert to GPIO descriptors - gpio-charger: add optional support for charge current limiting - max17040: add support for max17041, max17043, max17044 - max17040: add support for max17048, max17049, max17058, max17059 - smb347-charger: add DT support - smb247-charger: add SMB345 and SMB358 support - simple-battery: add temperature properties - lots of minor fixes, cleanups and DT binding YAML conversions Reset drivers: - ocelot: Add support for Sparx5" * tag 'for-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (81 commits) power: reset: POWER_RESET_OCELOT_RESET should depend on Ocelot or Sparx5 power: supply: bq25980: Fix uninitialized wd_reg_val and overrun power: supply: ltc2941: Fix ptr to enum cast power: supply: test-power: revise parameter printing to use sprintf power: supply: charger-manager: fix incorrect check on charging_duration_ms power: supply: max17040: Fix ptr to enum cast power: supply: bq25980: Fix uninitialized wd_reg_val power: supply: bq25980: remove redundant zero check on ret power: reset: ocelot: Add support for Sparx5 dt-bindings: reset: ocelot: Add Sparx5 support power: supply: sbs-battery: keep error code when get_property() fails power: supply: bq25980: Add support for the BQ259xx family dt-binding: bq25980: Add the bq25980 flash charger power: supply: fix spelling mistake "unprecise" -> "imprecise" power: supply: test_power: add missing newlines when printing parameters by sysfs power: supply: pm2301: drop duplicated i2c_device_id power: supply: charger-manager: drop unused charger assignment power: supply: rt9455: skip 'struct acpi_device_id' when !CONFIG_ACPI power: supply: goldfish: skip 'struct acpi_device_id' when !CONFIG_ACPI power: supply: bq25890: skip 'struct acpi_device_id' when !CONFIG_ACPI ...
2020-10-16PM: AVS: smartreflex Move driver to soc specific driversUlf Hansson3-1058/+0
The avs drivers are all SoC specific drivers that doesn't share any code. Instead they are located in a directory, mostly to keep similar functionality together. From a maintenance point of view, it makes better sense to collect SoC specific drivers like these, into the SoC specific directories. Therefore, let's move the smartreflex driver for OMAP to the ti directory. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Nishanth Menon <nm@ti.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-10-16PM: AVS: rockchip-io: Move the driver to the rockchip specific driversUlf Hansson3-639/+0
The avs drivers are all SoC specific drivers that doesn't share any code. Instead they are located in a directory, mostly to keep similar functionality together. From a maintenance point of view, it makes better sense to collect SoC specific drivers like these, into the SoC specific directories. Therefore, let's move the rockchip-io driver to the rockchip directory. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-10-15power: reset: POWER_RESET_OCELOT_RESET should depend on Ocelot or Sparx5Geert Uytterhoeven1-0/+1
To add support for Sparx5, the dependency on MSCC_OCELOT was removed. However, this increases exposure of the driver question not only to Sparx5 platforms, but to everyone. Hence re-add the dependency on MSCC_OCELOT, and extend it with ARCH_SPARX5, to prevent asking the user about this driver when configuring a kernel without Ocelot and Sparx5 support. Fixes: ec871696b7776767 ("power: reset: ocelot: Add support for Sparx5") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-15Merge tag 'char-misc-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-miscLinus Torvalds3-3/+3
Pull char/misc driver updates from Greg KH: "Here is the big set of char, misc, and other assorted driver subsystem patches for 5.10-rc1. There's a lot of different things in here, all over the drivers/ directory. Some summaries: - soundwire driver updates - habanalabs driver updates - extcon driver updates - nitro_enclaves new driver - fsl-mc driver and core updates - mhi core and bus updates - nvmem driver updates - eeprom driver updates - binder driver updates and fixes - vbox minor bugfixes - fsi driver updates - w1 driver updates - coresight driver updates - interconnect driver updates - misc driver updates - other minor driver updates All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (396 commits) binder: fix UAF when releasing todo list docs: w1: w1_therm: Fix broken xref, mistakes, clarify text misc: Kconfig: fix a HISI_HIKEY_USB dependency LSM: Fix type of id parameter in kernel_post_load_data prototype misc: Kconfig: add a new dependency for HISI_HIKEY_USB firmware_loader: fix a kernel-doc markup w1: w1_therm: make w1_poll_completion static binder: simplify the return expression of binder_mmap test_firmware: Test partial read support firmware: Add request_partial_firmware_into_buf() firmware: Store opt_flags in fw_priv fs/kernel_file_read: Add "offset" arg for partial reads IMA: Add support for file reads without contents LSM: Add "contents" flag to kernel_read_file hook module: Call security_kernel_post_load_data() firmware_loader: Use security_post_load_data() LSM: Introduce kernel_post_load_data() hook fs/kernel_read_file: Add file_size output argument fs/kernel_read_file: Switch buffer size arg to size_t fs/kernel_read_file: Remove redundant size argument ...
2020-10-14Merge tag 'pm-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pmLinus Torvalds1-7/+1
Pull power management updates from Rafael Wysocki: "These rework the collection of cpufreq statistics to allow it to take place if fast frequency switching is enabled in the governor, rework the frequency invariance handling in the cpufreq core and drivers, add new hardware support to a couple of cpufreq drivers, fix a number of assorted issues and clean up the code all over. Specifics: - Rework cpufreq statistics collection to allow it to take place when fast frequency switching is enabled in the governor (Viresh Kumar). - Make the cpufreq core set the frequency scale on behalf of the driver and update several cpufreq drivers accordingly (Ionela Voinescu, Valentin Schneider). - Add new hardware support to the STI and qcom cpufreq drivers and improve them (Alain Volmat, Manivannan Sadhasivam). - Fix multiple assorted issues in cpufreq drivers (Jon Hunter, Krzysztof Kozlowski, Matthias Kaehlcke, Pali Rohár, Stephan Gerhold, Viresh Kumar). - Fix several assorted issues in the operating performance points (OPP) framework (Stephan Gerhold, Viresh Kumar). - Allow devfreq drivers to fetch devfreq instances by DT enumeration instead of using explicit phandles and modify the devfreq core code to support driver-specific devfreq DT bindings (Leonard Crestez, Chanwoo Choi). - Improve initial hardware resetting in the tegra30 devfreq driver and clean up the tegra cpuidle driver (Dmitry Osipenko). - Update the cpuidle core to collect state entry rejection statistics and expose them via sysfs (Lina Iyer). - Improve the ACPI _CST code handling diagnostics (Chen Yu). - Update the PSCI cpuidle driver to allow the PM domain initialization to occur in the OSI mode as well as in the PC mode (Ulf Hansson). - Rework the generic power domains (genpd) core code to allow domain power off transition to be aborted in the absence of the "power off" domain callback (Ulf Hansson). - Fix two suspend-to-idle issues in the ACPI EC driver (Rafael Wysocki). - Fix the handling of timer_expires in the PM-runtime framework on 32-bit systems and the handling of device links in it (Grygorii Strashko, Xiang Chen). - Add IO requests batching support to the hibernate image saving and reading code and drop a bogus get_gendisk() from there (Xiaoyi Chen, Christoph Hellwig). - Allow PCIe ports to be put into the D3cold power state if they are power-manageable via ACPI (Lukas Wunner). - Add missing header file include to a power capping driver (Pujin Shi). - Clean up the qcom-cpr AVS driver a bit (Liu Shixin). - Kevin Hilman steps down as designated reviwer of adaptive voltage scaling (AVS) drivers (Kevin Hilman)" * tag 'pm-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (65 commits) cpufreq: stats: Fix string format specifier mismatch arm: disable frequency invariance for CONFIG_BL_SWITCHER cpufreq,arm,arm64: restructure definitions of arch_set_freq_scale() cpufreq: stats: Add memory barrier to store_reset() cpufreq: schedutil: Simplify sugov_fast_switch() ACPI: EC: PM: Drop ec_no_wakeup check from acpi_ec_dispatch_gpe() ACPI: EC: PM: Flush EC work unconditionally after wakeup PCI/ACPI: Whitelist hotplug ports for D3 if power managed by ACPI PM: hibernate: remove the bogus call to get_gendisk() in software_resume() cpufreq: Move traces and update to policy->cur to cpufreq core cpufreq: stats: Enable stats for fast-switch as well cpufreq: stats: Mark few conditionals with unlikely() cpufreq: stats: Remove locking cpufreq: stats: Defer stats update to cpufreq_stats_record_transition() PM: domains: Allow to abort power off when no ->power_off() callback PM: domains: Rename power state enums for genpd PM / devfreq: tegra30: Improve initial hardware resetting PM / devfreq: event: Change prototype of devfreq_event_get_edev_by_phandle function PM / devfreq: Change prototype of devfreq_get_devfreq_by_phandle function PM / devfreq: Add devfreq_get_devfreq_by_node function ...
2020-10-13power: supply: bq25980: Fix uninitialized wd_reg_val and overrunDan Murphy1-14/+15
Fix the issue when 'i' is equal to array size then array index over runs the array when checking for the watch dog value. Fixes: 5069185fc18e ("power: supply: bq25980: Add support for the BQ259xx family") Signed-off-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-10power: supply: ltc2941: Fix ptr to enum castIskren Chernev1-1/+2
clang complains about casting pointers to smaller enum types. Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-09Merge tag 'for-v5.9-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supplyLinus Torvalds1-0/+6
Pull power supply fix from Sebastian Reichel: "Just a single change to revert enablement of packet error checking for battery data on Chromebooks, since some of their embedded controllers do not handle it correctly" * tag 'for-v5.9-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power: supply: sbs-battery: chromebook workaround for PEC
2020-10-09power: supply: sbs-battery: chromebook workaround for PECSebastian Reichel1-0/+6
Looks like the I2C tunnel implementation from Chromebook's embedded controller does not handle PEC correctly. Fix this by disabling PEC for batteries behind those I2C tunnels as a workaround. Note, that some Chromebooks actually have been reported to have working PEC support (with I2C tunnel). Since the problem has not yet been fully understood this simply reverts all Chromebooks to not use PEC for now. Reported-by: "Milan P. Stanić" <mps@arvanta.net> Reported-by: Vicente Bergas <vicencb@gmail.com> CC: Enric Balletbo i Serra <enric.balletbo@collabora.com> Fixes: 7222bd603dd2 ("power: supply: sbs-battery: add PEC support") Tested-by: Vicente Bergas <vicencb@gmail.com> Tested-by: "Milan P. Stanić" <mps@arvanta.net> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-09power: supply: test-power: revise parameter printing to use sprintfHarley A.W. Lorenzo1-19/+13
Simplify code by using sprintf instead of strcpy+strcat+strlen. Signed-off-by: Harley A.W. Lorenzo <hl1998@protonmail.com> Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-09power: supply: charger-manager: fix incorrect check on charging_duration_msColin Ian King1-1/+1
Currently the duration check on the discharging duration setting is checking the charging duration rather than the discharging duration due to a cut-n-paste coding error. Fix this by checking the value desc->charging_max_duration_ms. Addresses-Coverity: ("Copy-paste-error") Fixes: 8fcfe088e21a ("charger-manager: Support limit of maximum possible") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-09power: supply: max17040: Fix ptr to enum castIskren Chernev1-1/+1
clang complains about casting pointers to smaller enum types. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-08power: supply: bq25980: Fix uninitialized wd_reg_valDan Murphy1-1/+1
Fix the uninitialized wd_reg_val if the for..loop was not successful in finding an appropriate match. Fixes: 5069185fc18e ("power: supply: bq25980: Add support for the BQ259xx family") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-08power: supply: bq25980: remove redundant zero check on retColin Ian King1-3/+0
Currently ret is assigned to zero and the following statement checks if it is non-zero. This check is redundant and can be removed Addresses-Coverity: ("Logically dead code") Fixes: 5069185fc18e ("power: supply: bq25980: Add support for the BQ259xx family") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-08power: reset: ocelot: Add support for Sparx5Lars Povlsen2-14/+44
This adds reset support for Sparx5 in the ocelot-reset driver. Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-10-06power: supply: sbs-battery: keep error code when get_property() failsIkjoon Jang1-15/+9
Commit 395a7251dc2b (power: supply: sbs-battery: don't assume i2c errors as battery disconnect) overwrites the original error code returned from internal functions. On such a sporadic i2c error, a user will get a wrong value without errors. Fixes: 395a7251dc2b (power: supply: sbs-battery: don't assume i2c errors as battery disconnect) Signed-off-by: Ikjoon Jang <ikjn@chromium.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>