5672 Commits

Author SHA1 Message Date
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
Thomas Richard
a8d1376568 mfd: cgbc-core: Add support for conga-SA8
Add Board Controller support for the conga-SA8 module.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://lore.kernel.org/r/20250318-b4-cgbc-sa8-support-v1-1-6ae9ec443c05@bootlin.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-21 11:34:08 +00:00
Thomas Richard
ddbc194589 mfd: cgbc: Add support for HWMON
The Board Controller has some internal sensors. Add a hwmon cell for the
cgbc-hwmon driver which adds support for temperature, voltage, current
and fan sensors.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://lore.kernel.org/r/20250203-congatec-board-controller-hwmon-v4-2-ff6c76a4662c@bootlin.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-21 11:31:01 +00:00
Dan Carpenter
3ce71a0893 mfd: cgbc-core: Cleanup signedness in cgbc_session_request()
This doesn't affect how the code works because there are some implicit
casts, but the "ret" variable is used to hold negative error codes so
it should be type int.

Declare it as "int" instead of "unsigned int".

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/9e812dfa-e216-4e40-bbf0-d0b63b110bb0@stanley.mountain
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 11:48:03 +00:00
Dr. David Alan Gilbert
44356090d5 mfd: pcf50633: Remove remaining PCF50633 support
Remove the remaining parts of the 50633, the core, headers and glue.

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-10-linux@treblig.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 11:42:51 +00:00
Dr. David Alan Gilbert
786ad21f43 mfd: pcf50633: Remove unused platform IRQ code
As part of the pcf50633 removal, take out it's irq code
(which includes one bit still called from the core, but it'll
go soon).

Signed-off-by: "Dr. David Alan Gilbert" <linux@treblig.org>
Link: https://lore.kernel.org/r/20250311014959.743322-9-linux@treblig.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 11:42:40 +00:00
Dr. David Alan Gilbert
8559602247 mfd: pcF50633-gpio: Remove unused driver
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>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250311014959.743322-4-linux@treblig.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 11:42:35 +00:00
Dr. David Alan Gilbert
0d0e549538 mfd: pcf50633-adc: Remove unused driver
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-2-linux@treblig.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 11:42:26 +00:00
Chen Ni
f82718251e mfd: qnap-mcu: Convert commas to semicolons in qnap_mcu_exec()
Replace comma between expressions with semicolons.

Using a ',' in place of a ';' can have unintended side effects.
Although that is not the case here, it is seems best to use ';'
unless ',' is intended.

Found by inspection.
No functional change intended.
Compile tested only.

Fixes: 998f70d1806b ("mfd: Add base driver for qnap-mcu devices")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20250310031145.650950-1-nichen@iscas.ac.cn
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 10:55:15 +00:00
Andrew Perepech
be23147462 mfd: mt6397-core: Add mfd_cell for mt6359-accdet
Add an mfd_cell for mt6359-accdet and describe its IRQ resources to
allow the mt6359-accdet driver to probe.

Signed-off-by: Andrew Perepech <andrew.perepech@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Acked-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20250305-mt6359-accdet-dts-v4-2-e5ffa5ee9991@collabora.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:07 +00:00
Dr. David Alan Gilbert
0d1217ab7f mfd: ezx-pcap: Remove unused pcap_adc_sync
pcap_adc_sync() was added in 2009 by commit 13a09f93d2bf ("mfd: add PCAP
driver") but has remained unused; the async version is still used.

Remove it.

Signed-off-by: "Dr. David Alan Gilbert" <linux@treblig.org>
Link: https://lore.kernel.org/r/20250306011027.257021-1-linux@treblig.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:07 +00:00
Lukas Bulwahn
98cf2d5039 mfd: Remove STA2x11 core driver
With commit dcbb01fbb7ae ("x86/pci: Remove old STA2x11 support"), the core
driver for STA2x11 is not needed and cannot be built anymore.

Remove the driver and its header file.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250303100055.372689-1-lukas.bulwahn@redhat.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:07 +00:00
Aaron Kling
0d084ee9ba mfd: max77620: Allow building as a module
The driver works fine as a module, so allowing building as such.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Link: https://lore.kernel.org/r/20250228-max77620-module-v2-1-eb686216437c@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:07 +00:00
Chenyuan Yang
4cdf1d2a81 mfd: ene-kb3930: Fix a potential NULL pointer dereference
The off_gpios could be NULL. Add missing check in the kb3930_probe().
This is similar to the issue fixed in commit b1ba8bcb2d1f
("backlight: hx8357: Fix potential NULL pointer dereference").

This was detected by our static analysis tool.

Cc: stable@vger.kernel.org
Fixes: ede6b2d1dfc0 ("mfd: ene-kb3930: Add driver for ENE KB3930 Embedded Controller")
Suggested-by: Lee Jones <lee@kernel.org>
Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
Link: https://lore.kernel.org/r/20250224233736.1919739-1-chenyuan0y@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:07 +00:00
Eder Zulian
ba09916efb mfd: syscon: Add check for invalid resource size
Add a consistency check to avoid assigning an invalid value to
max_register due to a possible DT misconfiguration.

Suggested-by: Mark Langsdorf <mlangsdo@redhat.com>
Signed-off-by: Eder Zulian <ezulian@redhat.com>
Link: https://lore.kernel.org/r/20250212184524.585882-1-ezulian@redhat.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:07 +00:00
Lee Jones
417206a226 mfd: max8997: Remove unused function max8997_irq_exit()
Utilise devm_*() managed resource helpers for freeing IRQs instead.

Reported-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:06 +00:00
Shree Ramamoorthy
7947219ab1 mfd: tps65219: Add support for TI TPS65214 PMIC
Use chip ID and chip_data struct to differentiate between 3 PMIC devices in
probe(). Add TPS65214 resource information. Update descriptions and
copyright information to reflect the driver supports 3 PMIC devices.

Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com>
Link: https://lore.kernel.org/r/20250206173725.386720-6-s-ramamoorthy@ti.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:06 +00:00
Shree Ramamoorthy
7f9ed27eea mfd: tps65219: Add support for TI TPS65215 PMIC
Use chip ID and chip_data struct to differentiate between devices in
probe(). Add TPS65215 resource information. Update descriptions and
copyright information to reflect the driver supports 2 PMIC devices.

Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com>
Link: https://lore.kernel.org/r/20250206173725.386720-5-s-ramamoorthy@ti.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:06 +00:00
Shree Ramamoorthy
76b58d5111 mfd: tps65219: Remove TPS65219_REG_TI_DEV_ID check
The chipid macro/variable and regmap_read function call is not needed
because the TPS65219_REG_TI_DEV_ID register value is not a consistent value
across TPS65219 PMIC config versions. Reading from the DEV_ID register
without a consistent value to compare it to isn't useful. There isn't a
way to verify the match data ID is the same ID read from the DEV_ID device
register. 0xF0 isn't a DEV_ID value consistent across TPS65219 NVM
configurations.

For TPS65215, there is a consistent value in bits 5-0 of the DEV_ID
register. However, there are other error checks in place within probe()
that apply to both PMICs rather than keeping this isolated check for one
PMIC.

Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com>
Link: https://lore.kernel.org/r/20250206173725.386720-4-s-ramamoorthy@ti.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:06 +00:00
Andy Shevchenko
6b1a65c5a2 mfd: upboard-fpga: Remove ACPI_PTR() annotation
The ACPI ID table is defined globally without an #ifdef check for CONFIG_ACPI,
so ACPI_PTR() makes no sense here. Also note, driver depends on ACPI anyway.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250205122536.631252-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:06 +00:00
Robert Marko
98c8a0f33e mfd: at91-usart: Make it selectable for ARCH_LAN969X
LAN969x uses the AT91 USART IP so make it selectable for ARCH_LAN969X.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20250131171739.1044701-2-robert.marko@sartura.hr
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:05 +00:00
Andy Shevchenko
06edb8636a mfd: intel_soc_pmic_crc: Drop unneeded assignment for cache_type
REGCACHE_NONE is the default type of the cache when not provided.
Drop unneeded explicit assignment to it.

Note, it's defined to 0, and if ever be redefined, it will break
literally a lot of the drivers, so it very unlikely to happen.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20250129152828.1802315-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:05 +00:00
Andy Shevchenko
9eb99c0850 mfd: intel_soc_pmic_chtdc_ti: Drop unneeded assignment for cache_type
REGCACHE_NONE is the default type of the cache when not provided.
Drop unneeded explicit assignment to it.

Note, it's defined to 0, and if ever be redefined, it will break
literally a lot of the drivers, so it very unlikely to happen.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20250129152823.1802273-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:05 +00:00
Nikita Zhandarovich
2d8cb9ffe1 mfd: sm501: Switch to BIT() to mitigate integer overflows
If offset end up being high enough, right hand expression in functions
like sm501_gpio_set() shifted left for that number of bits, may
not fit in int type.

Just in case, fix that by using BIT() both as an option safe from
overflow issues and to make this step look similar to other gpio
drivers.

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

Fixes: f61be273d369 ("sm501: add gpiolib support")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Link: https://lore.kernel.org/r/20250115171206.20308-1-n.zhandarovich@fintech.ru
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:05 +00:00
Krzysztof Kozlowski
9675c059e4 mfd: ipaq-micro/tps65010: 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/20250114192538.911970-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:05 +00:00
Fabrice Gasnier
7dc0dddbe5 mfd: stm32-timers: Add support for stm32mp25
Add support for STM32MP25 SoC. Use newly introduced compatible, to handle
new features.
Identification and hardware configuration registers allow to read the
timer version and capabilities (counter width, number of channels...).
So, rework the probe to avoid touching ARR register by simply read the
counter width when available. This may avoid messing with a possibly
running timer.
Also add useful bit fields to stm32-timers header file.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20250110091922.980627-3-fabrice.gasnier@foss.st.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-14 08:59:05 +00:00
Lee Jones
01bdf0e8ba Merge branches 'ib-mfd-input-leds-power-6.15', 'ib-mfd-power-6.15' and 'ib-mfd-regulator-6.15' into ibs-for-mfd-merged 2025-03-14 08:58:28 +00:00
Kaustabh Chakraborty
ed33479b7b mfd: sec: Add support for S2MPU05 PMIC
Add support for Samsung's S2MPU05 PMIC. It's the primary PMIC used by
Exynos7870 devices. It houses regulators (21 LDOs and 5 BUCKs) and a RTC
clock device.

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250301-exynos7870-pmic-regulators-v3-2-808d0b47a564@disroot.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-13 12:38:45 +00:00
Dzmitry Sankouski
c8d50f0297 mfd: Add new driver for MAX77705 PMIC
Add the core MFD driver for max77705 PMIC. Drivers for sub-devices
will be added in subsequent patches.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250123-starqltechn_integration_upstream-v17-5-8b06685b6612@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-02-20 16:37:40 +00:00
Dzmitry Sankouski
7b591ef98b mfd: simple-mfd-i2c: Add MAX77705 support
Add MAX77705 support - fuel gauge and hwmon devices.
Hwmon provides charger input and system bus measurements.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250123-starqltechn_integration_upstream-v17-4-8b06685b6612@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-02-20 16:37:33 +00:00
Chris Morgan
bfad07fe29 mfd: axp20x: AXP717: Add AXP717_TS_PIN_CFG to writeable regs
Add AXP717_TS_PIN_CFG (register 0x50) to the table of writeable
registers so that the temperature sensor can be configured by the
battery driver.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://lore.kernel.org/r/20250204155835.161973-3-macroalpha82@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-02-20 16:05:09 +00:00
Rafael J. Wysocki
bca84a7b93 PM: sleep: Use DPM_FLAG_SMART_SUSPEND conditionally
A recent discussion has revealed that using DPM_FLAG_SMART_SUSPEND
unconditionally is generally problematic because it may lead to
situations in which the device's runtime PM information is internally
inconsistent or does not reflect its real state [1].

For this reason, change the handling of DPM_FLAG_SMART_SUSPEND so that
it is only taken into account if it is consistently set by the drivers
of all devices having any PM callbacks throughout dependency graphs in
accordance with the following rules:

 - The "smart suspend" feature is only enabled for devices whose drivers
   ask for it (that is, set DPM_FLAG_SMART_SUSPEND) and for devices
   without PM callbacks unless they have never had runtime PM enabled.

 - The "smart suspend" feature is not enabled for a device if it has not
   been enabled for the device's parent unless the parent does not take
   children into account or it has never had runtime PM enabled.

 - The "smart suspend" feature is not enabled for a device if it has not
   been enabled for one of the device's suppliers taking runtime PM into
   account unless that supplier has never had runtime PM enabled.

Namely, introduce a new device PM flag called smart_suspend that is only
set if the above conditions are met and update all DPM_FLAG_SMART_SUSPEND
users to check power.smart_suspend instead of directly checking the
latter.

At the same time, drop the power.set_active flage introduced recently
in commit 3775fc538f53 ("PM: sleep: core: Synchronize runtime PM status
of parents and children") because it is now sufficient to check
power.smart_suspend along with the dev_pm_skip_resume() return value
to decide whether or not pm_runtime_set_active() needs to be called
for the device.

Link: https://lore.kernel.org/linux-pm/CAPDyKFroyU3YDSfw_Y6k3giVfajg3NQGwNWeteJWqpW29BojhQ@mail.gmail.com/ [1]
Fixes: 7585946243d6 ("PM: sleep: core: Restrict power.set_active propagation")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Bjorn Helgaas <bhelgaas@google.com> # drivers/pci
Link: https://patch.msgid.link/1914558.tdWV9SEqCh@rjwysocki.net
2025-02-19 13:22:12 +01:00
Rob Herring (Arm)
5728c92ae1 mfd: syscon: Restore device_node_to_regmap() for non-syscon nodes
Commit ba5095ebbc7a ("mfd: syscon: Allow syscon nodes without a
"syscon" compatible") broke drivers which call device_node_to_regmap()
on nodes without a "syscon" compatible. Restore the prior behavior for
device_node_to_regmap().

This also makes using device_node_to_regmap() incompatible with
of_syscon_register_regmap() again, so add kerneldoc for
device_node_to_regmap() and syscon_node_to_regmap() to make it clear
how and when each one should be used.

Fixes: ba5095ebbc7a ("mfd: syscon: Allow syscon nodes without a "syscon" compatible")
Reported-by: Vaishnav Achath <vaishnav.a@ti.com>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Nishanth Menon <nm@ti.com>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Tested-by: Frank Wunderlich <frank-w@public-files.de>
Tested-by: Dhruva Gole <d-gole@ti.com>
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20250124191644.2309790-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-02-11 14:53:39 +00:00
Linus Torvalds
909fd2b89f - Fix race in device_node_get_regmap() using more extensive locking.
- Remove unused platform driver support for syscon.
 - Allow syscon nodes to be registered without a "syscon" compatible string.
 - Make `platform_data` pointer const in struct mfd_cell.
 - Revert support for multiple AXP PMICs to avoid regressions.
 - Increase SoundWire attach timeout and use gpiod_set_raw() for GPIO operation.
 - Store the result from fault_log() for use by other sub-components.
 - Fix an invalid regmap-config max_register value.
 - Add another Gemini Lake ISA bridge PCI device ID.
 - Use devm_register_power_off_handler() to simplify code.
 - Add support for QNAP microcontroller units, including LEDs, input, and hwmon.
 - Use MFD_CELL macros and remove unused code.
 - Add support for AAEON UP board FPGA.
 - Remove unused includes.
 - Fix various typos and compatibility issues in multiple bindings.
 - Add new bindings for rk3562 QoS, LED1202, and qcom,tcsr-ipq5424.
 - Convert several bindings to YAML schema.
 - Update sprd,sc2731 bindings to reference sprd,sc2731-efuse bindings directly.
 - Fix rohm,bd71815 bindings by correcting resistor values and typos.
 - Documentation improvements:
 - Add documentation for LED1202 and qnap-mcu-hwmon.
 - Adjust the file entry for the qnap-mcu header in MAINTAINERS.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmePbHkACgkQUa+KL4f8
 d2HQNw//fM3+JpyTUKjUtBl8YH0ilgZ2iKiXLHyJ6vMIqv+RfLlPAliM8f1bkEj8
 x/9kKp6ytdyAhQ/oAJW/vxRhWZVsfh9T7WSy/Q/WNChcGJ0KtUwtjWWuezdDJoyr
 6Ju4PhKHVz46cBW56u3OCbcogN8AHi1gZiAh8APwVhldUO6swaisPBvxw/4u4WMs
 HGviTLueXEptF4/actnArQ1YJ6tctY7C5tV06f6Irxn6hSz8EpGBRQ47S7Hom+mx
 aIyRLkERqhZ1FNBDfk2YERqaOyxzQRYy+PMNr6AtQ/TE+7pVBOz7xoSI3VH3k7mM
 k4u8Gau9qbnVi/pUkabgcdKOCGUYeZzXZgJT/Ttq5O9ddPE8sHMcLrxKMtUP2CBE
 6Zf0EljscGFOWise/ocNUblpy0rfXPl+wMiibxY5C+X56QkluDn2Q8ObGODt0bbR
 ACgPFL2S8m2MLEOTzBKDlSgeqoMZFKVWkqAry+yNUgIKbtM6pIdaM5ZCUhgdJ5GL
 CxGP6uw68oAUnr1lRCytgGR5XtmcIXS/Jo2u/T7cmucD3inuxQyt5TrZxma48QbL
 2+P2vmymn6ZWQb82OptrnKCMsBEXnNbWv+2BiRYoKXQt48BxIocVrsyEQIh4qGcP
 KPUB1aCxP/zJ2H7rTaK4QqM+fgOloShs5nI21v5EWSCQKvTN5ko=
 =3HQm
 -----END PGP SIGNATURE-----

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

Pull mfd updates from Lee Jones:

 - Fix race in device_node_get_regmap() using more extensive locking

 - Remove unused platform driver support for syscon

 - Allow syscon nodes to be registered without a "syscon" compatible
   string

 - Make `platform_data` pointer const in struct mfd_cell

 - Revert support for multiple AXP PMICs to avoid regressions

 - Increase SoundWire attach timeout and use gpiod_set_raw() for GPIO
   operation

 - Store the result from fault_log() for use by other sub-components

 - Fix an invalid regmap-config max_register value

 - Add another Gemini Lake ISA bridge PCI device ID

 - Use devm_register_power_off_handler() to simplify code

 - Add support for QNAP microcontroller units, including LEDs, input,
   and hwmon

 - Use MFD_CELL macros and remove unused code

 - Add support for AAEON UP board FPGA

 - Remove unused includes

 - Fix various typos and compatibility issues in multiple bindings

 - Add new bindings for rk3562 QoS, LED1202, and qcom,tcsr-ipq5424

 - Convert several bindings to YAML schema

 - Update sprd,sc2731 bindings to reference sprd,sc2731-efuse bindings
   directly

 - Fix rohm,bd71815 bindings by correcting resistor values and typos

 - Documentation improvements:
    - Add documentation for LED1202 and qnap-mcu-hwmon
    - Adjust the file entry for the qnap-mcu header in MAINTAINERS

* tag 'mfd-next-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (35 commits)
  MAINTAINERS: Adjust the file entry for the qnap-mcu header
  dt-bindings: mfd: syscon: Fix ti,j784s4-acspcie-proxy-ctrl compatible
  dt-bindings: mfd: syscon: Fix al,alpine-sysfabric-service compatible
  Revert "mfd: axp20x: Allow multiple regulators"
  dt-bindings: mfd: syscon: Add rk3562 QoS register compatible
  mfd: syscon: Allow syscon nodes without a "syscon" compatible
  mfd: syscon: Remove the platform driver support
  mfd: syscon: Fix race in device_node_get_regmap()
  dt-bindings: mfd: atmel: Convert to YAML schema
  dt-bindings: mfd: atmel,at91sam9260: Convert to YAML schema
  dt-bindings: mfd: sprd,sc2731: Reference sprd,sc2731-efuse bindings
  mfd: tps65219: Remove unused macros & add regmap.h
  mfd: tps65219: Use MFD_CELL macros
  leds: Add LED1202 I2C driver
  dt-bindings: leds: Add LED1202 LED Controller
  Documentation:leds: Add leds-st1202.rst
  mfd: Add support for AAEON UP board FPGA
  mfd: da9052: Store result from fault_log
  mfd: intel_soc_pmic_chtdc_ti: Fix invalid regmap-config max_register value
  mfd: cs42l43: Use devres for remove as well
  ...
2025-01-22 09:16:02 -08:00
Andre Przywara
b246bd32a3 Revert "mfd: axp20x: Allow multiple regulators"
As Chris and Vasily reported, the attempt to support multiple AXP PMICs
in one system [1] breaks some of the battery and charging functionality
on devices with AXP PMICs. The reason is that the drivers now fail to get
the correct IIO channel for the ADC component, as the current code seems
to rely on the zero-based enumeration of the regulator devices.
A fix is possible, but not trivial, as it requires some rework in the AXP
MFD driver, which cannot be fully reviewed or tested in time for the
6.13 release.

So revert this patch for now, to avoid regressions on battery powered
devices. This patch was really only necessary for devices with two
PMICs, support for which is not mainline yet anyway, so we don't lose
any functionality.

This reverts commit e37ec32188701efa01455b9be42a392adab06ce4.

[1] https://lore.kernel.org/linux-sunxi/20241007001408.27249-4-andre.przywara@arm.com/

Reported-by: Chris Morgan <macroalpha82@gmail.com>
Closes: https://lore.kernel.org/linux-sunxi/675489c1.050a0220.8d73f.6e90@mx.google.com/
Reported-by: Vasily Khoruzhick <anarsoul@gmail.com>
Closes: https://lore.kernel.org/linux-sunxi/CA+E=qVf8_9gn0y=mcdKXvj2PFoHT2eF+JN=CmtTNdRGaSnpgKg@mail.gmail.com/
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20250108164359.2609078-1-andre.przywara@arm.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-01-09 11:38:33 +00:00
Rob Herring (Arm)
ba5095ebbc mfd: syscon: Allow syscon nodes without a "syscon" compatible
of_syscon_register_regmap() was added for nodes which need a custom
regmap setup. It's not really correct for those nodes to claim they are
compatible with "syscon" as the default handling likely doesn't work in
those cases. If device_node_get_regmap() happens to be called first,
then of_syscon_register() will be called and an incorrect regmap will be
created (barring some other error). That may lead to unknown results in
the worst case. In the best case, of_syscon_register_regmap() will fail
with -EEXIST. This problem remains unless these cases drop "syscon" (an
ABI issue) or we exclude them using their specific compatible. ATM,
there is only one user: "google,gs101-pmu"

There are also cases of adding "syscon" compatible to existing nodes
after the fact in order to register the syscon. That presents a
potential DT ABI problem. Instead, if there's a kernel change needing a
syscon for a node, then it should be possible to allow the kernel to
register a syscon without a DT change. That's only possible by using
of_syscon_register_regmap() currently, but in the future we may want to
support a match list for cases which don't need a custom regmap.

With this change, the lookup functions will succeed for any node
registered by of_syscon_register_regmap() regardless of whether the node
compatible contains "syscon".

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Tested-by: Will McVicker <willmcvicker@google.com>
Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20241217-syscon-fixes-v2-3-4f56d750541d@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-01-09 11:11:54 +00:00
Rob Herring (Arm)
26769582bf mfd: syscon: Remove the platform driver support
The platform driver is dead code. It is not used by DT platforms since
commit bdb0066df96e ("mfd: syscon: Decouple syscon interface from
platform devices") which said:

    For non-DT based platforms, this patch keeps syscon platform driver
    structure so that syscon can be probed and such non-DT based drivers
    can use syscon_regmap_lookup_by_pdev API and access regmap handles.
    Once all users of "syscon_regmap_lookup_by_pdev" migrated to DT based,
    we can completely remove platform driver of syscon, and keep only helper
    functions to get regmap handles.

The last user of syscon_regmap_lookup_by_pdevname() was removed in 2018.
syscon_regmap_lookup_by_pdevname() was then removed in 2019, but that
commit failed to remove the rest of the platform driver.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Will McVicker <willmcvicker@google.com>
Acked-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Tested-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20241217-syscon-fixes-v2-2-4f56d750541d@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-01-09 11:11:47 +00:00
Rob Herring (Arm)
805f7aaf7f mfd: syscon: Fix race in device_node_get_regmap()
It is possible for multiple, simultaneous callers calling
device_node_get_regmap() with the same node to fail to find an entry in
the syscon_list. There is a period of time while the first caller is
calling of_syscon_register() that subsequent callers also fail to find
an entry in the syscon_list and then call of_syscon_register() a second
time.

Fix this by keeping the lock held until after of_syscon_register()
completes and adds the node to syscon_list. Convert the spinlock to a
mutex as many of the functions called in of_syscon_register() such as
kzalloc() and of_clk_get() may sleep.

Fixes: bdb0066df96e ("mfd: syscon: Decouple syscon interface from platform devices")
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Will McVicker <willmcvicker@google.com>
Tested-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Link: https://lore.kernel.org/r/20241217-syscon-fixes-v2-1-4f56d750541d@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2025-01-09 11:11:36 +00:00
Shree Ramamoorthy
6891e88dfb mfd: tps65219: Use MFD_CELL macros
Use MFD_CELL macro helpers instead of plain struct properties, which makes
the code shorter with the common defined MFD cell attributes.

Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com>
Link: https://lore.kernel.org/r/20241217204935.1012106-2-s-ramamoorthy@ti.com
Signed-off-by: Lee Jones <lee@kernel.org>
2025-01-09 09:55:35 +00:00
Thomas Richard
c2b148f3bc mfd: Add support for AAEON UP board FPGA
The UP boards implement some features (pin controller, LEDs) through an
on-board FPGA.

This MFD driver implements the line protocol to communicate with the FPGA
through regmap, and registers pin controller and led cells.

This commit adds support for UP and UP Squared boards.

Based on the work done by Gary Wang <garywang@aaeon.com.tw>.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://lore.kernel.org/r/20241211-aaeon-up-board-pinctrl-support-v1-1-24719be27631@bootlin.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-12-17 13:17:26 +00:00
Marcus Folkesson
c925bb8853 mfd: da9052: Store result from fault_log
Other sub-components (da9052-wdt) could use the result to determine
reboot cause. Expose the result by make it part of the da9052 structure.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Link: https://lore.kernel.org/r/20241210-da9052-wdt-v2-1-95a5756e9ac8@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-12-17 13:17:25 +00:00
Hans de Goede
70e997e010 mfd: intel_soc_pmic_chtdc_ti: Fix invalid regmap-config max_register value
The max_register = 128 setting in the regmap config is not valid.

The Intel Dollar Cove TI PMIC has an eeprom unlock register at address 0x88
and a number of EEPROM registers at 0xF?. Increase max_register to 0xff so
that these registers can be accessed.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20241208150028.325349-1-hdegoede@redhat.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-12-17 13:17:25 +00:00
Charles Keepax
0f35dc4bd5 mfd: cs42l43: Use devres for remove as well
Currently the device is powered down in the remove callback, however
all other clean up is done through devres. The problem here is the
MFD children are cleaned up through devres. As this happens after
the remove callback has run, this leads to the incorrect ordering
where the child remove functions run after the device has been powered
down. Put the power down into devres as well such that everything runs
in the expected order.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20241205115822.2371719-4-ckeepax@opensource.cirrus.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-12-17 13:17:25 +00:00
Charles Keepax
47dde1a077 mfd: cs42l43: Increase the SoundWire attach timeout
Some SoundWire controllers take a very long time to fully power up. As
such, increase the timeout that the cs42l43 driver will wait for the
device to initially appear on the bus.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20241205115822.2371719-3-ckeepax@opensource.cirrus.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-12-17 13:17:25 +00:00
Charles Keepax
a57f93b786 mfd: cs42l43: Use gpiod_set_raw for GPIO operations
The GPIO framework supports specifying if a GPIO is active low or
high and will invert accordingly. Whilst specifying this is part of
the normal GPIO definition flow on device tree systems, it is a DSD
extension under ACPI, that Windows doesn't really use. This means most
ACPI systems do not set the polarity of the pin.

The current cs42l43 driver assumes it is setting the level of the line
directly, which is actually the case on all current systems and likely
most future ones. However if the part was used in a device tree system
or an ACPI system that actually used the DSD extensions this would get
inverted, causing the driver to fail probe. As the driver always knows
the polarity of its own reset line, use the raw set API making the
intention to set the level directly clear and to avoid any such future
issues.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20241205115822.2371719-2-ckeepax@opensource.cirrus.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-12-17 13:17:25 +00:00
Maciej Strozek
d496ad33e6 mfd: cs42l43: Prepare support for updated bios patch
Newer bios patch firmware versions now require use of the shadow register
interface, which was previously only required by the full firmware, update
the check accordingly.

Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20241205115822.2371719-1-ckeepax@opensource.cirrus.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-12-17 13:17:25 +00:00
Hans de Goede
1e89d21f81 mfd: lpc_ich: Add another Gemini Lake ISA bridge PCI device-id
On N4100 / N4120 Gemini Lake SoCs the ISA bridge PCI device-id is 31e8
rather the 3197 found on e.g. the N4000 / N4020.

While at fix the existing GLK PCI-id table entry breaking the table
being sorted by device-id.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20241114193808.110132-1-hdegoede@redhat.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-12-17 13:17:25 +00:00
Dragan Simic
00e6dbc805 mfd: stpmic1: Use devm_register_power_off_handler()
Simplify the code a bit by using devm_register_power_off_handler(), which is
a purpose-specific wrapper for devm_register_sys_off_handler().  No intended
functional changes are introduced.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Link: https://lore.kernel.org/r/219e0de8bcd1b2ef24142c837d8331ffc535ab26.1731415409.git.dsimic@manjaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2024-12-17 13:17:25 +00:00
Dragan Simic
88dfdd0327 mfd: axp20x: Use devm_register_power_off_handler()
Simplify the code a bit by using devm_register_power_off_handler(), which is
a purpose-specific wrapper for devm_register_sys_off_handler().  No intended
functional changes are introduced.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Link: https://lore.kernel.org/r/ab1f059f4b5bef75da3d3903d0fbf28bddffd57c.1731415409.git.dsimic@manjaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2024-12-17 13:17:25 +00:00
Heiko Stuebner
998f70d180 mfd: Add base driver for qnap-mcu devices
These microcontroller units are used in network-attached-storage devices
made by QNAP and provide additional functionality to the system.

This adds the base driver that implements the serial protocol via
serdev and additionally hooks into the poweroff handlers to turn
off the parts of the system not supplied by the general PMIC.

Turning off (at least the TSx33 devices using Rockchip SoCs) consists of
two separate actions. Turning off the MCU alone does not turn off the main
SoC and turning off only the SoC/PMIC does not turn off the hard-drives.
Also if the MCU is not turned off, the system also won't start again until
it is unplugged from power.

So on shutdown the MCU needs to be turned off separately before the
main PMIC.

The protocol spoken by the MCU is sadly not documented, but was
obtained by listening to the chatter on the serial port, as thankfully
the "hal_app" program from QNAPs firmware allows triggering all/most
MCU actions from the command line.

The implementation of how to talk to the serial device got some
inspiration from the rave-sp servdev driver.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20241107114712.538976-5-heiko@sntech.de
Signed-off-by: Lee Jones <lee@kernel.org>
2024-12-17 13:14:33 +00:00