summaryrefslogtreecommitdiffstats
path: root/drivers/mfd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'mfd-next-6.7' of ↵Linus Torvalds2023-11-0344-333/+436
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Allow all MFD Cell properties to be filled in dynamically at runtime - Skip disabled device nodes and continue to look for subsequent devices New Device Support: - Add support for Lunar Lake-M PCI to Intel LPSS PCI - Add support for Denverton to Intel ICH LPC New Functionality: - Add support for Clocks to Texas Instruments TWL* Core - Add support for Interrupts to STMicroelectronics STM32 Timers Fix-ups: - Convert to new devm-* (managed) power-off API - Remove superfluous code - Bunch of Device Tree additions, conversions and adaptions - Simplify obtaining resources (memory, device data) using unified API helpers - Trivial coding-style / spelling type clean-ups - Constify / staticify changes - Expand or edit on existing documentation - Convert some Regmap configurations to use the Maple Tree cache - Apply new __counted_by() annotation to several data structures containing flexible arrays - Replace strncpy() with strscpy() Bug Fixes: - Remove double put creating reference imbalances - Ensure headphone/lineout detection gets set when booting with ACPI" * tag 'mfd-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (73 commits) mfd: lpc_ich: Mark *_gpio_offsets data with const spmi: rename spmi device lookup helper spmi: document spmi_device_from_of() refcounting dt-bindings: mfd: armltd: Move Arm board syscon's to separate schema mfd: rk8xx: Add support for RK806 power off mfd: rk8xx: Add support for standard system-power-controller property dt-bindings: mfd: rk806: Allow system-power-controller property dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller dt-bindings: mfd: max8925: Convert to DT schema format mfd: Use i2c_get_match_data() in a selection of drivers mfd: Use device_get_match_data() in a bunch of drivers mfd: mc13xxx-spi/wm831x-spi: Use spi_get_device_match_data() mfd: motorola-cpcap: Drop unnecessary of_match_device() call mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs mfd: qcom-spmi-pmic: Switch to EXPORT_SYMBOL_GPL() mfd: qcom-spmi-pmic: Fix revid implementation mfd: qcom-spmi-pmic: Fix reference leaks in revid helper mfd: intel-m10-bmc: Change contact for ABI docs mfd: max8907: Convert to use maple tree register cache mfd: max77686: Convert to use maple tree register cache ...
| * mfd: lpc_ich: Mark *_gpio_offsets data with constAndy Shevchenko2023-11-011-3/+3
| | | | | | | | | | | | | | | | | | | | There is no reason why the GPIO resource offsets should not be const. Mark them accordingly and update a qualifier in struct lpc_ich_gpio_info definition. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20231024160650.3898959-1-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones <lee@kernel.org>
| * spmi: rename spmi device lookup helperJohan Hovold2023-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename the SPMI device helper which is used to lookup a device from its OF node as spmi_find_device_by_of_node() so that it reflects the implementation and matches how other helpers like this are named. This will specifically make it more clear that this is a lookup function which returns a reference counted structure. Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Acked-by: Stephen Boyd <sboyd@kernel.org> Link: https://lore.kernel.org/r/20231003152927.15000-6-johan+linaro@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: rk8xx: Add support for RK806 power offOndrej Jirman2023-11-011-0/+4
| | | | | | | | | | | | | | | | | | | | Use DEV_OFF bit to power off the RK806 PMIC, when system-power-controller is used in DTS. Signed-off-by: Ondrej Jirman <megi@xff.cz> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20231019165732.3818789-5-megi@xff.cz Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: rk8xx: Add support for standard system-power-controller propertyOndrej Jirman2023-11-011-1/+2
| | | | | | | | | | | | | | | | | | DT property rockchip,system-power-controller is now deprecated. Signed-off-by: Ondrej Jirman <megi@xff.cz> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20231019165732.3818789-4-megi@xff.cz Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: Use i2c_get_match_data() in a selection of driversRob Herring2023-11-016-55/+15
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: Use device_get_match_data() in a bunch of driversRob Herring2023-11-018-58/+26
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: mc13xxx-spi/wm831x-spi: Use spi_get_device_match_data()Rob Herring2023-11-012-24/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| * mfd: motorola-cpcap: Drop unnecessary of_match_device() callRob Herring2023-11-011-6/+1
| | | | | | | | | | | | | | | | | | | | 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>
| * mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devsHans de Goede2023-11-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: qcom-spmi-pmic: Switch to EXPORT_SYMBOL_GPL()Johan Hovold2023-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: qcom-spmi-pmic: Fix revid implementationJohan Hovold2023-11-011-16/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: qcom-spmi-pmic: Fix reference leaks in revid helperJohan Hovold2023-11-011-13/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: max8907: Convert to use maple tree register cacheMark Brown2023-11-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: max77686: Convert to use maple tree register cacheMark Brown2023-11-011-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. 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>
| * mfd: max77620: Convert to use maple tree register cacheMark Brown2023-11-011-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. 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>
| * mfd: intel-lpss: Add Intel Lunar Lake-M PCI IDsJarkko Nikula2023-11-011-0/+13
| | | | | | | | | | | | | | | | 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>
| * mfd: rk8xx: Convert to use maple tree register cacheMark Brown2023-11-011-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. 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>
| * mfd: twl: Convert to use maple tree register cacheMark Brown2023-11-011-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. 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>
| * mfd: tps65912: Convert to use maple tree register cacheMark Brown2023-11-011-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. 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>
| * mfd: tps65910: Convert to use maple tree register cacheMark Brown2023-11-011-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. 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>
| * mfd: tps6586x: Convert to use maple tree register cacheMark Brown2023-11-011-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. 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>
| * mfd: tps65128: Convert to use maple tree register cacheMark Brown2023-11-011-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. 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>
| * mfd: tps65090: Convert to use maple tree register cacheMark Brown2023-11-011-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. 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>
| * mfd: tps65086: Convert to use maple tree register cacheMark Brown2023-11-011-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. 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>
| * mfd: db8500-prcmu: Replace deprecated strncpy with strscpyJustin Stitt2023-11-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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>
| * mfd: lpc_ich: Add a platform device for pinctrl DenvertonAndy Shevchenko2023-11-011-0/+49
| | | | | | | | | | | | | | | | | | 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>
| * mfd: lpc_ich: Move APL GPIO resources to a custom structureAndy Shevchenko2023-11-011-11/+41
| | | | | | | | | | | | | | | | | | | | 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>
| * mfd: lpc_ich: Make struct lpc_ich_priv use enum for chipset memberAndy Shevchenko2023-11-011-13/+13
| | | | | | | | | | | | | | | | | | 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>
| * mfd: dln2: Fix double put in dln2_probeDinghao Liu2023-11-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: max8998: Simplify obtaining I2C match data and drop ↵Biju Das2023-11-011-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: max77541: Simplify obtaining I2C match dataBiju Das2023-11-011-5/+1
| | | | | | | | | | | | | | | | | | 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>
| * mfd: madera-i2c: Simplify obtaining I2C match dataBiju Das2023-11-011-8/+1
| | | | | | | | | | | | | | | | | | | | 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>
| * mfd: arizona-i2c: Simplify obtaining I2C match dataBiju Das2023-11-011-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: iqs62x: Annotate struct iqs62x_fw_blk with __counted_byKees Cook2023-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: stm32-timers: Add support for interruptsFabrice Gasnier2023-11-011-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: twl-core: Add a clock subdevice for the TWL6032Andreas Kemnade2023-11-011-0/+16
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: atmel-hlcdc: Add compatible for sam9x75 XLCD controllerManikandan Muralidharan2023-11-011-0/+1
| | | | | | | | | | | | | | | | 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>
| * mfd: wcd934x: Update to use maple tree register cacheMark Brown2023-11-011-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 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>
| * mfd: axp20x: Generalise handling without interruptAndre Przywara2023-11-011-20/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: palmas: Make similar OF and ID tableBiju Das2023-11-011-5/+5
| | | | | | | | | | | | | | | | | | | | 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>
| * mfd: palmas: Move OF table closer to its consumerBiju Das2023-11-011-17/+8
| | | | | | | | | | | | | | | | | | | | 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>
| * mfd: palmas: Constify .data in OF table and {palmas,tps65917}_irq_chipBiju Das2023-11-011-16/+11
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: palmas: Remove trailing comma in the terminator entryBiju Das2023-11-011-1/+1
| | | | | | | | | | | | | | | | 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>
| * mfd: core: Ensure disabled devices are skipped without abortingHerve Codina2023-11-011-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mfd: max8997: Simplify obtaining I2C match data and drop ↵Biju Das2023-11-011-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Merge tag 'ib-mfd-i2c-reboot-v6.7' into ibs-for-mfd-mergedLee Jones2023-11-011-8/+42
| |\ | | | | | | | | | Immutable branch between MFD, I2C and Reboot due for the v6.7 merge window
| | * mfd: tps6586x: Register restart handlerBenjamin Bara2023-07-281-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 8f0c714ad9be. 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>
| | * mfd: tps6586x: Use devm-based power off handlerBenjamin Bara2023-07-281-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | 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