Commit Graph

3564 Commits

Author SHA1 Message Date
Linus Torvalds
99ef60d119 USB / Thunderbolt changes for 7.1-rc1
Here is the big set of USB and Thunderbolt changes for 7.1-rc1.
 
 Lots of little things in here, nothing major, just constant
 improvements, updates, and new features.  Highlights are:
   - new USB power supply driver support (will cause merge conflicts in
     drivers/power/supply/Makefile, but it's a simple fix)  These changes
     did touch outside of drivers/usb/ but got acks from the relevant
     mantainers for them.
   - dts file updates and conversions
   - string function conversions into "safer" ones
   - new device quirks
   - xhci driver updates
   - usb gadget driver minor fixes
   - typec driver additions and updates
   - small number of thunderbolt driver changes
   - dwc3 driver updates and additions of new hardware support
   - other minor driver updates
 
 All of these have been in the linux-next tree for a while with no
 reported issues
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCaeSx6g8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ynqjQCgqhbj0Pg2DiL+hZ4xEVlsKD8MJsMAn0vbdsR5
 UiYztWABA245P1hO9i+K
 =/fxh
 -----END PGP SIGNATURE-----

Merge tag 'usb-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB / Thunderbolt updates from Greg KH:
 "Here is the big set of USB and Thunderbolt changes for 7.1-rc1.

  Lots of little things in here, nothing major, just constant
  improvements, updates, and new features. Highlights are:

   - new USB power supply driver support.

     These changes did touch outside of drivers/usb/ but got acks from
     the relevant mantainers for them.

   - dts file updates and conversions

   - string function conversions into "safer" ones

   - new device quirks

   - xhci driver updates

   - usb gadget driver minor fixes

   - typec driver additions and updates

   - small number of thunderbolt driver changes

   - dwc3 driver updates and additions of new hardware support

   - other minor driver updates

  All of these have been in the linux-next tree for a while with no
  reported issues"

* tag 'usb-7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (176 commits)
  usb: dwc3: starfive: Add JHB100 USB 2.0 DRD controller
  dt-bindings: usb: dwc3: add support for StarFive JHB100
  dt-bindings: usb: atmel,at91sam9rl-udc: convert to DT schema
  dt-bindings: usb: atmel,at91rm9200-udc: convert to DT schema
  dt-bindings: usb: generic-ehci: fix schema structure and add at91sam9g45 constraints
  dt-bindings: usb: generic-ohci: add AT91RM9200 OHCI binding support
  arm: dts: at91: remove unused #address-cells/#size-cells from sam9x60 udc node
  drivers/usb/host: Fix spelling error 'seperate' -> 'separate'
  usbip: tools: add hint when no exported devices are found
  USB: serial: iuu_phoenix: fix iuutool author name
  usb: gadget: f_ncm: validate minimum block_len in ncm_unwrap_ntb()
  usb: gadget: f_phonet: fix skb frags[] overflow in pn_rx_complete()
  usb: gadget: f_hid: Add missing error code
  usb: typec: cros_ec_ucsi: Load driver from OF and ACPI definitions
  dt-bindings: chrome: Add cros-ec-ucsi compatibility to typec binding
  USB: of: Simplify with scoped for each OF child loop
  usbip: validate number_of_packets in usbip_pack_ret_submit()
  usb: gadget: renesas_usb3: validate endpoint index in standard request handlers
  usb: core: config: reverse the size check of the SSP isoc endpoint descriptor
  usb: typec: ucsi: Set usb mode on partner change
  ...
2026-04-19 08:47:40 -07:00
Linus Torvalds
59bd5ae0db power supply and reset changes for the 7.1 series
* power-supply drivers
   - S2MU005: new battery fuel gauge driver
   - macsmc-power: new driver for Apple Silicon
   - qcom_battmgr: Add support for Glymur and Kaanapali
   - max17042: add support for max77759
   - qcom_smbx: allow disabling charging
   - bd71828: add input current limit support
   - multiple drivers: use new device managed workqueue allocation
     function
   - misc. small cleanups and fixes
  * reset core
   - Expose sysfs for registered reboot_modes
  * reset drivers
   - misc. small cleanups and fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmniTwkACgkQ2O7X88g7
 +pqZCA//ZETuZH1fB1/uJQocXxC6wksAaYUq4BvRlmj5e/dc42ouLbC8IfzMnAET
 aMc9zHOSKdUdW0a9DpWlOZaXT4AZ5EN7Pjd5XeRjrWwaufPvvZgX0Abjb9UpT6nU
 yYMbKvJeNMIVGqByboneWK0LOekijJVz8dkAe31eE+8tNNAn3Y/V8v9FiS9nG5sL
 0WqnhmCNBd9vS/QYvoxSMB9UC64LxYISYlDl/v525mqFRoDdkIh9q+WO7Wdq3Mtk
 tOGIRu1i001jpXxLwtIx9N1Uoq62inyuuPeBrpdKAjxKQyXQSiKrcVX1gQdbBmZm
 ggAFJ5p6wWYeDXA5/9C4z0wsud+/ZbgvzJvYOqTbkJQA2c/+Sz928EjHrRre9DzU
 l3Z0eVLtuekKXMhwiXRN66JjYmYjZJA5gJXKgd+8slHSXSpgp6scv5zMQYCTny5d
 Jj+Ztp5k70RLrl88Y0Dihi7lKy07NhlrYMO7HPNrwEnydxPRTdLfLahZkb/SJep0
 YTX/r0s/Ab+VG+qWmAlvVjwbDglmsYDMcmyJarJKvXoE7CE+jwL1447UiI0BAOjO
 ZDUGojBHst36ySORWjq0LmjP6F2r582hXWzeY08Skuj05n2bBJpT89rEF+BGYwhR
 KhQgH7mCvsbG8QJuTROGK/fpDZ5L7aGwJBfMchgdWmDs8r9zY5M=
 =5Yic
 -----END PGP SIGNATURE-----

Merge tag 'for-v7.1' 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 drivers:
   - S2MU005: new battery fuel gauge driver
   - macsmc-power: new driver for Apple Silicon
   - qcom_battmgr: Add support for Glymur and Kaanapali
   - max17042: add support for max77759
   - qcom_smbx: allow disabling charging
   - bd71828: add input current limit support
   - multiple drivers: use new device managed workqueue allocation
     function
   - misc small cleanups and fixes

  Reset core:
   - Expose sysfs for registered reboot_modes

  Reset drivers
   - misc small cleanups and fixes"

* tag 'for-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (36 commits)
  power: supply: qcom_smbx: allow disabling charging
  power: reset: drop unneeded dependencies on OF_GPIO
  power: supply: bd71828: add input current limit property
  dt-bindings: power: reset: cortina,gemini-power-controller: convert to DT schema
  power: supply: add support for S2MU005 battery fuel gauge device
  dt-bindings: power: supply: document Samsung S2MU005 battery fuel gauge
  power: reset: reboot-mode: fix -Wformat-security warning
  power: supply: ipaq_micro: Simplify with devm
  power: supply: mt6370: Simplify with devm_alloc_ordered_workqueue()
  power: supply: max77705: Free allocated workqueue and fix removal order
  power: supply: max77705: Drop duplicated IRQ error message
  power: supply: cw2015: Free allocated workqueue
  power: reset: keystone: Use register_sys_off_handler(SYS_OFF_MODE_RESTART)
  power: supply: twl4030_madc: Drop unused header includes
  power: supply: bq24190: Avoid rescheduling after cancelling work
  power: supply: axp288_charger: Simplify returns of dev_err_probe()
  power: supply: axp288_charger: Do not cancel work before initializing it
  power: supply: cpcap-battery: pass static battery cell data from device tree
  dt-bindings: power: supply: cpcap-battery: document monitored-battery property
  power: supply: qcom_battmgr: Add support for Glymur and Kaanapali
  ...
2026-04-17 11:41:33 -07:00
Linus Torvalds
090748e62f m68k updates for v7.1
- Add support for QEMU virt-ctrl, and use it for system reset and
     power off on the virt platform,
   - Defconfig updates,
   - Miscellaneous fixes and improvements.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCaeCVXwAKCRCKwlD9ZEnx
 cIhWAQCxwoddlBD7QRpLvcrtbrL20poOfGtf5pY3VZaohEbzzwEAlCnp0TnwuEES
 gSKc5MVGDx9x6YdwyeFEX4PTU882YwI=
 =kV2B
 -----END PGP SIGNATURE-----

Merge tag 'm68k-for-v7.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k

Pull m68k updates from Geert Uytterhoeven:

 - Add support for QEMU virt-ctrl, and use it for system reset
   and power off on the virt platform

 - defconfig updates

 - Miscellaneous fixes and improvements

* tag 'm68k-for-v7.1-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
  m68k: virt: Switch to qemu-virt-ctrl driver
  power: reset: Add QEMU virt-ctrl driver
  m68k: defconfig: Update defconfigs for v7.0-rc1
  m68k: emu: Replace unbounded sprintf() in nfhd_init_one()
  m68k: uapi: Add ucontext.h
  m68k: defconfig: hp300: Enable monochrome and 16-color linux logos
  m68k: q40: Remove commented out code
2026-04-16 08:11:01 -07:00
Linus Torvalds
d60bc14015 power sequencing updates for v7.1-rc1
- add support for the PCIe M.2 Key E connectors in pwrseq-pcie-m2
 - describe PCIe M.2 Mechanical Key E connectors in DT bindings
 - add serdev helpers for looking up devices by OF nodes
 - minor serdev core rework to enable support for PCIe M.2 Key E connectors
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEkeUTLeW1Rh17omX8BZ0uy/82hMMFAmnYtCcACgkQBZ0uy/82
 hMOjPg//fhIzA8h/w1YUXF5nW0Q7jyIzfCnpsKxNdIrREqYSKY1KRAsY8TWt0YCy
 5DcPfPyrEizn8enZoTiescZy26TnTDB87tWUMemNb1aMcpL30oRdCCzACrZK2/R5
 2+S/9h4UcsDxkChyRKnPgJfXd6M6RcsnjYDZ4nQ5zLasPQ3XCpV6+XyZuVnVVPzh
 vzENOtXQTUg0OnsK75O1pDWn4WkGCq3zc81LuucRM+yb0xSezG7aAk+jKwdIo8N1
 AfUbmnA4N0WRs0hTbQ/ovdRe8HddFGVNtBzGXqObKOSSKfslTehWMs1ukm8/HQf1
 3jLxEAJ5EC/A31rm60Wp1WhLRFbSfs9Ih6WyRM81q1AwIp4/AujV4M8k0zYpHtM1
 sdJUBOYl9UNuzQ3st5SXmc3mBZ1ivu+VoJbztm9sPJYhhpZKb7jXPPXMC6TPAu5B
 NquSscjTPcOtKm3t4h42VoYbr3WrB7hAR6FRIvX1MCC91GCgSdVaays7rAj3zU1u
 vRk7OgdEihwZ8zpI4Li8A7Qrg5O7F9ALF8qiXiNNPQjlc4npfYLvGA7FztAy1V4p
 L1yHLHkFjDc2mwl/9B7q2sLi4mKUbLFMwFRYbwR5GnwK65qdLmDXH+d2OdrmgliS
 SWCKFyNV+EmNCJIjCgVi+brH9WaIlKjW4DHAScH5z+gP5Fs1aj4=
 =Nqgg
 -----END PGP SIGNATURE-----

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

Pull power sequencing updates from Bartosz Golaszewski:
 "For this release we have an extension of the pwrseq-pcie-m2 driver
  with support for PCIe M.2 Key E connectors.

  The rest of the commits fulfill a supporting role: document the
  hardware in DT bindings, provide required serdev helpers (this has
  been provided in an immutable branch to Rob Herring so you may see it
  in his PR as well) and is followed up by some Kconfig fixes from Arnd.

  Summary:

   - add support for the PCIe M.2 Key E connectors in pwrseq-pcie-m2

   - describe PCIe M.2 Mechanical Key E connectors in DT bindings

   - add serdev helpers for looking up devices by OF nodes

   - minor serdev core rework to enable support for PCIe M.2 Key E
     connectors"

* tag 'pwrseq-updates-for-v7.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  power: sequencing: pcie-m2: add SERIAL_DEV_BUS dependency
  power: sequencing: pcie-m2: enforce PCI and OF dependencies
  power: sequencing: pcie-m2: Create serdev device for WCN7850 bluetooth
  power: sequencing: pcie-m2: Add support for PCIe M.2 Key E connectors
  dt-bindings: connector: Add PCIe M.2 Mechanical Key E connector
  dt-bindings: serial: Document the graph port
  serdev: Do not return -ENODEV from of_serdev_register_devices() if external connector is used
  serdev: Add an API to find the serdev controller associated with the devicetree node
  serdev: Convert to_serdev_*() helpers to macros and use container_of_const()
2026-04-13 20:28:22 -07:00
Kuan-Wei Chiu
ad9d2cd065 power: reset: Add QEMU virt-ctrl driver
Add a new driver for the 'virt-ctrl' device found on QEMU virt machines
(e.g. m68k). This device provides a simple interface for system reset
and power off [1].

This driver utilizes the modern system-off API to register callbacks
for both system restart and power off. It also registers a reboot
notifier to catch SYS_HALT events, ensuring that LINUX_REBOOT_CMD_HALT
is properly handled. It is designed to be generic and can be reused by
other architectures utilizing this QEMU device.

Link: https://gitlab.com/qemu-project/qemu/-/blob/v10.2.0/hw/misc/virt_ctrl.c [1]
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patch.msgid.link/20260412211952.3564033-2-visitorckw@gmail.com
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
2026-04-13 12:16:10 +02:00
Arnd Bergmann
b4464d8f31 power: sequencing: pcie-m2: add SERIAL_DEV_BUS dependency
The newly added serdev code fails to link when serdev is turned off:

arm-linux-gnueabi-ld: drivers/power/sequencing/pwrseq-pcie-m2.o: in function `pwrseq_pcie_m2_remove_serdev':
pwrseq-pcie-m2.c:(.text+0xc8): undefined reference to `serdev_device_remove'
arm-linux-gnueabi-ld: drivers/power/sequencing/pwrseq-pcie-m2.o: in function `pwrseq_m2_pcie_notify':
pwrseq-pcie-m2.c:(.text+0x69c): undefined reference to `of_find_serdev_controller_by_node'
arm-linux-gnueabi-ld: pwrseq-pcie-m2.c:(.text+0x6f8): undefined reference to `serdev_device_alloc'
arm-linux-gnueabi-ld: pwrseq-pcie-m2.c:(.text+0x724): undefined reference to `serdev_device_add'

Add another Kconfig dependency for this

Fixes: 3f736aecbd ("power: sequencing: pcie-m2: Create serdev device for WCN7850 bluetooth")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260401191030.948046-1-arnd@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-04-03 14:20:36 +02:00
Arnd Bergmann
19b8c8fc83 power: sequencing: pcie-m2: enforce PCI and OF dependencies
The driver fails to build when PCI is disabled:

drivers/power/sequencing/pwrseq-pcie-m2.c: In function 'pwrseq_pcie_m2_register_notifier':
drivers/power/sequencing/pwrseq-pcie-m2.c:368:54: error: 'pci_bus_type' undeclared (first use in this function); did you mean 'pci_pcie_type'?
  368 |                         ret = bus_register_notifier(&pci_bus_type, &ctx->nb);
      |                                                      ^~~~~~~~~~~~
      |                                                      pci_pcie_type

Similarly, when CONFIG_OF is disabled:

drivers/power/sequencing/pwrseq-pcie-m2.c: In function 'pwrseq_m2_pcie_create_bt_node':
drivers/power/sequencing/pwrseq-pcie-m2.c:191:9: error: implicit declaration of function 'of_changeset_init' [-Wimplicit-function-declaration]
  191 |         of_changeset_init(ctx->ocs);
      |         ^~~~~~~~~~~~~~~~~

Make both dependencies unconditional to prevent compile-testing
in either configuration.

Fixes: 3f736aecbd ("power: sequencing: pcie-m2: Create serdev device for WCN7850 bluetooth")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://patch.msgid.link/20260401091847.305294-1-arnd@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-04-03 14:20:10 +02:00
Casey Connolly
98d68b74eb power: supply: qcom_smbx: allow disabling charging
Hook up USBIN_CMD_IL so that writing "0" to the status register will
disable charging, this is useful to let users limit charging
automatically.

Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
Link: https://patch.msgid.link/20260315-smb2-cherry-pick-v1-1-b2710e470490@ixit.cz
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-04-03 00:40:54 +02:00
Bartosz Golaszewski
0629c33fe1 power: reset: drop unneeded dependencies on OF_GPIO
OF_GPIO is selected automatically on all OF systems. Any symbols it
controls also provide stubs so there's really no reason to select it
explicitly. For Kconfig entries that have no other dependencies: convert
it to requiring OF to avoid new symbols popping up for everyone in make
config, for others just drop it altogether.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260316-gpio-of-kconfig-v2-8-de2f4b00a0e4@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-04-03 00:40:09 +02:00
Andreas Kemnade
be353c6729 power: supply: bd71828: add input current limit property
Add input current property to be able to work around issues created by
automatic input limiting and have some control.
Disabling the automatic management is another step.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20260401-bd-inp-limit-v1-1-689eb22531e2@kemnade.info
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-04-03 00:30:36 +02:00
Manivannan Sadhasivam
3f736aecbd power: sequencing: pcie-m2: Create serdev device for WCN7850 bluetooth
For supporting bluetooth over the non-discoverable UART interface of
WCN7850, create the serdev device after enumerating the PCIe interface.
This is mandatory since the device ID is only known after the PCIe
enumeration and the ID is used for creating the serdev device.

Since by default there is no OF or ACPI node for the created serdev,
create a dynamic OF 'bluetooth' node with the 'compatible' property and
attach it to the serdev device. This will allow the serdev device to bind
to the existing bluetooth driver.

Tested-by: Hans de Goede <johannes.goede@oss.qualcomm.com> # ThinkPad T14s gen6 (arm64)
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260326-pci-m2-e-v7-8-43324a7866e6@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-03-31 09:48:44 +02:00
Manivannan Sadhasivam
0d38285a12 power: sequencing: pcie-m2: Add support for PCIe M.2 Key E connectors
Add support for handling the power sequence of the PCIe M.2 Key E
connectors. These connectors are used to attach the Wireless Connectivity
devices to the host machine including combinations of WiFi, BT, NFC using
interfaces such as PCIe/SDIO for WiFi, USB/UART for BT and I2C for NFC.

Currently, this driver supports only the PCIe interface for WiFi and UART
interface for BT. The driver also only supports driving the 3.3v/1.8v power
supplies and W_DISABLE{1/2}# GPIOs. The optional signals of the Key E
connectors are not currently supported.

Tested-by: Hans de Goede <johannes.goede@oss.qualcomm.com> # ThinkPad T14s gen6 (arm64)
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20260326-pci-m2-e-v7-7-43324a7866e6@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-03-31 09:48:44 +02:00
Amit Sunil Dhamne
70d7dd27f6 power: supply: max77759: add charger driver
Add support for MAX77759 battery charger driver. This is a 4A 1-Cell
Li+/LiPoly dual input switch mode charger. While the device can support
USB & wireless charger inputs, this implementation only supports USB
input. This implementation supports both buck and boost modes.

Signed-off-by: Amit Sunil Dhamne <amitsd@google.com>
Reviewed-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260325-max77759-charger-v9-5-4486dd297adc@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-30 16:58:33 +02:00
Badhri Jagan Sridharan
a43dd4f6f9 power: supply: Add PD SPR AVS support to USB type enum
Add two new members to the power_supply_usb_type to represent the
USB Power Delivery (PD) Standard Power Range (SPR) Adjustable Voltage
Supply (AVS) charging types:

POWER_SUPPLY_USB_TYPE_PD_SPR_AVS: For devices supporting only the
PD SPR AVS type.

POWER_SUPPLY_USB_TYPE_PD_PPS_SPR_AVS: For devices that support both
PD Programmable Power Supply (PPS) and PD SPR AVS.

Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://patch.msgid.link/20260316150301.3892223-3-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18 16:08:39 +01:00
Yassine Oudjana
aa21327998 power: supply: add support for S2MU005 battery fuel gauge device
Samsung's S2MU005 PMIC, which contains battery charger functionality
also includes a battery fuel gauge device, which is separate from the
PMIC itself, and typically connected to an I2C bus. Add a generic driver
to support said device.

Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
Co-developed-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Link: https://patch.msgid.link/20260304-s2mu005-fuelgauge-v3-2-e4dc4e47cde8@disroot.org
[Moved mutex init before power-supply registration]
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-11 10:34:44 +01:00
Arnd Bergmann
c7e05ab38a power: reset: reboot-mode: fix -Wformat-security warning
The device_create() function expects a format string to construct a device
name, so passing a variable here introduces a possible vulnerability in
case the string can contain '%' characters:

drivers/power/reset/reboot-mode.c:148:22: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
drivers/power/reset/reboot-mode.c:148:22: note: treat the string as an argument to avoid this
  148 |                                                  (void *)priv, reboot->dev->driver->name);

Use an trivial "%s" format instead and pass the name as the string to be
included here.

Fixes: cfaf0a9078 ("power: reset: reboot-mode: Expose sysfs for registered reboot_modes")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260306150738.497978-1-arnd@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-11 07:58:43 +01:00
Krzysztof Kozlowski
2cfc7cac68 power: supply: ipaq_micro: Simplify with devm
Simplify the driver by using devm interfaces, which allow to drop
probe() error paths and the remove() callback.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260305-workqueue-devm-v2-6-66a38741c652@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-11 06:58:00 +01:00
Krzysztof Kozlowski
f23afa0104 power: supply: mt6370: Simplify with devm_alloc_ordered_workqueue()
Simplify the driver probe function by using
devm_alloc_ordered_workqueue() which handles the cleanup already.

Change is not equivalent in the workqueue itself: use non-legacy API
which does not set (__WQ_LEGACY | WQ_MEM_RECLAIM).  The workqueue is
used to update power supply data (power_supply_changed()) status, thus
there is no point to run it for memory reclaim.  Note that dev_name() is
not directly used in second argument to prevent possible unlikely
parsing any "%" character in device name as format.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260305-workqueue-devm-v2-5-66a38741c652@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-11 06:58:00 +01:00
Krzysztof Kozlowski
1e668baade power: supply: max77705: Free allocated workqueue and fix removal order
Use devm interface for allocating workqueue to fix two bugs at the same
time:

1. Driver leaks the memory on remove(), because the workqueue is not
   destroyed.

2. Driver allocates workqueue and then registers interrupt handlers
   with devm interface.  This means that probe error paths will not use a
   reversed order, but first destroy the workqueue and then, via devm
   release handlers, free the interrupt.

   The interrupt handler schedules work on this exact workqueue, thus if
   interrupt is hit in this short time window - after destroying
   workqueue, but before devm() frees the interrupt - the schedulled
   work will lead to use of freed memory.

Change is not equivalent in the workqueue itself: use non-legacy API
which does not set (__WQ_LEGACY | WQ_MEM_RECLAIM).  The workqueue is
used to update power supply (power_supply_changed()) status, thus there
is no point to run it for memory reclaim.  Note that dev_name() is not
directly used in second argument to prevent possible unlikely parsing
any "%" character in device name as format.

Fixes: 11741b8e38 ("power: supply: max77705: Fix workqueue error handling in probe")
Fixes: a6a494c8e3 ("power: supply: max77705: Add charger driver for Maxim 77705")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260305-workqueue-devm-v2-4-66a38741c652@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-11 06:58:00 +01:00
Krzysztof Kozlowski
2064c64ceb power: supply: max77705: Drop duplicated IRQ error message
Core already prints error message on devm_request_threaded_irq()
failure, so no need to do that second time.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260305-workqueue-devm-v2-3-66a38741c652@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-11 06:58:00 +01:00
Krzysztof Kozlowski
db254b0b23 power: supply: cw2015: Free allocated workqueue
Use devm interface so allocated workqueue will be freed during device
removal and error paths, thus fixing a memory leak.

Change is not equivalent in the workqueue itself: use non-legacy API
which does not set (__WQ_LEGACY | WQ_MEM_RECLAIM).  The workqueue is
used to read updated data from the battery, thus there is no point to
run it for memory reclaim.

Cc: stable@vger.kernel.org
Fixes: b4c7715c10 ("power: supply: add CellWise cw2015 fuel gauge driver")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260305-workqueue-devm-v2-2-66a38741c652@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-11 06:58:00 +01:00
Felix Gu
5c3daa5301 power: sequencing: pcie-m2: Fix device node reference leak in probe
In pwrseq_pcie_m2_probe(), ctx->of_node acquires an explicit reference
to the device node using of_node_get(), but there is no corresponding
of_node_put() in the driver's error handling paths or removal.

Since the ctx is tied to the lifecycle of the platform device, there
is no need to hold an additional reference to the device's own of_node.

Fixes: 52e7b5bd62 ("power: sequencing: Add the Power Sequencing driver for the PCIe M.2 connectors")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Link: https://patch.msgid.link/20260302-m2-v1-1-a6533e18aa69@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-03-04 09:16:41 +01:00
Andrew Davis
c2bfe2edf7 power: reset: keystone: Use register_sys_off_handler(SYS_OFF_MODE_RESTART)
Function register_restart_handler() is deprecated. Using this new API
removes our need to keep and manage a struct notifier_block.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20260303175959.75647-1-afd@ti.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:19 +01:00
Krzysztof Kozlowski
e6d91eed84 power: supply: twl4030_madc: Drop unused header includes
Driver does not use any code from workqueue.h and param.h.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Link: https://patch.msgid.link/20260220174938.672883-8-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:08 +01:00
Krzysztof Kozlowski
4f73a52df7 power: supply: bq24190: Avoid rescheduling after cancelling work
Driver initializes delayed work and then registers interrupt handler
with devm interface.  This means that device removal will not use a
reversed order, but first cancel pending work items and then, via devm
release handlers, free the interrupt.

The interrupt handler does not directly use/schedule work
items on the workqueue, however it updates the status of the battery
charger which might lead to calling power_supply_changed() and trigger
chain of calls leading to scheduling the work items.  If this happens
during short time window after cancel_delayed_work_sync() in remove()
callback, the work would be rescheduled.

Avoid this by using devm interface to initialize and cancel work item,
thus having exactly reverse order during remove() in respect to rest of
the probe/cleanup paths.  This is also more logical and readable code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Link: https://patch.msgid.link/20260220174938.672883-7-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:08 +01:00
Krzysztof Kozlowski
727fe2e90e power: supply: axp288_charger: Simplify returns of dev_err_probe()
One of benefits of dev_err_probe() is that it returns the error value
greatly simplifying the error paths (e.g. three lines -> one line).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Link: https://patch.msgid.link/20260220174938.672883-6-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:08 +01:00
Krzysztof Kozlowski
658342fd75 power: supply: axp288_charger: Do not cancel work before initializing it
Driver registered devm handler to cancel_work_sync() before even the
work was initialized, thus leading to possible warning from
kernel/workqueue.c on (!work->func) check, if the error path was hit
before the initialization happened.

Use devm_work_autocancel() on each work item independently, which
handles the initialization and handler to cancel work.

Fixes: 165c235774 ("power: supply: axp288_charger: Properly stop work on probe-error / remove")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Link: https://patch.msgid.link/20260220174938.672883-5-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:08 +01:00
Svyatoslav Ryhel
f0c8407c83 power: supply: cpcap-battery: pass static battery cell data from device tree
Add an option to populate battery cell properties from the device tree if
the driver cannot access the battery's NVMEM.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://patch.msgid.link/20260130134021.353688-3-clamor95@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:08 +01:00
Anjelique Melendez
16a7c32e58 power: supply: qcom_battmgr: Add support for Glymur and Kaanapali
Glymur is a compute platform which has the same power supply properties
as X1E80100 and Kaanapali is a mobile platform which has the same power
supply properties as SM8550. Add support for the Glymur and Kaanapali
compatible strings.

Signed-off-by: Anjelique Melendez <anjelique.melendez@oss.qualcomm.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20260209204915.1983997-6-anjelique.melendez@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:07 +01:00
Hector Martin
0ebf821cf6 power: supply: Add macsmc-power driver for Apple Silicon
This driver provides battery and AC status monitoring for Apple Silicon
Macs via the SMC (System Management Controller). It supports reporting
capacity, voltage, current, and charging status, and modifying the
charging behaviour across multiple generations of SMC firmware.

Signed-off-by: Hector Martin <marcan@marcan.st>
Co-developed-by: Joey Gouly <joey.gouly@arm.com>
Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Co-developed-by: Janne Grunau <j@jannau.net>
Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Reviewed-by: Sven Peter <sven@kernel.org>
Co-developed-by: Michael Reeves <michael.reeves077@gmail.com>
Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
Link: https://patch.msgid.link/20260217-b4-macsmc-power-v7-1-4a4d63664362@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:07 +01:00
Dmitry Torokhov
5c2ffc0b21 power: supply: sbs-manager: normalize return value of gpio_get
The GPIO get callback is expected to return 0 or 1 (or a negative error
code). Ensure that the value returned by sbsm_gpio_get_value() is
normalized to the [0, 1] range.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Link: https://patch.msgid.link/aZYoL2MnTYU5FuQh@google.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:07 +01:00
Jaime Saguillo Revilla
68e6343fbf power: supply: cpcap-battery: fix typo in config name
Rename cpcap_battery_unkown_data to
cpcap_battery_unknown_data to correct a spelling mistake
in the identifier.

No functional change.

Signed-off-by: Jaime Saguillo Revilla <jaime.saguillo@gmail.com>
Link: https://patch.msgid.link/20260219212353.49416-1-jaime.saguillo@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:07 +01:00
Shivendra Pratap
cfaf0a9078 power: reset: reboot-mode: Expose sysfs for registered reboot_modes
Currently, there is no standardized mechanism for userspace to discover
supported reboot modes on a platform. This limits userspace scripts, to
rely on hardcoded assumptions about the available reboot-modes.

Create a class 'reboot-mode' and a device under it. Use the name of the
registering driver as device name. Expose a sysfs interface under this
device to show available reboot mode arguments.

 This results in the creation of:
   /sys/class/reboot-mode/<driver>/reboot_modes

This read-only sysfs file will exposes the supported reboot mode
arguments provided by the registering driver, enabling userspace to
query the list of arguments.

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
Link: https://patch.msgid.link/20260224-next-15nov_expose_sysfs-v24-2-4ee5b49d5a06@oss.qualcomm.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:07 +01:00
André Draszik
c10b68e331 power: supply: max17042: report time to full (max17055 & max77759)
Report the remaining time to full as calculated by the firmware for
devices that implement this.
Similar to time to empty, the reported value is only meaningful when
charging, i.e. if it is != U16_MAX.

Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260302-max77759-fg-v3-11-3c5f01dbda23@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:07 +01:00
André Draszik
83a86e27c3 power: supply: max17042: consider task period (max77759)
Several (register) values reported by the fuel gauge depend on its
internal task period and it needs to be taken into account when
calculating results. All relevant example formulas in the data sheet
assume the default task period (of 5760) and final results need to be
adjusted based on the task period in effect.

Update the code as and where necessary.

Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260302-max77759-fg-v3-10-3c5f01dbda23@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:07 +01:00
André Draszik
2864fb6aa9 power: supply: max17042: initial support for Maxim MAX77759
The Maxim MAX77759 is a companion PMIC intended for use in mobile
phones and tablets. It is used on Google Pixel 6 and 6 Pro (oriole and
raven). Amongst others, it contains a fuel gauge that is similar to the
ones supported by this driver.

The fuel gauge can measure battery charge and discharge current,
battery voltage, battery temperature, and the Type C connector's
temperature.

The MAX77759 incorporates the Maxim ModelGauge m5 algorithm. It, as
well as previous generations like m3 on max17047/max17050, requires
the host to save/restore some register values across power cycles to
maintain full accuracy. Extending the driver for such support is out of
scope in this initial commit.

Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260302-max77759-fg-v3-9-3c5f01dbda23@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:07 +01:00
André Draszik
2288d5eaca power: supply: max17042: support standard shunt-resistor-micro-ohms DT property
shunt-resistor-micro-ohms is a standard property used to describe the
value of a shunt resistor required when measuring currents. Standard
properties should be used instead of vendor-specific ones of similar
intention when possible.

Try to read it from DT, and fall back to the vendor-specific property
maxim,rsns-microohm if unsuccessful for compatibility with existing
DTs.

Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260302-max77759-fg-v3-8-3c5f01dbda23@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:07 +01:00
André Draszik
0c5a6dc85d power: supply: max17042: time to empty is meaningless when charging
When charging, the fuel gauge reports U16_MAX as time to empty.
Ignoring this special case (as this driver currently does), causes the
remaining time to be reported as ~102hours, which is incorrect.

Update the code to not return anything in this case.

Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260302-max77759-fg-v3-7-3c5f01dbda23@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:07 +01:00
André Draszik
9a44949da6 power: supply: max17042: avoid overflow when determining health
If vmax has the default value of INT_MAX (e.g. because not specified in
DT), battery health is reported as over-voltage. This is because adding
any value to vmax (the vmax tolerance in this case) causes it to wrap
around, making it negative and smaller than the measured battery
voltage.

Avoid that by using size_add().

Fixes: edd4ab0559 ("power: max17042_battery: add HEALTH and TEMP_* properties support")
Cc: stable@vger.kernel.org
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260302-max77759-fg-v3-6-3c5f01dbda23@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:07 +01:00
André Draszik
699f0f71ac power: supply: max17042: use dev_err_probe() where appropriate
dev_err_probe() exists to simplify code, harmonise error messages, and
set the deferred probe reason if relevant - there's no reason not to
use it here.

While at it, return the actual error from devm_regmap_init_i2c() rather
than overwriting with -EINVAL, when relevant.

Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260302-max77759-fg-v3-5-3c5f01dbda23@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:07 +01:00
André Draszik
e370b67c2c power: supply: max17042: fix a comment typo (then -> than)
Fix this trivial typo where than should be used instead of then.

Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Link: https://patch.msgid.link/20260302-max77759-fg-v3-4-3c5f01dbda23@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-03-03 23:58:06 +01:00
Linus Torvalds
323bbfcf1e Convert 'alloc_flex' family to use the new default GFP_KERNEL argument
This is the exact same thing as the 'alloc_obj()' version, only much
smaller because there are a lot fewer users of the *alloc_flex()
interface.

As with alloc_obj() version, this was done entirely with mindless brute
force, using the same script, except using 'flex' in the pattern rather
than 'objs*'.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21 17:09:51 -08:00
Linus Torvalds
bf4afc53b7 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using

    git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21 17:09:51 -08:00
Kees Cook
69050f8d6d treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-21 01:02:28 -08:00
Linus Torvalds
7563f7e0e9 power supply and reset changes for the 7.0 series
* power-supply core
   - sysfs: Constify pointer passed to dev_attr_psp
   - extend DT binding documentation for battery cells to allow
     describing voltage drop behaviour
  * power-supply drivers
   - multiple: Remove unused gpio include header
   - multiple: Fix potential IRQ use-after-free on driver unload
   - bd71828: Add support for ROHM BD72720
   - misc. small fixes
  * reset drivers
   - tdx-ec-poweroff: fix restart
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmmOWCwACgkQ2O7X88g7
 +ppKvRAAkOUnzB2XBNuFUo7lF5menrccueob0oDKFXqrOM4TEtByMQBcxYCU0Li7
 eYIWt1XlcjNJ2rvQfgbVAKWBp5aKAWlizH8f4Q1Z/1GTxKNrCAZdGF0ARsW+0l4Q
 mVOXZa/2FAD/zfV+xrHKZV0x0NWnMjaZPgsRFq1Gvc7Q+Fs11S8UvK266wjIzF5w
 3T9tAJapEcXgd9OpQSTJr898GI09tJLLbJLFNGeHY5+l+nzmCvL8gZWGDPxdDPEj
 c4EhTMfhQr4uJsFxwdPGdaLxWaYlGWMR+Ji/AA+56QuK1F3DekpTZWpPIh2loPgo
 A8cVNaOrusCA/8ZmaTTsSvTzgkj/sttXwV2CvSa0TyY7EaET3TZAwZVgvYEunmj6
 TJHIizRc/jPf+yoHMF9d9iEfgtaxUmbtzJ3KWF/Tt89vxZ0CxCvxeUYTELRiJkJz
 iXBmDlhfmoMBJlh76ULZr36tEytDc2UG6cLr812qjtMhkza9QZkWn8HF7lny9rZy
 df/uUzcfA4lLVu/XPEUo7KDYyx2Pd2T61nC0lsCgmExe46bjP9HLdLVUKHX8GCVA
 5/sqeLViUMqsKk32L3+zOeMGPPHd/qUlq0ItFDuqsaHEHxwFruFEU0Q2a3wAXvcI
 J2tQ4lhnxM5N5DNTL2QeAl2DxDzVUehxAxJQiXNJu9lDjh08wxw=
 =HkTZ
 -----END PGP SIGNATURE-----

Merge tag 'for-v7.0' 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:
   - sysfs: constify pointer passed to dev_attr_psp
   - extend DT binding documentation for battery cells to allow
     describing voltage drop behaviour

  power-supply drivers:
   - multiple: Remove unused gpio include header
   - multiple: Fix potential IRQ use-after-free on driver unload
   - bd71828: Add support for ROHM BD72720
   - misc small fixes

  reset drivers:
   - tdx-ec-poweroff: fix restart"

* tag 'for-v7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (30 commits)
  power: supply: bd71828: Use dev_err_probe()
  dt-bindings: power: supply: google,goldfish-battery: Convert to DT schema
  power: supply: qcom_battmgr: Recognize "LiP" as lithium-polymer
  power: supply: wm97xx: Use devm_power_supply_register()
  power: supply: wm97xx: Use devm_kcalloc()
  power: supply: pm8916_lbc: Fix use-after-free for extcon in IRQ handler
  power: reset: tdx-ec-poweroff: fix restart
  docs: power: update documentation about removed function
  power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed()
  MAINTAINERS: adjust file entry in ROHM BD71828 CHARGER
  power: supply: ab8500_chargalg: improve kernel-doc
  power: supply: sysfs: Constify pointer passed to dev_attr_psp()
  power: supply: bq27xxx: fix wrong errno when bus ops are unsupported
  power: reset: nvmem-reboot-mode: respect cell size for nvmem_cell_write
  power: supply: sbs-battery: Fix use-after-free in power_supply_changed()
  power: supply: rt9455: Fix use-after-free in power_supply_changed()
  power: supply: pm8916_lbc: Fix use-after-free in power_supply_changed()
  power: supply: pm8916_bms_vm: Fix use-after-free in power_supply_changed()
  power: supply: pf1550: Fix use-after-free in power_supply_changed()
  power: supply: goldfish: Fix use-after-free in power_supply_changed()
  ...
2026-02-12 18:24:37 -08:00
Linus Torvalds
d701782152 gpio updates for v7.0-rc1
GPIOLIB core:
 - shrink the GPIO bus driver stub code
 - rework software node support for "undefined" software nodes
 - provide and use devm_fwnode_gpiod_get_optional()
 - only compile the OF quirk for MT2701 when needed
 
 New drivers:
 - add the GPIO driver for ROHM bd72720
 - add the gpio-line-mux driver providing 1-to-many mapping for a single
   real GPIO
 
 Driver changes:
 - refactor gpio-pca9570: use lock guard, add missing headers, use devres
   consistently
 - add support for a new model (G7 Aspeed sgpiom) to the aspeed-sgpio driver
   along with some prerequisite refactoring
 - use device_get_match_data() where applicable and save some lines
 - add support for more models to gpio-cadence
 - add the compatible property to reset-gpio and use it in shared GPIO
   management
 - drop unnecessary use of irqd_get_trigger_type() in gpio-max77759
 - add support for a new variant to gpio-pca953x
 - extend build coverage with COMPILE_TEST for more drivers
 - constify configfs structures in gpio-sim and gpio-virtuser
 - add support for the K3 SoC to gpio-spacemit
 - implement the missing .get_direction() callback in gpio-max77620
 - add support for Tegra264 to gpio-tegra186
 - drop unneeded MODULE_ALIAS() from gpio-menz127
 
 DT bindings:
 - document support for the opencores GPIO controller in gpio-mmio
 - document new variants for gpio-pca953x
 
 Documentation:
 - extensively describe interrupt source detection for gpio-pca953x and
   add more models to the list of supported variants
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEkeUTLeW1Rh17omX8BZ0uy/82hMMFAmmK9bwACgkQBZ0uy/82
 hMM3rQ/7BTRmMgGiJXlDpqkUoA9fQusiEcokwgmpvlJFM3cb2ANzrjxqZDGnUVLS
 OFaVCPjgUTDrmWNgSSy5SBfyfVkvbXmT7X5+e38qotlNun6BKCPhF1H5HxBgJv9P
 ObHXZ6ACrg4Ia+jl0QkpIXUDC/vAzaBUml5LUATGHpwf/pa4ZcBDXXbLIEtEfSpb
 kNDDQVeWJlWxDYNuJudR8BL2saZFEoD9RaX8F4jLya8ogecoKXElK8Nj0G0Gua8D
 UkH9aKMlNTIrk/iE6MiohaLWWqBgRV6+wO6vd2IRek5iItTbPffk4iT2/dOiX8H4
 HcOxXBxACH/+wicXGwY360r5M5BCYaMcUvLQaCxLuac2T4302aFLcrWH7be+Ju6f
 F+rPBRK1LTYwn0LNlu1I7hYBbwNWHCXfWejXXTH4pMO4uyiwCPpkBHXWCyjWSTuV
 YhIbWVYuQjVgxvPCoJ0+67ju++I2ShlXtiT6NorQrxGt9CCBzMN4KU/uMPkN5j+Z
 RgurHuEEB1hZ8h5Tzs058L6Pxfyp4eY6Qy8BKLPcrGZaKvvX/EZeI/JkeQOOItKe
 VoVq4NIeeqYmqzFa5xrsRYnGUw6lKVj2M5SrjRfbGRz4xVX+rSgrBZMrz1gJyisP
 1M5LiGj+c91oo41tysJdPjkc8dkN47hFbNLzB27kXDfm77qlbUE=
 =Zhuy
 -----END PGP SIGNATURE-----

Merge tag 'gpio-updates-for-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio updates from Bartosz Golaszewski:
 "There are two new drivers and some changes to GPIO core but mostly
  just GPIO driver updates across a wide array of files, adding support
  for new models as well as various refactoring changes. Nothing
  controversial and everything has spent a good measure of time in
  linux-next.

  GPIOLIB core:
   - shrink the GPIO bus driver stub code
   - rework software node support for "undefined" software nodes
   - provide and use devm_fwnode_gpiod_get_optional()
   - only compile the OF quirk for MT2701 when needed

  New drivers:
   - add the GPIO driver for ROHM bd72720
   - add the gpio-line-mux driver providing 1-to-many mapping for a
     single real GPIO

  Driver changes:
   - refactor gpio-pca9570: use lock guard, add missing headers, use
     devres consistently
   - add support for a new model (G7 Aspeed sgpiom) to the aspeed-sgpio
     driver along with some prerequisite refactoring
   - use device_get_match_data() where applicable and save some lines
   - add support for more models to gpio-cadence
   - add the compatible property to reset-gpio and use it in shared GPIO
     management
   - drop unnecessary use of irqd_get_trigger_type() in gpio-max77759
   - add support for a new variant to gpio-pca953x
   - extend build coverage with COMPILE_TEST for more drivers
   - constify configfs structures in gpio-sim and gpio-virtuser
   - add support for the K3 SoC to gpio-spacemit
   - implement the missing .get_direction() callback in gpio-max77620
   - add support for Tegra264 to gpio-tegra186
   - drop unneeded MODULE_ALIAS() from gpio-menz127

  DT bindings:
   - document support for the opencores GPIO controller in gpio-mmio
   - document new variants for gpio-pca953x

  Documentation:
   - extensively describe interrupt source detection for gpio-pca953x
     and add more models to the list of supported variants"

* tag 'gpio-updates-for-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (59 commits)
  gpio: tegra186: Add support for Tegra264
  dt-bindings: gpio: Add Tegra264 support
  gpio: spacemit-k1: Use PDR for pin direction, not SDR/CDR
  gpio: max77620: Implement .get_direction() callback
  gpio: aspeed-sgpio: Support G7 Aspeed sgpiom controller
  dt-bindings: gpio: aspeed,sgpio: Support ast2700
  gpio: aspeed-sgpio: Convert IRQ functions to use llops callbacks
  gpio: aspeed-sgpio: Create llops to handle hardware access
  gpio: aspeed-sgpio: Remove unused bank name field
  gpio: aspeed-sgpio: Change the macro to support deferred probe
  regulator: bd71815: switch to devm_fwnode_gpiod_get_optional
  gpiolib: introduce devm_fwnode_gpiod_get_optional() wrapper
  gpio: mmio: Add compatible for opencores GPIO
  dt-bindings: gpio-mmio: Correct opencores GPIO
  gpio: pca9570: use lock guards
  gpio: pca9570: Don't use "proxy" headers
  gpio: pca9570: Use devm_mutex_init() for mutex initialization
  MAINTAINERS: Add ROHM BD72720 PMIC
  power: supply: bd71828-power: Support ROHM BD72720
  power: supply: bd71828: Support wider register addresses
  ...
2026-02-11 10:53:39 -08:00
Dmitry Baryshkov
ecfcae7885 power: sequencing: qcom-wcn: fix error path for VDDIO handling
In case getting VDDIO regulator returned an error, WCN power sequencing
driver passes ret to dev_err_probe() as the error code, however it is
known that ret is 0 at this point. Pass PTR_ERR(ctx->vddio) instead.

Fixes: 0eb85f468e ("power: sequencing: qcom-wcn: add support for WCN39xx")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/aYXvQxKqmjP_sdCd@stanley.mountain/
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20260207-fix-wcn39xx-v1-1-df0606108ce2@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-02-09 10:32:27 +01:00
Ziyi Guo
e1dccb485c power: sequencing: fix missing state_lock in pwrseq_power_on() error path
pwrseq_power_on() calls pwrseq_unit_disable() when the
post_enable callback fails. However, this call is outside the
scoped_guard(mutex, &pwrseq->state_lock) block that ends.

pwrseq_unit_disable() has lockdep_assert_held(&pwrseq->state_lock),
which will fail when called from this error path.

Add the scoped_guard block to cover the post_enable callback and its
error handling to ensure the lock is held when pwrseq_unit_disable() is
called.

Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
Link: https://patch.msgid.link/20260130182651.1576579-1-n7l8m4@u.northwestern.edu
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-02-04 11:26:14 +01:00
Matti Vaittinen
12bdf471e3 power: supply: bd71828: Use dev_err_probe()
The driver uses separate error printing and error returning at probe()
for locations where the error value is hard-coded and can't be
EPROBE_DEFER. This helps to omit the extra return value check which is
done in dev_err_probe().

Using the dev_err_probe() has some other benefits besides handling the
-EPROBE_DEFER though, like standardizing the print for error numbers.
Some believe thes outweigh the benefit of skipping the extra check.

Use dev_err_probe() consistently in the bd71828 power-supply probe.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://patch.msgid.link/aWi_GG74sZRfajA_@mva-rohm
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-01-30 22:41:17 +01:00
Sebastian Reichel
cb3aa2b540 Immutable branch between MFD, Clk, GPIO, Power, Regulator and RTC due for the v6.20 merge window
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmlo7yoACgkQUa+KL4f8
 d2FKig//RoRbxD0C2OPFfZ7Gi8+lUXfky2sAxRo/lrwpZ9KKppzUB0Jh7YPRzhdD
 9vtCHcACrc7Q5qYI+u0+Xylr3T9VLvXS0ymE0sdXHZyOpqpKF14JT5AvZwGYiIyF
 T5KXJFwtyuZsg4SdoNV7obT4X4NOsGOmNlrhWkNDo7TGoIu+Hq3ia0LDRL9o0ims
 WJTpJuvkUJkZ1tu5vrBvfu/u8y4p+DZ1bgQDu33sQgvyA9yQ9/j1+TQ7YapCVlAI
 6KnkkrRxZ4N21UnF6BTlj896WJa9YI72jzAKgDvXoICoff12IJL0hainw8UeZs1g
 2AagW4umuT9zNNFrIHyxHIHXLnBZ2D8Dtnv3WvFoDgY4Yj2t+7C9nHc/qiXSbKOB
 uUBF9sHev5aI0KqyW0/RGJ0Z19zt71Mu5Nz2FWPCYpy8WuEti7hiY/rQgOIOHdYs
 Vw5zib9rwOQRwC99EA3SYyiPPuBd+lD0JRSClWoopcZdxO0d0TQ91mjvFPV7/kMI
 CtPQfN62f8wRCU7KnG+9pfChmxfnGz7d6bT98hFz/kTeB8EDJOz8Cu5KitB9iYHO
 SMuf408W6bdLiectcY2GGihELI1Rsa3pVHceeI1WLA8W+XE0mC6KEDMahOiE9rRT
 E0U41YYDsJFwReMTz2LKhs4rPkr3BQFMV1cTS2smBQ2tSGb46PY=
 =A82v
 -----END PGP SIGNATURE-----

Merge tag 'ib-mfd-clk-gpio-power-regulator-rtc-v6.20' into psy-next

Merge immutable branch between MFD, Clk, GPIO, Power, Regulator and RTC
due for the v6.20 merge window to apply further cleanups on top of the
BD72720 power-supply driver contained in this branch.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2026-01-30 22:38:57 +01:00