Commit Graph

5616 Commits

Author SHA1 Message Date
Matthias Schiffer
b58bbbd7c5 mfd: tqmx86: Refactor GPIO IRQ setup
Move IRQ setup into a helper function. The string "GPIO" for error
messages is replaced with a label argument to prepare for reusing the
function for the I2C IRQ.

No functional change intended.

Co-developed-by: Gregor Herburger <gregor.herburger@tq-group.com>
Signed-off-by: Gregor Herburger <gregor.herburger@tq-group.com>
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://lore.kernel.org/r/97f481334f480a113b7076e76f994e0e73ee5aa5.1731325758.git.matthias.schiffer@ew.tq-group.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-11-12 14:46:49 +00:00
Matthias Schiffer
aaac6067d7 mfd: tqmx86: Improve gpio_irq module parameter description
Clarify that "7, 9, 12" refers to the valid arguments that can be
passed as gpio_irq.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://lore.kernel.org/r/3275f436b66f6807c02256bc852d39b03ebd64d5.1731325758.git.matthias.schiffer@ew.tq-group.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-11-12 14:46:41 +00:00
Matthias Schiffer
97f0db5952 mfd: tqmx86: Add board definitions for TQMx120UC, TQMx130UC and TQMxE41S
This adds support for 3 new TQMx86 COMs:

- TQMx120UC/TQMx130UC: COM Express Compact Type 6 modules with 12th and
  13th Generation Intel Core CPUs ([1, 2])
- TQMxE41S: SMARC 2.1 module with Intel Atom x7000E and compatible CPUs [3]

[1] https://www.tq-group.com/en/products/tq-embedded/x86-architecture/tqmx120uc/
[2] https://www.tq-group.com/en/products/tq-embedded/x86-architecture/tqmx130uc/
[3] https://www.tq-group.com/en/products/tq-embedded/x86-architecture/tqmxe41s/

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://lore.kernel.org/r/90ddebda96d29246992b58ae0231a511f6424211.1731325758.git.matthias.schiffer@ew.tq-group.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-11-12 14:46:36 +00:00
Karel Balej
156d87b679 mfd: 88pm886: Add the RTC cell
Add a MFD cell for the chip's Real-Time Clock (RTC).

Signed-off-by: Karel Balej <balejk@matfyz.cz>
Link: https://lore.kernel.org/r/20241012193345.18594-1-balejk@matfyz.cz
Signed-off-by: Lee Jones <lee@kernel.org>
2024-11-12 14:45:03 +00:00
Hans de Goede
7beb2261bc mfd: intel_soc_pmic_crc: Add support for non ACPI instantiated i2c_client
On some x86 Bay Trail tablets which shipped with Android as factory OS,
the DSDT is so broken that the PMIC needs to be manually instantiated by
the special x86-android-tablets.ko "fixup" driver for cases like this.

Add an i2c_device_id table so that the driver can match on manually
instantiated i2c_client-s (which lack an ACPI fwnode to match on).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241104150655.41402-3-hdegoede@redhat.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-11-12 12:15:42 +00:00
Hans de Goede
521aa8bc1c mfd: intel_soc_pmic_*: Consistently use filename as driver name
Currently the intel_soc_pmic_bxtwc, intel_soc_pmic_chtwc and
intel_soc_pmic_crc PMIC drivers use more or less free form strings
for their driver name.

Where as intel_soc_pmic_chtdc_ti and intel_soc_pmic_mrfld use the driver's
filename as driver name.

Update the 3 others to also use the driver's filename to make the naming
consistent.

Suggested-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241104150655.41402-2-hdegoede@redhat.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-11-12 12:15:42 +00:00
Zhang Changzhong
d256d612f4 mfd: rt5033: Fix missing regmap_del_irq_chip()
Fix missing call to regmap_del_irq_chip() in error handling path by
using devm_regmap_add_irq_chip().

Fixes: 0b27125854 ("mfd: rt5033: Add Richtek RT5033 driver core.")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Link: https://lore.kernel.org/r/1730302867-8391-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-11-06 08:04:24 +00:00
Christophe JAILLET
5a700e77d6 mfd: cgbc-core: Fix error handling paths in cgbc_init_device()
If an error occurs after a cgbc_session_request() call, it should be
balanced by a corresponding cgbc_session_release(), as already done in the
remove function.

Fixes: 6f1067cfbe ("mfd: Add Congatec Board Controller driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://lore.kernel.org/r/83194335554146efc52c331993f083bd765db6f9.1730205085.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Lee Jones <lee@kernel.org>
2024-11-05 16:13:47 +00:00
Uwe Kleine-König
10821a0613 mfd: Switch back to struct platform_driver::remove()
After commit 0edb555a65 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.

Convert all platform drivers below drivers/mfd to use .remove(), with
the eventual goal to drop struct platform_driver::remove_new(). As
.remove() and .remove_new() have the same prototypes, conversion is done
by just changing the structure member name in the driver initializer.

On the way do a few whitespace changes to make indention consistent.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20241025102943.250184-2-u.kleine-koenig@baylibre.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-11-01 15:56:58 +00:00
Matti Vaittinen
9b15062cc0 mfd: rtc: bd7xxxx Drop IC name from IRQ
A few ROHM PMICs have an RTC block which can be controlled by the
rtc-bd70528 driver. The RTC driver needs the alarm interrupt information
from the parent MFD driver. The MFD driver provides the interrupt
information as a set of named interrupts, where the name is of form:
<PMIC model>-rtc-alm-<x>, where x is an alarm block number.

>From the RTC driver point of view it is irrelevant what the PMIC name
is. It is sufficient to know this is alarm interrupt for a block X. The
PMIC model information is carried to RTC via the platform device ID.
Hence, having the PMIC model in the interrupt name is only making things
more complex because the RTC driver needs to request differently named
interrupts on different PMICs, making code unnecessary complicated.

Simplify this slightly by always using the RTC driver name 'bd70528' as
the prefix for alarm interrupts, no matter what the exact PMIC model is,
and always request the alarm interrupts of same name no matter what the
PMIC model is.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/ZvVNCfk10ih0YFLW@fedora
Signed-off-by: Lee Jones <lee@kernel.org>
2024-11-01 15:53:05 +00:00
Yassine Oudjana
6e31bb8d3a mfd: mt6397: Add initial support for MT6328
The MT6328 PMIC is commonly used with the MT6735 SoC. Add initial
support for this PMIC.

Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20241018081050.23592-5-y.oudjana@protonmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-31 16:25:03 +00:00
Jean Delvare
577f6c2c59 mfd: adp5585: Drop obsolete dependency on COMPILE_TEST
Since commit 0166dc11be ("of: make CONFIG_OF user selectable"), it
is possible to test-build any driver which depends on OF on any
architecture by explicitly selecting OF. Therefore depending on
COMPILE_TEST as an alternative is no longer needed.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20241022124745.5d8d3778@endymion.delvare
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-31 16:18:50 +00:00
Charles Keepax
2bb0106db9 mfd: cs42l43: Disable IRQs during suspend
The ASoC CODEC driver masks the IRQs whilst entering and exiting
system suspend to avoid issues where the IRQ handler can run but PM
runtime is disabled. However, as the IRQs could also be used from
other parts of the driver, it would be better to move this handling to
the MFD level.

Remove the handling from the ASoC driver and move it to the MFD
driver. Whilst moving also ensure the IRQs are all masked at the device
level before powering down the device, as per hardware recommendations.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org.>
Link: https://lore.kernel.org/r/20241014095202.828194-1-ckeepax@opensource.cirrus.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-31 16:17:09 +00:00
Andre Przywara
35fec94afe mfd: axp20x: Add support for AXP323
The X-Powers AXP323 is a very close sibling of the AXP313A. The only
difference seems to be the ability to dual-phase the first two DC/DC
converter, which adds another register.

Add the required boilerplate to introduce a new PMIC to the AXP MFD
driver. Where possible, this just maps into the existing structs defined
for the AXP313A, only deviating where needed.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20241007001408.27249-5-andre.przywara@arm.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-31 15:51:29 +00:00
Andre Przywara
e37ec32188 mfd: axp20x: Allow multiple regulators
At the moment trying to register a second AXP chip makes the probe fail,
as some sysfs registration fails due to a duplicate name:

...
[    3.688215] axp20x-i2c 0-0035: AXP20X driver loaded
[    3.695610] axp20x-i2c 0-0036: AXP20x variant AXP323 found
[    3.706151] sysfs: cannot create duplicate filename '/bus/platform/devices/axp20x-regulator'
[    3.714718] CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.0-rc1-00026-g50bf2e2c079d-dirty #192
[    3.724020] Hardware name: Avaota A1 (DT)
[    3.728029] Call trace:
[    3.730477]  dump_backtrace+0x94/0xec
[    3.734146]  show_stack+0x18/0x24
[    3.737462]  dump_stack_lvl+0x80/0xf4
[    3.741128]  dump_stack+0x18/0x24
[    3.744444]  sysfs_warn_dup+0x64/0x80
[    3.748109]  sysfs_do_create_link_sd+0xf0/0xf8
[    3.752553]  sysfs_create_link+0x20/0x40
[    3.756476]  bus_add_device+0x64/0x104
[    3.760229]  device_add+0x310/0x760
[    3.763717]  platform_device_add+0x10c/0x238
[    3.767990]  mfd_add_device+0x4ec/0x5c8
[    3.771829]  mfd_add_devices+0x88/0x11c
[    3.775666]  axp20x_device_probe+0x70/0x184
[    3.779851]  axp20x_i2c_probe+0x9c/0xd8
...

This is because we use PLATFORM_DEVID_NONE for the mfd_add_devices()
call, which would number the child devices in the same 0-based way, even
for the second (or any other) instance.

Use PLATFORM_DEVID_AUTO instead, which automatically assigns
non-conflicting device numbers.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20241007001408.27249-4-andre.przywara@arm.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-31 15:51:27 +00:00
Andre Przywara
697a4001d3 mfd: axp20x: Ensure relationship between IDs and model names
At the moment there is an implicit relationship between the AXP model
IDs and the order of the strings in the axp20x_model_names[] array.
This is fragile, and makes adding IDs in the middle error prone.

Make this relationship official by changing the ID type to the actual
enum used, and using indexed initialisers for the string list.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20241007001408.27249-3-andre.przywara@arm.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-31 15:51:20 +00:00
Andy Shevchenko
3d1c3272a8 mfd: ipaq-micro: Add missing break for the default case
Even default case should have a break statement to make code robust
against changes (e.g., adding a case after the default one).

Add missing break for the default case.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241016130023.872277-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-31 14:59:40 +00:00
Andy Shevchenko
4a8b3d48da mfd: intel_soc_pmic_bxtwc: Deduplicate error messages
Move the individual error messages inside bxtwc_add_chained_irq_chip()
in order to deduplicate them.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241016105201.757024-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-31 14:58:50 +00:00
Andy Shevchenko
3d6b7374f0 mfd: intel_soc_pmic_bxtwc: Use temporary variable for struct device
Use a temporary variable for the struct device pointers to avoid
dereferencing. This makes code a bit neater.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241016105201.757024-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-31 14:58:50 +00:00
Andy Shevchenko
d2e77347ce mfd: intel_soc_pmic_bxtwc: Don't use "proxy" headers
Update header inclusions to follow IWYU (Include What You Use)
principle.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241016105201.757024-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-31 14:58:50 +00:00
Andy Shevchenko
1f9e418aaf mfd: intel_soc_pmic_bxtwc: Switch to use ATTRIBUTE_GROUPS()
Embrace ATTRIBUTE_GROUPS() to avoid boiler plate code.
While at it, move DEVICE_ATTR_ADMIN_RW() closer to the callbacks.

This should not introduce any functional changes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241016105201.757024-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-31 14:58:50 +00:00
Andreas Kemnade
f2be0c3a95 mfd: twl-core: Add a clock subdevice for the TWL6030
Also the TWL6030 has some clocks, so add a subdevice for that.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Link: https://lore.kernel.org/r/20241014161109.2222-2-andreas@kemnade.info
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-25 09:48:58 +01:00
Matti Vaittinen
894d915d23 mfd: bd96801: Add ERRB IRQ
The ROHM BD96801 "scalable PMIC" provides two physical IRQs. The ERRB
handling can in many cases be omitted because it is used to inform fatal
IRQs, which usually kill the power from the SOC.

There may however be use-cases where the SOC has a 'back-up' emergency
power source which allows some very short time of operation to try to
gracefully shut down sensitive hardware. Furthermore, it is possible the
processor controlling the PMIC is not powered by the PMIC. In such cases
handling the ERRB IRQs may be beneficial.

Add support for ERRB IRQs.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/dda4464443fba81f79d5f8d73947dbd63083cff2.1727931468.git.mazziesaccount@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:11 +01:00
Dragan Simic
337dd40b3b mfd: rk8xx-core: Check "system-power-controller" first
Commit 961748bb15 ("dt-bindings: mfd: rk8xx: Deprecate rockchip,system-
power-controller") made the property "rockchip,system-power-controller"
deprecated in favor of the shorter, universal form "system-power-controller".
Following the updates to the board dts files, [1] make the favored property
name checked first, to save a few CPU cycles.

[1] https://lore.kernel.org/linux-rockchip/20241008105450.20648-1-didi.debian@cknow.org/T/#u

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Link: https://lore.kernel.org/r/08d4e88974c205eba124086ce156622e2e4cdc20.1728397516.git.dsimic@manjaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:11 +01:00
Andy Shevchenko
3727c0b4ff mfd: intel_soc_pmic_bxtwc: Fix IRQ domain names duplication
For all of the devices regmap IRQ may try to created the folder
with the same name which is impossible and fails with:

  debugfs: File '\_SB.IPC1.PMIC' in directory 'domains' already present!

Add domain_suffix to all of the IRQ chips driver registers to solve
the issue.

Fixes: 39d047c0b1 ("mfd: add Intel Broxton Whiskey Cove PMIC driver")
Fixes: 957ae50981 ("platform/x86: Add Whiskey Cove PMIC TMU support")
Fixes: 57129044f5 ("mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips")
Depends-on: dde286ee57 ("regmap: Allow setting IRQ domain name suffix")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241005193029.1929139-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:11 +01:00
Andy Shevchenko
0350d783ab mfd: intel_soc_pmic_bxtwc: Use IRQ domain for PMIC devices
While design wise the idea of converting the driver to use
the hierarchy of the IRQ chips is correct, the implementation
has (inherited) flaws. This was unveiled when platform_get_irq()
had started WARN() on IRQ 0 that is supposed to be a Linux
IRQ number (also known as vIRQ).

Rework the driver to respect IRQ domain when creating each MFD
device separately, as the domain is not the same for all of them.

Fixes: 57129044f5 ("mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips")
Tested-by: Zhang Ning <zhangn1985@outlook.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241005193029.1929139-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:11 +01:00
Andy Shevchenko
9b79d59e6b mfd: intel_soc_pmic_bxtwc: Use IRQ domain for TMU device
While design wise the idea of converting the driver to use
the hierarchy of the IRQ chips is correct, the implementation
has (inherited) flaws. This was unveiled when platform_get_irq()
had started WARN() on IRQ 0 that is supposed to be a Linux
IRQ number (also known as vIRQ).

Rework the driver to respect IRQ domain when creating each MFD
device separately, as the domain is not the same for all of them.

Fixes: 957ae50981 ("platform/x86: Add Whiskey Cove PMIC TMU support")
Fixes: 57129044f5 ("mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips")
Reported-by: Zhang Ning <zhangn1985@outlook.com>
Closes: https://lore.kernel.org/r/TY2PR01MB3322FEDCDC048B7D3794F922CDBA2@TY2PR01MB3322.jpnprd01.prod.outlook.com
Tested-by: Zhang Ning <zhangn1985@outlook.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241005193029.1929139-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:11 +01:00
Andy Shevchenko
686fb77712 mfd: intel_soc_pmic_bxtwc: Use IRQ domain for USB Type-C device
While design wise the idea of converting the driver to use
the hierarchy of the IRQ chips is correct, the implementation
has (inherited) flaws. This was unveiled when platform_get_irq()
had started WARN() on IRQ 0 that is supposed to be a Linux
IRQ number (also known as vIRQ).

Rework the driver to respect IRQ domain when creating each MFD
device separately, as the domain is not the same for all of them.

Fixes: 9c6235c863 ("mfd: intel_soc_pmic_bxtwc: Add bxt_wcove_usbc device")
Fixes: d2061f9cc3 ("usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY")
Fixes: 57129044f5 ("mfd: intel_soc_pmic_bxtwc: Use chained IRQs for second level IRQ chips")
Reported-by: Zhang Ning <zhangn1985@outlook.com>
Closes: https://lore.kernel.org/r/TY2PR01MB3322FEDCDC048B7D3794F922CDBA2@TY2PR01MB3322.jpnprd01.prod.outlook.com
Tested-by: Zhang Ning <zhangn1985@outlook.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20241005193029.1929139-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:11 +01:00
Julia Lawall
6af8d30527 mfd: atmel-smc: Reorganize kerneldoc parameter names
Reorganize kerneldoc parameter names to match the parameter
order in the function header.

Problems identified using Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/20240930112121.95324-18-Julia.Lawall@inria.fr
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:10 +01:00
Masahiro Yamada
b90ea940be mfd: wcd934x: Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE()
Since commit b4b8183055 ("slimbus: generate MODULE_ALIAS() from
MODULE_DEVICE_TABLE()"), modpost automatically generates MODULE_ALIAS()
from MODULE_DEVICE_TABLE(slim, ).

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20241002151539.43762-1-masahiroy@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:10 +01:00
Charles Keepax
e59148b784 mfd: cs42l43: Fix issues in probe error paths
The error path in cs42l43_boot_work() will lead to an unbalanced
regulator put, when the driver is removed. Fix this by relying
on remove to power down the device. Also the boot work needs to
be synchronised with driver remove, to ensure the work is not
still running after the driver has been removed. Add the required
cancel_work_sync().

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20241002121311.162691-1-ckeepax@opensource.cirrus.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:10 +01:00
Dzmitry Sankouski
bf231e5feb mfd: sec-core: Add support for the Samsung s2dos05
S2DOS05 is a panel/touchscreen PMIC, often found in
Samsung phones. We define regulator sub-device for which driver will
be added in subsequent patch. The device also has ADC for power and
current measurements.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20240617-starqltechn_integration_upstream-v5-2-ea1109029ba5@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:10 +01:00
Marcus Folkesson
2e3378f6c7 mfd: da9052-spi: Change read-mask to write-mask
Driver has mixed up the R/W bit.
The LSB bit is set on write rather than read.
Change it to avoid nasty things to happen.

Fixes: e9e9d39735 ("mfd: da9052: Avoid setting read_flag_mask for da9052-i2c driver")
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Link: https://lore.kernel.org/r/20240925-da9052-v2-1-f243e4505b07@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:10 +01:00
Mark Brown
63c1bce0ec mfd: bd96801: Use maple tree register cache
The maple tree register cache uses a more modern data structure than the
rbtree cache and makes implementation decisions more suited to modern
hardware, switch the bd96801 driver to it to take advantage of this newer
code. No functional changes.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/20240924-mfd-bd96801-maple-v1-1-04fe33e1f009@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:10 +01:00
Abhishek Pandit-Subedi
7613bc0d11 mfd: cros_ec: Don't load charger with UCSI
When UCSI is enabled, don't load cros_usbpd_charger and cros_usbpd_logger
drivers. Charger functionality is provided by the UCSI driver already and
logging will need to be added.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Łukasz Bartosik <ukaszb@chromium.org>
Link: https://lore.kernel.org/r/20240910101527.603452-9-ukaszb@chromium.org
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:09 +01:00
Pavan Holla
4636d159dd mfd: cros_ec: Load cros_ec_ucsi on supported ECs
Load cros_ec_ucsi driver if the ChromeOS EC implements
UCSI Platform Policy Manager (PPM).

Signed-off-by: Pavan Holla <pholla@chromium.org>
Signed-off-by: Łukasz Bartosik <ukaszb@chromium.org>
Link: https://lore.kernel.org/r/20240910101527.603452-8-ukaszb@chromium.org
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:09 +01:00
Jinjie Ruan
2174f9a8c9 mfd: tps65010: Use IRQF_NO_AUTOEN flag in request_irq() to fix race
As the comment said, disable_irq() after request_irq() still has a
time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN
flag will disable IRQ auto-enable when request IRQ.

Fixes: 72cd799544 ("[PATCH] I2C: add i2c driver for TPS6501x")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20240912031530.2211654-1-ruanjinjie@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:09 +01:00
Shen Lichuan
b7cb398d7b mfd: atmel-flexcom/rk8xx-core: Convert comma to semicolon
Replace a comma between expression statements by a semicolon.

Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> #  for atmel-flexcom.c
Link: https://lore.kernel.org/r/20240905092718.95011-1-shenlichuan@vivo.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:09 +01:00
Nishanth Menon
2e63d6fa11 mfd: syscon: Use regmap max_register_is_0 as needed
syscon has always set the optional max_register configuration of
regmap to ensure the correct checks are in place. However, a recent
commit 0ec74ad3c1 ("regmap: rework ->max_register handling")
introduced explicit configuration in regmap framework for register
maps that is exactly 1 register, when max_register is pointing to a
valid register 0. This commit solved a previous limitation of regmap
framework.

Update syscon driver to consistent in regmap configuration for
all sizes of syscons by using this new capability by setting
max_register_is_0, when the max_register is valid and 0.

Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20240903184710.1552067-1-nm@ti.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-16 09:04:09 +01:00
Thomas Richard
6f1067cfbe mfd: Add Congatec Board Controller driver
Add core MFD driver for the Board Controller found on some Congatec SMARC
module. This Board Controller provides functions like watchdog, GPIO, and
I2C busses.

This commit adds support only for the conga-SA7 module.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://lore.kernel.org/r/20241001-congatec-board-controller-v3-1-39ceceed5c47@bootlin.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-10-09 16:31:48 +01:00
Linus Torvalds
b0a53b4f3f - Added support for the Analog Devices ADP5585 GPIO and PWM functions.
- Added parsing of GPIO hogs for the ADP5585.
 - Fixed module autoloading in the MAX14577 driver.
 - Simplified and cleaned up the CROS_EC driver.
 - Made the Lenovo Yoga Tab 3 X90F DMI match less strict in the INTEL_SOC_PMIC_CHTWC driver.
 - Added support for the RK806 PMIC on the I2C bus.
 - Removed the remaining header file for the DS1WM driver.
 - Added compatible strings for various devices in the device tree bindings.
 - Fixed a comma-related issue in the 88PM860X_CORE driver.
 - Constified read-only regmap structs in various drivers.
 - Used scoped variables with memory allocators to simplify error paths in the MT6360 and SYSCON drivers.
 - Added Intel Arrow Lake-H and Panther Lake LPSS PCI IDs.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmbxjKgACgkQUa+KL4f8
 d2HO3A//Vj7h1R6noTl9Zc3fDzFvoTCnsPsIuH52AQHnk7E2ReCFbRwQeXW/aOTa
 QtvY+0LxYnhd/wUzS9ER4zQo5AP+mAk5OAb7oVnR6nL/RJdbWh+0tFu89YYn2oWi
 YeKxPA/SoD6wRnHFf7x2NXc12nbvNVJ7Yc5C8PALB+K41d2o6hs5dgn9DBe2kExY
 pn1FH/EMv2czg5B5PEDteOXcTEV+Q//hhNfBpeRbmF/qEIAIA/ZTDeKaFe2LOfEq
 z144v8m8TcJBwxXSg1KQhEyYdTcz+DtbIJ6YWr7ehllhXq/QPrlLIj0XBtgmPclm
 PaeOQFT007C/oFERSPA4+szwJFnOjkapE/ui5BwQ8BuXfvtp7IxwU8tHJHqO01bb
 ut/sVNtQcTZ9KplVa1m1JTKPKeoTWlfpo4B/2SMsnvDLKrvPQXtuFAKYSzusZWX0
 oJtXGuSEJMQ/27jyxn209VDhdtAPIgLnFFxnoXoIOW7n2sTfeP4AjTFHUIzD2x/u
 ufxUQCM9hNvAz3nYEtdxSh2EVf0bY+Lzu318ce3Hpa/LgFRLH8lqL1IsO1C9ljF7
 uPauDrDQCGmGEPD9x8bR4zRaEUj5qFTfeJHmbwh7xqjqzH9JKMiV6OMbAw2lHP9B
 D0KmsDEcQiU76uuBwRuqXonOfFqGmPGeYvluXXNbeM8st8H8Y34=
 =WuEO
 -----END PGP SIGNATURE-----

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

Pull MFD updates from Lee Jones:

 - Added support for the Analog Devices ADP5585 GPIO and PWM functions

 - Added parsing of GPIO hogs for the ADP5585

 - Fixed module autoloading in the MAX14577 driver

 - Simplified and cleaned up the CROS_EC driver

 - Made the Lenovo Yoga Tab 3 X90F DMI match less strict in the
   INTEL_SOC_PMIC_CHTWC driver

 - Added support for the RK806 PMIC on the I2C bus

 - Removed the remaining header file for the DS1WM driver

 - Added compatible strings for various devices in the device tree
   bindings

 - Fixed a comma-related issue in the 88PM860X_CORE driver

 - Constified read-only regmap structs in various drivers

 - Used scoped variables with memory allocators to simplify error paths
   in the MT6360 and SYSCON drivers

 - Added Intel Arrow Lake-H and Panther Lake LPSS PCI IDs

* tag 'mfd-next-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (44 commits)
  mfd: atc260x: Convert a bunch of commas to semicolons
  dt-bindings: mfd: qcom,tcsr: Add compatible for sa8775p
  mfd: intel-lpss: Add Intel Panther Lake LPSS PCI IDs
  mfd: intel-lpss: Add Intel Arrow Lake-H LPSS PCI IDs
  dt-bindings: mfd: syscon: Add rk3576 QoS register compatible
  dt-bindings: mfd: adp5585: Add parsing of hogs
  mfd: tc3589x: Drop vendorless compatible string from match table
  mfd: qcom-spmi-pmic: Use for_each_child_of_node_scoped()
  mfd: max77620: Use for_each_child_of_node_scoped()
  mfd: intel_soc_pmic_chtwc: Make Lenovo Yoga Tab 3 X90F DMI match less strict
  mfd: cros_ec: Update module description
  mfd: cros_ec: Simplify and clean-up cros_ec_dev_init()
  mfd: max14577: Provide MODULE_DEVICE_TABLE() to fix module autoloading
  mfd: rk8xx: Add support for rk806 on i2c bus
  dt-bindings: mfd: syscon: Add ti,j784s4-acspcie-proxy-ctrl compatible
  mfd: ds1wm: Remove remaining header file
  MAINTAINERS: Repair file entry in MARVELL 88PM886 PMIC DRIVER
  mfd: 88pm860x-core: Convert comma to semicolon
  mfd: syscon: Use scoped variables with memory allocators to simplify error paths
  mfd: mt6360: Use scoped variables with memory allocators to simplify error paths
  ...
2024-09-23 14:17:08 -07:00
Chen Ni
91dba615c3 mfd: atc260x: Convert a bunch of commas to semicolons
Replace a comma between expression statements by a semicolon.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://lore.kernel.org/r/20240902085019.4111445-1-nichen@iscas.ac.cn
Signed-off-by: Lee Jones <lee@kernel.org>
2024-09-23 16:20:55 +01:00
Ilpo Järvinen
db6a186505 mfd: intel-lpss: Add Intel Panther Lake LPSS PCI IDs
Add Intel Panther Lake-H/P PCI IDs.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240829095719.1557-3-ilpo.jarvinen@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-09-23 16:20:54 +01:00
Ilpo Järvinen
6112597f5b mfd: intel-lpss: Add Intel Arrow Lake-H LPSS PCI IDs
Add Intel Arrow Lake-H PCI IDs.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240829095719.1557-2-ilpo.jarvinen@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-09-23 16:20:54 +01:00
Rob Herring (Arm)
04bb1800e6 mfd: tc3589x: Drop vendorless compatible string from match table
There's no need to list "tc3589x" in the DT match table. The I2C core
will strip any vendor prefix and match against the i2c_device_id table
which has an "tc3589x" entry.

Probably "tc3589x" and TC3589X_UNKNOWN could be removed altogether.
Use of that compatible was only on some STE platforms and was dropped
in 2013. There were ABI breaks in 2014 claiming no DTs in the wild. See
commit 1637d480f8 ("pinctrl: nomadik: force-convert to generic config
bindings").

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20240826191300.1410222-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2024-09-23 16:20:54 +01:00
Jinjie Ruan
015d188002 mfd: qcom-spmi-pmic: Use for_each_child_of_node_scoped()
Avoids the need for manual cleanup of_node_put() in early exits
from the loop.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20240826092734.2899562-3-ruanjinjie@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-09-23 16:20:54 +01:00
Jinjie Ruan
0db28e963a mfd: max77620: Use for_each_child_of_node_scoped()
Avoids the need for manual cleanup of_node_put() in early exits
from the loop.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20240826092734.2899562-2-ruanjinjie@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-09-23 16:20:54 +01:00
Hans de Goede
ae7eee56cd mfd: intel_soc_pmic_chtwc: Make Lenovo Yoga Tab 3 X90F DMI match less strict
There are 2G and 4G RAM versions of the Lenovo Yoga Tab 3 X90F and it
turns out that the 2G version has a DMI product name of
"CHERRYVIEW D1 PLATFORM" where as the 4G version has
"CHERRYVIEW C0 PLATFORM". The sys-vendor + product-version check are
unique enough that the product-name check is not necessary.

Drop the product-name check so that the existing DMI match for the 4G
RAM version also matches the 2G RAM version.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20240825132617.8809-1-hdegoede@redhat.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-09-23 16:20:54 +01:00
Tzung-Bi Shih
fd0fec405d mfd: cros_ec: Update module description
The module description can be backtracked to commit e7c256fbfb
("platform/chrome: Add Chrome OS EC userspace device interface").

The description became out-of-date after a bunch of changes e.g:

- commit 5668bfdd90 ("platform/chrome: cros_ec_dev - Register cros-ec sensors").
- commit ea01a31b90 ("cros_ec: Split cros_ec_devs module").
- commit 5e0115581b ("cros_ec: Move cros_ec_dev module to drivers/mfd").

Update the description.

Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20240822121539.4265-1-tzungbi@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2024-09-23 16:20:53 +01:00
Tzung-Bi Shih
dc98e25bc3 mfd: cros_ec: Simplify and clean-up cros_ec_dev_init()
Simplify cros_ec_dev_init() by the following changes:
- Get rid of label `failed_devreg`.
- Remove a redundant space and comment.
- Use `if (ret)` instead of `if (ret < 0)`.

Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20240819102326.5235-1-tzungbi@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2024-09-23 16:20:53 +01:00