3353 Commits

Author SHA1 Message Date
Linus Torvalds
28a1b05678 i2c-for-6.15-rc1
i2c-core updates (collected by Wolfram)
 
  - remove last user and unexport i2c_of_match_device()
  - irq usage cleanup from Jiri
 
 i2c-host updates (collected by Andi)
 
 Refactoring and cleanups
  - octeon, cadence, i801, pasemi, mlxbf, bcm-iproc: general
    refactorings
  - octeon: remove 10-bit address support
 
 Improvements
  - amd-asf: improved error handling
  - designware: use guard(mutex)
  - amd-asf, designware: update naming to follow latest specs
  - cadence: fix cleanup path in probe
  - i801: use MMIO and I/O mapping helpers to access registers
  - pxa: handle error after clk_prepare_enable
 
 New features
  - added i2c_10bit_addr_*_from_msg() and updated multiple drivers
  - omap: added multiplexer state handling
  - qcom-geni: update frequency configuration
  - qup: introduce DMA usage policy
 
 New hardware support
  - exynos: add support for Samsung exynos7870
  - k1: add support for spacemit k1 (new driver)
  - imx: add support for i.mx94 lpi2c
  - rk3x: add support for rk3562
  - designware: add support for Renesas RZ/N1D
 
 Multiplexers
  - ltc4306, reg: fix assignment in platform_driver structure
 
 at24 eeprom updates (collected by Bartosz)
 
 - add two new compatible entries to the DT binding document
 - drop of_match_ptr() and ACPI_PTR() macros
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmfoBuwACgkQFA3kzBSg
 KbZ+xg/9EEJIae2OVU1o7Ea4kPeyQEdLd2c6wjdrBWRdKuMcBMXR5y16yNI73bWZ
 greZpQDM3AQDNDoJQRe0502pjY/IzVmG6cgDqEdkI0/9x09e2Tk4UJacJttWbcS1
 eCvfvn+yIC2XFoDH/kQozoxSnADXF7yA4XFjF0ljosk+kbtTj6VYV4P0iOkyTaM6
 yWiU55X7x6S6P4pLtY+KByTFEfwV5YLBIJZv4U7sGR+XghUkFfa5mg3ZfblKDIe3
 7SU1XLwSpLbLDf5xn1GMJEHZoq+Glqvrg32TSwbPcV6Aqf67LGXcTvUd+lPxWDsk
 rrpylo4XCfSgBn26NuCJBVWXmtraa1QEKrKvNw+7jIakxJ32YuAo/Lvc2Jk3KMcy
 bdOLR3C5RXNJAE2QDgsIspp3VJSMk43aeLhJm/zATu4sEjOUc0tNwQueXeuVXbp2
 X9wX9ErPBpwn9f2jCZ1+v4vRbQbmQZREo6xVzNUd/AJf3muthKBP7tLokxq9pNlx
 q/x6N4PGy+x9MFT8BIwNgPpP4i8bVtWh+RJL68jh3WQoqNigkDGD0qmO/MZkHUeW
 n+pdI1MpoMaB+BH3HmWuTCOMYGNo4hfdrrAhmdh3fqQRrikgEXxXp3jicRBjoih+
 vSgjQ5Q4bwhHzYqRNbBWVIvgSayQKVbaLqkbWjoWdngJCOUU7Tw=
 =q/EK
 -----END PGP SIGNATURE-----

Merge tag 'i2c-for-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c updates from Wolfram Sang:
 "i2c-core updates (collected by Wolfram):
   - remove last user and unexport i2c_of_match_device()
   - irq usage cleanup from Jiri

  i2c-host updates (collected by Andi):

  Refactoring and cleanups:
   - octeon, cadence, i801, pasemi, mlxbf, bcm-iproc: general
     refactorings
   - octeon: remove 10-bit address support

  Improvements:
   - amd-asf: improved error handling
   - designware: use guard(mutex)
   - amd-asf, designware: update naming to follow latest specs
   - cadence: fix cleanup path in probe
   - i801: use MMIO and I/O mapping helpers to access registers
   - pxa: handle error after clk_prepare_enable

  New features:
   - added i2c_10bit_addr_*_from_msg() and updated multiple drivers
   - omap: added multiplexer state handling
   - qcom-geni: update frequency configuration
   - qup: introduce DMA usage policy

  New hardware support:
   - exynos: add support for Samsung exynos7870
   - k1: add support for spacemit k1 (new driver)
   - imx: add support for i.mx94 lpi2c
   - rk3x: add support for rk3562
   - designware: add support for Renesas RZ/N1D

  Multiplexers:
   - ltc4306, reg: fix assignment in platform_driver structure

  at24 eeprom updates (collected by Bartosz):
   - add two new compatible entries to the DT binding document
   - drop of_match_ptr() and ACPI_PTR() macros"

* tag 'i2c-for-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (50 commits)
  dt-bindings: i2c: snps,designware-i2c: describe Renesas RZ/N1D variant
  irqdomain: i2c: Switch to irq_find_mapping()
  i2c: iproc: Refactor prototype and remove redundant error checks
  i2c: qcom-geni: Update i2c frequency table to match hardware guidance
  i2c: mlxbf: Use readl_poll_timeout_atomic() for polling
  i2c: pasemi: Add registers bits and switch to BIT()
  i2c: k1: Initialize variable before use
  i2c: spacemit: add support for SpacemiT K1 SoC
  dt-bindings: i2c: spacemit: add support for K1 SoC
  i2c: omap: Add support for setting mux
  dt-bindings: i2c: omap: Add mux-states property
  i2c: octeon: remove 10-bit addressing support
  i2c: octeon: fix return commenting
  i2c: i801: Use MMIO if available
  i2c: i801: Switch to iomapped register access
  i2c: i801: Improve too small kill wait time in i801_check_post
  i2c: i801: Move i801_wait_intr and i801_wait_byte_done in the code
  i2c: i801: Cosmetic improvements
  i2c: cadence: Move reset_control_assert after pm_runtime_set_suspended in probe error path
  i2c: cadence: Simplify using devm_clk_get_enabled()
  ...
2025-04-01 14:21:02 -07:00
Linus Torvalds
d6b02199cd - The 7 patch series "powerpc/crash: use generic crashkernel
reservation" from Sourabh Jain changes powerpc's kexec code to use more
   of the generic layers.
 
 - The 2 patch series "get_maintainer: report subsystem status
   separately" from Vlastimil Babka makes some long-requested improvements
   to the get_maintainer output.
 
 - The 4 patch series "ucount: Simplify refcounting with rcuref_t" from
   Sebastian Siewior cleans up and optimizing the refcounting in the ucount
   code.
 
 - The 12 patch series "reboot: support runtime configuration of
   emergency hw_protection action" from Ahmad Fatoum improves the ability
   for a driver to perform an emergency system shutdown or reboot.
 
 - The 16 patch series "Converge on using secs_to_jiffies() part two"
   from Easwar Hariharan performs further migrations from
   msecs_to_jiffies() to secs_to_jiffies().
 
 - The 7 patch series "lib/interval_tree: add some test cases and
   cleanup" from Wei Yang permits more userspace testing of kernel library
   code, adds some more tests and performs some cleanups.
 
 - The 2 patch series "hung_task: Dump the blocking task stacktrace" from
   Masami Hiramatsu arranges for the hung_task detector to dump the stack
   of the blocking task and not just that of the blocked task.
 
 - The 4 patch series "resource: Split and use DEFINE_RES*() macros" from
   Andy Shevchenko provides some cleanups to the resource definition
   macros.
 
 - Plus the usual shower of singleton patches - please see the individual
   changelogs for details.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQTTMBEPP41GrTpTJgfdBJ7gKXxAjgUCZ+nuqwAKCRDdBJ7gKXxA
 jtNqAQDxqJpjWkzn4yN9CNSs1ivVx3fr6SqazlYCrt3u89WQvwEA1oRrGpETzUGq
 r6khQUIcQImPPcjFqEFpuiSOU0MBZA0=
 =Kii8
 -----END PGP SIGNATURE-----

Merge tag 'mm-nonmm-stable-2025-03-30-18-23' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull non-MM updates from Andrew Morton:

 - The series "powerpc/crash: use generic crashkernel reservation" from
   Sourabh Jain changes powerpc's kexec code to use more of the generic
   layers.

 - The series "get_maintainer: report subsystem status separately" from
   Vlastimil Babka makes some long-requested improvements to the
   get_maintainer output.

 - The series "ucount: Simplify refcounting with rcuref_t" from
   Sebastian Siewior cleans up and optimizing the refcounting in the
   ucount code.

 - The series "reboot: support runtime configuration of emergency
   hw_protection action" from Ahmad Fatoum improves the ability for a
   driver to perform an emergency system shutdown or reboot.

 - The series "Converge on using secs_to_jiffies() part two" from Easwar
   Hariharan performs further migrations from msecs_to_jiffies() to
   secs_to_jiffies().

 - The series "lib/interval_tree: add some test cases and cleanup" from
   Wei Yang permits more userspace testing of kernel library code, adds
   some more tests and performs some cleanups.

 - The series "hung_task: Dump the blocking task stacktrace" from Masami
   Hiramatsu arranges for the hung_task detector to dump the stack of
   the blocking task and not just that of the blocked task.

 - The series "resource: Split and use DEFINE_RES*() macros" from Andy
   Shevchenko provides some cleanups to the resource definition macros.

 - Plus the usual shower of singleton patches - please see the
   individual changelogs for details.

* tag 'mm-nonmm-stable-2025-03-30-18-23' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (77 commits)
  mailmap: consolidate email addresses of Alexander Sverdlin
  fs/procfs: fix the comment above proc_pid_wchan()
  relay: use kasprintf() instead of fixed buffer formatting
  resource: replace open coded variant of DEFINE_RES()
  resource: replace open coded variants of DEFINE_RES_*_NAMED()
  resource: replace open coded variant of DEFINE_RES_NAMED_DESC()
  resource: split DEFINE_RES_NAMED_DESC() out of DEFINE_RES_NAMED()
  samples: add hung_task detector mutex blocking sample
  hung_task: show the blocker task if the task is hung on mutex
  kexec_core: accept unaccepted kexec segments' destination addresses
  watchdog/perf: optimize bytes copied and remove manual NUL-termination
  lib/interval_tree: fix the comment of interval_tree_span_iter_next_gap()
  lib/interval_tree: skip the check before go to the right subtree
  lib/interval_tree: add test case for span iteration
  lib/interval_tree: add test case for interval_tree_iter_xxx() helpers
  lib/rbtree: add random seed
  lib/rbtree: split tests
  lib/rbtree: enable userland test suite for rbtree related data structure
  checkpatch: describe --min-conf-desc-length
  scripts/gdb/symbols: determine KASLR offset on s390
  ...
2025-04-01 10:06:52 -07:00
Linus Torvalds
556f1b4874 power supply and reset changes for the 6.15 series
* power-supply core
   - remove unused set_charged infrastructure
   - drop of_node from power_supply struct
  * power-supply drivers
   - axp717: support devices without thermistors
   - bq27xxx: support max design voltage for bq270x0 and bq27x10
   - pcf50633: drop charger driver
   - max1720x: add battery health support
   - switch all power-supply devices from of_node to fwnode
   - convert regmap users to maple tree register cache
   - convert drivers to devm_kmemdup_array
   - misc cleanups and fixes
  * reset drivers
   - at91-sama5d2_shdwc: add sama7d65 support
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmfmAhAACgkQ2O7X88g7
 +pqUVA//QoohKXgC1WOsias7WU0pw+D+zjpGUtiCTyw0EVBjEGcRiK1Fa2mhgn0x
 jQnB84K0WbNZN9uuquMZXBBU7lMQIX/Lltjsy04Y0ZpEdvaO7XpbHXfumy/O5q/3
 xqQzJm+sscE/jBLABauLchSu3Ro3/RlazG9N6XWA8MS9cqUx0wJqsXaITLvrFAsP
 mgV+Ybnusnd1oHjbceccPZzUHqWeBVHE5+fpJlB8HfrmovG3jvfjRtaUabsmhHVM
 afpDXHx7amGJVU3Ild8CRp7UGM0w3RXk7HT3e98o6lzVsULP6JwyCBKq7pUivjF8
 xnGROrpyuYl8yZ8U55cROk0kxEu984o7h1b+SU6ZEXtXwOCUn6Cb+eOSxNUmCKi4
 orl8iEdO/Elxe+L6LnbQUcSgnGg3w6Ugl9rAb+MJ/8R6srrFpghAv7WnnRgJFmKW
 Yt58NtQzCs6yLtgMcnhE98sGgBCD/uBV8xxqtntiKXReTREfVy+dFGlRCJJCSmBN
 TNg49PgOKUyAOYR/7NBBlco9YKMgsKzb3vfOmoO+o3VQy0WYRrC3wOOGkUTQVfTb
 oPXdB3H4hD+eZ5SvGtwSm3E23LWhBlLfb8Zoo45oRpYzqmfQ3vUekKuuzGlScgPY
 Anpua874fJk07SYyz8nE/VMR2BjVyz3Jf98zKdO0Gw35FXDcaTQ=
 =C0aa
 -----END PGP SIGNATURE-----

Merge tag 'for-v6.15' of 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:
   - remove unused set_charged infrastructure
   - drop of_node from power_supply struct

  Power-supply drivers:
   - axp717: support devices without thermistors
   - bq27xxx: support max design voltage for bq270x0 and bq27x10
   - pcf50633: drop charger driver
   - max1720x: add battery health support
   - switch all power-supply devices from of_node to fwnode
   - convert regmap users to maple tree register cache
   - convert drivers to devm_kmemdup_array
   - misc cleanups and fixes

  Reset drivers:
   - at91-sama5d2_shdwc: add sama7d65 support

* tag 'for-v6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (30 commits)
  power: supply: mt6370: Remove redundant 'flush_workqueue()' calls
  Revert "power: supply: bq27xxx: do not report bogus zero values"
  power: supply: max77693: Fix wrong conversion of charge input threshold value
  power: supply: pcf50633: Remove charger
  power: supply: all: switch psy_cfg from of_node to fwnode
  power: supply: core: get rid of of_node
  power: reset: at91-sama5d2_shdwc: Add sama7d65 PMC
  power: supply: smb347: convert to use maple tree register cache
  power: supply: rt9455: convert to use maple tree register cache
  power: supply: max1720x: convert to use maple tree register cache
  power: supply: ltc4162l: convert to use maple tree register cache
  power: supply: bq25980: convert to use maple tree register cache
  power: supply: bq25890: convert to use maple tree register cache
  power: supply: bq2515x: convert to use maple tree register cache
  power: supply: bq24257: convert to use maple tree register cache
  power: supply: bd99954: convert to use maple tree register cache
  power: supply: Remove unused set_charged method
  power: supply: ds2760: Remove unused ds2760_battery_set_charged
  power: supply: core: Remove unused power_supply_set_battery_charged
  power: supply: sc27xx: use devm_kmemdup_array()
  ...
2025-03-29 18:11:12 -07:00
Linus Torvalds
dcab75a3c8 * Maxim MAX77705:
* Added core MFD driver.
     * Added charger driver.
     * Added devicetree bindings for the charger and MFD core.
     * Added Haptic controller support via the input subsystem.
     * Added LED support.
     * Added support to simple-mfd-i2c for fuel gauge and hwmon.
   * Samsung S2MPU05 (Exynos7870 PMIC):
     * Added core MFD support.
     * Added Regulator support for 21 LDOs and 5 BUCKs.
     * Added devicetree bindings for regulators and the PMIC core.
   * TI TPS65215 & TPS65214:
     * Added support to the existing TPS65219 driver.
     * Added devicetree bindings.
   * STMicroelectronics STM32MP25:
     * Added support to the stm32-timers MFD driver.
     * Added devicetree bindings.
   * Congatec Board Controller (CGBC):
     * Added HWMON support for internal sensors.
     * Added support for the conga-SA8 module.
   * Microchip LAN969X:
     * Enabled the at91-usart MFD driver for this architecture.
   * MediaTek MT6359:
     * Added mfd_cell for mt6359-accdet to allow its driver to probe.
 
   * AXP20X (AXP717): Added AXP717_TS_PIN_CFG register to writeable
     regs for temperature sensor configuration.
   * SM501: Switched to using BIT() macro to mitigate potential
     integer overflows in GPIO functions.
   * ENE KB3930: Added a NULL pointer check for off_gpios during
     probe to prevent potential dereference.
   * SYSCON: Added a check for invalid resource size to prevent
     issues from DT misconfiguration.
   * CGBC: Corrected signedness issues in cgbc_session_request.
 
   * intel_soc_pmic_chtdc_ti / intel_soc_pmic_crc: Removed unneeded
     explicit assignment to REGCACHE_NONE.
   * ipaq-micro / tps65010: Switched to using str_enable_disable()
     helpers for clarity and potential size reduction.
   * upboard-fpga: Removed unnecessary ACPI_PTR() annotation.
   * max8997: Removed unused max8997_irq_exit() function, using
     devm_* helpers instead.
   * lp3943: Dropped unused #include <linux/pwm.h> from the header
     file.
   * db8500-prcmu: Removed needless return statements in void APIs.
   * qnap-mcu: Replaced commas with semicolons between expressions
     for correctness.
 
   * STA2X11: Removed the core MFD driver as the underlying
     platform support was removed.
   * EZX-PCAP: Removed the unused pcap_adc_sync function.
   * PCF50633 (OpenMoko PMIC): Removed the entire driver (core, adc,
     gpio, irq) as the underlying s3c24xx platform support was removed.
 
   * Converted fsl,mcu-mpc8349emitx binding to YAML.
   * Added qcom,msm8937-tcsr compatible.
   * Added microchip,sama7d65-flexcom compatible.
   * Added rockchip,rk3528-qos syscon compatible.
   * Added airoha,en7581-pbus-csr syscon compatible.
   * Added microchip,sama7d65-ddr3phy syscon compatible.
   * Added microchip,sama7d65-sfrbu syscon compatible.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmfmqKQACgkQUa+KL4f8
 d2G+rA//UU3UixCD8FsNN+o4DS7FbxdiSUCrATOBKia9MGfor4xCl6Qk9ZyO4sE1
 Rr9zUrTb1xlCmMZupZlkV8TDHHcaiUbgmnKB161d4HMxCbju10MKlm7faz2vRMz3
 a73ehTmUeNDiWG3t1/2zAyRt7PHPC2zakUlnXlLhLir12uR2jsDSeGOZh4xR7Hdi
 5nkOA2xWbbeW4b+ybwZ32afbLtZFkLo80QvqDx/D9lMUnQO0FqKak0Zope7IzeqC
 ilg+tIJOQRGEbjEVQ+pVXsPI6zfmO8eAja70F7sm+Q6TVDw2JhHU/YElHw+quiP+
 aLYeE+DuSun1EYlK4ATQ0vzUdgsaOEWblF0eythctXFTfM9ZKhzWYdXEOvco7N4u
 R9BYRtM/zGkxiScbr6igyjWZx7NPOsKEKIi5tOv+C2BAKb53om7vsNuMgvMDL/8W
 gztmG0SMKwJSx2Dg7h1LLUfa3tG9QRFd0I+Yfaso3MtYmxnZVcJtM5IQbvzf6i/B
 3fSiGP6PDNeJqbn9k3/7SB8Tb4XmJUN2LFdDtDuWVhgZpSDULkjpYxAXDIrbp+il
 QNdLPiU1x7OzPkFZQxtXLt7yRmlEc2lu9jJHkGVM1M18TMexQiFxoSY9NxkbUj3o
 T4s/PKGmRKHP9XxCmRSfu6Veql0MPUwtvkErlUf4GTLWK4oshag=
 =ntF1
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "Maxim MAX77705:
   - Added core MFD driver.
   - Added charger driver.
   - Added devicetree bindings for the charger and MFD core.
   - Added Haptic controller support via the input subsystem.
   - Added LED support.
   - Added support to simple-mfd-i2c for fuel gauge and hwmon.

  Samsung S2MPU05 (Exynos7870 PMIC):
   - Added core MFD support.
   - Added Regulator support for 21 LDOs and 5 BUCKs.
   - Added devicetree bindings for regulators and the PMIC core.

  TI TPS65215 & TPS65214:
   - Added support to the existing TPS65219 driver.
   - Added devicetree bindings.

  STMicroelectronics STM32MP25:
   - Added support to the stm32-timers MFD driver.
   - Added devicetree bindings.

  Congatec Board Controller (CGBC):
   - Added HWMON support for internal sensors.
   - Added support for the conga-SA8 module.

  Microchip LAN969X:
   - Enabled the at91-usart MFD driver for this architecture.

  MediaTek MT6359:
   - Added mfd_cell for mt6359-accdet to allow its driver to probe.

  Other misc driver updates:
   - AXP20X (AXP717): Added AXP717_TS_PIN_CFG register to writeable regs
     for temperature sensor configuration.
   - SM501: Switched to using BIT() macro to mitigate potential integer
     overflows in GPIO functions.
   - ENE KB3930: Added a NULL pointer check for off_gpios during probe
     to prevent potential dereference.
   - SYSCON: Added a check for invalid resource size to prevent issues
     from DT misconfiguration.
   - CGBC: Corrected signedness issues in cgbc_session_request
   - intel_soc_pmic_chtdc_ti / intel_soc_pmic_crc: Removed unneeded
     explicit assignment to REGCACHE_NONE.
   - ipaq-micro / tps65010: Switched to using str_enable_disable()
     helpers for clarity and potential size reduction.
   - upboard-fpga: Removed unnecessary ACPI_PTR() annotation.
   - max8997: Removed unused max8997_irq_exit() function, using devm_*
     helpers instead.
   - lp3943: Dropped unused #include <linux/pwm.h> from the header file.
   - db8500-prcmu: Removed needless return statements in void APIs.
   - qnap-mcu: Replaced commas with semicolons between expressions for
     correctness.
   - STA2X11: Removed the core MFD driver as the underlying platform
     support was removed.
   - EZX-PCAP: Removed the unused pcap_adc_sync function.
   - PCF50633 (OpenMoko PMIC): Removed the entire driver (core, adc,
     gpio, irq) as the underlying s3c24xx platform support was removed.

  Devicetree updates:
   - Converted fsl,mcu-mpc8349emitx binding to YAML
   - Added qcom,msm8937-tcsr compatible
   - Added microchip,sama7d65-flexcom compatible
   - Added rockchip,rk3528-qos syscon compatible
   - Added airoha,en7581-pbus-csr syscon compatible
   - Added microchip,sama7d65-ddr3phy syscon compatible
   - Added microchip,sama7d65-sfrbu syscon compatible"

* tag 'mfd-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (49 commits)
  mfd: cgbc-core: Add support for conga-SA8
  dt-bindings: mfd: syscon: Add microchip,sama7d65-sfrbu
  dt-bindings: mfd: syscon: Add microchip,sama7d65-ddr3phy
  mfd: cgbc: Add support for HWMON
  dt-bindings: mfd: syscon: Add the pbus-csr node for Airoha EN7581 SoC
  mfd: cgbc-core: Cleanup signedness in cgbc_session_request()
  mfd: pcf50633: Remove remaining PCF50633 support
  mfd: pcf50633: Remove unused platform IRQ code
  mfd: pcF50633-gpio: Remove unused driver
  mfd: pcf50633-adc: Remove unused driver
  mfd: qnap-mcu: Convert commas to semicolons in qnap_mcu_exec()
  mfd: mt6397-core: Add mfd_cell for mt6359-accdet
  dt-bindings: mfd: syscon: Add rk3528 QoS register compatible
  dt-bindings: mfd: atmel,sama5d2-flexcom: Add microchip,sama7d65-flexcom
  mfd: ezx-pcap: Remove unused pcap_adc_sync
  mfd: db8500-prcmu: Remove needless return in three void APIs
  mfd: Remove STA2x11 core driver
  mfd: max77620: Allow building as a module
  mfd: ene-kb3930: Fix a potential NULL pointer dereference
  dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8937
  ...
2025-03-29 14:33:13 -07:00
Linus Torvalds
a50b4fe095 A treewide hrtimer timer cleanup
hrtimers are initialized with hrtimer_init() and a subsequent store to
   the callback pointer. This turned out to be suboptimal for the upcoming
   Rust integration and is obviously a silly implementation to begin with.
 
   This cleanup replaces the hrtimer_init(T); T->function = cb; sequence
   with hrtimer_setup(T, cb);
 
   The conversion was done with Coccinelle and a few manual fixups.
 
   Once the conversion has completely landed in mainline, hrtimer_init()
   will be removed and the hrtimer::function becomes a private member.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCgAxFiEEQp8+kY+LLUocC4bMphj1TA10mKEFAmff5jQTHHRnbHhAbGlu
 dXRyb25peC5kZQAKCRCmGPVMDXSYoVvRD/wKtuwmiA66NJFgXC0qVq82A6fO3bY8
 GBdbfysDJIbqGu5PTcULTbJ8qkqv3jeLUv6CcXvS4sZ7y/uJQl2lzf8yrD/0bbwc
 rLI6sHiPSZmK93kNVN4X5H7kvt7cE/DYC9nnEOgK3BY5FgKc4n9887d4aVBhL8Lv
 ODwVXvZ+xi351YCj7qRyPU24zt/p4tkkT1o2k4a0HBluqLI0D+V20fke9IERUL8r
 d1uWKlcn0TqYDesE8HXKIhbst3gx52rMJrXBJDHwFmG6v8Pj1fkTXCVpPo8QcBz8
 OTVkpomN9f/Tx4+GZwhZOF86LhLL3OhxD6pT7JhFCXdmSGv+Ez8uyk1YZysM/XpV
 Juy/1yAcBpDIDkmhMFGdAAn48Nn9Fotty0r4je60zSEp1d/4QMXcFme29qr2JTUE
 iWnQ/HD6DxUjVHqy7CYvvo26Xegg1C7qgyOVt4PYZwAM1VKF5P3kzYTb4SAdxtop
 Tpji1sfW9QV08jqMNo6XntD32DSP9S2HqjO9LwBw700jnx2jjJ35fcJs6iodMOUn
 gckIZLMn3L0OoglPdyA5O7SNTbKE7aFiRKdnT/cJtR3Fa39Qu27CwC5gfiyuie9I
 Q+LG8GLuYSBHXAR+PBK4GWlzJ7Dn8k3eqmbnLeKpRMsU6ZzcttgA64xhaviN2wN0
 iJbvLJeisXr3GA==
 =bYAX
 -----END PGP SIGNATURE-----

Merge tag 'timers-cleanups-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer cleanups from Thomas Gleixner:
 "A treewide hrtimer timer cleanup

  hrtimers are initialized with hrtimer_init() and a subsequent store to
  the callback pointer. This turned out to be suboptimal for the
  upcoming Rust integration and is obviously a silly implementation to
  begin with.

  This cleanup replaces the hrtimer_init(T); T->function = cb; sequence
  with hrtimer_setup(T, cb);

  The conversion was done with Coccinelle and a few manual fixups.

  Once the conversion has completely landed in mainline, hrtimer_init()
  will be removed and the hrtimer::function becomes a private member"

* tag 'timers-cleanups-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (100 commits)
  wifi: rt2x00: Switch to use hrtimer_update_function()
  io_uring: Use helper function hrtimer_update_function()
  serial: xilinx_uartps: Use helper function hrtimer_update_function()
  ASoC: fsl: imx-pcm-fiq: Switch to use hrtimer_setup()
  RDMA: Switch to use hrtimer_setup()
  virtio: mem: Switch to use hrtimer_setup()
  drm/vmwgfx: Switch to use hrtimer_setup()
  drm/xe/oa: Switch to use hrtimer_setup()
  drm/vkms: Switch to use hrtimer_setup()
  drm/msm: Switch to use hrtimer_setup()
  drm/i915/request: Switch to use hrtimer_setup()
  drm/i915/uncore: Switch to use hrtimer_setup()
  drm/i915/pmu: Switch to use hrtimer_setup()
  drm/i915/perf: Switch to use hrtimer_setup()
  drm/i915/gvt: Switch to use hrtimer_setup()
  drm/i915/huc: Switch to use hrtimer_setup()
  drm/amdgpu: Switch to use hrtimer_setup()
  stm class: heartbeat: Switch to use hrtimer_setup()
  i2c: Switch to use hrtimer_setup()
  iio: Switch to use hrtimer_setup()
  ...
2025-03-25 10:54:15 -07:00
Wolfram Sang
21fd849535 i2c-host updates for v6.15
Refactoring and cleanups
  - octeon, cadence, i801, pasemi, mlxbf, bcm-iproc: general
    refactorings
  - octeon: remove 10-bit address support
 
 Improvements
  - amd-asf: improved error handling
  - designware: use guard(mutex)
  - amd-asf, designware: update naming to follow latest specs
  - cadence: fix cleanup path in probe
  - i801: use MMIO and I/O mapping helpers to access registers
  - pxa: handle error after clk_prepare_enable
 
 New features
  - added i2c_10bit_addr_*_from_msg() and updated multiple drivers
  - omap: added multiplexer state handling
  - qcom-geni: update frequency configuration
  - qup: introduce DMA usage policy
 
 New hardware support
  - exynos: add support for Samsung exynos7870
  - k1: add support for spacemit k1 (new driver)
  - imx: add support for i.mx94 lpi2c
  - rk3x: add support for rk3562
 
 Multiplexers
  - ltc4306, reg: fix assignment in platform_driver structure
 -----BEGIN PGP SIGNATURE-----
 
 iIwEABYIADQWIQScDfrjQa34uOld1VLaeAVmJtMtbgUCZ97X5hYcYW5kaS5zaHl0
 aUBrZXJuZWwub3JnAAoJENp4BWYm0y1uU9AA/RP+DKnscKffF0ZMz7FPDHQ+uzDJ
 bi2WU/vKSKORJN9+AQDdxMOCtqQWbwuWZKNFI9UX4YBW2Tv8heCjgzvZXxmiAg==
 =P/Dk
 -----END PGP SIGNATURE-----

Merge tag 'i2c-host-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux into i2c/for-mergewindow

i2c-host updates for v6.15

Refactoring and cleanups
 - octeon, cadence, i801, pasemi, mlxbf, bcm-iproc: general
   refactorings
 - octeon: remove 10-bit address support

Improvements
 - amd-asf: improved error handling
 - designware: use guard(mutex)
 - amd-asf, designware: update naming to follow latest specs
 - cadence: fix cleanup path in probe
 - i801: use MMIO and I/O mapping helpers to access registers
 - pxa: handle error after clk_prepare_enable

New features
 - added i2c_10bit_addr_*_from_msg() and updated multiple drivers
 - omap: added multiplexer state handling
 - qcom-geni: update frequency configuration
 - qup: introduce DMA usage policy

New hardware support
 - exynos: add support for Samsung exynos7870
 - k1: add support for spacemit k1 (new driver)
 - imx: add support for i.mx94 lpi2c
 - rk3x: add support for rk3562

Multiplexers
 - ltc4306, reg: fix assignment in platform_driver structure
2025-03-25 12:35:59 +01:00
Easwar Hariharan
2c54b24fef power: supply: da9030: convert timeouts to secs_to_jiffies()
Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced
secs_to_jiffies().  As the value here is a multiple of 1000, use
secs_to_jiffies() instead of msecs_to_jiffies() to avoid the
multiplication

This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with
the following Coccinelle rules:

@depends on patch@
expression E;
@@

-msecs_to_jiffies
+secs_to_jiffies
(E
- * \( 1000 \| MSEC_PER_SEC \)
)

Link: https://lkml.kernel.org/r/20250225-converge-secs-to-jiffies-part-two-v3-10-a43967e36c88@linux.microsoft.com
Signed-off-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Cc: Carlos Maiolino <cem@kernel.org>
Cc: Carlos Maiolino <cmaiolino@redhat.com>
Cc: Chris Mason <clm@fb.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Damien Le Maol <dlemoal@kernel.org>
Cc: "Darrick J. Wong" <djwong@kernel.org>
Cc: David Sterba <dsterba@suse.com>
Cc: Dick Kennedy <dick.kennedy@broadcom.com>
Cc: Dongsheng Yang <dongsheng.yang@easystack.cn>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Frank Li <frank.li@nxp.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Ilpo Jarvinen <ilpo.jarvinen@linux.intel.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: James Bottomley <james.bottomley@HansenPartnership.com>
Cc: James Smart <james.smart@broadcom.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Julia Lawall <julia.lawall@inria.fr>
Cc: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Cc: Keith Busch <kbusch@kernel.org>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Mark Brown <broonie@kernel.org>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Nicolas Palix <nicolas.palix@imag.fr>
Cc: Niklas Cassel <cassel@kernel.org>
Cc: Oded Gabbay <ogabbay@kernel.org>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Selvin Thyparampil Xavier <selvin.xavier@broadcom.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Shyam-sundar S-k <Shyam-sundar.S-k@amd.com>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-17 12:16:58 -07:00
Chen Ni
0b8d073f6c power: supply: mt6370: Remove redundant 'flush_workqueue()' calls
'destroy_workqueue()' already drains the queue before destroying it, so
there is no need to flush it explicitly.

Remove the redundant 'flush_workqueue()' calls.

This was generated with coccinelle:

@@
expression E;
@@
- flush_workqueue(E);
  destroy_workqueue(E);

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Link: https://lore.kernel.org/r/20250312073729.1430053-1-nichen@iscas.ac.cn
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-17 16:00:09 +01:00
Sicelo A. Mhlongo
4ebeb27b72 Revert "power: supply: bq27xxx: do not report bogus zero values"
Commit f3974aca381e ("power: supply: bq27xxx: do not report bogus zero
values") breaks property reporting on chips which are reporting normal
values. During testing, excessive emphasis was evidently placed on the
chip with non-working conditions, and not enough testing was done on a
battery that had normal state.

A correct fix will be submitted in a separate patch.

Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
Closes: https://lore.kernel.org/linux-pm/CB5B8FE7-D619-4D30-BD2D-58B6CEF83D46@goldelico.com/
Fixes: f3974aca381e ("power: supply: bq27xxx: do not report bogus zero values")
Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
Link: https://lore.kernel.org/r/20250312121712.146109-2-absicsz@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-17 15:53:59 +01:00
Artur Weber
30cc7b0d0e power: supply: max77693: Fix wrong conversion of charge input threshold value
The charge input threshold voltage register on the MAX77693 PMIC accepts
four values: 0x0 for 4.3v, 0x1 for 4.7v, 0x2 for 4.8v and 0x3 for 4.9v.
Due to an oversight, the driver calculated the values for 4.7v and above
starting from 0x0, rather than from 0x1 ([(4700000 - 4700000) / 100000]
gives 0).

Add 1 to the calculation to ensure that 4.7v is converted to a register
value of 0x1 and that the other two voltages are converted correctly as
well.

Fixes: 87c2d9067893 ("power: max77693: Add charger driver for Maxim 77693")
Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250316-max77693-charger-input-threshold-fix-v1-1-2b037d0ac722@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-17 15:25:24 +01:00
Dr. David Alan Gilbert
aae075a93f power: supply: pcf50633: Remove charger
The pcf50633 was used as part of the OpenMoko devices but
the support for its main chip was recently removed in:
commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support")

See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20250311014959.743322-7-linux@treblig.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-12 07:57:35 +01:00
Sebastian Reichel
46d0c03c55 power: supply: all: switch psy_cfg from of_node to fwnode
When registering a power-supply device, either a of_node or the more
recent fwnode can be supplied. Since fwnode can also contain an of_node,
let's try to get rid of it.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20250225-psy-core-convert-to-fwnode-v1-4-d5e4369936bb@collabora.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:42:34 +01:00
Sebastian Reichel
1342540387 power: supply: core: get rid of of_node
This removes .of_node from 'struct power_supply', since there
is already a copy in .dev.of_node and there is no need to have
two copies.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20250225-psy-core-convert-to-fwnode-v1-1-d5e4369936bb@collabora.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:42:34 +01:00
Ryan Wanner
2fc78cd0a3 power: reset: at91-sama5d2_shdwc: Add sama7d65 PMC
Add sama7d65-pmc compatible string to the list of valid PMC IDs.

Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
Link: https://lore.kernel.org/r/c5fa1d88a072d79db4f1a6b99ad69632a83e8f8d.1740671156.git.Ryan.Wanner@microchip.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:36:33 +01:00
Bo Liu
bfa2b6370b power: supply: smb347: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20250228080236.2759-10-liubo03@inspur.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:30:54 +01:00
Bo Liu
af4499fb2a power: supply: rt9455: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20250228080236.2759-9-liubo03@inspur.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:30:54 +01:00
Bo Liu
dde0409a22 power: supply: max1720x: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20250228080236.2759-8-liubo03@inspur.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:30:54 +01:00
Bo Liu
8cf985e069 power: supply: ltc4162l: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20250228080236.2759-7-liubo03@inspur.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:30:54 +01:00
Bo Liu
f8be87583c power: supply: bq25980: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20250228080236.2759-6-liubo03@inspur.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:30:54 +01:00
Bo Liu
21153cf9a7 power: supply: bq25890: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20250228080236.2759-5-liubo03@inspur.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:30:54 +01:00
Bo Liu
71a7627d3a power: supply: bq2515x: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20250228080236.2759-4-liubo03@inspur.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:30:54 +01:00
Bo Liu
6d166a6986 power: supply: bq24257: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20250228080236.2759-3-liubo03@inspur.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:30:54 +01:00
Bo Liu
0857367003 power: supply: bd99954: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20250228080236.2759-2-liubo03@inspur.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:30:54 +01:00
Dr. David Alan Gilbert
172b7d79f7 power: supply: ds2760: Remove unused ds2760_battery_set_charged
With power_supply_set_battery_charged() deleted in the previous
patch, there's no one left to call the set_charged method.
The only implemented is in ds2760, unwire it and delete the
associated functions and data.

(Arguably it might be time to delete ds2760 since I don't
think there are any users left)

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20250307230225.128775-3-linux@treblig.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:06:41 +01:00
Dr. David Alan Gilbert
46723e2839 power: supply: core: Remove unused power_supply_set_battery_charged
power_supply_set_battery_charged() has been unused since 2019's
commit 0f884f8a090e ("ARM: pxa: remove raumfeld board files and
defconfig")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://lore.kernel.org/r/20250307230225.128775-2-linux@treblig.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-03-08 01:06:41 +01:00
Raag Jadav
76d5fb0e58 power: supply: sc27xx: use devm_kmemdup_array()
Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Link: https://lore.kernel.org/r/20250221165333.2780888-9-raag.jadav@intel.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-02-25 01:50:38 +01:00
Chris Morgan
bbcfe510ec power: supply: axp20x_battery: Update temp sensor for AXP717 from device tree
Allow a boolean property of "x-powers,no-thermistor" to specify devices
where the ts pin is not connected to anything. This works around an
issue found with some devices where the efuse is not programmed
correctly from the factory or when the register gets set erroneously.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Tested-by: Philippe Simons <simons.philippe@gmail.com>
Link: https://lore.kernel.org/r/20250204155835.161973-4-macroalpha82@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-02-21 02:19:29 +01:00
Dzmitry Sankouski
a6a494c8e3 power: supply: max77705: Add charger driver for Maxim 77705
Add driver for Maxim 77705 switch-mode charger.
It providing power supply class information to userspace.

The driver is configured through DTS (battery and system related
settings).

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20250123-starqltechn_integration_upstream-v17-3-8b06685b6612@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-02-20 16:37:23 +00:00
Sicelo A. Mhlongo
45291874a7 power: supply: bq27xxx_battery: do not update cached flags prematurely
Commit 243f8ffc883a1 ("power: supply: bq27xxx_battery: Notify also about
status changes") intended to notify userspace when the status changes,
based on the flags register. However, the cached state is updated too
early, before the flags are tested for any changes. Remove the premature
update.

Fixes: 243f8ffc883a1 ("power: supply: bq27xxx_battery: Notify also about status changes")
Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
Link: https://lore.kernel.org/r/20241125152945.47937-1-absicsz@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-02-20 01:44:45 +01:00
Sicelo A. Mhlongo
f3974aca38 power: supply: bq27xxx: do not report bogus zero values
On the bq27x00 and bq27x10 variants, a number of conditions may reset the value
stored in the NAC register. This will cause capacity, energy, and charge to
report the value 0, even when the battery is full. On the other hand, the chip
also provides a flag, EDVF, which accurately detects the true battery empty
condition, when capacity, charge, and energy are really 0.  Therefore, discard
readings for these properties if their value is 0 while EDVF is unset.

Tested on the Nokia N900 with bq27200.

Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
Link: https://lore.kernel.org/r/20250207220605.106768-1-absicsz@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-02-20 00:49:51 +01:00
Sicelo A. Mhlongo
903599768a power: supply: bq27xxx: Add voltage_max_design property for bq270x0 and bq27x10
Report VOLTAGE_MAX_DESIGN for the bq27x00 and bq27x10 fuel gauges. Per the
datasheet, this value is stored in the Charge Termination Voltage Settings
(QV0 and QV1) of the Pack Configuration register.

Tested on the Nokia N900 with bq27200.

Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
Link: https://lore.kernel.org/r/20250207211521.103357-1-absicsz@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-02-20 00:29:55 +01:00
Dimitri Fedrau
4ad5c72670 power: supply: max1720x: add health property
Add health property, which checks that temperature, voltage and current are
within limits for the battery. Limits can be programmed in non-volatile
memory.

Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
Link: https://lore.kernel.org/r/20250204-max1720x_health-v1-1-97ebbe4a0bc5@liebherr.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-02-20 00:27:50 +01:00
Nam Cao
563608c204 power: reset: ltc2952-poweroff: Switch to use hrtimer_setup()
hrtimer_setup() takes the callback function pointer as argument and
initializes the timer completely.

Replace hrtimer_init() and the open coded initialization of
hrtimer::function with the new setup mechanism.

Patch was created by using Coccinelle.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Zack Rusin <zack.rusin@broadcom.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/all/75ef5206f52f194b9c51653628cd2d0b083a482f.1738746904.git.namcao@linutronix.de
2025-02-18 11:19:04 +01:00
Nam Cao
1b73fd14cf power: supply: ab8500_chargalg: Switch to use hrtimer_setup()
hrtimer_setup() takes the callback function pointer as argument and
initializes the timer completely.

Replace hrtimer_init() and the open coded initialization of
hrtimer::function with the new setup mechanism.

Patch was created by using Coccinelle.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Zack Rusin <zack.rusin@broadcom.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/all/fa0bf7376ce8f124c8285a52d9f55d0ab4c42988.1738746904.git.namcao@linutronix.de
2025-02-18 11:19:04 +01:00
Andrew Kreimer
252e6671d6 power: supply: axp20x_usb_power: Fix typo in dev_warn message
There is a typo in a dev_warn message:
 - reqested -> requested

Fix it via codespell.

Signed-off-by: Andrew Kreimer <algonell@gmail.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20250206083405.10286-1-algonell@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-02-15 04:13:43 +01:00
André Draszik
a893610905 power: supply: max1720x: fix a comment typo
mesaurment -> measurement

Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://lore.kernel.org/r/20250213-max1720x-typo-v1-1-9c88611cac34@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-02-15 04:08:50 +01:00
Andy Shevchenko
c6250d0eab power: ip5xxx_power: Make use of i2c_get_match_data()
Get matching data in one step by switching to use i2c_get_match_data().

Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2025-02-13 16:47:21 +01:00
Chris Morgan
98380110bd power: supply: axp20x_battery: Fix fault handling for AXP717
Correct the fault handling for the AXP717 by changing the i2c write
from regmap_update_bits() to regmap_write_bits(). The update bits
function does not work properly on a RW1C register where we must
write a 1 back to an existing register to clear it.

Additionally, as part of this testing I confirmed the behavior of
errors reappearing, so remove comment about assumptions.

Fixes: 6625767049c2 ("power: supply: axp20x_battery: add support for AXP717")
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20250131231455.153447-2-macroalpha82@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-02-03 12:41:18 +01:00
Hans de Goede
64dd6edfc4 power: supply: core: Fix extension related lockdep warning
Since commit 6037802bbae8 ("power: supply: core: implement extension API")
there is the following ABBA deadlock (simplified) between the LED trigger
code and the power-supply code:

1) When registering a power-supply class device, power_supply_register()
calls led_trigger_register() from power_supply_create_triggers() in
a scoped_guard(rwsem_read, &psy->extensions_sem) context.
led_trigger_register() then in turn takes a LED subsystem lock.
So here we have the following locking order:

* Read-lock extensions_sem
* Lock LED subsystem lock(s)

2) When registering a LED class device, with its default trigger set
to a power-supply LED trigger (which has already been registered)
The LED class code calls power_supply_led_trigger_activate() when
setting up the default trigger. power_supply_led_trigger_activate()
calls power_supply_get_property() to determine the initial value of
to assign to the LED and that read-locks extensions_sem. So now we
have the following locking order:

* Lock LED subsystem lock(s)
* Read-lock extensions_sem

Fixing this is easy, there is no need to hold the extensions_sem when
calling power_supply_create_triggers() since all triggers are always
created rather then checking for the presence of certain attributes as
power_supply_add_hwmon_sysfs() does. Move power_supply_create_triggers()
out of the guard block to fix this.

Here is the lockdep report fixed by this change:

[   31.249343] ======================================================
[   31.249378] WARNING: possible circular locking dependency detected
[   31.249413] 6.13.0-rc6+ #251 Tainted: G         C  E
[   31.249440] ------------------------------------------------------
[   31.249471] (udev-worker)/553 is trying to acquire lock:
[   31.249501] ffff892adbcaf660 (&psy->extensions_sem){.+.+}-{4:4}, at: power_supply_get_property.part.0+0x22/0x150
[   31.249574]
               but task is already holding lock:
[   31.249603] ffff892adbc0bad0 (&led_cdev->trigger_lock){+.+.}-{4:4}, at: led_trigger_set_default+0x34/0xe0
[   31.249657]
               which lock already depends on the new lock.

[   31.249696]
               the existing dependency chain (in reverse order) is:
[   31.249735]
               -> #2 (&led_cdev->trigger_lock){+.+.}-{4:4}:
[   31.249778]        down_write+0x3b/0xd0
[   31.249803]        led_trigger_set_default+0x34/0xe0
[   31.249833]        led_classdev_register_ext+0x311/0x3a0
[   31.249863]        input_leds_connect+0x1dc/0x2a0
[   31.249889]        input_attach_handler.isra.0+0x75/0x90
[   31.249921]        input_register_device.cold+0xa1/0x150
[   31.249955]        hidinput_connect+0x8a2/0xb80
[   31.249982]        hid_connect+0x582/0x5c0
[   31.250007]        hid_hw_start+0x3f/0x60
[   31.250030]        hid_device_probe+0x122/0x1f0
[   31.250053]        really_probe+0xde/0x340
[   31.250080]        __driver_probe_device+0x78/0x110
[   31.250105]        driver_probe_device+0x1f/0xa0
[   31.250132]        __device_attach_driver+0x85/0x110
[   31.250160]        bus_for_each_drv+0x78/0xc0
[   31.250184]        __device_attach+0xb0/0x1b0
[   31.250207]        bus_probe_device+0x94/0xb0
[   31.250230]        device_add+0x64a/0x860
[   31.250252]        hid_add_device+0xe5/0x240
[   31.250279]        usbhid_probe+0x4dc/0x620
[   31.250303]        usb_probe_interface+0xe4/0x2a0
[   31.250329]        really_probe+0xde/0x340
[   31.250353]        __driver_probe_device+0x78/0x110
[   31.250377]        driver_probe_device+0x1f/0xa0
[   31.250404]        __device_attach_driver+0x85/0x110
[   31.250431]        bus_for_each_drv+0x78/0xc0
[   31.250455]        __device_attach+0xb0/0x1b0
[   31.250478]        bus_probe_device+0x94/0xb0
[   31.250501]        device_add+0x64a/0x860
[   31.250523]        usb_set_configuration+0x606/0x8a0
[   31.250552]        usb_generic_driver_probe+0x3e/0x60
[   31.250579]        usb_probe_device+0x3d/0x120
[   31.250605]        really_probe+0xde/0x340
[   31.250629]        __driver_probe_device+0x78/0x110
[   31.250653]        driver_probe_device+0x1f/0xa0
[   31.250680]        __device_attach_driver+0x85/0x110
[   31.250707]        bus_for_each_drv+0x78/0xc0
[   31.250731]        __device_attach+0xb0/0x1b0
[   31.250753]        bus_probe_device+0x94/0xb0
[   31.250776]        device_add+0x64a/0x860
[   31.250798]        usb_new_device.cold+0x141/0x38f
[   31.250828]        hub_event+0x1166/0x1980
[   31.250854]        process_one_work+0x20f/0x580
[   31.250879]        worker_thread+0x1d1/0x3b0
[   31.250904]        kthread+0xee/0x120
[   31.250926]        ret_from_fork+0x30/0x50
[   31.250954]        ret_from_fork_asm+0x1a/0x30
[   31.250982]
               -> #1 (triggers_list_lock){++++}-{4:4}:
[   31.251022]        down_write+0x3b/0xd0
[   31.251045]        led_trigger_register+0x40/0x1b0
[   31.251074]        power_supply_register_led_trigger+0x88/0x150
[   31.251107]        power_supply_create_triggers+0x55/0xe0
[   31.251135]        __power_supply_register.part.0+0x34e/0x4a0
[   31.251164]        devm_power_supply_register+0x70/0xc0
[   31.251190]        bq27xxx_battery_setup+0x1a1/0x6d0 [bq27xxx_battery]
[   31.251235]        bq27xxx_battery_i2c_probe+0xe5/0x17f [bq27xxx_battery_i2c]
[   31.251272]        i2c_device_probe+0x125/0x2b0
[   31.251299]        really_probe+0xde/0x340
[   31.251324]        __driver_probe_device+0x78/0x110
[   31.251348]        driver_probe_device+0x1f/0xa0
[   31.251375]        __driver_attach+0xba/0x1c0
[   31.251398]        bus_for_each_dev+0x6b/0xb0
[   31.251421]        bus_add_driver+0x111/0x1f0
[   31.251445]        driver_register+0x6e/0xc0
[   31.251470]        i2c_register_driver+0x41/0xb0
[   31.251498]        do_one_initcall+0x5e/0x3a0
[   31.251522]        do_init_module+0x60/0x220
[   31.251550]        __do_sys_init_module+0x15f/0x190
[   31.251575]        do_syscall_64+0x93/0x180
[   31.251598]        entry_SYSCALL_64_after_hwframe+0x76/0x7e
[   31.251629]
               -> #0 (&psy->extensions_sem){.+.+}-{4:4}:
[   31.251668]        __lock_acquire+0x13ce/0x21c0
[   31.251694]        lock_acquire+0xcf/0x2e0
[   31.251719]        down_read+0x3e/0x170
[   31.251741]        power_supply_get_property.part.0+0x22/0x150
[   31.251774]        power_supply_update_leds+0x8d/0x230
[   31.251804]        power_supply_led_trigger_activate+0x18/0x20
[   31.251837]        led_trigger_set+0x1fc/0x300
[   31.251863]        led_trigger_set_default+0x90/0xe0
[   31.251892]        led_classdev_register_ext+0x311/0x3a0
[   31.251921]        devm_led_classdev_multicolor_register_ext+0x6e/0xb80 [led_class_multicolor]
[   31.251969]        ktd202x_probe+0x464/0x5c0 [leds_ktd202x]
[   31.252002]        i2c_device_probe+0x125/0x2b0
[   31.252027]        really_probe+0xde/0x340
[   31.252052]        __driver_probe_device+0x78/0x110
[   31.252076]        driver_probe_device+0x1f/0xa0
[   31.252103]        __driver_attach+0xba/0x1c0
[   31.252125]        bus_for_each_dev+0x6b/0xb0
[   31.252148]        bus_add_driver+0x111/0x1f0
[   31.252172]        driver_register+0x6e/0xc0
[   31.252197]        i2c_register_driver+0x41/0xb0
[   31.252225]        do_one_initcall+0x5e/0x3a0
[   31.252248]        do_init_module+0x60/0x220
[   31.252274]        __do_sys_init_module+0x15f/0x190
[   31.253986]        do_syscall_64+0x93/0x180
[   31.255826]        entry_SYSCALL_64_after_hwframe+0x76/0x7e
[   31.257614]
               other info that might help us debug this:

[   31.257619] Chain exists of:
                 &psy->extensions_sem --> triggers_list_lock --> &led_cdev->trigger_lock

[   31.257630]  Possible unsafe locking scenario:

[   31.257632]        CPU0                    CPU1
[   31.257633]        ----                    ----
[   31.257634]   lock(&led_cdev->trigger_lock);
[   31.257637]                                lock(triggers_list_lock);
[   31.257640]                                lock(&led_cdev->trigger_lock);
[   31.257643]   rlock(&psy->extensions_sem);
[   31.257646]
                *** DEADLOCK ***

[   31.289433] 4 locks held by (udev-worker)/553:
[   31.289443]  #0: ffff892ad9658108 (&dev->mutex){....}-{4:4}, at: __driver_attach+0xaf/0x1c0
[   31.289463]  #1: ffff892adbc0bbc8 (&led_cdev->led_access){+.+.}-{4:4}, at: led_classdev_register_ext+0x1c7/0x3a0
[   31.289476]  #2: ffffffffad0e30b0 (triggers_list_lock){++++}-{4:4}, at: led_trigger_set_default+0x2c/0xe0
[   31.289487]  #3: ffff892adbc0bad0 (&led_cdev->trigger_lock){+.+.}-{4:4}, at: led_trigger_set_default+0x34/0xe0

Fixes: 6037802bbae8 ("power: supply: core: implement extension API")
Cc: Thomas Weißschuh <linux@weissschuh.net>
Cc: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20250130140035.20636-1-hdegoede@redhat.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-02-03 12:25:37 +01:00
Andrey Vatoropin
3fb3cb4350 power: supply: da9150-fg: fix potential overflow
Size of variable sd_gain equals four bytes - DA9150_QIF_SD_GAIN_SIZE.
Size of variable shunt_val equals two bytes - DA9150_QIF_SHUNT_VAL_SIZE.

The expression sd_gain * shunt_val is currently being evaluated using
32-bit arithmetic. So during the multiplication an overflow may occur.

As the value of type 'u64' is used as storage for the eventual result, put
ULL variable at the first position of each expression in order to give the
compiler complete information about the proper arithmetic to use. According
to C99 the guaranteed width for a variable of type 'unsigned long long' >=
64 bits.

Remove the explicit cast to u64 as it is meaningless.

Just for the sake of consistency, perform the similar trick with another
expression concerning 'iavg'.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: a419b4fd9138 ("power: Add support for DA9150 Fuel-Gauge")
Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru>
Link: https://lore.kernel.org/r/20250130090030.53422-1-a.vatoropin@crpt.ru
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-02-03 12:23:49 +01:00
Linus Torvalds
f28f489045 power supply and reset changes for the 6.14 series
* power-supply core
   - introduce power supply extensions, which allows adding properties to
     a power supply device from a separate driver. This will be used
     initially to extend the generic ACPI charger/battery driver with
     vendor extensions for charge thresholds.
   - convert all drivers from power_supply_for_each_device to new
     power_supply_for_each_psy(), which avoids lots of casting being
     done in the drivers.
   - avoid LED trigger like values in uevent for POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR
   - introduce POWER_SUPPLY_PROP_CHARGE_TYPES, which is similar to the
     POWER_SUPPLY_PROP_CHARGE_TYPE property, but also lists the available
     options on the specific platform
 
  * power-supply drivers
   - dell-laptop: use new power_supply_charge_types_show/_parse helpers
   - stc3117: new driver for equally named fuel gauge chip
   - bq24190: add support for new POWER_SUPPLY_PROP_CHARGE_TYPES
   - bq24190: add BQ24297 support
   - bq27xxx: add voltage min design for bq27000/bq27200
   - cros_charge-control: convert to new power supply extension API
   - multiple drivers: constify 'struct bin_attribute'
   - ds2782: convert to device managed resources
   - max1720x: add charge full property
   - max1720x: support extra thermistor temperatures
   - max17042: add max77705 support
   - ip5xxx-power: add support for IP5306
   - ltc4162-l-charger: add ltc4162-f/s and ltc4015 support
   - gpio-charger: support for default charge current limit
   - misc. small cleanups and fixes
 
  * reset drivers
   - at91-poweroff: add sam9x7 support
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmeWnUkACgkQ2O7X88g7
 +pqTPQ/9HXCZQdf+JmcBVrdDfL9Ud/onfQN4iQFaft27yb8808YcXCjlorehdd9p
 rHmKxUzKSLjf2OeTLzIMx9I7Yh0UksLlL1FMSthUOpCvd5TIu1ifwW/VGX1Vif7h
 cNOIImg3H4m7qiycXZJIPMgj2PlkCG4sZ9cPO6uOCfkXJdKOsHUa+4sv6WENB8om
 sFn2dV0oR4NiMy5deX8O+gLDuHotKv2nsAXBKcTlgsNBJPLBGhqiPRJwTKBH5HC2
 B43OTEJ7gwE+IMkf4S5PkRCZS9C4zKVGPYigs8MP06R27UH8u1OZf/yW4eYkqucC
 ITIMKQcedInnLnueVnAv0mjmdMKdTXYZajqlOt8H9/c8ZwiWSSgAXtXqm8jyqWKL
 /FIFOd4EVBOKRLmxIUSm4izKHI1mvW9qYRF30oHSSXc9zizu8EeZGzlXwDPkATXs
 hcLHc0HbQduZ6Rf8WfjeQlypR7dD/6ikmvFP56FmntzO4RZ7i0lrAbV3AmZi9VlS
 fQCTN5cbZGDHV2miv7AZYI09P1VhptVVv+Kttwk2KXI1St1k8fuNqLy2BpmnqVwZ
 3qw9q2yuFJvApr6Xz6DTdGIFdY5pChE1g7MFJQm8MJOE06i0QM5AdJG1aN2+7zop
 qUtHraAQEDFsl3QvFBUavE6wN9LLWIB3w60CQ0M2fX0jrDd2m/U=
 =dx5S
 -----END PGP SIGNATURE-----

Merge tag 'for-v6.14' of 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:

   - introduce power supply extensions, which allows adding properties
     to a power supply device from a separate driver. This will be used
     initially to extend the generic ACPI charger/battery driver with
     vendor extensions for charge thresholds.

   - convert all drivers from power_supply_for_each_device to new
     power_supply_for_each_psy(), which avoids lots of casting being
     done in the drivers.

   - avoid LED trigger like values in uevent for
     POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR

   - introduce POWER_SUPPLY_PROP_CHARGE_TYPES, which is similar to the
     POWER_SUPPLY_PROP_CHARGE_TYPE property, but also lists the
     available options on the specific platform

  Power-supply drivers

   - dell-laptop: use new power_supply_charge_types_show/_parse helpers

   - stc3117: new driver for equally named fuel gauge chip

   - bq24190: add support for new POWER_SUPPLY_PROP_CHARGE_TYPES

   - bq24190: add BQ24297 support

   - bq27xxx: add voltage min design for bq27000/bq27200

   - cros_charge-control: convert to new power supply extension API

   - multiple drivers: constify 'struct bin_attribute'

   - ds2782: convert to device managed resources

   - max1720x: add charge full property

   - max1720x: support extra thermistor temperatures

   - max17042: add max77705 support

   - ip5xxx-power: add support for IP5306

   - ltc4162-l-charger: add ltc4162-f/s and ltc4015 support

   - gpio-charger: support for default charge current limit

   - misc small cleanups and fixes

  Reset drivers:

   - at91-poweroff: add sam9x7 support"

* tag 'for-v6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (77 commits)
  power: supply: max1720x: add support for reading internal and thermistor temperatures
  power: supply: ltc4162l: Use GENMASK macro in bitmask operation
  power: supply: max17042: add max77705 fuel gauge support
  dt-bindings: power: supply: max17042: add max77705 support
  power: supply: add undervoltage health status property
  power: supply: max17042: add platform driver variant
  power: supply: max17042: make interrupt shared
  power: reset: keystone: Use syscon_regmap_lookup_by_phandle_args
  power: supply: Use str_enable_disable-like helpers
  platform/x86: dell-laptop: Use power_supply_charge_types_show/_parse() helpers
  power: supply: bq2415x_charger: Immediately reschedule delayed work on notifier events
  power: supply: Add STC3117 fuel gauge unit driver
  dt-bindings: power: supply: Add STC3117 Fuel Gauge
  power: supply: ug3105_battery: Let the core handle POWER_SUPPLY_PROP_TECHNOLOGY
  power: supply: gpio-charger: add support for default charge current limit
  dt-bindings: power: supply: gpio-charger: add support for default charge current limit
  power: supply: Use power_supply_external_power_changed() in __power_supply_changed_work()
  power: supply: core: fix build of extension sysfs group if CONFIG_SYSFS=n
  power: supply: bq2415x_charger: report charging state changes to userspace
  bq27xxx: add voltage min design for bq27000 and bq27200
  ...
2025-01-27 15:37:16 -08:00
Linus Torvalds
0c9343150c pwrseq updates for v6.14-rc1
- support a new model in the qcom-wcn pwrseq driver
 - explain the need to keep the WLAN_EN GPIO workaround for now with
   a FIXME comment
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmeOWBYACgkQEacuoBRx
 13KaWw/+KzgWOYZwS+HP0aEnJf4LeJi6QHCYP1hO+oGdSIWlxN40/B9BYbbwuEJA
 uuud8Gnh/0UaBZP4wp8AEcvMW4crKfrjNuGpgpj1tGtMX6AhRYYHq34tI/EtE6+g
 u7woHB9iIV8bMLU0kXKJmEyG6Bnmu3src1ZUthDPL6OKyGjRUUwojsmUKldR4xS7
 LLVn2CYacgrd54/bX3Yzw/avIZTp6Im2/4Az0s/p/HPwhui+L69NcV5JtV8+oJJM
 +44YvggLgbTch9YDpJ3i700jGAhUX9VsH4ddPYbe/ERQaFjvFF+EXzQ6yd6sjxdu
 DQJWt6UG0mqIE0TwzpHiU9yVgJqgI47CBGFmSeh+C/xzNuedzq7urlSdmQenRlQS
 fDho1NDMzb3f4vjQj9uzJrLEC0+h+A/M9UHQIghvg8beqAb6E15iCH7qXAIV7kjI
 B3Jp/LUSovHvVPxdiHZvEGGo4c9avNinea0zN1Ym2Xyi0pSRqlZbjaHpt+G0UhEw
 M7zD+FGUG195S1PHIBi2h6OhvUzsqchTjWgn0z/smxPAiAD6k+DPwVXUWgiVoD/9
 oD/8a8PrXUqP4qs6nxgOsdD2qHn13ea/saASlt2ow9CEjgB1j03dITpqINjxYl43
 dB3SDEqr1tlpdNhUjEDrfekGhnvK3ninBLwgxK3p9g3065Ekyow=
 =VK8V
 -----END PGP SIGNATURE-----

Merge tag 'pwrseq-updates-for-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull power sequencing updates from Bartosz Golaszewski:
 "We added support for another Qualcomm WCN model and a FIXME comment
  that explains why we still need to keep a GPIO workaround for now
  despite having merged a set of changes to the PCI code that seemingly
  fixed the underlying problem:

   - support a new model in the qcom-wcn pwrseq driver

   - explain the need to keep the WLAN_EN GPIO workaround for now with a
     FIXME comment"

* tag 'pwrseq-updates-for-v6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  power: sequencing: qcom-wcn: explain why we need the WLAN_EN GPIO hack
  power: sequencing: qcom-wcn: add support for the WCN6750 PMU
2025-01-22 08:52:26 -08:00
Dimitri Fedrau
b4a95b8fd3 power: supply: max1720x: add support for reading internal and thermistor temperatures
If enabled in the nPackCfg register, the Temp1, Temp2 and IntTemp registers
contain the temperature readings from the AIN1 thermistor, AIN2 thermistor
and internal die temperature respectively. Registers are shared between SBS
and normal IC functions and are always readable regardless of IC settings.

Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
Link: https://lore.kernel.org/r/20250116-max1720x-temperature-v2-1-9638969d091a@liebherr.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-01-17 22:33:04 +01:00
Kim Seer Paller
92c71aa1a8 power: supply: ltc4162l: Use GENMASK macro in bitmask operation
Replace the bitmask operation BIT(6) - 1 with GENMASK(5, 0) to make the
code clearer and readable.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
Link: https://lore.kernel.org/r/20250117024307.4119-1-kimseer.paller@analog.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-01-17 22:31:16 +01:00
Dzmitry Sankouski
260d7c5e53 power: supply: max17042: add max77705 fuel gauge support
Add max77705 fuel gauge support.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Link: https://lore.kernel.org/r/20250108-starqltechn_integration_upstream-v14-5-f6e84ec20d96@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-01-15 22:39:18 +01:00
Dzmitry Sankouski
df998c2232 power: supply: add undervoltage health status property
Add POWER_SUPPLY_HEALTH_UNDERVOLTAGE status for power supply
to report under voltage lockout failures.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Link: https://lore.kernel.org/r/20250108-starqltechn_integration_upstream-v14-1-f6e84ec20d96@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-01-15 22:39:18 +01:00
Dzmitry Sankouski
0cd4f1f77a power: supply: max17042: add platform driver variant
Maxim PMICs may include fuel gauge with additional features, which is
out of single Linux power supply driver scope.

For example, in max77705 PMIC fuelgauge has additional registers, like
IIN_REG, VSYS_REG, ISYS_REG. Those needed to measure PMIC input current,
system voltage and current respectively. Those measurements cannot be
bound to any of fuelgauge properties.

The solution here add and option to use max17042 driver as a MFD sub
device, thus allowing any additional functionality be implemented as
another sub device. This will help to reduce code duplication in MFD
fuel gauge drivers.

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Link: https://lore.kernel.org/r/20250107-b4-max17042-v6-2-3d0104ad5bc7@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-01-15 22:00:32 +01:00
Dzmitry Sankouski
bed41f08e2 power: supply: max17042: make interrupt shared
Fuelgauge blocks often are incorporated in bigger chip, which may use
only 1 line for interrupts. Make interrupt shared.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Link: https://lore.kernel.org/r/20250107-b4-max17042-v6-1-3d0104ad5bc7@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-01-15 22:00:32 +01:00
Krzysztof Kozlowski
81312ea9b8 power: reset: keystone: Use syscon_regmap_lookup_by_phandle_args
Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
syscon_regmap_lookup_by_phandle() combined with getting the syscon
argument.  Except simpler code this annotates within one line that given
phandle has arguments, so grepping for code would be easier.

There is also no real benefit in printing errors on missing syscon
argument, because this is done just too late: runtime check on
static/build-time data.  Dtschema and Devicetree bindings offer the
static/build-time check for this already.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250111185358.183725-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-01-15 21:51:39 +01:00
Krzysztof Kozlowski
2d678e3e1e power: supply: Use str_enable_disable-like helpers
Replace ternary (condition ? "enable" : "disable") syntax with helpers
from string_choices.h because:
1. Simple function call with one argument is easier to read.  Ternary
   operator has three arguments and with wrapping might lead to quite
   long code.
2. Is slightly shorter thus also easier to read.
3. It brings uniformity in the text - same string.
4. Allows deduping by the linker, which results in a smaller binary
   file.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250114203611.1013324-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2025-01-15 21:41:22 +01:00