summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
Commit message (Collapse)AuthorAgeFilesLines
* mfd: ti_am335x_tscadc: Fix TI SoC dependenciesPeter Robinson2024-02-051-0/+1
| | | | | | | | | | | | [ Upstream commit 284d16c456e5d4b143f375b8ccc4038ab3f4ee0f ] The ti_am335x_tscadc is specific to some TI SoCs, update the dependencies for those SoCs and compile testing. Signed-off-by: Peter Robinson <pbrobinson@gmail.com> Link: https://lore.kernel.org/r/20231220155643.445849-1-pbrobinson@gmail.com Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
* mfd: intel-lpss: Fix the fractional clock divider flagsAndy Shevchenko2024-01-251-1/+1
| | | | | | | | | | | | | | | [ Upstream commit 03d790f04fb2507173913cad9c213272ac983a60 ] The conversion to CLK_FRAC_DIVIDER_POWER_OF_TWO_PS uses wrong flags in the parameters and hence miscalculates the values in the clock divider. Fix this by applying the flag to the proper parameter. Fixes: 82f53f9ee577 ("clk: fractional-divider: Introduce POWER_OF_TWO_PS flag") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reported-by: Alex Vinarskis <alex.vinarskis@gmail.com> Link: https://lore.kernel.org/r/20231211111441.3910083-1-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
* mfd: tps6594: Add null pointer check to tps6594_device_init()Kunwu Chan2024-01-251-0/+3
| | | | | | | | | | | | | | [ Upstream commit 825906f2ebe83977d747d8bce61675dddd72485d ] devm_kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: 325bec7157b3 ("mfd: tps6594: Add driver for TI TPS6594 PMIC") Suggested-by: Lee Jones <lee@kernel.org> Signed-off-by: Kunwu Chan <chentao@kylinos.cn> Link: https://lore.kernel.org/r/20231208033320.49345-1-chentao@kylinos.cn Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
* mfd: syscon: Fix null pointer dereference in of_syscon_register()Kunwu Chan2024-01-251-0/+4
| | | | | | | | | | | | | | [ Upstream commit 41673c66b3d0c09915698fec5c13b24336f18dd1 ] kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: e15d7f2b81d2 ("mfd: syscon: Use a unique name with regmap_config") Signed-off-by: Kunwu Chan <chentao@kylinos.cn> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20231204092443.2462115-1-chentao@kylinos.cn Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
* mfd: cs42l43: Correct SoundWire port listCharles Keepax2024-01-251-46/+28
| | | | | | | | | | | | | | | | | [ Upstream commit 47b1b03dc56ebc302620ce43e967aa8f33516f6f ] Two ports are missing from the port list, and the wrong port is set to 4 channels. Also the attempt to list them by function is rather misguided, there is nothing in the hardware that fixes a particular port to one function. Factor out the port properties to an actual struct, fixing the missing ports and correcting the port set to 4 channels. Fixes: ace6d1448138 ("mfd: cs42l43: Add support for cs42l43 core driver") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20231130115712.669180-1-ckeepax@opensource.cirrus.com Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
* mfd: rk8xx: fixup devices registration with PLATFORM_DEVID_AUTONeil Armstrong2024-01-251-21/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Upstream commit 4aedcd4aa61d536ca17e67ecd5bc5d42529164f4 ] Since commit 210f418f8ace ("mfd: rk8xx: Add rk806 support"), devices are registered with "0" as id, causing devices to not have an automatic device id and prevents having multiple RK8xx PMICs on the same system. Properly pass PLATFORM_DEVID_AUTO to devm_mfd_add_devices() and since it will ignore the cells .id with this special value, also cleanup by removing all now ignored cells .id values. Now we have the same behaviour as before rk806 introduction and rk806 retains the intended behavior. This fixes a regression while booting the Odroid Go Ultra on v6.6.1: sysfs: cannot create duplicate filename '/bus/platform/devices/rk808-clkout' CPU: 3 PID: 97 Comm: kworker/u12:2 Not tainted 6.6.1 #1 Hardware name: Hardkernel ODROID-GO-Ultra (DT) Workqueue: events_unbound deferred_probe_work_func Call trace: dump_backtrace+0x9c/0x11c show_stack+0x18/0x24 dump_stack_lvl+0x78/0xc4 dump_stack+0x18/0x24 sysfs_warn_dup+0x64/0x80 sysfs_do_create_link_sd+0xf0/0xf8 sysfs_create_link+0x20/0x40 bus_add_device+0x114/0x160 device_add+0x3f0/0x7cc platform_device_add+0x180/0x270 mfd_add_device+0x390/0x4a8 devm_mfd_add_devices+0xb0/0x150 rk8xx_probe+0x26c/0x410 rk8xx_i2c_probe+0x64/0x98 i2c_device_probe+0x104/0x2e8 really_probe+0x184/0x3c8 __driver_probe_device+0x7c/0x16c driver_probe_device+0x3c/0x10c __device_attach_driver+0xbc/0x158 bus_for_each_drv+0x80/0xdc __device_attach+0x9c/0x1ac device_initial_probe+0x14/0x20 bus_probe_device+0xac/0xb0 deferred_probe_work_func+0xa0/0xf4 process_one_work+0x1bc/0x378 worker_thread+0x1dc/0x3d4 kthread+0x104/0x118 ret_from_fork+0x10/0x20 rk8xx-i2c 0-001c: error -EEXIST: failed to add MFD devices rk8xx-i2c: probe of 0-001c failed with error -17 Fixes: 210f418f8ace ("mfd: rk8xx: Add rk806 support") Reported-by: Adam Green <greena88@gmail.com> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20231116-topic-amlogic-upstream-fix-rk8xx-devid-auto-v2-1-3f1bad68ab9d@linaro.org Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
* mfd: qcom-spmi-pmic: Fix revid implementationJohan Hovold2023-11-281-16/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 7b439aaa62fee474a0d84d67a25f4984467e7b95 upstream. 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: e9c11c6e3a0e ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mfd: qcom-spmi-pmic: Fix reference leaks in revid helperJohan Hovold2023-11-281-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit a0fa44c261e448c531f9adb3a5189a3520f3e316 upstream. 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: e9c11c6e3a0e ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mfd: intel-lpss: Add Intel Lunar Lake-M PCI IDsJarkko Nikula2023-11-281-0/+13
| | | | | | | | | | | [ Upstream commit e53b22b10c6e0de0cf2a03a92b18fdad70f266c7 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
* mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devsHans de Goede2023-11-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | [ Upstream commit 831d1af85133e1763d41e20414912d9a1058ea72 ] Commit 9e86b2ad4c11 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: e933836744a2 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
* mfd: dln2: Fix double put in dln2_probeDinghao Liu2023-11-201-1/+0
| | | | | | | | | | | | | | [ Upstream commit 759c409bc5fc496cbc22cd0b392d3cbb0c0e23eb ] The dln2_free() already contains usb_put_dev(). Therefore, the redundant usb_put_dev() before dln2_free() may lead to a double free. Fixes: 96da8f148396 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
* mfd: core: Ensure disabled devices are skipped without abortingHerve Codina2023-11-201-5/+12
| | | | | | | | | | | | | | | | | | | | [ Upstream commit 7ba7bdef4d14e3722e2842da3b48cbadb73e52d6 ] 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: 22380b65dc70 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
* Merge tag 'mfd-fixes-6.6' of ↵Linus Torvalds2023-10-051-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * mfd: cs42l43: Fix MFD_CS42L43 dependency on REGMAP_IRQWoody Zhang2023-09-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: ace6d1448138 ("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>
* | mfd: cs42l43: Use correct macro for new-style PM runtime opsCharles Keepax2023-09-231-2/+2
|/ | | | | | | | | | | | | | | 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: ace6d1448138 ("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>
* mfd: mc13xxx: Simplify device data fetching in probe()Biju Das2023-08-221-8/+1
| | | | | | | | | 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>
* mfd: rz-mtu3: Replace raw_spin_lock->spin_lock()Biju Das2023-08-221-8/+8
| | | | | | | | | | | | | | 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>
* mfd: rz-mtu3: Reduce critical sectionsBiju Das2023-08-221-9/+7
| | | | | | | | | | | | | | 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>
* mfd: mxs-lradc: Fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski2023-08-221-1/+1
| | | | | | | | | | | '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>
* mfd: wm31x: Fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski2023-08-222-2/+2
| | | | | | | | | | | '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>
* mfd: wm8994: Fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski2023-08-221-1/+1
| | | | | | | | | | | | '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>
* mfd: tc3589: Fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski2023-08-221-1/+1
| | | | | | | | | | | '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>
* mfd: lp87565: Fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski2023-08-221-1/+1
| | | | | | | | | | | '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>
* mfd: hi6421-pmic: Fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski2023-08-221-1/+1
| | | | | | | | | | | '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>
* mfd: max77541: Fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski2023-08-221-1/+1
| | | | | | | | | | | '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>
* mfd: max14577: Fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski2023-08-221-2/+1
| | | | | | | | | | | | '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>
* mfd: stmpe: Fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski2023-08-221-1/+1
| | | | | | | | | | | '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>
* mfd: rn5t618: Remove redundant of_match_ptr()Zhu Wang2023-08-221-1/+1
| | | | | | | | | 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>
* mfd: lochnagar-i2c: Remove redundant of_match_ptr()Zhu Wang2023-08-221-1/+1
| | | | | | | | | | 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>
* mfd: stpmic1: Remove redundant of_match_ptr()Zhu Wang2023-08-221-1/+1
| | | | | | | | | 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>
* mfd: act8945a: Remove redundant of_match_ptr()Zhu Wang2023-08-221-1/+1
| | | | | | | | | 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>
* mfd: rsmu_spi: Remove redundant of_match_ptr()Zhu Wang2023-08-221-1/+1
| | | | | | | | | 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>
* mfd: altera-a10sr: Remove redundant of_match_ptr()Zhu Wang2023-08-221-1/+1
| | | | | | | | | 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>
* mfd: rsmu_i2c: Remove redundant of_match_ptr()Zhu Wang2023-08-221-1/+1
| | | | | | | | | 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>
* mfd: tc3589x: Remove redundant of_match_ptr()Ruan Jinjie2023-08-221-1/+1
| | | | | | | | | 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>
* mfd: ipaq-micro: Remove unused variable i in micro_rx_msg()Li Zetao2023-08-221-2/+0
| | | | | | | | | | | | | | | | 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>
* mfd: rz-mtu3: Remove duplicated include module.hYang Li2023-08-181-1/+0
| | | | | | | | ./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>
* mfd: qcom-pm8xxx: Fix potential deadlock on &chip->pm_irq_lockChengfeng Ye2023-08-181-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* mfd: rz-mtu3: Fix COMPILE_TEST build errorBiju Das2023-08-181-0/+1
| | | | | | | | | | | | | | 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>
* mfd: Explicitly include correct DT includesRob Herring2023-08-1850-64/+41
| | | | | | | | | | | | | | | 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>
* mfd: wm8998: Update to use maple tree register cacheMark Brown2023-08-181-1/+1
| | | | | | | | | | | | | | | 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>
* mfd: wm8997: Update to use maple tree register cacheMark Brown2023-08-181-1/+1
| | | | | | | | | | | | | | | 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>
* mfd: wm8994: Update to use maple tree register cacheMark Brown2023-08-181-3/+3
| | | | | | | | | | | | | | | 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>
* mfd: wm5110: Update to use maple tree register cacheMark Brown2023-08-181-1/+1
| | | | | | | | | | | | | | | 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>
* mfd: wm5102: Update to use maple tree register cacheMark Brown2023-08-181-1/+1
| | | | | | | | | | | | | | | 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>
* mfd: cs47l92: Update to use maple tree register cacheMark Brown2023-08-181-4/+4
| | | | | | | | | | | | | | | 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>
* mfd: cs47l90: Update to use maple tree register cacheMark Brown2023-08-181-4/+4
| | | | | | | | | | | | | | | 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>
* mfd: cs47l85: Update to use maple tree register cacheMark Brown2023-08-181-4/+4
| | | | | | | | | | | | | | | 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>
* mfd: cs47l35: Update to use maple tree register cacheMark Brown2023-08-181-4/+4
| | | | | | | | | | | | | | | 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>
* mfd: cs47l24: Update to use maple tree register cacheMark Brown2023-08-181-1/+1
| | | | | | | | | | | | | | | 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>