summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'mfd-next-6.1' of ↵Linus Torvalds2022-10-0726-334/+935
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Fix 'mfd_of_node_list' OF node entry resource leak New Drivers: - Add support for Ocelot VSC7512 Networking Chip - Add support for MediaTek MT6370 subPMIC - Add support for Richtek RT5120 (I2C) PMIC New Device Support: - Add support for Rockchip RV1126 and RK3588 to Syscon - Add support for Rockchip RK817 Battery Charger to RK808 - Add support for Silergy SY7636a Voltage Regulator to Simple MFD - Add support for Qualcomm PMP8074 PMIC to QCOM SPMI - Add support for Secure Update to Intel M10 BMC New Functionality: - Provide SSP type to Intel's LPSS (PCI) SPI driver Fix-ups: - Remove legacy / unused code; stmpe, intel_soc_pmic_crc, syscon - Unify / simplify; intel_soc_pmic_crc - Trivial reordering / spelling, etc; Makefile, twl-core - Convert to managed resources; intel_soc_pmic_crc - Use appropriate APIs; intel_soc_pmic_crc - strscpy() conversion; htc-i2cpld, lpc_ich, mfd-core - GPIOD conversion; htc-i2cpld, stmpe - Add missing header file includes; twl4030-irq - DT goodies; stmpe, mediatek,mt6370, x-powers,axp152, aspeed,ast2x00-scu, mediatek,mt8195-scpsys, qcom,spmi-pmic, syscon, qcom,tcsr, rockchip,rk817, sprd,ums512-glbreg, dlg,da9063 Bug Fixes: - Properly check return values; sm501, htc-i2cpld - Repair Two-Wire Bus Mode; da9062-core - Fix error handling; intel_soc_pmic_core, fsl-imx25-tsadc, lp8788, lp8788-irq" * tag 'mfd-next-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (60 commits) mfd: syscon: Remove repetition of the regmap_get_val_endian() mfd: ocelot-spi: Add missing MODULE_DEVICE_TABLE power: supply: Add charger driver for Rockchip RK817 dt-bindings: mfd: mt6370: Fix the indentation in the example mfd: da9061: Fix Failed to set Two-Wire Bus Mode. mfd: htc-i2cpld: Fix an IS_ERR() vs NULL bug in htcpld_core_probe() dt-bindings: mfd: qcom,tcsr: Drop simple-mfd from IPQ6018 mfd: sm501: Add check for platform_driver_register() dt-bindings: mfd: mediatek: Add scpsys compatible for mt8186 mfd: twl4030: Add missed linux/device.h header dt-bindings: mfd: dlg,da9063: Add missing regulator patterns dt-bindings: mfd: sprd: Add bindings for ums512 global registers mfd: intel_soc_pmic_chtdc_ti: Switch from __maybe_unused to pm_sleep_ptr() etc dt-bindings: mfd: syscon: Add rk3588 QoS register compatible mfd: stmpe: Switch to using gpiod API mfd: qcom-spmi-pmic: Add pm7250b compatible dt-bindings: mfd: Add missing (unevaluated|additional)Properties on child nodes mfd/omap1: htc-i2cpld: Convert to a pure GPIO driver mfd: intel-m10-bmc: Add d5005 bmc secure update driver dt-bindings: mfd: syscon: Drop ref from reg-io-width ...
| * mfd: syscon: Remove repetition of the regmap_get_val_endian()Andy Shevchenko2022-09-291-8/+0
| | | | | | | | | | | | | | | | | | | | Since the commit 0dbdb76c0ca8 ("regmap: mmio: Parse endianness definitions from DT") regmap MMIO parses DT itsef, no need to repeat this in the caller(s). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220808140811.26734-1-andriy.shevchenko@linux.intel.com
| * mfd: ocelot-spi: Add missing MODULE_DEVICE_TABLEYang Yingliang2022-09-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module. Fixes: f3e893626abe ("mfd: ocelot: Add support for the vsc7512 chip via spi") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220922103703.1731266-1-yangyingliang@huawei.com
| * mfd: da9061: Fix Failed to set Two-Wire Bus Mode.Jens Hillenstedt2022-09-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In da9062_i2c_probe() regmap_clear_bits() tries to access CONFIG_J register. As CONFIG_J is not present in da9061_aa_writeable_ranges[] probe of da9061 fails: da9062 2-0058: Entering I2C mode! da9062 2-0058: Failed to set Two-Wire Bus Mode. da9062: probe of 2-0058 failed with error -5 Add CONFIG_J register to da9061_aa_writeable_ranges[]. Fixes: 5c6f0f456351 ("mfd: da9062: Support SMBus and I2C mode") Signed-off-by: Jens Hillenstedt <jens.hillenstedt@ise.de> Reviewed-by: Adam Ward <DLG-Adam.Ward.opensource@dm.renesas.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220915092004.168744-1-jens.hillenstedt@ise.de
| * mfd: htc-i2cpld: Fix an IS_ERR() vs NULL bug in htcpld_core_probe()Peng Wu2022-09-281-3/+6
| | | | | | | | | | | | | | | | | | | | | | The gpiochip_request_own_desc() function returns error pointers on error, it doesn't return NULL. Fixes: 0ef5164a81fbf ("mfd/omap1: htc-i2cpld: Convert to a pure GPIO driver") Signed-off-by: Peng Wu <wupeng58@huawei.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220913071659.94677-1-wupeng58@huawei.com
| * mfd: sm501: Add check for platform_driver_register()Jiasheng Jiang2022-09-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | As platform_driver_register() can return error numbers, it should be better to check platform_driver_register() and deal with the exception. Fixes: b6d6454fdb66 ("[PATCH] mfd: SM501 core driver") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220913091112.1739138-1-jiasheng@iscas.ac.cn
| * mfd: twl4030: Add missed linux/device.h headerAndy Shevchenko2022-09-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With compile testing on non-OMAP platforms compiler might be not happy: In function ‘twl4030_sih_setup’: error: implicit declaration of function ‘dev_err’ [-Werror=implicit-function-declaration] error: implicit declaration of function ‘dev_info’ [-Werror=implicit-function-declaration] In function ‘twl4030_init_irq’: error: invalid use of undefined type ‘struct device’ Add missed header. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220923175401.8723-1-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_chtdc_ti: Switch from __maybe_unused to pm_sleep_ptr() etcAndy Shevchenko2022-09-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less heavier for builds than the use of __maybe_unused attributes. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220906134256.14293-1-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: stmpe: Switch to using gpiod APIDmitry Torokhov2022-09-281-23/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch switches the driver away from legacy gpio/of_gpio API to gpiod API, and removes use of of_get_named_gpio_flags() which I want to make private to gpiolib. We also need to patch relevant DTS files, as the original code relied on the fact that of_get_named_gpio_flags() would fetch any data encoded in GPIO flags, even if it does not reflect valid flags for a GPIO. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/YxeS1BK2OBH1P/kO@google.com
| * mfd/omap1: htc-i2cpld: Convert to a pure GPIO driverLinus Walleij2022-09-281-33/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of passing GPIO numbers pertaining to ourselves through platform data, just request GPIO descriptors from our own GPIO chips and use them, and cut down on the unnecessary complexity. Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Cc: Janusz Krzysztofik <jmkrzyszt@gmail.com> Cc: Tony Lindgren <tony@atomide.com> Cc: Cory Maccarrone <darkstar6262@gmail.com> Cc: linux-omap@vger.kernel.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220905115810.5987-1-linus.walleij@linaro.org
| * mfd: intel-m10-bmc: Add d5005 bmc secure update driverRuss Weight2022-09-281-0/+1
| | | | | | | | | | | | | | | | | | Add the D5005 BMC secure update driver to the MAX10 BMC driver for D5005 devices. Signed-off-by: Russ Weight <russell.h.weight@intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220902165706.518074-2-russell.h.weight@intel.com
| * mfd: qcom-spmi-pmic: Add support for PMP8074Robert Marko2022-09-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | Add support for PMP8074 PMIC which is a companion PMIC for the Qualcomm IPQ8074 SoC-s. It shares the same subtype identifier as PM8901. Signed-off-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220818221815.346233-2-robimarko@gmail.com
| * mfd: Move from strlcpy with unused retval to strscpyWolfram Sang2022-09-283-3/+3
| | | | | | | | | | | | | | | | | | | | | | Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220818210030.7012-1-wsa+renesas@sang-engineering.com
| * mfd: fsl-imx25: Fix check for platform_get_irq() errorsDan Carpenter2022-09-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The mx25_tsadc_remove() function assumes all non-zero returns are success but the platform_get_irq() function returns negative on error and positive non-zero values on success. It never returns zero, but if it did then treat that as a success. Fixes: 18f773937968 ("mfd: fsl-imx25: Clean up irq settings during removal") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/YvTfkbVQWYKMKS/t@kili
| * mfd: rt5120: Add Richtek PMIC supportChiYuan Huang2022-09-283-0/+137
| | | | | | | | | | | | | | | | Add Richtek RT5120 PMIC I2C driver. Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/1660100142-32493-3-git-send-email-u0084500@gmail.com
| * mfd: core: Delete corresponding OF node entries from list on MFD removalMichal Oleszczyk2022-09-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we consider MFD which implements hotplug (e.g. USB hotplug driver based on product and vendor IDs) functionality it turns out that its sub-devices are correctly matched with corresponding device tree nodes only at the first time. When physical device reboots or is replugged (and MFD driver is disconnected and probed back again) all sub-devices fails in mfd_add_device() with error 'Failed to locate of_node'. The reason of that behavior is that when any MFD sub-device is created for the first time (and matched with device tree node) it is added to the mfd_of_node_list. It looks like this list is never cleaned even if devices added there are intentionally removed from the system. So when MFD device is replugged and all sub-devices are matched with their device tree nodes again they fail as matched nodes already exist in mfd_of_node_list. In other words current implementation does not support MFD with hotplug feature. This commit extends MFD core for hotplugging support by removing appropriate OF node entry from mfd_of_node_list when corresponding device is removed from the system. Thanks to that when device is added once again it can be matched with its device tree node successfully. Signed-off-by: Michal Oleszczyk <oleszczyk.m@gmail.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220809060336.31892-1-m.oleszczyk@grinn-global.com
| * mfd: twl-core: Fix double "to to" in comment.Jason Wang2022-09-281-1/+1
| | | | | | | | | | | | | | | | The double `to' is duplicated in the comment, remove one. Signed-off-by: Jason Wang <wangborong@cdjrlc.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220802201757.8142-1-wangborong@cdjrlc.com
| * mfd: lp8788: Fix an error handling path in lp8788_irq_init() and ↵Christophe JAILLET2022-09-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lp8788_irq_init() In lp8788_irq_init(), if an error occurs after a successful irq_domain_add_linear() call, it must be undone by a corresponding irq_domain_remove() call. irq_domain_remove() should also be called in lp8788_irq_exit() for the same reason. Fixes: eea6b7cc53aa ("mfd: Add lp8788 mfd driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/bcd5a72c9c1c383dd6324680116426e32737655a.1659261275.git.christophe.jaillet@wanadoo.fr
| * mfd: lp8788: Fix an error handling path in lp8788_probe()Christophe JAILLET2022-09-281-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Should an error occurs in mfd_add_devices(), some resources need to be released, as already done in the .remove() function. Add an error handling path and a lp8788_irq_exit() call to undo a previous lp8788_irq_init(). Fixes: eea6b7cc53aa ("mfd: Add lp8788 mfd driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/18398722da9df9490722d853e4797350189ae79b.1659261275.git.christophe.jaillet@wanadoo.fr
| * mfd: fsl-imx25: Fix an error handling path in mx25_tsadc_setup_irq()Christophe JAILLET2022-09-281-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If devm_of_platform_populate() fails, some resources need to be released. Introduce a mx25_tsadc_unset_irq() function that undoes mx25_tsadc_setup_irq() and call it both from the new error handling path of the probe and in the remove function. Fixes: a55196eff6d6 ("mfd: fsl-imx25: Use devm_of_platform_populate()") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/d404e04828fc06bcfddf81f9f3e9b4babbe35415.1659269156.git.christophe.jaillet@wanadoo.fr
| * mfd: silergy,sy7636a: Add config option MFD_SY7636AAlistair Francis2022-09-281-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a specific MFD_SY7636A config option. As part of this change we can use MFD_SY7636A as a dependency for all SY7636a components and also remove the name from MFD_SIMPLE_MFD_I2C as it no longer needs to be selectable. Signed-off-by: Alistair Francis <alistair@alistair23.me> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220525115554.430971-2-alistair@alistair23.me
| * mfd: mt6370: Add MediaTek MT6370 supportChiYuan Huang2022-09-284-0/+428
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the MediaTek MT6370 SubPMIC. MediaTek MT6370 is a SubPMIC consisting of a single cell battery charger with ADC monitoring, RGB LEDs, dual channel flashlight, WLED backlight driver, display bias voltage supply, one general purpose LDO, and the USB Type-C & PD controller complies with the latest USB Type-C and PD standards. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Signed-off-by: ChiaEn Wu <chiaen_wu@richtek.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220805070610.3516-8-peterwu.pub@gmail.com
| * mfd: rk808: Add Rockchip rk817 battery charger supportChris Morgan2022-09-281-1/+15
| | | | | | | | | | | | | | | | | | Add rk817 charger support cell to rk808 mfd driver. Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Signed-off-by: Maya Matuszczyk <maccraft123mc@gmail.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220808173809.11320-3-macroalpha82@gmail.com
| * mfd: intel_soc_pmic_crc: Update the copyright yearAndy Shevchenko2022-09-281-1/+1
| | | | | | | | | | | | | | | | | | Update the copyright year to be 2012-2014, 2022. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220801114211.36267-10-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_crc: Replace intel_soc_pmic with crystal_coveAndy Shevchenko2022-09-281-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To reflect the point that this driver is only for one type of the PMICs, replace intel_soc_pmic with crystal_cove (avoid using crc for possible namespace collisions with CRC library APIs). Note, also rename the driver name since we don't expect any user that enumerates by it, only ACPI known so far. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220801114211.36267-9-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_crc: Convert driver to use ->probe_new()Andy Shevchenko2022-09-281-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | Use the ->probe_new() callback. The driver does not use const struct i2c_device_id * argument, so convert it to utilise the simplified I²C driver registration. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220801114211.36267-8-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_crc: Drop redundant ACPI_PTR() and ifdefferyAndy Shevchenko2022-09-282-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The driver depends on ACPI, ACPI_PTR() resolution is always the same. Otherwise a compiler may produce a warning. That said, the rule of thumb either ugly ifdeffery with ACPI_PTR or none should be used in a driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220801114211.36267-7-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to ↵Andy Shevchenko2022-09-281-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | pm_sleep_ptr() etc Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220801114211.36267-6-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata()Andy Shevchenko2022-09-281-2/+2
| | | | | | | | | | | | | | | | | | | | We have the specific helpers for I2C device to set and get its driver data. Convert driver to use them instead of open coded variants. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220801114211.36267-5-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip()Andy Shevchenko2022-09-281-15/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use devm_regmap_add_irq_chip() to simplify the code. While at it, replace -1 magic parameter by PLATFORM_DEVID_NONE when calling mfd_add_devices(). Note, the mfd_add_devices() left in non-devm variant here due to potentially increased churn while wrapping pwm_remove_table(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220801114211.36267-4-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic: Move non-Intel Makefile entries to their own groupAndy Shevchenko2022-09-281-3/+4
| | | | | | | | | | | | | | | | | | | | It looks like a random position for couple of Makefile entries that are disrupting Intel PMIC group. Move them to their own group. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220801114211.36267-3-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_crc: Merge Intel PMIC core to crcAndy Shevchenko2022-09-284-194/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The core part is misleading since its only purpose to serve Crystal Cove PMIC, although for couple of different platforms. Merge core part into crc one. Advantages among others are: - speed up a compilation and build - decreasing the code base - reducing noise in the namespace by making some data static and const Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220801114211.36267-2-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe()Christophe JAILLET2022-09-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit in Fixes: has added a pwm_add_table() call in the probe() and a pwm_remove_table() call in the remove(), but forget to update the error handling path of the probe. Add the missing pwm_remove_table() call. Fixes: a3aa9a93df9f ("mfd: intel_soc_pmic_core: ADD PWM lookup table for CRC PMIC based PWM") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220801114211.36267-1-andriy.shevchenko@linux.intel.com
| * mfd: stmpe: Probe sub-function by compatibleFrancesco Dolcini2022-09-281-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use sub-function of_compatible during probe, instead of using the node name. The code should not rely on the node names during probe, in addition to that the previously hard-coded node names are not compliant to the latest naming convention (they are not generic and they use underscores), and it was broken by mistake already once [1]. [1] commit 56086b5e804f ("ARM: dts: imx6qdl-apalis: Avoid underscore in node name") Suggested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220712163345.445811-3-francesco.dolcini@toradex.com
| * mfd: stmpe: Remove rotator block from probeFrancesco Dolcini2022-09-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove rotator block from probe, it is not used in any device tree file, there is no related cell defined, it's just dead non-working code with no of_compatible for it. This is a preliminary change to allow probing by of_compatible and not by a fixed name. Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220712163345.445811-2-francesco.dolcini@toradex.com
| * mfd: intel-lpss: Provide an SSP type to the SPI driverAndy Shevchenko2022-09-281-46/+95
| | | | | | | | | | | | | | | | | | | | The SPI driver wants to know the exact type of the controller. Provide this information to it. This is a complementary part to the previously updated intel-lpss-acpi.c. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220702211903.9093-1-andriy.shevchenko@linux.intel.com
* | Merge tag 'i2c-for-6.1-rc1' of ↵Linus Torvalds2022-10-0446-127/+46
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: - 'remove' callback converted to return void. Big change with trivial fixes all over the tree. Other subsystems depending on this change have been asked to pull an immutable topic branch for this. - new driver for Microchip PCI1xxxx switch - heavy refactoring of the Mellanox BlueField driver - we prefer async probe in the i801 driver now - the rest is usual driver updates (support for more SoCs, some refactoring, some feature additions) * tag 'i2c-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (37 commits) i2c: pci1xxxx: prevent signed integer overflow i2c: acpi: Replace zero-length array with DECLARE_FLEX_ARRAY() helper i2c: i801: Prefer async probe i2c: designware-pci: Use standard pattern for memory allocation i2c: designware-pci: Group AMD NAVI quirk parts together i2c: microchip: pci1xxxx: Add driver for I2C host controller in multifunction endpoint of pci1xxxx switch docs: i2c: slave-interface: return errno when handle I2C_SLAVE_WRITE_REQUESTED i2c: mlxbf: remove device tree support i2c: mlxbf: support BlueField-3 SoC i2c: cadence: Add standard bus recovery support i2c: mlxbf: add multi slave functionality i2c: mlxbf: support lock mechanism macintosh/ams: Adapt declaration of ams_i2c_remove() to earlier change i2c: riic: Use devm_platform_ioremap_resource() i2c: mlxbf: remove IRQF_ONESHOT dt-bindings: i2c: rockchip: add rockchip,rk3128-i2c dt-bindings: i2c: renesas,rcar-i2c: Add r8a779g0 support i2c: tegra: Add GPCDMA support i2c: scmi: Convert to be a platform driver i2c: rk3x: Add rv1126 support ...
| * i2c: Make remove callback return voidUwe Kleine-König2022-08-1646-127/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The value returned by an i2c driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero that the error is ignored.) So change the prototype of the remove function to return no value. This way driver authors are not tempted to assume that passing an error to the upper layer is a good idea. All drivers are adapted accordingly. There is no intended change of behaviour, all callbacks were prepared to return 0 before. Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com> Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au> Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Crt Mori <cmo@melexis.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Marek Behún <kabel@kernel.org> # for leds-turris-omnia Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxsw Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for surface3_power Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> # for bmc150-accel-i2c + kxcjk-1013 Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> # for media/* + staging/media/* Acked-by: Miguel Ojeda <ojeda@kernel.org> # for auxdisplay/ht16k33 + auxdisplay/lcd2s Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for versaclock5 Reviewed-by: Ajay Gupta <ajayg@nvidia.com> # for ucsi_ccg Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # for iio Acked-by: Peter Rosin <peda@axentia.se> # for i2c-mux-*, max9860 Acked-by: Adrien Grassein <adrien.grassein@gmail.com> # for lontium-lt8912b Reviewed-by: Jean Delvare <jdelvare@suse.de> # for hwmon, i2c-core and i2c/muxes Acked-by: Corey Minyard <cminyard@mvista.com> # for IPMI Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for drivers/power Acked-by: Krzysztof Hałasa <khalasa@piap.pl> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@kernel.org>
* | mfd: ocelot: Add support for the vsc7512 chip via spiColin Foster2022-09-095-0/+533
|/ | | | | | | | | | | | | | | The VSC7512 is a networking chip that contains several peripherals. Many of these peripherals are currently supported by the VSC7513 and VSC7514 chips, but those run on an internal CPU. The VSC7512 lacks this CPU, and must be controlled externally. Utilize the existing drivers by referencing the chip as an MFD. Add support for the two MDIO buses, the internal phys, pinctrl, and serial GPIO. Signed-off-by: Colin Foster <colin.foster@in-advantage.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20220905162132.2943088-9-colin.foster@in-advantage.com
* Merge tag 'mfd-next-5.20' of ↵Linus Torvalds2022-08-0619-521/+280
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Framework: - Change maintainer email address - Use acpi_dev_for_each_child() helper to walk the ACPI list New Device Support: - BCM2711 RPiVid ASB in Broadcom BCM2835 - MT8195 dual-core RISC-V MCU in Chrome OS Embedded Controller - Regulator, RTC and Keys in MediaTek MT6357 PMIC - GPIO in X-Powers AXP20x PMIC - MT6331 and MT6332 in MediaTek MT6357 PMIC - Intel Meteor Lake-P PCI in Intel LPSS PCI New Functionality: - Add support for non-ACPI platforms; lpc_ich Fix-ups: - Use platform data instead of hard-coded values; bcm2835-pm - Make use of BIT/GENMASK macros; intel_soc_pmic_bxtwc - Use dev_err_probe() helper; intel_soc_pmic_chtwc, intel_soc_pmic_bxtwc - Use provided generic APIs / helpers; lpc_ich - Clean-up .remove() return values; asic3, t7l66xb, tc6387xb, tc6393xb - Use correct formatting specifiers; syscon - Replace sprintf() with sysfs_emit(); intel_soc_pmic_bxtwc - Automatically detect and fill USB endpoint pointers; dln2 - Use more appropriate dev/platform/spi resources APIs; intel_soc_pmic_bxtwc - Make use of pm_sleep_ptr(); intel_soc_pmic_chtwc, intel_soc_pmic_bxtwc - Improve error handling; intel_soc_pmic_bxtwc - Use core driver API to create groups; intel_soc_pmic_bxtwc - Kconfig fix-ups; MFD_SUN6I_PRCM - Admin: whitespace/email addresses/etc; max77714, db8500-prcmu, ipaq-micro, intel_soc_pmic_bxtwc - Remove duplicate/unused code/functionality; lpc_ich, twl-core, qcom-pm8008, intel_soc_pmic_bxtwc - DT fix-ups / conversions; da9063, ti,j721e-system-controller, st,stm32-timers, mt6397, qcom,tcsr, mps,mp2629, qcom-pm8xxx, fsl,imx8qxp-csr Bug Fixes: - Fix of_node reference leak; max77620" * tag 'mfd-next-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (49 commits) dt-bindings: mfd: stm32-timers: Move fixed string node names under 'properties' dt-bindings: mfd: st,stm32-timers: Correct 'resets' property name dt-bindings: mfd: syscon: Update Lee Jones' email address MAINTAINERS: Use Lee Jones' kernel.org address for Syscon submissions MAINTAINERS: Use Lee Jones' kernel.org address for MFD submissions mfd: sun6i-prcm: Update Kconfig description mfd: intel_soc_pmic_bxtwc: Fix spelling in the comment mfd: intel_soc_pmic_bxtwc: Drop unneeded casting mfd: intel_soc_pmic_bxtwc: Use sysfs_emit() instead of sprintf() mfd: intel_soc_pmic_bxtwc: Use bits.h macros for all masks mfd: intel_soc_pmic_bxtwc: Drop redundant ACPI_PTR() mfd: intel_soc_pmic_bxtwc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc mfd: intel_soc_pmic_bxtwc: Extend use of temporary variable for struct device mfd: intel_soc_pmic_bxtwc: Use dev_err_probe() mfd: intel_soc_pmic_bxtwc: Convert to use platform_get/set_drvdata() mfd: intel_soc_pmic_bxtwc: Create sysfs attributes using core driver's facility mfd: intel_soc_pmic_bxtwc: Don't shadow error codes in show()/store() mfd: intel-lpss: Add Intel Meteor Lake-P PCI IDs mfd: mt6397: Add basic support for MT6331+MT6332 PMIC mfd: axp20x: Add AXP221/AXP223/AXP809 GPIO cells ...
| * mfd: sun6i-prcm: Update Kconfig descriptionSamuel Holland2022-07-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | This driver is used by a specific range of SoCs between when the PRCM hardware was introduced (A31) and when the PRCM CCU driver was added (A83T). It is unlikely to be extended to additional hardware. Update the description to include the full list of applicable SoCs. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220702184044.51144-1-samuel@sholland.org
| * mfd: intel_soc_pmic_bxtwc: Fix spelling in the commentAndy Shevchenko2022-07-191-5/+5
| | | | | | | | | | | | | | | | | | | | There are a few of spelling issues in the comment, fix them. While at it, fix indentation in the MODULE_AUTHOR() parameter and update copyright years. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220628221747.33956-11-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_bxtwc: Drop unneeded castingAndy Shevchenko2022-07-191-1/+1
| | | | | | | | | | | | | | | | | | The casting from size_t to ssize_t is not needed in addr_store(), drop it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220628221747.33956-10-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_bxtwc: Use sysfs_emit() instead of sprintf()Andy Shevchenko2022-07-191-2/+2
| | | | | | | | | | | | | | | | | | | | sysfs_emit() is preferred over sprintf() when formatting the value to be returned to user space in show() functions, because it knows about sysfs buffer specifics and has sanity checks. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220628221747.33956-9-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_bxtwc: Use bits.h macros for all masksAndy Shevchenko2022-07-191-10/+11
| | | | | | | | | | | | | | | | | | Currently we are using BIT(), but GENMASK(). Make use of the latter one as well (far less error-prone, far more concise). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220628221747.33956-8-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_bxtwc: Drop redundant ACPI_PTR()Andy Shevchenko2022-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The driver depends on ACPI (via MFD_INTEL_PMC_BXT), ACPI_PTR() resolution is always the same. Otherwise a compiler may produce a warning. That said, the rule of thumb either ugly ifdeffery with ACPI_PTR or none should be used in a driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220628221747.33956-7-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_bxtwc: Switch from CONFIG_PM_SLEEP guards to ↵Andy Shevchenko2022-07-191-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | pm_sleep_ptr() etc Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220628221747.33956-6-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_bxtwc: Extend use of temporary variable for struct deviceAndy Shevchenko2022-07-191-11/+8
| | | | | | | | | | | | | | | | Extend use of temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220628221747.33956-5-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_bxtwc: Use dev_err_probe()Andy Shevchenko2022-07-191-60/+26
| | | | | | | | | | | | | | | | Simplify the mux error path a bit by using dev_err_probe(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220628221747.33956-4-andriy.shevchenko@linux.intel.com
| * mfd: intel_soc_pmic_bxtwc: Convert to use platform_get/set_drvdata()Andy Shevchenko2022-07-191-2/+2
| | | | | | | | | | | | | | | | | | | | We have the specific helpers for platform device to set and get its driver data. Convert driver to use them instead of open coded variants. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220628221747.33956-3-andriy.shevchenko@linux.intel.com