Commit graph

5413 commits

Author SHA1 Message Date
Rob Herring
0db434f513 mfd: Use i2c_get_match_data() in a selection of drivers
Use preferred i2c_get_match_data() instead of of_match_device() and
i2c driver_data to get the driver match data. With this, adjust the
includes to explicitly include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Link: https://lore.kernel.org/r/20231017203603.2700864-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:17 +00:00
Rob Herring
830fafce06 mfd: Use device_get_match_data() in a bunch of drivers
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231017203612.2701060-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:17 +00:00
Rob Herring
15d71e678e mfd: mc13xxx-spi/wm831x-spi: Use spi_get_device_match_data()
Use preferred spi_get_device_match_data() instead of of_match_device() and
spi_get_device_id() to get the driver match data. With this, adjust the
includes to explicitly include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231017203550.2700601-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>

tils.feedkeys.call.run(35)
all.run(37)
all.run(39)
2023-11-01 10:02:16 +00:00
Rob Herring
9f58744c5e mfd: motorola-cpcap: Drop unnecessary of_match_device() call
If probe is reached, we've already matched the device and in the case of
DT matching, the struct device_node pointer will be set. Therefore, there
is no need to call of_match_device() in probe.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231017203537.2700340-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:16 +00:00
Hans de Goede
831d1af851 mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs
Commit 9e86b2ad4c changed the channel used for HPDET detection
(headphones vs lineout detection) from being hardcoded to
ARIZONA_ACCDET_MODE_HPL (HP left channel) to it being configurable
through arizona_pdata.hpdet_channel the DT/OF parsing added for
filling arizona_pdata on devicetree platforms ensures that
arizona_pdata.hpdet_channel gets set to ARIZONA_ACCDET_MODE_HPL
when not specified in the devicetree-node.

But on ACPI platforms where arizona_pdata is filled by
arizona_spi_acpi_probe() arizona_pdata.hpdet_channel was not
getting set, causing it to default to 0 aka ARIZONA_ACCDET_MODE_MIC.

This causes headphones to get misdetected as line-out on some models.
Fix this by setting hpdet_channel = ARIZONA_ACCDET_MODE_HPL.

Fixes: e933836744 ("mfd: arizona: Add support for ACPI enumeration of WM5102 connected over SPI")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20231014205414.59415-1-hdegoede@redhat.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:16 +00:00
Johan Hovold
10450565b4 mfd: qcom-spmi-pmic: Switch to EXPORT_SYMBOL_GPL()
Switch to using EXPORT_SYMBOL_GPL() for the revid helper as there is no
reason not to use it.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Acked-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20231003152927.15000-4-johan+linaro@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:16 +00:00
Johan Hovold
7b439aaa62 mfd: qcom-spmi-pmic: Fix revid implementation
The Qualcomm SPMI PMIC revid implementation is broken in multiple ways.

First, it assumes that just because the sibling base device has been
registered that means that it is also bound to a driver, which may not
be the case (e.g. due to probe deferral or asynchronous probe). This
could trigger a NULL-pointer dereference when attempting to access the
driver data of the unbound device.

Second, it accesses driver data of a sibling device directly and without
any locking, which means that the driver data may be freed while it is
being accessed (e.g. on driver unbind).

Third, it leaks a struct device reference to the sibling device which is
looked up using the spmi_device_from_of() every time a function (child)
device is calling the revid function (e.g. on probe).

Fix this mess by reimplementing the revid lookup so that it is done only
at probe of the PMIC device; the base device fetches the revid info from
the hardware, while any secondary SPMI device fetches the information
from the base device and caches it so that it can be accessed safely
from its children. If the base device has not been probed yet then probe
of a secondary device is deferred.

Fixes: e9c11c6e3a ("mfd: qcom-spmi-pmic: expose the PMIC revid information to clients")
Cc: stable@vger.kernel.org      # 6.0
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Acked-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20231003152927.15000-3-johan+linaro@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:16 +00:00
Johan Hovold
a0fa44c261 mfd: qcom-spmi-pmic: Fix reference leaks in revid helper
The Qualcomm SPMI PMIC revid implementation is broken in multiple ways.

First, it totally ignores struct device_node reference counting and
leaks references to the parent bus node as well as each child it
iterates over using an open-coded for_each_child_of_node().

Second, it leaks references to each spmi device on the bus that it
iterates over by failing to drop the reference taken by the
spmi_device_from_of() helper.

Fix the struct device_node leaks by reimplementing the lookup using
for_each_child_of_node() and adding the missing reference count
decrements. Fix the sibling struct device leaks by dropping the
unnecessary lookups of devices with the wrong USID.

Note that this still leaves one struct device reference leak in case a
base device is found but it is not the parent of the device used for the
lookup. This will be addressed in a follow-on patch.

Fixes: e9c11c6e3a ("mfd: qcom-spmi-pmic: expose the PMIC revid information to clients")
Cc: stable@vger.kernel.org	# 6.0
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Acked-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20231003152927.15000-2-johan+linaro@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:16 +00:00
Mark Brown
4fddf148f7 mfd: max8907: Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231001-mfd-maxim-maple-v1-3-cdfeb48a4d15@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:15 +00:00
Mark Brown
728f337477 mfd: max77686: Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Link: https://lore.kernel.org/r/20231001-mfd-maxim-maple-v1-2-cdfeb48a4d15@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:15 +00:00
Mark Brown
fc12429b40 mfd: max77620: Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231001-mfd-maxim-maple-v1-1-cdfeb48a4d15@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:15 +00:00
Jarkko Nikula
e53b22b10c mfd: intel-lpss: Add Intel Lunar Lake-M PCI IDs
Add Intel Lunar Lake-M SoC PCI IDs.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Link: https://lore.kernel.org/r/20231002083344.75611-1-jarkko.nikula@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:15 +00:00
Mark Brown
7f70d4590d mfd: rk8xx: Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231001-mfd-rk88x-maple-v1-1-90434cfb2f90@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:15 +00:00
Mark Brown
1c943dfd80 mfd: twl: Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-7-0657862de3f6@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:15 +00:00
Mark Brown
214fbbd05b mfd: tps65912: Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-6-0657862de3f6@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:15 +00:00
Mark Brown
535cd579bc mfd: tps65910: Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-5-0657862de3f6@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:14 +00:00
Mark Brown
e142b022b3 mfd: tps6586x: Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-4-0657862de3f6@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:14 +00:00
Mark Brown
2e9a3fc2f9 mfd: tps65128: Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-3-0657862de3f6@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:14 +00:00
Mark Brown
778eea25bf mfd: tps65090: Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-2-0657862de3f6@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:14 +00:00
Mark Brown
6917c33322 mfd: tps65086: Convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-1-0657862de3f6@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:14 +00:00
Justin Stitt
6bce629689 mfd: db8500-prcmu: Replace deprecated strncpy with strscpy
`strncpy` is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

We expect project_name to be NUL-terminated based on its use with
pr_info:
| 	pr_info("PRCMU firmware: %s(%d), version %d.%d.%d\n",
| 		fw_info.version.project_name,
| 		fw_info.version.project,
| 		fw_info.version.api_version,
| 		fw_info.version.func_version,
| 		fw_info.version.errata);

Moreover, NUL-padding does not seem to be needed.

Considering the above, a suitable replacement is `strscpy` [2] due to
the fact that it guarantees NUL-termination on the destination buffer
without unnecessarily NUL-padding.

Let's also change `PRCMU_FW_PROJECT_NAME_LEN` to just
sizeof(fw_info.version.project_name) as this is more idiomatic strscpy
usage.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230927-strncpy-drivers-mfd-db8500-prcmu-c-v1-1-db9693f92a68@google.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:14 +00:00
Andy Shevchenko
b4e40505f9 mfd: lpc_ich: Add a platform device for pinctrl Denverton
This is to cater the need in non-ACPI system whereby a platform device
has to be created in order to bind with the Denverton pinctrl driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230926190834.932233-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:13 +00:00
Andy Shevchenko
1f84f88dc1 mfd: lpc_ich: Move APL GPIO resources to a custom structure
We are expecting more platforms that want to instantiate
the GPIO device via P2SB. For them prepare the custom structure
and move Apollo Lake data there. Refactor the code accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230926190834.932233-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:13 +00:00
Andy Shevchenko
b0eb61880f mfd: lpc_ich: Make struct lpc_ich_priv use enum for chipset member
We have a specific enum for the supported chipsets.
Make struct lpc_ich_priv use better type for the chipset member.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230926190834.932233-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:13 +00:00
Dinghao Liu
759c409bc5 mfd: dln2: Fix double put in dln2_probe
The dln2_free() already contains usb_put_dev(). Therefore,
the redundant usb_put_dev() before dln2_free() may lead to
a double free.

Fixes: 96da8f1483 ("mfd: dln2: Fix memory leak in dln2_probe()")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20230925024134.9683-1-dinghao.liu@zju.edu.cn
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:13 +00:00
Biju Das
c4974eea6c mfd: max8998: Simplify obtaining I2C match data and drop max8998_i2c_get_driver_data()
Simplify probe() by using i2c_get_match_data() instead of
max8998_i2c_get_driver_data() for retrieving match data from
OF/ID tables.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230923174928.56824-5-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:13 +00:00
Biju Das
bffa42885f mfd: max77541: Simplify obtaining I2C match data
Simplify probe() by replacing device_get_match_data() and ID lookup for
retrieving match data by i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230923174928.56824-4-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:12 +00:00
Biju Das
f1f23a1a79 mfd: madera-i2c: Simplify obtaining I2C match data
Simplify probe() by replacing of_device_get_match_data() and ID lookup for
retrieving match data by i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230923174928.56824-3-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:12 +00:00
Biju Das
7ec9f1f31d mfd: arizona-i2c: Simplify obtaining I2C match data
Simplify probe() by replacing device_get_match_data() and ID lookup for
retrieving match data by i2c_get_match_data(). After this drop
intializing the variable type.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230923174928.56824-2-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:12 +00:00
Kees Cook
69c3f91545 mfd: iqs62x: Annotate struct iqs62x_fw_blk with __counted_by
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

As found with Coccinelle[1], add __counted_by for struct iqs62x_fw_blk.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20230922175337.work.150-kees@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:12 +00:00
Fabrice Gasnier
1c7ea43fc4 mfd: stm32-timers: Add support for interrupts
There are two types of STM32 timers that may have:

- a global interrupt line
- 4 dedicated interrupt lines.

Those interrupts are optional as defined in the dt-bindings. Enforce checks
on either one, four or no interrupts are provided with their names.
Optionally get them here, to be used by child devices.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20230829134029.2402868-5-fabrice.gasnier@foss.st.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:12 +00:00
Andreas Kemnade
6341632041 mfd: twl-core: Add a clock subdevice for the TWL6032
Clock device needs no separate devicetree node, so add it as
a platform device. Other devices in the family also have controllable
clocks, but due to the lack of testing, just add it for the TWL6032
now.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://lore.kernel.org/r/20230916100515.1650336-4-andreas@kemnade.info
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:12 +00:00
Manikandan Muralidharan
ad3a3c6e4a mfd: atmel-hlcdc: Add compatible for sam9x75 XLCD controller
Add compatible for sam9x75 XLCD controller.

Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Link: https://lore.kernel.org/r/20230915104849.187146-2-manikandan.m@microchip.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:11 +00:00
Mark Brown
a50afa310d mfd: wcd934x: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the wcd934x to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230912-mfd-wcd934x-maple-v2-1-292a154113e3@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:11 +00:00
Andre Przywara
b2cb2ae222 mfd: axp20x: Generalise handling without interrupt
At the moment we allow the AXP15060 and the AXP806 PMICs to omit the
interrupt line to the SoC, and we skip registering the PEK (power key)
driver in this case, since that crashes when no IRQ is described in the
DT node.
The IRQ pin potentially not being connected to anything does affect more
PMICs, though, and the PEK driver is not the only one requiring an
interrupt: at least the AC power supply driver crashes in a similar
fashion.

Generalise the handling of AXP MFD devices when the platform tables
describe no interrupt, by allowing each device to specify an alternative
MFD list for this case. If no specific alternative is specified, we go
with the safe default of "just the regulators", which matches the current
situation.

This enables new devices using the AXP313a PMIC, but not connecting the
IRQ pin.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20230828213229.20332-1-andre.przywara@arm.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:10 +00:00
Biju Das
9a41c31e40 mfd: palmas: Make similar OF and ID table
Make similar OF and ID table to extend support for ID match using
i2c_match_data(). Currently it works only for OF match tables as the
driver_data is wrong for ID match.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230831183153.63750-5-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:10 +00:00
Biju Das
a17e0bc66f mfd: palmas: Move OF table closer to its consumer
Move OF table near to the user.

While at it, arrange compatible and data in single line.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230831183153.63750-4-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:10 +00:00
Biju Das
93ec3d0e02 mfd: palmas: Constify .data in OF table and {palmas,tps65917}_irq_chip
Constify .data in OF table and {palmas,tps65917}_irq_chip and replace
the variable *features->features in struct palmas_driver_data and
drop the {palmas,tps659038}_features variables and use their values
directly in the named initialization.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230831183153.63750-3-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:10 +00:00
Biju Das
3f9a06dc79 mfd: palmas: Remove trailing comma in the terminator entry
Remove trailing comma in the terminator entry for OF table.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230831183153.63750-2-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:10 +00:00
Herve Codina
7ba7bdef4d mfd: core: Ensure disabled devices are skipped without aborting
The loop searching for a matching device based on its compatible
string is aborted when a matching disabled device is found.
This abort prevents to add devices as soon as one disabled device
is found.

Continue searching for an other device instead of aborting on the
first disabled one fixes the issue.

Fixes: 22380b65dc ("mfd: mfd-core: Ensure disabled devices are ignored without error")
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/528425d6472176bb1d02d79596b51f8c28a551cc.1692376361.git.christophe.leroy@csgroup.eu
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:10 +00:00
Biju Das
676c267223 mfd: max8997: Simplify obtaining I2C match data and drop max8997_i2c_get_driver_data()
Simplify probe() by using i2c_get_match_data() instead of
max8997_i2c_get_driver_data() for retrieving match data from
OF/ID tables.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230828160224.92037-1-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-11-01 10:02:09 +00:00
Lee Jones
55bb1a507f Immutable branch between MFD, I2C and Reboot due for the v6.7 merge window
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmUJs9wACgkQUa+KL4f8
 d2H3dxAAnWy5w8P8abSO2j8HAh9sRBvNqYYRB8/YvLVbplYROrzoS4OS+14OfDLB
 UC1X3vafG0AcQFzXr+HyYFEGUYGAqSrDSA1JkzSd9l1HKNyDSfiCnvaofV0SaDIE
 4v4rBXhC7Se5nuw3+wTfPJ/q59FluNEmnA1rBS8xCI7QXTVluilofmLZnPzb3/Ie
 +5WqWiMt2MSzfxzdGF4VgCgwjmH/Cr/CPJWQlXaKzw4gS0V5GGSw0kN/8BOJrXCP
 bm2XYt5j1S/kIdl4dTQPIEmaUjbNX4eToKz/Okp7kwgr9wzZJbqxKJrEEujAf/5c
 R+Pz+Zbwa4sggR73rnMxSa9ZRbhC9rV9ImAlFSKXF9Qe5eObP5wp2KgfBntMEObH
 W3B/YQOTGkt4YuzNqjQEo/zfxUPDLsiXyNQARQDF/03VJY3xVTAfj3LYUeoq8Nms
 ELgZjNd6hEMGdSN1hdzPfXR2rBZwTHC+f/187OzxPu26ofwMEPpQDgoekZ2a4U1v
 9B7iIkbg40MuYjOKGKPElQH80N6DSeeEBZuk+xXAfszW1GRRrxvRZX02nT1ytZHO
 GKkAZq7GjgfoMjWVCremqwXQ3wDeXDa8uN6M1AZWa8WUTVdUZcwBeOFgBGEd85bN
 i1cES5dcoNn3XbrO8qZneu6K0WLmOLw2cnU5LmRJqvXev/SKNMM=
 =XwZD
 -----END PGP SIGNATURE-----

Merge tag 'ib-mfd-i2c-reboot-v6.7' into ibs-for-mfd-merged

Immutable branch between MFD, I2C and Reboot due for the v6.7 merge window
2023-11-01 10:00:28 +00:00
Linus Torvalds
bc622f16c1 Couple of small fixes, including:
- Potential build failure in CS42L43
   - Device Tree bindings clean-up for a superseded patch
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmUe1V0ACgkQUa+KL4f8
 d2FhOA/9G0L0+sCd5kYKInfNcZklY/R9XKNoX5g5DQA8vyVllWIycbPL6VlPli0d
 IRyw7uQLdWba4mlNWXql5pU7wGWgBqr268VwFhCGK6/vbJLpMFYEWGmOq306x6wz
 poSrKmAKJeFswb0GSEyLeDtt/3c0k9bYV+ZUxavNTwoYmLaApP0NKQmNuH0mptA6
 pZ825PCEWbNS++FI5lv+dPfOzWDlh691n8ea41HRD/svGDdNCS+EpTLcX9L+81P+
 EIx+GWtW7CUGNYP2jJhMU7WW4/+3Uxdyrojmx+t9vkiD6t6sZkclDBxMzf7x+vLt
 NtcWpUdeHR0phAFTUxR74w7vIgfiHb2HWNdpmzNB7ZWuGsClQDIVU8KL2JtvDZ6X
 hcByEKnz7QwOXaZo5qwfWmmc5rVQkZG5CKrVN23/DVHlseyFShmllI4yw7fjfAGn
 JWAF5IwrfZFgVPAeTmmZwmuNFx4pZiPj4ajBLmEvF5OxuHsaNjE1W7WOZnITwRdn
 22EL9Q/DRsdzDci4eW7AHDwqwMJhUW7HIVMWEOMknuS/aEdrtJhNB2X8TDC9/zBi
 p50K+mxGs/RB/uvHDDCce/fVgDpTDhuovAJRncigGZmDvWgXHMR7+UIgNW9opHwl
 i8833UANGOEfBi68quVcAr7EI3CnTsMtr0b/JTibmTcrV0vZb10=
 =g4wJ
 -----END PGP SIGNATURE-----

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

Pull MFD fixes from Lee Jones:
 "A couple of small fixes:

   - Potential build failure in CS42L43

   - Device Tree bindings clean-up for a superseded patch"

* tag 'mfd-fixes-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd:
  dt-bindings: mfd: Revert "dt-bindings: mfd: maxim,max77693: Add USB connector"
  mfd: cs42l43: Fix MFD_CS42L43 dependency on REGMAP_IRQ
2023-10-05 11:03:20 -07:00
Charles Keepax
eb72d52070 mfd: cs42l43: Use correct macro for new-style PM runtime ops
The code was accidentally mixing new and old style macros, update the
macros used to remove an unused function warning whilst building with
no PM enabled in the config.

Fixes: ace6d14481 ("mfd: cs42l43: Add support for cs42l43 core driver")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/all/20230822114914.340359-1-ckeepax@opensource.cirrus.com/
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Lee Jones <lee@kernel.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-09-23 11:10:23 -07:00
Woody Zhang
9ef4dc24eb mfd: cs42l43: Fix MFD_CS42L43 dependency on REGMAP_IRQ
MFD_CS42L43 depends on REGMAP_IRQ as it uses devm_regmap_add_irq_chip.
Otherwise the build may fail with following log.

  AR      drivers/built-in.a
  AR      built-in.a
  AR      vmlinux.a
  LD      vmlinux.o
  OBJCOPY modules.builtin.modinfo
  GEN     modules.builtin
  MODPOST Module.symvers
ERROR: modpost: "devm_regmap_add_irq_chip" [drivers/mfd/cs42l43.ko] undefined!

Fixes: ace6d14481 ("mfd: cs42l43: Add support for cs42l43 core driver")
Signed-off-by: Woody Zhang <woodylab@foxmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/tencent_E54C7156F583E15FFE320E576E3389C39A08@qq.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-09-19 15:05:20 +01:00
Biju Das
9aab92bc3a mfd: mc13xxx: Simplify device data fetching in probe()
Simplify probe() by replacing of_match_device() and ID lookup
for retrieving match data by i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230819183155.22335-1-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:52 +01:00
Biju Das
d92df6fb81 mfd: rz-mtu3: Replace raw_spin_lock->spin_lock()
As per kernel documentation, use raw_spinlock_t only in real critical core
code, low-level interrupt handling, and places where disabling preemption
or interrupts is required. Here the lock is for concurrent register access
from different drivers, hence spin_lock() is sufficient.

Reported-by: Pavel Machek <pavel@denx.de>
Closes: https://lore.kernel.org/all/ZIL%2FitcJvV5s3Bnf@duo.ucw.cz/
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Pavel Machek <pavel@denx.de>
Link: https://lore.kernel.org/r/20230815073445.9579-3-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:52 +01:00
Biju Das
a160d1286b mfd: rz-mtu3: Reduce critical sections
Reduce critical sections on rz_mtu3_start_stop_ch() and
rz_mtu3_is_enabled() by moving offset and bitpos computation
outside the critical section and drop the 'ret' variable on
rz_mtu3_is_enabled() and return 'tstr & BIT(bitpos)' directly.

Reported-by: Pavel Machek <pavel@denx.de>
Closes: https://lore.kernel.org/all/ZIMAse1ikTuycJ02@duo.ucw.cz/
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Pavel Machek <pavel@denx.de>
Link: https://lore.kernel.org/r/20230815073445.9579-2-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:52 +01:00
Krzysztof Kozlowski
367124ebb3 mfd: mxs-lradc: Fix Wvoid-pointer-to-enum-cast warning
'soc' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  mxs-lradc.c:145:15: error: cast to smaller integer type 'enum mxs_lradc_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810095849.123321-9-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:52 +01:00
Krzysztof Kozlowski
4e57d1425c mfd: wm31x: Fix Wvoid-pointer-to-enum-cast warning
'type' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  wm831x-spi.c:36:10: error: cast to smaller integer type 'enum wm831x_parent' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810095849.123321-8-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:52 +01:00
Krzysztof Kozlowski
5033fb9779 mfd: wm8994: Fix Wvoid-pointer-to-enum-cast warning
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  wm8994-core.c:631:19: error: cast to smaller integer type 'enum wm8994_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230810095849.123321-7-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:52 +01:00
Krzysztof Kozlowski
a2ce000265 mfd: tc3589: Fix Wvoid-pointer-to-enum-cast warning
'version' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  tc3589x.c:343:13: error: cast to smaller integer type 'enum tc3589x_version' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810095849.123321-6-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:52 +01:00
Krzysztof Kozlowski
aad6c588bd mfd: lp87565: Fix Wvoid-pointer-to-enum-cast warning
'dev_type' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  lp87565.c:95:23: error: cast to smaller integer type 'enum lp87565_device_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810095849.123321-5-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:51 +01:00
Krzysztof Kozlowski
b2ee6a378d mfd: hi6421-pmic: Fix Wvoid-pointer-to-enum-cast warning
'type' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  hi6421-pmic-core.c:62:9: error: cast to smaller integer type 'enum hi6421_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810095849.123321-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:51 +01:00
Krzysztof Kozlowski
b1da99664b mfd: max77541: Fix Wvoid-pointer-to-enum-cast warning
'id' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  max77541.c:176:18: error: cast to smaller integer type 'enum max7754x_ids' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810095849.123321-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:51 +01:00
Krzysztof Kozlowski
0f28379e3a mfd: max14577: Fix Wvoid-pointer-to-enum-cast warning
'dev_type' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  max14577.c:406:5: error: cast to smaller integer type 'enum maxim_device_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Link: https://lore.kernel.org/r/20230810095849.123321-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:51 +01:00
Krzysztof Kozlowski
4db65f45e0 mfd: stmpe: Fix Wvoid-pointer-to-enum-cast warning
'partnum' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

stmpe-i2c.c:90:13: error: cast to smaller integer type 'enum stmpe_partnum' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810095849.123321-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:51 +01:00
Zhu Wang
59cf381f12 mfd: rn5t618: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, so it is not necessary to use
of_match_ptr() here. We remove of_match_ptr() here.

Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
Link: https://lore.kernel.org/r/20230808130023.202700-9-wangzhu9@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:51 +01:00
Zhu Wang
d20642ad4f mfd: lochnagar-i2c: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, so it is not necessary to use
of_match_ptr() here. We remove of_match_ptr() here.

Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808130023.202700-8-wangzhu9@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:51 +01:00
Zhu Wang
9425f72ad3 mfd: stpmic1: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, so it is not necessary to use
of_match_ptr() here. We remove of_match_ptr() here.

Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
Link: https://lore.kernel.org/r/20230808130023.202700-6-wangzhu9@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:51 +01:00
Zhu Wang
0003732302 mfd: act8945a: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, so it is not necessary to use
of_match_ptr() here. We remove of_match_ptr() here.

Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
Link: https://lore.kernel.org/r/20230808130023.202700-5-wangzhu9@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:50 +01:00
Zhu Wang
6192a8a179 mfd: rsmu_spi: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, so it is not necessary to use
of_match_ptr() here. We remove of_match_ptr() here.

Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
Link: https://lore.kernel.org/r/20230808130023.202700-4-wangzhu9@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:50 +01:00
Zhu Wang
23fa9421f8 mfd: altera-a10sr: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, so it is not necessary to use
of_match_ptr() here. We remove of_match_ptr() here.

Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
Link: https://lore.kernel.org/r/20230808130023.202700-3-wangzhu9@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:50 +01:00
Zhu Wang
e158e08a76 mfd: rsmu_i2c: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, so it is not necessary to use
of_match_ptr() here. We remove of_match_ptr() here.

Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
Link: https://lore.kernel.org/r/20230808130023.202700-2-wangzhu9@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:50 +01:00
Ruan Jinjie
8e922937a7 mfd: tc3589x: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, it is not necessary to use
of_match_ptr() here.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230808130003.4076702-1-ruanjinjie@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:50 +01:00
Li Zetao
87ea8c7e2d mfd: ipaq-micro: Remove unused variable i in micro_rx_msg()
There is a warning reported by kernel test robot:

drivers/mfd/ipaq-micro.c:81:6: warning: unused variable ‘i’ [-Wunused-variable]

Since the commit 92d82d76c842 ("mfd: ipaq-micro: Use %*ph for printing
hexdump of a small buffer"), the variable 'i' is unused. Remove it to
silence the warning.

Reported-by: kernelci.org bot <bot@kernelci.org>
Closes: https://lore.kernel.org/all/64c8aeac.170a0220.e3234.2745@mx.google.com/
Signed-off-by: Li Zetao <lizetao1@huawei.com>
Link: https://lore.kernel.org/r/20230817114505.1810920-1-lizetao1@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-22 08:07:50 +01:00
Yang Li
8cce9c4cdf mfd: rz-mtu3: Remove duplicated include module.h
./drivers/mfd/rz-mtu3.c: linux/module.h is included more than once.

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230810005938.12519-1-yang.lee@linux.alibaba.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:04 +01:00
Chengfeng Ye
f1a63db65e mfd: qcom-pm8xxx: Fix potential deadlock on &chip->pm_irq_lock
As &chip->pm_irq_lock is acquired by pm8xxx_irq_handler() under irq
context, other process context code should disable irq before acquiring
the lock.

Since .irq_set_type and .irq_get_irqchip_state callbacks are generally
executed from process context without irq disabled by default, the same
lock acquision should disable irq.

Possible deadlock scenario
pm8xxx_irq_set_type()
    -> pm8xxx_config_irq()
    -> spin_lock(&chip->pm_irq_lock)
        <irq interrupt>
        -> pm8xxx_irq_handler()
        -> pm8xxx_irq_master_handler()
        -> pm8xxx_irq_block_handler()
        -> pm8xxx_read_block_irq()
        -> spin_lock(&chip->pm_irq_lock) (deadlock here)

This flaw was found using an experimental static analysis tool we are
developing for irq-related deadlock.

Fix the potential deadlock by spin_lock_irqsave().

Signed-off-by: Chengfeng Ye <dg573847474@gmail.com>
Reviewed-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Link: https://lore.kernel.org/r/20230720071330.50382-1-dg573847474@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:03 +01:00
Biju Das
94f34d9940 mfd: rz-mtu3: Fix COMPILE_TEST build error
When (MFD) RZ_MTU3=m and PWM_RZ_MTU3=y, It hits the below error
aarch64-linux-gnu-ld: rz-mtu3.c:(.text+0x544): undefined reference to `mfd_remove_devices'

Fix this issue by selecting MFD_CORE.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Closes: https://lore.kernel.org/linux-pwm/20230718090023.wo6m6ffzaifgctkj@pengutronix.de/
Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230718134314.118333-1-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:03 +01:00
Rob Herring
dc0c386e09 mfd: Explicitly include correct DT includes
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230714174731.4059811-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:03 +01:00
Mark Brown
9855e7cd65 mfd: wm8998: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the wm8998 driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230713-mfd-cirrus-maple-v1-11-16dacae402a8@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:03 +01:00
Mark Brown
56b8cea680 mfd: wm8997: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the wm8997 driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230713-mfd-cirrus-maple-v1-10-16dacae402a8@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:03 +01:00
Mark Brown
3d14b0f733 mfd: wm8994: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the wm8994 driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230713-mfd-cirrus-maple-v1-9-16dacae402a8@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:02 +01:00
Mark Brown
4207abf35e mfd: wm5110: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the wm5110 driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230713-mfd-cirrus-maple-v1-8-16dacae402a8@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:02 +01:00
Mark Brown
85627565a4 mfd: wm5102: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the wm5102 driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230713-mfd-cirrus-maple-v1-7-16dacae402a8@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:02 +01:00
Mark Brown
9300b1e5c6 mfd: cs47l92: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the cs47l92 driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230713-mfd-cirrus-maple-v1-6-16dacae402a8@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:02 +01:00
Mark Brown
7f3494994b mfd: cs47l90: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the cs47l90 driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230713-mfd-cirrus-maple-v1-5-16dacae402a8@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:02 +01:00
Mark Brown
fdcd10cd5e mfd: cs47l85: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the cs47l85 driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230713-mfd-cirrus-maple-v1-4-16dacae402a8@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:02 +01:00
Mark Brown
f38630fd7c mfd: cs47l35: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the cs47l35 driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230713-mfd-cirrus-maple-v1-3-16dacae402a8@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:02 +01:00
Mark Brown
01f71e73a2 mfd: cs47l24: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the cs47l24 driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230713-mfd-cirrus-maple-v1-2-16dacae402a8@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:02 +01:00
Mark Brown
4ffee2918d mfd: cs47l15: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the cs47l15 driver to use the more modern data structure.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230713-mfd-cirrus-maple-v1-1-16dacae402a8@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:01 +01:00
Mark Brown
cdc707f72e mfd: axp20x: Update to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache. In
v6.5 it has also acquired the ability to generate multi-register writes in
sync operations, bringing performance up to parity with the rbtree cache
there.

Update the axp20x driver to use the more modern data structure, really it
should have been fine even without the most recent round of updates.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230712-mfd-axp20x-maple-v1-1-4df3749107a6@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:01 +01:00
Biju Das
edae094671 mfd: Add module build support for RZ/G2L MTU3a
Modified Kconfig to enable module build support for RZ/G2L MTU3a driver.
While at it, added module.h header file.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230711092841.119161-1-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:01 +01:00
Yangtao Li
2459f4dfe5 mfd: hi655x-pmic: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706113939.1178-7-frank.li@vivo.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:00 +01:00
Yangtao Li
4c0104bf90 mfd: stm32-timers: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706113939.1178-6-frank.li@vivo.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:00 +01:00
Yangtao Li
390a3549fc mfd: omap-usb-host: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706113939.1178-5-frank.li@vivo.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:00 +01:00
Yangtao Li
fed64817f0 mfd: exynos-lpass: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706113939.1178-4-frank.li@vivo.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:00 +01:00
Yangtao Li
07141cfedf mfd: ti_am335x_tscadc: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706113939.1178-3-frank.li@vivo.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:00 +01:00
Yangtao Li
41b2e61ae6 mfd: omap-usb-tll: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706113939.1178-2-frank.li@vivo.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:00 +01:00
Yangtao Li
8e950a6068 mfd: atmel-hlcdc: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706113939.1178-1-frank.li@vivo.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:00 +01:00
Geert Uytterhoeven
d085c27aa6 mfd: rk808: Make MFD_RK8XX tristate
There is no reason for MFD_RK8XX to be bool, all drivers that depend on
it, or that select it, are tristate.

Fixes: c20e8c5b12 ("mfd: rk808: Split into core and i2c")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/d132363fc9228473e9e652b70a3761b94de32d70.1688475844.git.geert+renesas@glider.be
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:48:00 +01:00
Andy Shevchenko
8325ec08d6 mfd: ipaq-micro: Use %*ph for printing hexdump of a small buffer
The kernel already has a helper to print a hexdump of a small
buffer via pointer extension. Use that instead of open coded
variant.

In long term it helps to kill pr_cont() or at least narrow down
its use.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230703140923.2840-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:47:59 +01:00
Lee Jones
2ccfad1c2b Immutable branch between MFD, Pinctrl and soundwire due for the v6.6 merge window
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmTfkKAACgkQUa+KL4f8
 d2FwzxAArqA6/pebr+19TNvv6hFuUxpbR57jr0XM4YzPNvBJs/iEk1wfdGTkOdFG
 NSWVGDIE4aY62mwehq0AEfYQVrTzKcAuMJZgOeg0lzReBYMhn6WuyCc192L7tgRA
 H3bm2oQcSVXiNGXvKoTr9fDckBf5Ta9OcoVmf48YFQXvwv+vuO/kS77JuVkLZxwH
 yycmLxD7PJlvikj8ITsg8pzj/xLhCpHziLsyMjQpgvr7hRPG+f5W0Dq9vNONI5IL
 YU810I2Dp+bU5YGAElGTrSwHnI2FrCUlrcR88ukGPN9rBn84TcmypWsetMR83juo
 zcn6AfUp6WuhaQxs06tTzsNc9cQpKjtjYojTZ1OYYsC7eOhlF3ifQLEiqVJbfY0W
 8BN1e3QDf59ZwXAUJJKrV37yHc9/uuGVerc7dzkng0f2OHosNWzLNyy7LiOb80dD
 Hp/yGxXXyiASGjswSaxqbu67TuEPWKuoceW0wRS9/ExZx+cPvEzdTzdCWYej7cDH
 UmJup/J053htC1k/vos+0SRezqeuXvHXDRuwP9Lnhdct9eeDiGFn920S9d2DVjgR
 PImk+O9dTnOVehNY7+I9tqBK9dM3AolH/jbEQQ6VkIfm2clewBy+1M0SohWIBW/E
 4iQbtPkVXwGHI9Lp+6pP4exhA58FQCDL4KoUkchWsokF9zTM/eM=
 =Sb7O
 -----END PGP SIGNATURE-----
mergetag object c01467355f
 type commit
 tag ib-mfd-regulator-v6.6
 tagger Lee Jones <lee@kernel.org> 1692391395 +0100
 
 Immutable branch between MFD and Regulator due for the v6.6 merge window
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmTf1+MACgkQUa+KL4f8
 d2G9Zg/+PKbGOPxuOunK2TJMZM2JsgLgNGWPraGnCTW3RZ7YCRmykFDX1sSAopgF
 jZ8ObrbpL6sa1FxdN0FV4yh5i0DtJIj6hL6tiR/rbAagij7Sm8PsXQo/GQ89OJmp
 +iioDd23pjIGMAYeG24sNor8SGG5ZDudluiSc9lGvYC6m9wUgah+LyKPuX3Zkypq
 /WPlMfDsSsidlgvsvrc197h1By+XVAv//ReuPSNzA7Y9Jq+LKrK3pwgCT+AKB783
 VaqaDNSGnzvTvvvHaguxyQEnmdrFG12Elom+kkP/6ZeVj3KDTE3QDRgolBnlRk4P
 KPCIxJ7gWfET81H4/z+XOHSRVUHjc3puxbw9boSCm2j3YJCHbtScje6MQT6YSzeG
 8FuJJXjqZf+YYhHZt4LwZQvfoS91+P/5xve9DdYStOtvGS2k9562yZmXJWYFM3uF
 uu1TPgWHkA6ryF/1QRVkz4oLA71kQc47W30gZuu9xLclXRlU0OQQk/oPXCplwzUN
 K1aG5GAg1Q3fsvBtfxv0xnzUGNOQbqoLHgnmx2qzY/scyhzQ9EzlqVmpI/jP9dOq
 63mpIQe5OvJDyCJ1auKjBBsYR4Q2SUmTA40/4lcG0VYs/tb1jJeauxPuGTuhEFur
 YpU5luPHfbWhkNO0uYq25ih8+RRXkH51CQu4TGhigMacH4b+ZX4=
 =jD5V
 -----END PGP SIGNATURE-----

Merge tags 'ib-mfd-pinctrl-soundwire-v6.6' and 'ib-mfd-regulator-v6.6' into ibs-for-mfd-merged

Immutable branch between MFD, Pinctrl and soundwire due for the v6.6 merge window

Immutable branch between MFD and Regulator due for the v6.6 merge window
2023-08-18 21:47:03 +01:00
Andre Werner
c01467355f mfd: tps65086: Read DEVICE ID register 1 from device
This commit prepares a following commit for the regulator part of the MFD.
The driver should support different device chips that differ in their
register definitions, for instance to control LDOA1 and SWB2.
So it is necessary to use a dedicated regulator description for a
specific device variant. Thus, the content from DEVICEID Register 1 is
used to choose a dedicated configuration between the different device
variants.

Signed-off-by: Andre Werner <andre.werner@systec-electronic.com>
Link: https://lore.kernel.org/r/20230818083721.29790-2-andre.werner@systec-electronic.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-18 21:43:02 +01:00
Charles Keepax
ace6d14481 mfd: cs42l43: Add support for cs42l43 core driver
The CS42L43 is an audio CODEC with integrated MIPI SoundWire interface
(Version 1.2.1 compliant), I2C, SPI, and I2S/TDM interfaces designed
for portable applications. It provides a high dynamic range, stereo
DAC for headphone output, two integrated Class D amplifiers for
loudspeakers, and two ADCs for wired headset microphone input or
stereo line input. PDM inputs are provided for digital microphones.

The MFD component registers and initialises the device and provides
PM/system power management.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230804104602.395892-4-ckeepax@opensource.cirrus.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-08-17 12:06:11 +01:00
Benjamin Bara
510f276df2 mfd: tps6586x: Register restart handler
There are a couple of boards which use a tps6586x as
"ti,system-power-controller", e.g. the tegra20-tamonten.dtsi.
For these, the only registered restart handler is the warm reboot via
tegra's PMC. As the bootloader of the tegra20 requires the VDE, it must
be ensured that VDE is enabled (which is the case after a cold reboot).
For the "normal reboot", this is basically the case since 8f0c714ad9.
However, this workaround is not executed in case of an emergency restart.
In case of an emergency restart, the system now simply hangs in the
bootloader, as VDE is not enabled (because it is not used).

The TPS658629-Q1 provides a SOFT RST bit in the SUPPLYENE reg to request
a (cold) reboot, which takes at least 20ms (as the data sheet states).
This avoids the hang-up.

Tested on a TPS658640.

Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
Link: https://lore.kernel.org/r/20230327-tegra-pmic-reboot-v7-5-18699d5dcd76@skidata.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-07-28 11:33:20 +01:00
Benjamin Bara
8bd141b17c mfd: tps6586x: Use devm-based power off handler
Convert the power off handler to a devm-based power off handler.

Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
Link: https://lore.kernel.org/r/20230327-tegra-pmic-reboot-v7-4-18699d5dcd76@skidata.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-07-28 11:33:14 +01:00
Linus Torvalds
b8ec70ab66 - New Drivers
- Add support for TI TPS6594/TPS6593/LP8764 PMICs
    - Add support for Samsung RT5033 Battery Charger
    - Add support for Analog Devices MAX77540 and MAX77541 PMICs
 
  - New Device Support
    - Add support for SPI to Rockchip RK808 (and friends)
    - Add support for AXP192 PMIC to X-Powers AXP20X
    - Add support for AXP313a PMIC to X-Powers AXP20X
    - Add support for RK806 to Rockchip RK8XX
 
  - Removed Device Support
    - Removed MFD support for Richtek RT5033 Battery
 
  - Fix-ups
    - Remove superfluous code
    - Switch I2C drivers from .probe_new() to .probe()
    - Convert over to managed resources (devm_*(), etc)
    - Use dev_err_probe() for returning errors from .probe()
    - Add lots of Device Tree bindings / support
    - Improve cache efficiency by switching to Maple
    - Use own exported namespaces (NS)
    - Include missing and remove superfluous headers
    - Start using / convert to the new shutdown sys-off API
    - Trivial: variable / define renaming
    - Make use of of_property_read_reg() when requesting DT 'reg's
 
  - Bug Fixes
    - Fix chip revision readout due to incorrect data masking
    - Amend incorrect register and mask values used for charger state
    - Hide unused functionality at compile time
    - Fix resource leaks following error handling routines
    - Return correct error values and fix error handling in general
    - Repair incorrect device names - used for device matching
    - Remedy broken module auto-loading
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmSinHkACgkQUa+KL4f8
 d2Gj3A/9EimIwZKau8OeHCVue1mNrEVkVsCiWIZF1eHliufNbH0g3+9gzTB1yQfL
 PmE2tN+vxdHNPJKzPnrmEEdJpm+rV6RikUD3I1mVN0wPSXDmZPx9kYuJD8SmMtZo
 aDLQIMwqY0ZijGgAoVWmRtYo5praWSFvyutiD1yYEI4yAz/QcLoNvWjt3qb0H+fq
 Un1LYErrLxLar0GllzQa5lzoNEAoSBvO1TmS8z4Cm5uiU6Orahh2DlsE/Do40GSc
 5YYntAEsuJ1Bkg7JB+bxdU4BJnJskqzaasLIe3Fc4rXf6zdh/21EpmhpFGY+BS8s
 51f+NjViMwi+3uiBe5g8f/pIy6dIpkfvdukzbqDhDwqXnexftpy3+i99PJiWludR
 Xpr6s+g6zpxLAoKzHNA1jm5B3I0IPJEBoWe8jAalIcGIQBdjiF9UAkas3z9NTEoa
 8TrjW1Abxow1TB9ouT0kE7hvQk2UpYLEbNdDAByE4mM33d5AF7UpcEBrhmbFDA/E
 12q5EMoV9uXIzf+LS2TdYroo8SVYHufiIoiwU6QPJzWVVFJ3lrU3pA1Oe+aICMNu
 90EVDI1Ve37WTJfN9+FAlncaWF99AEqZwrES25QrKhMQO4w6LS35shlzTzpUcB4k
 q+upr81cWLz0t7fmjgn4yVa1CWzaQ19nylqXF/Nb4RP/6ZiP2Dw=
 =EmOj
 -----END PGP SIGNATURE-----

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

Pull MFD updates from Lee Jones:
 "New Drivers:
   - Add support for TI TPS6594/TPS6593/LP8764 PMICs
   - Add support for Samsung RT5033 Battery Charger
   - Add support for Analog Devices MAX77540 and MAX77541 PMICs

  New Device Support:
   - Add support for SPI to Rockchip RK808 (and friends)
   - Add support for AXP192 PMIC to X-Powers AXP20X
   - Add support for AXP313a PMIC to X-Powers AXP20X
   - Add support for RK806 to Rockchip RK8XX

  Removed Device Support:
   - Removed MFD support for Richtek RT5033 Battery

  Fix-ups:
   - Remove superfluous code
   - Switch I2C drivers from .probe_new() to .probe()
   - Convert over to managed resources (devm_*(), etc)
   - Use dev_err_probe() for returning errors from .probe()
   - Add lots of Device Tree bindings / support
   - Improve cache efficiency by switching to Maple
   - Use own exported namespaces (NS)
   - Include missing and remove superfluous headers
   - Start using / convert to the new shutdown sys-off API
   - Trivial: variable / define renaming
   - Make use of of_property_read_reg() when requesting DT 'reg's

  Bug Fixes:
   - Fix chip revision readout due to incorrect data masking
   - Amend incorrect register and mask values used for charger state
   - Hide unused functionality at compile time
   - Fix resource leaks following error handling routines
   - Return correct error values and fix error handling in general
   - Repair incorrect device names - used for device matching
   - Remedy broken module auto-loading"

* tag 'mfd-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (51 commits)
  dt-bindings: mfd: max77541: Add ADI MAX77541/MAX77540
  iio: adc: max77541: Add ADI MAX77541 ADC Support
  regulator: max77541: Add ADI MAX77541/MAX77540 Regulator Support
  dt-bindings: regulator: max77541: Add ADI MAX77541/MAX77540 Regulator
  mfd: Switch two more drivers back to use struct i2c_driver::probe
  dt-bindings: mfd: samsung,s5m8767: Simplify excluding properties
  mfd: stmpe: Only disable the regulators if they are enabled
  mfd: max77541: Add ADI MAX77541/MAX77540 PMIC Support
  dt-bindings: mfd: gateworks-gsc: Remove unnecessary fan-controller nodes
  mfd: core: Use of_property_read_reg() to parse "reg"
  mfd: stmfx: Nullify stmfx->vdd in case of error
  mfd: stmfx: Fix error path in stmfx_chip_init
  mfd: intel-lpss: Add missing check for platform_get_resource
  mfd: stpmic1: Add PMIC poweroff via sys-off handler
  mfd: stpmic1: Fixup main control register and bits naming
  dt-bindings: mfd: qcom,tcsr: Add the compatible for IPQ8074
  mfd: tps65219: Add support for soft shutdown via sys-off API
  mfd: pm8008: Drop bogus i2c module alias
  mfd: pm8008: Fix module autoloading
  mfd: tps65219: Add GPIO cell instance
  ...
2023-07-03 10:55:04 -07:00
Linus Torvalds
e5476f57b3 gpio updates for v6.5
Core GPIO library:
 - remove unused symbols
 - don't spam the kernel log with messages about hogs
 - remove old sysfs API cruft
 - improve handling of GPIO masks
 
 New drivers
 - add a driver for the BlueField-3 GPIO controller
 - add GPIO support for the TPS65219 PMIC
 
 Driver improvements:
 - extend the gpio-aggregator driver to support ramp-up/ramp-down delay
 - remove unnecessary CONFIG_OF guards from gpio-aggregator
 - readability improvements in gpio-tangier
 - switch i2c drivers back to using probe() now that it's been converted in
   the i2c subsystem to not taking the id parameter
 - remove unused inclusions of of_gpio.h in several drivers
 - make pm ops static in gpio-davinci and fix a comment
 - use more devres in drivers to shrink and simplify the code
 - add missing include in gpio-sa1100
 - add HAS_IOPORT KConfig dependency where needed
 - add permissions checks before accessing pins in gpio-tegra186
 - convert the gpio-zynq driver to using immutable irqchips
 - preserve output settings set by the bootloader in gpio-mpc8xxx
 
 Selftests:
 - tweak the variable naming in script tests
 
 Device tree updates:
 - convert gpio-mmio and gpio-stmpe to YAML
 - add parsing of GPIO hogs to gpio-vf610
 - add bindings for the Cirrus EP93xx GPIO controller
 - add gpio-line-names property to the gpio-pca9570 bindings
 - extend the binding for x-powers,axp209 with another block
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmSbB5YACgkQEacuoBRx
 13I8xhAAoI9irAnAbh+Lgn0EdziMlqE6E8oohBtRY7rHK7Pi3IZNoATK3GT5bebF
 a0+EzqOTM22g2qIv41zkG7SyBgdkRg6Ld+/ogvlgddphhEGxY3MdRbSyPacHlzj1
 BYnOJt+uQ46TwnzyTjVLn/1aGcD2LPB0j4rS1HnbsDHT8xGAjdq2O3YYNH7ZairA
 ZbIc/2Cpn4X1YWXX+s3a4B8w1eCEoRNG2Fvie6hmr518TSctP/MiFe6W7+eQrHwT
 GI491Rr4qT/lmRFVsxslYUPREUe/va8RM3uIC23zEkZYjsbRLJ2tvCGulm8D/H1n
 rUB9yXj+n5mCjTH7Gebg7J99NKpHo4uoXKrFhhetH9a0adsJCOwBr14YO8NP66jK
 hmZW8f8+QEAA4nhXx0VqpOp1FGw5unhPF/k8Apct8TeVJCv9i8g5QRreTf1030Hl
 l8x7JhsHlZGADGeLBPaNBIjuCB99YEMNtl4Ouzh7w1/1JsFcwI/cdASNxrsI4SCf
 Tl92+xAqZlfnnuHAQFiBBwKxnsHxclBwq3umMQD7kB3cdMELh2gqA3M8F+NGp5SB
 XMcE3gwDH53fXu74523G36sqNqkLNF0K974LwzSz0t4A8tSlwbt2esvzpxa0bDLe
 oqYD+TGAvX+uzr05KZ1kyUfD+95mMHsYY9sQWoUzHQelGmXV32M=
 =3KNJ
 -----END PGP SIGNATURE-----

Merge tag 'gpio-updates-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio updates from Bartosz Golaszewski:
 "We have two new drivers, some improvements to the core code, lots of
  different updates to existing GPIO drivers and some dt-bindings on
  top.

  There's nothing controversial in here and almost everything has been
  in next for more than a week (95% a lot longer than this). The only
  thing that has spent less time in next is a new driver so no risk of
  regressions.

  The single merge pulls in changes that remove all usage of global GPIO
  numbers from arch/arm/mach-omap.

  Core GPIO library:
   - remove unused symbols
   - don't spam the kernel log with messages about hogs
   - remove old sysfs API cruft
   - improve handling of GPIO masks

  New drivers:
   - add a driver for the BlueField-3 GPIO controller
   - add GPIO support for the TPS65219 PMIC

  Driver improvements:
   - extend the gpio-aggregator driver to support ramp-up/ramp-down
     delay
   - remove unnecessary CONFIG_OF guards from gpio-aggregator
   - readability improvements in gpio-tangier
   - switch i2c drivers back to using probe() now that it's been
     converted in the i2c subsystem to not taking the id parameter
   - remove unused inclusions of of_gpio.h in several drivers
   - make pm ops static in gpio-davinci and fix a comment
   - use more devres in drivers to shrink and simplify the code
   - add missing include in gpio-sa1100
   - add HAS_IOPORT KConfig dependency where needed
   - add permissions checks before accessing pins in gpio-tegra186
   - convert the gpio-zynq driver to using immutable irqchips
   - preserve output settings set by the bootloader in gpio-mpc8xxx

  Selftests:
   - tweak the variable naming in script tests

  Device tree updates:
   - convert gpio-mmio and gpio-stmpe to YAML
   - add parsing of GPIO hogs to gpio-vf610
   - add bindings for the Cirrus EP93xx GPIO controller
   - add gpio-line-names property to the gpio-pca9570 bindings
   - extend the binding for x-powers,axp209 with another block"

* tag 'gpio-updates-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (58 commits)
  of: unittest: drop assertions for GPIO hog messages
  gpiolib: Drop unused domain_ops memeber of GPIO IRQ chip
  gpio: synq: remove unused zynq_gpio_irq_reqres/zynq_gpio_irq_relres
  dt-bindings: gpio: gpio-vf610: Add parsing of hogs
  gpio: lpc18xx: Remove unused of_gpio.h inclusion
  gpio: xra1403: Remove unused of_gpio.h inclusion
  gpio: mpc8xxx: Remove unused of_gpio.h inclusion
  dt-bindings: gpio: Add Cirrus EP93xx
  gpio: mpc8xxx: latch GPIOs state on module load when configured as output
  selftests: gpio: gpio-sim: Use same variable name for sysfs pathname
  gpio: mlxbf3: Add gpio driver support
  gpio: delay: Remove duplicative functionality
  gpio: aggregator: Set up a parser of delay line parameters
  gpio: aggregator: Support delay for setting up individual GPIOs
  gpio: aggregator: Remove CONFIG_OF and of_match_ptr() protections
  dt-bindings: gpio: pca9570: add gpio-line-names property
  gpiolib: remove unused gpio_cansleep()
  gpio: tps65219: add GPIO support for TPS65219 PMIC
  gpio: zynq: fix zynqmp_gpio not an immutable chip warning
  gpio: davinci: make davinci_gpio_dev_pm_ops static
  ...
2023-06-29 10:11:10 -07:00
Uwe Kleine-König
a6b6790c02 mfd: Switch two more drivers back to use struct i2c_driver::probe
struct i2c_driver::probe_new is about to go away. Switch the driver to
use the probe callback with the same prototype.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230626091941.557733-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Lee Jones <lee@kernel.org>
2023-06-26 16:38:30 +01:00