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
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
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