summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'mfd-next-6.5' of ↵Linus Torvalds2023-07-03113-172/+678
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Drivers: - Add support for TI TPS6594/TPS6593/LP8764 PMICs - Add support for Samsung RT5033 Battery Charger - Add support for Analog Devices MAX77540 and MAX77541 PMICs New Device Support: - Add support for SPI to Rockchip RK808 (and friends) - Add support for AXP192 PMIC to X-Powers AXP20X - Add support for AXP313a PMIC to X-Powers AXP20X - Add support for RK806 to Rockchip RK8XX Removed Device Support: - Removed MFD support for Richtek RT5033 Battery Fix-ups: - Remove superfluous code - Switch I2C drivers from .probe_new() to .probe() - Convert over to managed resources (devm_*(), etc) - Use dev_err_probe() for returning errors from .probe() - Add lots of Device Tree bindings / support - Improve cache efficiency by switching to Maple - Use own exported namespaces (NS) - Include missing and remove superfluous headers - Start using / convert to the new shutdown sys-off API - Trivial: variable / define renaming - Make use of of_property_read_reg() when requesting DT 'reg's Bug Fixes: - Fix chip revision readout due to incorrect data masking - Amend incorrect register and mask values used for charger state - Hide unused functionality at compile time - Fix resource leaks following error handling routines - Return correct error values and fix error handling in general - Repair incorrect device names - used for device matching - Remedy broken module auto-loading" * tag 'mfd-next-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (51 commits) dt-bindings: mfd: max77541: Add ADI MAX77541/MAX77540 iio: adc: max77541: Add ADI MAX77541 ADC Support regulator: max77541: Add ADI MAX77541/MAX77540 Regulator Support dt-bindings: regulator: max77541: Add ADI MAX77541/MAX77540 Regulator mfd: Switch two more drivers back to use struct i2c_driver::probe dt-bindings: mfd: samsung,s5m8767: Simplify excluding properties mfd: stmpe: Only disable the regulators if they are enabled mfd: max77541: Add ADI MAX77541/MAX77540 PMIC Support dt-bindings: mfd: gateworks-gsc: Remove unnecessary fan-controller nodes mfd: core: Use of_property_read_reg() to parse "reg" mfd: stmfx: Nullify stmfx->vdd in case of error mfd: stmfx: Fix error path in stmfx_chip_init mfd: intel-lpss: Add missing check for platform_get_resource mfd: stpmic1: Add PMIC poweroff via sys-off handler mfd: stpmic1: Fixup main control register and bits naming dt-bindings: mfd: qcom,tcsr: Add the compatible for IPQ8074 mfd: tps65219: Add support for soft shutdown via sys-off API mfd: pm8008: Drop bogus i2c module alias mfd: pm8008: Fix module autoloading mfd: tps65219: Add GPIO cell instance ...
| * mfd: Switch two more drivers back to use struct i2c_driver::probeUwe Kleine-König2023-06-262-2/+2
| | | | | | | | | | | | | | | | | | struct i2c_driver::probe_new is about to go away. Switch the driver to use the probe callback with the same prototype. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230626091941.557733-1-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: stmpe: Only disable the regulators if they are enabledChristophe JAILLET2023-06-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In stmpe_probe(), if some regulator_enable() calls fail, probing continues and there is only a dev_warn(). So, if stmpe_probe() is called the regulator may not be enabled. It is cleaner to test it before calling regulator_disable() in the remove function. Fixes: 9c9e321455fb ("mfd: stmpe: add optional regulators") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/8de3aaf297931d655b9ad6aed548f4de8b85425a.1686998575.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: max77541: Add ADI MAX77541/MAX77540 PMIC SupportOkan Sahin2023-06-213-0/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFD driver for MAX77541/MAX77540 to enable its sub devices. The MAX77541 is a multi-function devices. It includes buck converter and ADC. The MAX77540 is a high-efficiency buck converter with two 3A switching phases. They have same regmap except for ADC part of MAX77541. Signed-off-by: Okan Sahin <okan.sahin@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230412111256.40013-6-okan.sahin@analog.com Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: core: Use of_property_read_reg() to parse "reg"Rob Herring2023-06-151-5/+1
| | | | | | | | | | | | | | | | | | Use the recently added of_property_read_reg() helper to get the untranslated "reg" address value. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230609183159.1766429-1-robh@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: stmfx: Nullify stmfx->vdd in case of errorAmelie Delaunay2023-06-151-3/+2
| | | | | | | | | | | | | | | | | | | | | | Nullify stmfx->vdd in case devm_regulator_get_optional() returns an error. And simplify code by returning an error only if return code is not -ENODEV, which means there is no vdd regulator and it is not an issue. Fixes: d75846ed08e6 ("mfd: stmfx: Fix dev_err_probe() call in stmfx_chip_init()") Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com> Link: https://lore.kernel.org/r/20230609092804.793100-2-amelie.delaunay@foss.st.com Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: stmfx: Fix error path in stmfx_chip_initAmelie Delaunay2023-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | In error path, disable vdd regulator if it exists, but don't overload ret. Because if regulator_disable() is successful, stmfx_chip_init will exit successfully while chip init failed. Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver") Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com> Link: https://lore.kernel.org/r/20230609092804.793100-1-amelie.delaunay@foss.st.com Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: intel-lpss: Add missing check for platform_get_resourceJiasheng Jiang2023-06-151-0/+3
| | | | | | | | | | | | | | | | | | | | Add the missing check for platform_get_resource and return error if it fails. Fixes: 4b45efe85263 ("mfd: Add support for Intel Sunrisepoint LPSS devices") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230609014818.28475-1-jiasheng@iscas.ac.cn
| * mfd: stpmic1: Add PMIC poweroff via sys-off handlerSean Nyekjaer2023-06-151-0/+21
| | | | | | | | | | | | | | | | | | | | Use devm_register_sys_off_handler() that allows to register multiple power-off handlers. This will allow boards using the stpmic1 to power-off. Signed-off-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230602062426.3947116-2-sean@geanix.com
| * mfd: stpmic1: Fixup main control register and bits namingSean Nyekjaer2023-06-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | Fixup main control register and bits naming so the match the naming from the datasheet. https://www.st.com/resource/en/datasheet/stpmic1.pdf Signed-off-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230602062426.3947116-1-sean@geanix.com
| * mfd: tps65219: Add support for soft shutdown via sys-off APIJerome Neanne2023-06-151-10/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use new API for power-off mode support: Link: https://lwn.net/Articles/894511/ Link: https://lore.kernel.org/all/7hfseqa7l0.fsf@baylibre.com/ sys-off API allows support of shutdown handler and restart handler. Shutdown was not supported before that enhancement. This is required for platform that are not using PSCI. Test: - restart: # reboot Default is cold reset: # cat /sys/kernel/reboot/mode Switch boot mode to warm reset: # echo warm > /sys/kernel/reboot/mode - power-off: # halt Tested on AM62-LP-SK board. Signed-off-by: Jerome Neanne <jneanne@baylibre.com> Suggested-by: Andrew Davis <afd@ti.com> Reviewed-by: Andrew Davis <afd@ti.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230608071947.3467751-1-jneanne@baylibre.com
| * mfd: pm8008: Drop bogus i2c module aliasJohan Hovold2023-06-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to commit af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF") drivers using OF matching needed an i2c module alias such as "i2c:pm8008" for module autoloading to work. Drop the bogus i2c alias from the pm8008 driver which was merged long after i2c core was fixed and whose alias did not match the driver name ("pm8008") to begin with. Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230526091646.17318-3-johan+linaro@kernel.org
| * mfd: pm8008: Fix module autoloadingJohan Hovold2023-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add the missing module device table alias to that the driver can be autoloaded when built as a module. Cc: stable@vger.kernel.org # 5.14 Fixes: 6b149f3310a4 ("mfd: pm8008: Add driver for QCOM PM8008 PMIC") Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230526091646.17318-2-johan+linaro@kernel.org
| * mfd: tps65219: Add GPIO cell instanceJerome Neanne2023-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TPS65219 PMIC GPIOs are exposed in a standard way: gpiodetect gpiochip0 [tps65219-gpio] (3 lines) tps65219-gpios is incorrect cell name (plural). Changed to tps65219-gpio (singular) Co-developed-by: Jonathan Cormier <jcormier@criticallink.com> Signed-off-by: Jonathan Cormier <jcormier@criticallink.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jerome Neanne <jneanne@baylibre.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230511-tps65219-add-gpio-support-v5-2-ebb94281c854@baylibre.com
| * mfd: tps6594: Fix an error code in probe()Dan Carpenter2023-06-152-2/+2
| | | | | | | | | | | | | | | | | | | | These error paths accidentally return success when they should return -EINVAL. Fixes: 325bec7157b3 ("mfd: tps6594: Add driver for TI TPS6594 PMIC") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/49f7cd8f-f7eb-40f1-91e8-291620c684df@kili.mountain Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: wcd934x: Simplify with dev_err_probe()Christophe JAILLET2023-06-151-12/+7
| | | | | | | | | | | | | | | | | | | | Use dev_err_probe() to simplify code, save a few LoC and be consistent with error codes handling in messages. It also filters -EPROBE_DEFER that can be returned by devm_clk_get(). Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/73fdc6ecf619f80fad126abca11fb579d3d87f64.1684565021.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: wcd934x: Fix an error handling path in wcd934x_slim_probe()Christophe JAILLET2023-06-151-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | If devm_gpiod_get_optional() fails, some resources need to be released, as already done in the .remove() function. While at it, remove the unneeded error code from a dev_err_probe() call. It is already added in a human readable way by dev_err_probe() itself. Fixes: 6a0ee2a61a31 ("mfd: wcd934x: Replace legacy gpio interface for gpiod") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/02d8447f6d1df52cc8357aae698152e9a9be67c6.1684565021.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: intel-lpss: Hide suspend/resume functions in #ifdefArnd Bergmann2023-06-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_PM is disabled, the prototypes for these two functions are not visible: drivers/mfd/intel-lpss.c:482:5: error: no previous prototype for 'intel_lpss_suspend' [-Werror=missing-prototypes] 482 | int intel_lpss_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~ drivers/mfd/intel-lpss.c:503:5: error: no previous prototype for 'intel_lpss_resume' [-Werror=missing-prototypes] 503 | int intel_lpss_resume(struct device *dev) Add the same #ifdef around the definition of the unused functions, which avoids the warning and slightly reduces the code size. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20230516202746.561111-1-arnd@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: axp20x: Add support for AXP192Aidan MacDonald2023-06-152-0/+143
| | | | | | | | | | | | | | | | | | The AXP192 PMIC is similar to the AXP202/AXP209, but with different regulators, additional GPIOs, and a different IRQ register layout. Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Link: https://lore.kernel.org/r/20230511092609.76183-1-aidanmacdonald.0x0@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: Switch i2c drivers back to use .probe()Uwe Kleine-König2023-06-1595-95/+95
| | | | | | | | | | | | | | | | | | | | | | | | After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type"), all drivers being converted to .probe_new() and then 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert back to (the new) .probe() to be able to eventually drop .probe_new() from struct i2c_driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230515182752.10050-1-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones <lee@kernel.org>
| * mfd: Remove redundant dev_set_drvdata() from I2C driversGuiting Shen2023-06-158-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | the i2c_set_clientdata() is the inline function which is complemented by the dev_set_drvdata() internally. Do not need to use i2c_set_clientdata() and dev_set_drvdata() at the same time. Signed-off-by: Guiting Shen <aarongt.shen@gmail.com> Reviewed-by: Johan Hovold <johan@kernel.org> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230425024526.6443-1-aarongt.shen@gmail.com
| * mfd: dln2: Remove the unneeded include <linux/i2c.h>Christophe JAILLET2023-06-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | This driver does not use i2c, so there is no point in including <linux/i2c.h> Remove it. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/baf28e7f0fb57e918b76eaa92b94a2ae1a02cce0.1682318879.git.christophe.jaillet@wanadoo.fr
| * mfd: rc5t583-irq: Remove the unneeded include <linux/i2c.h>Christophe JAILLET2023-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This driver does not use i2c, so there is no point in including <linux/i2c.h> Remove it and add the needed <linux/device.h> instead, which is much more lightweight. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/128025bf5b81f5424db2202b0c8cfd9722c28aab.1682319383.git.christophe.jaillet@wanadoo.fr
| * mfd: wm831x: Use maple tree register cacheMark Brown2023-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regmap has introduced a maple tree based register cache which makes use of this more advanced data structure which has been added to the kernel recently. Maple trees are much flatter than rbtrees, meaning that they do not grow to such depths when the register map is sparse which makes access a bit more efficient. The maple tree cache type is still a bit of a work in progress but should be effective for some devices already. The wm831x devices have a pretty sparse register map and being always on devices never do cache syncs so don't hit the major current disadvantage so they should be good candiates for using the maple tree cache. Update to do so, there should be little if any visible difference at runtime. Signed-off-by: Mark Brown <broonie@kernel.org> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230419-mfd-wm831x-maple-v1-1-e03e39d7bb0b@kernel.org
| * mfd: intel-m10-bmc: Manage access to MAX 10 fw handshake registersIlpo Järvinen2023-06-152-2/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some MAX 10 cards, the BMC firmware is not available to service handshake registers during secure update erase and write phases at normal speeds. This problem affects at least hwmon driver. When the MAX 10 hwmon driver tries to read the sensor values during a secure update, the reads are slowed down (e.g., reading all D5005 sensors takes ~24s which is magnitudes worse than the normal <0.02s). Manage access to the handshake registers using a rw semaphore and a FW state variable to prevent accesses during those secure update phases and return -EBUSY instead. If handshake_sys_reg_nranges == 0, don't update bwcfw_state as it is not used. This avoids the locking cost. Co-developed-by: Russ Weight <russell.h.weight@intel.com> Signed-off-by: Russ Weight <russell.h.weight@intel.com> Co-developed-by: Xu Yilun <yilun.xu@intel.com> Signed-off-by: Xu Yilun <yilun.xu@intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230417092653.16487-5-ilpo.jarvinen@linux.intel.com
| * mfd: intel-m10-bmc: Move m10bmc_sys_read() away from headerIlpo Järvinen2023-06-151-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move m10bmc_sys_read() out from the header to prepare it for adding more code into the function which would make it too large to be a static inline any more. While at it, replace the vague wording in function comment with more precise statements. Reviewed-by: Russ Weight <russell.h.weight@intel.com> Acked-by: Guenter Roeck <linux@roeck-us.net> # For hwmon Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Xu Yilun <yilun.xu@intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230417092653.16487-4-ilpo.jarvinen@linux.intel.com
| * mfd: intel-m10-bmc: Create m10bmc_sys_update_bits()Ilpo Järvinen2023-06-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Wrap regmap_update_bits() with m10bmc_sys_update_bits() in order to be able to add additional checks into it. Co-developed-by: Russ Weight <russell.h.weight@intel.com> Signed-off-by: Russ Weight <russell.h.weight@intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Xu Yilun <yilun.xu@intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230417092653.16487-3-ilpo.jarvinen@linux.intel.com
| * mfd: intel-m10-bmc: Move core symbols to own namespaceIlpo Järvinen2023-06-153-2/+4
| | | | | | | | | | | | | | | | | | | | | | Create INTEL_M10_BMC_CORE namespace for symbols exported by intel-m10-bmc-core. Reviewed-by: Russ Weight <russell.h.weight@intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Xu Yilun <yilun.xu@intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230417092653.16487-2-ilpo.jarvinen@linux.intel.com
| *-----. Merge branches 'tb-mfd-clk-input-pinctrl-power-rtc-sound-6.5', ↵Lee Jones2023-06-1510-18/+964
| |\ \ \ \ | | | | | | | | | | | | | | | | | | 'ib-mfd-tps6594-core-6.5', 'ib-mfd-regulator-max5970-6.5', 'ib-mfd-regulator-6.5' and 'ib-mfd-power-6.5' into ibs-for-mfd-merged
| | | | | * mfd: twl6040: Use maple tree register cacheMark Brown2023-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The twl6040 is only capable of performing single register read and write operations which means it gains no advantage from using a rbtree register cache, convert it to using the more modern maple tree register cache instead. This should be more efficient. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230609-mfd-twl6040-maple-v1-1-3493d051cd6f@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
| | | | | * mfd: rt5033: Fix chip revision readoutJakob Hauser2023-06-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After reading the data from the DEVICE_ID register, mask 0x0f needs to be applied to extract the revision of the chip [1]. The other part of the DEVICE_ID register, mask 0xf0, is a vendor identification code. That's how it is set up at similar products of Richtek, e.g. RT9455 [2] page 21 top. [1] https://github.com/msm8916-mainline/linux-downstream/blob/GT-I9195I/drivers/mfd/rt5033_core.c#L484 [2] https://www.richtek.com/assets/product_file/RT9455/DS9455-00.pdf Signed-off-by: Jakob Hauser <jahau@rocketmail.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/9a98521ffdf76851d5d344afa6ce65f692ecc024.1684182964.git.jahau@rocketmail.com
| | | | | * mfd: rt5033: Drop rt5033-battery sub-deviceStephan Gerhold2023-06-081-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fuel gauge in the RT5033 PMIC (rt5033-battery) has its own I2C bus and interrupt lines. Therefore, it is not part of the MFD device and needs to be specified separately in the device tree. Fixes: 0b271258544b ("mfd: rt5033: Add Richtek RT5033 driver core.") Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Signed-off-by: Jakob Hauser <jahau@rocketmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/6a8a19bc67b5be3732882e8131ad2ffcb546ac03.1684182964.git.jahau@rocketmail.com
| | | * | | mfd: max5970: Rename driver and remove wildcardNaresh Solanki2023-06-022-11/+11
| | | | |/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous version of this driver included wildcards in file names and descriptions. This patch renames the driver to only support MAX5970 and MAX5978, which are the only chips that the driver actually supports. Signed-off-by: Naresh Solanki <Naresh.Solanki@9elements.com> Link: https://lore.kernel.org/r/20230427113046.3971425-1-Naresh.Solanki@9elements.com Signed-off-by: Lee Jones <lee@kernel.org>
* | | | | Merge tag 'gpio-updates-for-v6.5' of ↵Linus Torvalds2023-06-291-9/+5
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio updates from Bartosz Golaszewski: "We have two new drivers, some improvements to the core code, lots of different updates to existing GPIO drivers and some dt-bindings on top. There's nothing controversial in here and almost everything has been in next for more than a week (95% a lot longer than this). The only thing that has spent less time in next is a new driver so no risk of regressions. The single merge pulls in changes that remove all usage of global GPIO numbers from arch/arm/mach-omap. Core GPIO library: - remove unused symbols - don't spam the kernel log with messages about hogs - remove old sysfs API cruft - improve handling of GPIO masks New drivers: - add a driver for the BlueField-3 GPIO controller - add GPIO support for the TPS65219 PMIC Driver improvements: - extend the gpio-aggregator driver to support ramp-up/ramp-down delay - remove unnecessary CONFIG_OF guards from gpio-aggregator - readability improvements in gpio-tangier - switch i2c drivers back to using probe() now that it's been converted in the i2c subsystem to not taking the id parameter - remove unused inclusions of of_gpio.h in several drivers - make pm ops static in gpio-davinci and fix a comment - use more devres in drivers to shrink and simplify the code - add missing include in gpio-sa1100 - add HAS_IOPORT KConfig dependency where needed - add permissions checks before accessing pins in gpio-tegra186 - convert the gpio-zynq driver to using immutable irqchips - preserve output settings set by the bootloader in gpio-mpc8xxx Selftests: - tweak the variable naming in script tests Device tree updates: - convert gpio-mmio and gpio-stmpe to YAML - add parsing of GPIO hogs to gpio-vf610 - add bindings for the Cirrus EP93xx GPIO controller - add gpio-line-names property to the gpio-pca9570 bindings - extend the binding for x-powers,axp209 with another block" * tag 'gpio-updates-for-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (58 commits) of: unittest: drop assertions for GPIO hog messages gpiolib: Drop unused domain_ops memeber of GPIO IRQ chip gpio: synq: remove unused zynq_gpio_irq_reqres/zynq_gpio_irq_relres dt-bindings: gpio: gpio-vf610: Add parsing of hogs gpio: lpc18xx: Remove unused of_gpio.h inclusion gpio: xra1403: Remove unused of_gpio.h inclusion gpio: mpc8xxx: Remove unused of_gpio.h inclusion dt-bindings: gpio: Add Cirrus EP93xx gpio: mpc8xxx: latch GPIOs state on module load when configured as output selftests: gpio: gpio-sim: Use same variable name for sysfs pathname gpio: mlxbf3: Add gpio driver support gpio: delay: Remove duplicative functionality gpio: aggregator: Set up a parser of delay line parameters gpio: aggregator: Support delay for setting up individual GPIOs gpio: aggregator: Remove CONFIG_OF and of_match_ptr() protections dt-bindings: gpio: pca9570: add gpio-line-names property gpiolib: remove unused gpio_cansleep() gpio: tps65219: add GPIO support for TPS65219 PMIC gpio: zynq: fix zynqmp_gpio not an immutable chip warning gpio: davinci: make davinci_gpio_dev_pm_ops static ...
| * | | | | ARM/mfd/gpio: Fixup TPS65010 regression on OMAP1 OSK1Linus Walleij2023-05-241-9/+5
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Aaro reports problems on the OSK1 board after we altered the dynamic base for GPIO allocations. It appears this happens because the OMAP driver now allocates GPIO numbers dynamically, so all that is references by number is a bit up in the air. Let's bite the bullet and try to just move the gpio_chip in the tps65010 MFD driver over to using dynamic allocations. Alter everything in the OSK1 board file to use a GPIO descriptor table and lookups. Utilize the NULL device to define some board-specific GPIO lookups and use these to immediately look up the same GPIOs, convert to IRQ numbers and pass as resources to the devices. This is ugly but should work. The .setup() callback for tps65010 was used for some GPIO hogging, but since the OSK1 is the only user in the entire kernel we can alter the signatures to something that is helpful and make a clean transition. Fixes: 92bf78b33b0b ("gpio: omap: use dynamic allocation of base") Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: andy.shevchenko@gmail.com Cc: Andreas Kemnade <andreas@kemnade.info> Acked-by: Lee Jones <lee@kernel.org> Reviewed-by: Lee Jones <lee@kernel.org> Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* | | | | TI TPS6594 PMIC support (RTC, pinctrl, regulators)Mark Brown2023-06-075-0/+870
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Esteban Blanc <eblanc@baylibre.com>: TPS6594 is a Power Management IC which provides regulators and others features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and PFSM (Pre-configurable Finite State Machine). The SoC and the PMIC can communicate through the I2C or SPI interfaces. TPS6594 is the super-set device while TPS6593 and LP8764 are derivatives. This series adds support to TI TPS6594 PMIC and its derivatives.
| * | | | mfd: tps6594: Add driver for TI TPS6594 PMICJulien Panis2023-05-185-0/+870
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for TPS6594 PMIC MFD core. It provides communication through the I2C and SPI interfaces, and supports protocols with embedded CRC data fields for safety applications. Signed-off-by: Julien Panis <jpanis@baylibre.com> Link: https://lore.kernel.org/r/20230511095126.105104-3-jpanis@baylibre.com Signed-off-by: Lee Jones <lee@kernel.org>
* | | | regulator: Add X-Powers AXP15060/AXP313a PMICMark Brown2023-06-062-1/+79
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Andre Przywara <andre.przywara@arm.com>: This patch series adds support for the X-Powers AXP15060 and AXP313a PMIC, which are general purpose PMICs as seen on different boards with different SOCs, mostly from Allwinner. This is mostly a repost of the previous patches, combining both the AXP313a and AXP15060 series, rebased on top of v6.4-rc3, and omitting the patches that already got merged. The first two patches are the successors of the AXP313a v10 post, the third patch is based on Shengyu's AXP15060 v3 post. There were no code changes, just some tiny context differences due to the rebase, plus I added the newly gained tags. As the DT bindings and the AXP15060 MFD part are already in the tree, this is just completing support with the MFD part for the AXP313a, and the regulator support for both PMICs.
| * | mfd: axp20x: Add support for AXP313a PMICMartin Botka2023-05-252-1/+79
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The AXP313a is a PMIC chip produced by X-Powers, it can be connected via an I2C bus. The name AXP1530 seems to appear as well, and this is what is used in the BSP driver. From all we know it's the same chip, just a different name. However we have only seen AXP313a chips in the wild, so go with this name. Compared to the other AXP PMICs it's a rather simple affair: just three DCDC converters, three LDOs, and no battery charging support. Describe the regmap and the MFD bits, along with the registers exposed via I2C. Aside from the various regulators, also describe the power key interrupts, and adjust the shutdown handler routine to use a different register than the other PMICs. Eventually advertise the device using the new compatible string. Signed-off-by: Martin Botka <martin.botka@somainline.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Link: https://lore.kernel.org/r/20230524000012.15028-2-andre.przywara@arm.com Signed-off-by: Lee Jones <lee@kernel.org>
* | mfd: rk8xx: Add rk806 supportSebastian Reichel2023-05-154-3/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | Add support for SPI connected rk806, which is used by the RK3588 evaluation boards. The PMIC is advertised to support I2C and SPI, but the evaluation boards all use SPI. Thus only SPI support is added here. Tested-by: Diederik de Haas <didi.debian@cknow.org> # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll <vincent.legoll@gmail.com> # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20230504173618.142075-9-sebastian.reichel@collabora.com Signed-off-by: Lee Jones <lee@kernel.org>
* | mfd: rk8xx-i2c: Use device_get_match_dataSebastian Reichel2023-05-152-54/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the device identification logic by supplying the relevant information via of_match_data. This also removes the dev_info() printing the chip version, since that's supplied by the match data now. Due to lack of hardware this change is compile-tested only. Tested-by: Diederik de Haas <didi.debian@cknow.org> # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll <vincent.legoll@gmail.com> # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20230504173618.142075-7-sebastian.reichel@collabora.com Signed-off-by: Lee Jones <lee@kernel.org>
* | mfd: rk808: Split into core and i2cSebastian Reichel2023-05-154-176/+243
| | | | | | | | | | | | | | | | | | | | | | | | Split rk808 into a core and an i2c part in preparation for SPI support. Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> # for RTC Tested-by: Diederik de Haas <didi.debian@cknow.org> # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll <vincent.legoll@gmail.com> # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20230504173618.142075-6-sebastian.reichel@collabora.com Signed-off-by: Lee Jones <lee@kernel.org>
* | mfd: rk808: Replace 'struct i2c_client' with 'struct device'Sebastian Reichel2023-05-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Put 'struct device' pointer into the MFD platform_data instead of the 'struct i2c_client' pointer. This simplifies the code and prepares the MFD for SPI support. Tested-by: Diederik de Haas <didi.debian@cknow.org> # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll <vincent.legoll@gmail.com> # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20230504173618.142075-5-sebastian.reichel@collabora.com Signed-off-by: Lee Jones <lee@kernel.org>
* | mfd: rk808: Use dev_err_probeSebastian Reichel2023-05-151-32/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use dev_err_probe instead of dev_err in probe function, which simplifies code a little bit and prints the error code. Also drop possibly incorrect printing of chip id registers while touching the error message. Tested-by: Diederik de Haas <didi.debian@cknow.org> # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll <vincent.legoll@gmail.com> # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20230504173618.142075-4-sebastian.reichel@collabora.com Signed-off-by: Lee Jones <lee@kernel.org>
* | mfd: rk808: Convert to device managed resourcesSebastian Reichel2023-05-151-42/+22
|/ | | | | | | | | | Fully convert the driver to device managed resources. Tested-by: Diederik de Haas <didi.debian@cknow.org> # Rock64, Quartz64 Model A + B Tested-by: Vincent Legoll <vincent.legoll@gmail.com> # Pine64 QuartzPro64 Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20230504173618.142075-3-sebastian.reichel@collabora.com Signed-off-by: Lee Jones <lee@kernel.org>
* Merge tag 'mfd-next-6.4' of ↵Linus Torvalds2023-05-0254-555/+1058
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Drivers: - Add support for Renesas RZ/G2L MTU3 New Device Support: - Add support for Lenovo Yoga Book X90F to Intel CHT WC - Add support for MAX5970 and MAX5978 to Simple MFD (I2C) - Add support for Meteor Lake PCH-S LPSS PCI to Intel LPSS PCI - Add support for AXP15060 PMIC to X-Powers PMIC collection Remove Device Support: - Remove support for Samsung 5M8751 and S5M8763 PMIC devices New Functionality: - Convert deprecated QCOM IRQ Chip to config registers - Add support for 32-bit address spaces to Renesas SMUs Fix-ups: - Make use of APIs / MACROs designed to simplify and demystify - Add / improve Device Tree bindings - Memory saving struct layout optimisations - Remove old / deprecated functionality - Factor out unassigned register addresses from ranges - Trivial: Spelling fixes, renames and coding style fixes - Rid 'defined but not used' warnings - Remove ineffective casts and pointer stubs Bug Fixes: - Fix incorrectly non-inverted mask/unmask IRQs on QCOM platforms - Remove MODULE_*() helpers from non-tristate drivers - Do not attempt to use out-of-range memory addresses associated with io_base - Provide missing export helpers - Fix remap bulk read optimisation fallout - Fix memory leak issues in error paths" * tag 'mfd-next-6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (88 commits) dt-bindings: mfd: ti,j721e-system-controller: Add SoC chip ID leds: bd2606mvv: Driver for the Rohm 6 Channel i2c LED driver dt-bindings: mfd: qcom,spmi-pmic: Document flash LED controller dt-bindings: mfd: x-powers,axp152: Document the AXP15060 variant mfd: axp20x: Add support for AXP15060 PMIC dt-bindings: mfd: x-powers,axp152: Document the AXP313a variant counter: rz-mtu3-cnt: Unlock on error in rz_mtu3_count_ceiling_write() dt-bindings: mfd: dlg,da9063: Document voltage monitoring dt-bindings: mfd: stm32: Remove unnecessary blank lines dt-bindings: mfd: qcom,spmi-pmic: Use generic ADC node name in examples dt-bindings: mfd: syscon: Add nuvoton,ma35d1-sys compatible MAINTAINERS: Add entries for Renesas RZ/G2L MTU3a counter driver counter: Add Renesas RZ/G2L MTU3a counter driver Documentation: ABI: sysfs-bus-counter: add cascade_counts_enable and external_input_phase_clock_select mfd: Add Renesas RZ/G2L MTU3a core driver dt-bindings: timer: Document RZ/G2L MTU3a bindings mfd: rsmu_i2c: Convert to i2c's .probe_new() again mfd: intel-lpss: Add Intel Meteor Lake PCH-S LPSS PCI IDs mfd: dln2: Fix memory leak in dln2_probe() mfd: axp20x: Fix axp288 writable-ranges ...
| * mfd: axp20x: Add support for AXP15060 PMICShengyu Qu2023-04-262-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The AXP15060 is a PMIC chip produced by X-Powers, and could be connected via an I2C bus. Describe the regmap and the MFD bits, along with the registers exposed via I2C. Eventually advertise the device using a new compatible string and add support for power off the system. The driver would disable PEK function if IRQ is not configured in device tree, since some boards (For example, Starfive Visionfive 2) didn't connect IRQ line of PMIC to SOC. GPIO function isn't enabled in this commit, since its configuration operation is different from any existing AXP PMICs and needs logic modification on existing driver. GPIO support might come in later patches. Signed-off-by: Shengyu Qu <wiagn233@outlook.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/TY3P286MB261162D57695AC8164ED50E298609@TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM
| * mfd: Add Renesas RZ/G2L MTU3a core driverBiju Das2023-04-264-0/+549
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RZ/G2L multi-function timer pulse unit 3 (MTU3a) is embedded in the Renesas RZ/G2L family SoCs. It consists of eight 16-bit timer channels and one 32-bit timer channel. It supports the following functions - Counter - Timer - PWM The 8/16/32 bit registers are mixed in each channel. Add MTU3a core driver for RZ/G2L SoC. The core driver shares the clk and channel register access for the other child devices like Counter, PWM and Clock event. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230330111632.169434-3-biju.das.jz@bp.renesas.com
| * mfd: rsmu_i2c: Convert to i2c's .probe_new() againUwe Kleine-König2023-04-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit reapplies commit 601e6d48ee35 ("mfd: rsmu_i2c: Convert to i2c's .probe_new()") which was accidently reverted by commit 1b3b1d6c27cc ("mfd: rsmu: Support 32-bit address space"). Without this change the driver fails to build in combination with commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") which is contained in v6.3-rc2. Fixes: 1b3b1d6c27cc ("mfd: rsmu: Support 32-bit address space") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230331070344.czphnnmvu2ojzo5l@pengutronix.de
| * mfd: intel-lpss: Add Intel Meteor Lake PCH-S LPSS PCI IDsJarkko Nikula2023-04-261-0/+15
| | | | | | | | | | | | | | | | | | Add Intel Meteor Lake PCH-S also called as Meteor Point-S LPSS PCI IDs. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230330132618.4108665-1-jarkko.nikula@linux.intel.com