Commit graph

4972 commits

Author SHA1 Message Date
Alina Yu 72b6a2d650
regulator: rtq2208: Fix invalid memory access when devm_of_regulator_put_matches is called
In this patch, a software bug has been fixed.
rtq2208_ldo_match is no longer a local variable.
It prevents invalid memory access when devm_of_regulator_put_matches
 is called.

Signed-off-by: Alina Yu <alina_yu@richtek.com>
Link: https://msgid.link/r/4ce8c4f16f1cf3aa4e5f36c0694dd3c5ccf3cd1c.1716870419.git.alina_yu@richtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-28 13:22:54 +01:00
Linus Torvalds c2c80ecdb4 regulator: Fixes for v6.10
A bunch of fixes that came in during the merge window, Matti found
 several issues with some of the more complexly configured Rohm
 regulators and the helpers they use and there were some errors in the
 specification of tps6594 when regulators are grouped together.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZPLEoACgkQJNaLcl1U
 h9DNfQf7B5ppKeMfWEzJKGywWmmzG96AldSvl7rcMyFxdzXjFu/kptGO0tLkJwTs
 DnlZF6TBooB/RezoHhVgq6nLtJcowQPlbhM3Y4gujzvumZiJ2k2Chsyy+H0YRvkZ
 kC9Bb2VGk7v5PimZiSugwgc1ZF+AE3LsZyzwWo4d0LZxOE1EyeQQ3SzygoKXtqzF
 QJxsT6+ynaeYBxVwW+pHztWca8b3o+kqNLauxcWb0J0sPJPu/dl2PIQrKIZBsOWC
 E34Y8MrrktqPApGE7kVL7dkmofceZI7Qv71aq2UJvRJOhvWP47f2L7nYwYi3kuIH
 EjioQuqa1Bf7Wms59Q68WLjn4e0ILA==
 =NeiV
 -----END PGP SIGNATURE-----

Merge tag 'regulator-fix-v6.10-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "A bunch of fixes that came in during the merge window.

  Matti found several issues with some of the more complexly configured
  Rohm regulators and the helpers they use and there were some errors in
  the specification of tps6594 when regulators are grouped together"

* tag 'regulator-fix-v6.10-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: tps6594-regulator: Correct multi-phase configuration
  regulator: tps6287x: Force writing VSEL bit
  regulator: pickable ranges: don't always cache vsel
  regulator: rohm-regulator: warn if unsupported voltage is set
  regulator: bd71828: Don't overwrite runtime voltages
2024-05-23 13:39:42 -07:00
Linus Torvalds a85629f435 - New Device Support
- Add support for X-Powers AXP717 PMIC to AXP22X
    - Add support for Rockchip RK816 PMIC to RK8XX
    - Add support for TI TPS65224 PMIC to TPS6594
 
  - New Functionality
    - Add Power Off functionality to Rohm BD71828
    - Allow I2C SMBus access in Renesas RSMU
 
  - Fix-ups
    - Device Tree binding adaptions/conversions/creation
    - Shift Intel support over to MSI interrupts
    - Generify adding platform data away from being ACPI specific
    - Use device core supplied attribute to register sysfs entries
    - Replace hand-rolled functionality with generic APIs
    - Utilise centrally provided helpers and macros
    - Clean-up error handling
    - Remove superfluous/duplicated/unused sections
    - Trivial; spelling, whitespace, coding-style adaptions
    - More Maple Tree conversions
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmZNwaMACgkQUa+KL4f8
 d2Gh8BAAlD0/SUXVKuMppST6pyqGp90BucELY/enaFFI7eHTrevxSM5Ywtbjig0l
 +pz7WYm0bmCGXhr1yGrrhryKc2hGWacT2MhM8mHpkomHpN3qEnRQRKnjISTHDLG5
 9t1UyqDaBsoI7HPO0iiHPiinoQnM/WIHEjaelQNgl4g2sj9iFMmGhXcYX6IXQwHs
 Yu3l58Yju7nBxjjmgb4tFs8CPf+/CCP0jpwzWd99kZHPcRhupULmQgSLhmbSf4H8
 /KQg7wFSufabxuJOKKR2gUIdGeMlaNhyoPtSdDyn0Pji7lubNyvfaK+JSyae9Esp
 HYD1RD87aQLFyJAfRnDUPI9xQauPpz29V/wGujlqTiz0GYEVGy4Yo2yWH/CoHhUV
 +yb3I/7I6u+rvQHH2bnsAUQ3doh6fuFNvjNJgNbBtqraJ2Pt3nJNGxfSolwPf3mt
 GEb60ahbzLMGtxbVoVOLbDvZgN3FeIKMcdamS1JvKTPTf62H9AOyhUIlzibm1AVl
 i3u2cEfygTeyqUdCIhNLEavmj4uHbFeGXgvveuvbizJTtdEoQ2QIuslwLTrpivkq
 URaDpZfclu9sv+FNY1wiQMnlC4uueyJpkfItEHX876uB7r1ReWMQD8Lf3hI5xJeh
 JM0si93OorG9DR3h5iBnJu1kHqtQ56E46BFP8oh70p9N+Hpaw5c=
 =QAjw
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Device Support:
   - Add support for X-Powers AXP717 PMIC to AXP22X
   - Add support for Rockchip RK816 PMIC to RK8XX
   - Add support for TI TPS65224 PMIC to TPS6594

  New Functionality:
   - Add Power Off functionality to Rohm BD71828
   - Allow I2C SMBus access in Renesas RSMU

  Fix-ups:
   - Device Tree binding adaptions/conversions/creation
   - Shift Intel support over to MSI interrupts
   - Generify adding platform data away from being ACPI specific
   - Use device core supplied attribute to register sysfs entries
   - Replace hand-rolled functionality with generic APIs
   - Utilise centrally provided helpers and macros
   - Clean-up error handling
   - Remove superfluous/duplicated/unused sections
   - Trivial; spelling, whitespace, coding-style adaptions
   - More Maple Tree conversions"

* tag 'mfd-next-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (44 commits)
  dt-bindings: mfd: Use full path to other schemas
  mfd: rsmu: support I2C SMBus access
  dt-bindings: mfd: Convert lp873x.txt to json-schema
  dt-bindings: mfd: aspeed: Drop 'oneOf' for pinctrl node
  dt-bindings: mfd: allwinner,sun6i-a31-prcm: Use hyphens in node names
  mfd: ssbi: Remove unused field 'slave' from 'struct ssbi'
  mfd: kempld: Remove custom DMI matching code
  mfd: cs42l43: Update patching revision check
  dt-bindings: mfd: qcom: pm8xxx: Add pm8901 compatible
  mfd: timberdale: Remove redundant assignment to variable err
  dt-bindings: mfd: qcom,spmi-pmic: Add pbs to SPMI device types
  dt-bindings: mfd: syscon: Add ti,am62p-cpsw-mac-efuse compatible
  dt-bindings: mfd: qcom,tcsr: Add compatible for SDX75
  mfd: axp20x: Convert to use Maple Tree register cache
  mfd: bd71828: Remove commented code lines
  mfd: intel-m10-bmc: Change staging size to a variable
  dt-bindings: mfd: Add ROHM BD71879
  mfd: Tidy Kconfig dependency's parentheses
  mfd: ocelot-spi: Use spi_sync_transfer()
  dt-bindings: mfd: syscon: Add missing simple syscon compatibles
  ...
2024-05-22 10:41:14 -07:00
Neha Malcom Francis 74b38cd77d
regulator: tps6594-regulator: Correct multi-phase configuration
According to the TPS6594 PMIC Manual (linked) 8.3.2.1.4 Multi-Phase BUCK
Regulator Configurations section, the PMIC ignores all the other bucks'
except the primary buck's regulator registers. This is BUCK1 for
configurations BUCK12, BUCK123 and BUCK1234 while it is BUCK3 for
BUCK34. Correct the registers mapped for these configurations
accordingly.

Fixes: f17ccc5deb ("regulator: tps6594-regulator: Add driver for TI TPS6594 regulators")
Link: https://www.ti.com/lit/gpn/tps6594-q1
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Link: https://msgid.link/r/20240521094758.2190331-1-n-francis@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-21 12:27:36 +01:00
Matti Vaittinen 1ace99d7c7
regulator: tps6287x: Force writing VSEL bit
The data-sheet for TPS6287x-Q1
https://www.ti.com/lit/ds/symlink/tps62873-q1.pdf
states at chapter 9.3.6.1 Output Voltage Range:

"Note that every change to the VRANGE[1:0] bits must be followed by a
write to the VSET register, even if the value of the VSET[7:0] bits does
not change."

The current implementation of the driver uses the
regulator_set_voltage_sel_pickable_regmap() helper which further uses
regmap_update_bits() to write the VSET-register. The
regmap_update_bits() will not access the hardware if the new register
value is same as old. It is worth noting that this is true also when the
register is marked volatile, which I can't say is wrong because
'read-mnodify-write'-cycle with a volatile register is in any case
something user should carefully consider.

The 'range_applied_by_vsel'-flag in regulator desc was added to force
the vsel register upodates by using regmap_write_bits(). This variant
will always unconditionally write the bits to the hardware.

It is worth noting that the vsel is now forced to be written to the
hardware, whether the range was changed or not. This may cause a
performance drop if users are wrtiting same voltage value repeteadly.

It would be possible to read the range register to determine if it was
changed, but this would be a performance issue for users who don't use
reg cache for vsel.

Always write the VSET register to the hardware regardless the cache.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Fixes: 7b0518fbf2 ("regulator: Add support for TI TPS6287x regulators")
Link: https://msgid.link/r/ZktD50C5twF1EuKu@fedora
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-20 20:27:16 +01:00
Matti Vaittinen f4f4276f98
regulator: pickable ranges: don't always cache vsel
Some PMICs treat the vsel_reg same as apply-bit. Eg, when voltage range
is changed, the new voltage setting is not taking effect until the vsel
register is written.

Add a flag 'range_applied_by_vsel' to the regulator desc to indicate this
behaviour and to force the vsel value to be written to hardware if range
was changed, even if the old selector was same as the new one.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://msgid.link/r/ZktCpcGZdgHWuN_L@fedora
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-20 18:40:39 +01:00
Matti Vaittinen cb3a0f84ae
regulator: rohm-regulator: warn if unsupported voltage is set
A few of the ROHM PMICs allow setting low-power state specific voltages
for regulators. These voltages are then taken in use (by the hardware)
when the PMIC state is changed.

The voltages for these states can be given via device-tree. If
unsupported voltage has been given, the users have only seen print:
"driver callback failed to parse DT for regulator <name>". This does
help to pinpoint the problem to some extent, but there may be several
properties in device-tree so it should help if we can be a bit more
specific.

Print the voltage value and the run-state property if voltage can not be
supported.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://msgid.link/r/0937411855967cbefd9ff2d6045a52ca26712c4a.1715848512.git.mazziesaccount@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-16 13:36:42 +01:00
Matti Vaittinen 0f9f7c63c4
regulator: bd71828: Don't overwrite runtime voltages
Some of the regulators on the BD71828 have common voltage setting for
RUN/SUSPEND/IDLE/LPSR states. The enable control can be set for each
state though.

The driver allows setting the voltage values for these states via
device-tree. As a side effect, setting the voltages for
SUSPEND/IDLE/LPSR will also change the RUN level voltage which is not
desired and can break the system.

The comment in code reflects this behaviour, but it is likely to not
make people any happier. The right thing to do is to allow setting the
enable/disable state at SUSPEND/IDLE/LPSR via device-tree, but to
disallow setting state specific voltages for those regulators.

BUCK1 is a bit different. It only shares the SUSPEND and LPSR state
voltages. The former behaviour of allowing to silently overwrite the
SUSPEND state voltage by LPSR state voltage is also changed here so that
the SUSPEND voltage is prioritized over LPSR voltage.

Prevent setting PMIC state specific voltages for regulators which do not
support it.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Fixes: 522498f8cb ("regulator: bd71828: Basic support for ROHM bd71828 PMIC regulators")
Link: https://msgid.link/r/e1883ae1e3ae5668f1030455d4750923561f3d68.1715848512.git.mazziesaccount@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-16 13:36:41 +01:00
Linus Torvalds 07bbfc6aba regulator: Updates for v6.10
There's one API update here, a new API factoring out a common pattern
 for reference voltage supplies.  These are supplies uses as a reference
 by analogue circuits where the consumer requests and enables the supply,
 reads the voltage to calibrate the user and then never touches it again.
 This is factored out into a single operation which just returns the
 voltage and uses devm_ to manage the request and enable portion.
 
 Otherwise this has been a very quiet release, we've got some new device
 support, some small fixes, housekeeping and cleanup work but nothing
 substantial.
 
 There's also some non-regulator changes in here, a number of users for
 the new reference voltage API were merged along with it and some MFD
 changes were pulled in as dependencies for new driver work.
 
 Highlights:
 
  - Add a new API for single operation handling of reference voltages.
  - Support for Allwinner AXP717 and D1, and NXP PCA9561A.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmZB3mMACgkQJNaLcl1U
 h9DRmAf9Etp/ydeKGrbYD4K34Ptk4ZwchkTfvPEiNmJEDBlbcazRoeCF9asUVsDR
 ByggQCahCWhEa+exT+IBQYswpwFRd1oZChSgGUmIS/7pvQDdaPL+53Fnw8SfzmdS
 QygBEMNN8TGIu2Y+OqEEqINJ407NLbv2SbIlFX1CywZ5hDvCtvFdqhX/xCxTedBN
 wXlyj2BLe/xmbTGxr3Ssb+l8a0oe1BZvLO6ddrg8DtS92l1zJ0sEk+fegHSQGPRI
 wI4QehjEgphBsoGhybMGz3ny0nvSs3JkpgRiG/ly3cT97Cx6KSGctMtqjmy7Ynh5
 TM3Qq5DS37pBKIm79zmQFbL1z2A9Bw==
 =wV3x
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "There's one API update here, a new API factoring out a common pattern
  for reference voltage supplies. These are supplies used as a reference
  by analogue circuits where the consumer requests and enables the
  supply, reads the voltage to calibrate the user and then never touches
  it again. This is factored out into a single operation which just
  returns the voltage and uses devm_ to manage the request and enable
  portion.

  Otherwise this has been a very quiet release, we've got some new
  device support, some small fixes, housekeeping and cleanup work but
  nothing substantial.

  There's also some non-regulator changes in here, a number of users for
  the new reference voltage API were merged along with it and some MFD
  changes were pulled in as dependencies for new driver work.

  Highlights:

   - Add a new API for single operation handling of reference voltages

   - Support for Allwinner AXP717 and D1, and NXP PCA9561A"

* tag 'regulator-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (33 commits)
  regulator: sun20i: Add Allwinner D1 LDOs driver
  regulator: dt-bindings: Add Allwinner D1 system LDOs
  regulator: Mention regulator id in error message about dummy supplies
  staging: iio: impedance-analyzer: ad5933: Use devm_regulator_get_enable_read_voltage()
  iio: frequency: admv1013: Use devm_regulator_get_enable_read_voltage()
  iio: addac: ad74115: Use devm_regulator_get_enable_read_voltage()
  hwmon: (adc128d818) simplify final return in probe
  regulator: devres: fix devm_regulator_get_enable_read_voltage() return
  hwmon: (da9052) Use devm_regulator_get_enable_read_voltage()
  hwmon: (adc128d818) Use devm_regulator_get_enable_read_voltage()
  regulator: devres: add API for reference voltage supplies
  regulator: rtq2208: Fix LDO discharge register and add vsel setting
  regulator: dt-bindings: fixed-regulator: Add a preferred node name
  regulator: axp20x: add support for the AXP717
  mfd: axp20x: Add support for AXP717 PMIC
  dt-bindings: mfd: x-powers,axp152: Document AXP717
  regulator: axp20x: fix typo-ed identifier
  dt-bindings: regulator: qcom,usb-vbus-regulator: Add PM7250B compatible
  regulator: pca9450: add pca9451a support
  regulator: dt-bindings: pca9450: add pca9451a support
  ...
2024-05-14 14:36:09 -07:00
Lee Jones cac5fd398b Merge branches 'ib-mfd-misc-pinctrl-regulator-6.10', 'ib-mfd-pinctrl-regulator-6.10' and 'ib-mfd-regulator-6.10' into ibs-for-mfd-merged 2024-05-10 15:38:46 +01:00
Samuel Holland 4e70b26c87
regulator: sun20i: Add Allwinner D1 LDOs driver
D1 contains two pairs of LDOs, "analog" LDOs and "system" LDOs. They are
similar and can share a driver, but only the system LDOs have a DT
binding defined so far.

The system LDOs have a single linear range. The voltage step is not an
integer, so a custom .list_voltage is needed to get the rounding right.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20240509153107.438220-3-wens@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-09 17:44:01 +02:00
Johan Hovold 2a4b49bb58
regulator: core: fix debugfs creation regression
regulator_get() may sometimes be called more than once for the same
consumer device, something which before commit dbe954d8f1 ("regulator:
core: Avoid debugfs: Directory ...  already present! error") resulted in
errors being logged.

A couple of recent commits broke the handling of such cases so that
attributes are now erroneously created in the debugfs root directory the
second time a regulator is requested and the log is filled with errors
like:

	debugfs: File 'uA_load' in directory '/' already present!
	debugfs: File 'min_uV' in directory '/' already present!
	debugfs: File 'max_uV' in directory '/' already present!
	debugfs: File 'constraint_flags' in directory '/' already present!

on any further calls.

Fixes: 2715bb11cf ("regulator: core: Fix more error checking for debugfs_create_dir()")
Fixes: 08880713ce ("regulator: core: Streamline debugfs operations")
Cc: stable@vger.kernel.org
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20240509133304.8883-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-09 17:43:57 +02:00
Uwe Kleine-König 75c48adfe9
regulator: Mention regulator id in error message about dummy supplies
With the name that is currently looked up it is considerably easier to
understand the issue and fix the warning.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20240507104703.2070117-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-07 23:55:37 +09:00
David Lechner 257b2335ee
regulator: devres: fix devm_regulator_get_enable_read_voltage() return
The devm_regulator_get_enable_read_voltage() function is supposed to
return the voltage that the regulator is currently set to. However, it
currently returns 0.

Fixes: b250c20b64 ("regulator: devres: add API for reference voltage supplies")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240506-regulator-devm_regulator_get_enable_read_voltage-fixes-v1-1-356cdd152067@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-07 10:31:47 +09:00
Mark Brown 48b6faae69
regulator: new API for voltage reference supplies
Merge series from David Lechner <dlechner@baylibre.com>:

In the IIO subsystem, we noticed a pattern in many drivers where we need
to get, enable and get the voltage of a supply that provides a reference
voltage. In these cases, we only need the voltage and not a handle to
the regulator. Another common pattern is for chips to have an internal
reference voltage that is used when an external reference is not
available. There are also a few drivers outside of IIO that do the same.

So we would like to propose a new regulator consumer API to handle these
specific cases to avoid repeating the same boilerplate code in multiple
drivers.

As an example of how these functions are used, I have included a few
patches to consumer drivers. But to avoid a giant patch bomb, I have
omitted the iio/adc and iio/dac patches I have prepared from this
series. I will send those separately but these will add 36 more users
of devm_regulator_get_enable_read_voltage() in addition to the 6 here.
In total, this will eliminate nearly 1000 lines of similar code and will
simplify writing and reviewing new drivers in the future.
2024-05-06 10:05:06 +09:00
Nirmala Devi Mal Nadar 00c826525f regulator: tps6594-regulator: Add TI TPS65224 PMIC regulators
Add support for TPS65224 regulators (bucks and LDOs) to TPS6594 driver as
they have significant functional overlap. TPS65224 PMIC has 4 buck
regulators and 3 LDOs. BUCK12 can operate in dual phase.
The output voltages are configurable and are meant to supply power to the
main processor and other components.

Signed-off-by: Nirmala Devi Mal Nadar <m.nirmaladevi@ltts.com>
Signed-off-by: Bhargav Raviprakash <bhargav.r@ltts.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/0109018f2fdcc305-3b817569-21b6-42a7-942c-8edbff3848f2-000000@ap-south-1.amazonses.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-05-03 10:07:09 +01:00
Alex Bee 5eb068da74 regulator: rk808: Add RK816 support
Add support for rk816 to the existing rk808 regulator driver.

The infrastructure of the driver can be re-used as is. A peculiarity for
this version is, that BUCK1/BUCK2 have a (common) bit which needs to
toggled after a voltage change to confirm the change. Regulator regmap
takes care of that by defining a apply_bit and apply_reg for those
regulators.

Signed-off-by: Alex Bee <knaerzche@gmail.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240416161237.2500037-6-knaerzche@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-05-03 09:15:38 +01:00
Alex Bee 9f4e899c28 regulator: rk808: Support apply_bit for rk808_set_suspend_voltage_range
rk808_set_suspend_voltage_range currently does not account the existence of
apply_bit/apply_reg.

This adds support for those in same way it is done in
regulator_set_voltage_sel_regmap and is required for the upcoming RK816
support

Signed-off-by: Alex Bee <knaerzche@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240416161237.2500037-5-knaerzche@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-05-03 09:15:36 +01:00
David Lechner b250c20b64
regulator: devres: add API for reference voltage supplies
A common use case for regulators is to supply a reference voltage to an
analog input or output device. This adds a new devres API to get,
enable, and get the voltage in a single call. This allows eliminating
boilerplate code in drivers that use reference supplies in this way.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240429-regulator-get-enable-get-votlage-v2-1-b1f11ab766c1@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-03 11:08:12 +09:00
Alina Yu 38bcec0e7c
regulator: rtq2208: Fix LDO discharge register and add vsel setting
The LDO's Vout is adjustable if the hardware setting allows it,
and it can be set either 1800mv or 3300mv.
Additionally, the discharge register has been moved to another position.

Signed-off-by: Alina Yu <alina_yu@richtek.com>
Link: https://lore.kernel.org/r/5d56b79c94de63fc86b5a70b7e374da4240fee8b.1714467553.git.alina_yu@richtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-01 23:14:29 +09:00
Alina Yu d1ef160b45
regulator: rtq2208: Fix the BUCK ramp_delay range to maximum of 16mVstep/us
The maximum ramp up and down range of BUCK are shorten
from 64mVstep/us to 16mVstep/us.
Therefore, the RTQ2208_RAMP_VALUE_MAX_uV is modified
to 16000uV in this version.

Signed-off-by: Alina Yu <alina_yu@richtek.com>
Link: https://lore.kernel.org/r/1777b18c0faa1f6b7196630e679a03362686c301.1714467553.git.alina_yu@richtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-01 23:11:37 +09:00
Krzysztof Kozlowski 68adb581a3
regulator: vqmmc-ipq4019: fix module autoloading
Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded
based on the alias from of_device_id table.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://msgid.link/r/20240410172615.255424-2-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-10 18:48:59 +01:00
Krzysztof Kozlowski ddd3f34c10
regulator: qcom-refgen: fix module autoloading
Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded
based on the alias from of_device_id table.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://msgid.link/r/20240410172615.255424-1-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-10 18:48:58 +01:00
AngeloGioacchino Del Regno d3cf8a1749
regulator: mt6360: De-capitalize devicetree regulator subnodes
The MT6360 regulator binding, the example in the MT6360 mfd binding, and
the devicetree users of those bindings are rightfully declaring MT6360
regulator subnodes with non-capital names, and luckily without using the
deprecated regulator-compatible property.

With this driver declaring capitalized BUCKx/LDOx as of_match string for
the node names, obviously no regulator gets probed: fix that by changing
the MT6360_REGULATOR_DESC macro to add a "match" parameter which gets
assigned to the of_match.

Fixes: d321571d5e ("regulator: mt6360: Add support for MT6360 regulator")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://msgid.link/r/20240409144438.410060-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-09 16:22:59 +01:00
Matti Vaittinen 7ab681dded
regulator: irq_helpers: duplicate IRQ name
The regulator IRQ helper requires caller to provide pointer to IRQ name
which is kept in memory by caller. All other data passed to the helper
in the regulator_irq_desc structure is copied. This can cause some
confusion and unnecessary complexity.

Make the regulator_irq_helper() to copy also the provided IRQ name
information so caller can discard the name after the call to
regulator_irq_helper() completes.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://msgid.link/r/ZhJMuUYwaZbBXFGP@drtxq0yyyyyyyyyyyyydy-3.rev.dnainternet.fi
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-08 13:58:57 +01:00
Mark Brown 604efe5018 Immutable branch between MFD and Regulator due for the v6.10 merge window
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmYFXDYACgkQUa+KL4f8
 d2GtvQ//cDm8f0dxPBtX3OhUat0jG9xhci/+a+12L3LbjrK8VnnTDp3HN/il3STo
 PdZc6f9kxI7HENumJx/5f2R+SWZSKz4EsOScMpu4S2ig09ygsdykkl0uwAR/VyIq
 xT7UaYR6DQHD2C1OaLadkGBcLLbIWIZ/XGZo6aOkdJ5/N+teguVVusJj9/wUrJeN
 Gmm+depjszlj6bgQUHSjKchx6K/BlDic3PzG4pg3KAUPYczEVGQ3QSPvT+be8Agl
 +QN3KqS1fzvHp4RYducKREYP446iT8Zj5kKrQsSc2YZ65v6zvwcQ0JMW7gKkqmqB
 oYqT4ABaKBLlH8iEtLGrbZGp5mgEoB3K293eI1avpJmW+SkOpPV+k5jWReS3AymD
 tp57paOymof0PT26Cccy8kD1UqOzWvyrSfFUZyMtA5D9geeCxfSDw70ngRGy6NGm
 PaMl7l8MAcffFauMLSGxxBjlvbfsEXx23Au5dQ58U68Hq59YTm2o3FXZ8yiOVm74
 +F0UIKthP4kwQdt7y3THS/qpbJURzI5p/7j/ci2QqHE+SeMGPVZF12EzNZcw69St
 E916nMPuHeTH5I1ssBQsi7Z+eaaPh+UIpb7sYR4hDT6l3gbrqBbgKkcyVEqonpbd
 I/r7q37cXoyn1sbIuSEu4S3Ugvjs7LwbDFrZODjYOR6yoEfRcOo=
 =s1gJ
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmYFaA8ACgkQJNaLcl1U
 h9COdQf8DjNS69Q1Q8ajj+eN0RHvF3Flp4SqeOxXJjCs9z6bijdBx+qvck+vb+Qo
 5VESLKu2arzar9WmHRdCKbXS4grBxFrkp9Araja8SVd8Z64hJRJNy5/q4OHZbJ+g
 RcGA38Xdl3I6qcQpAyXHKct28aZmP3CXz4TeN3kqklLHBPulahZffVfk+OtBn8zy
 6Y5SPFSMJFGSsEweV3tdmZAl39QJLVzTeWKWMSmcpIHok0wc21m/u6sbA6C3vHQJ
 +2JUekSu9itxcaT1Z5VoUddYlRf/gUIINLxelPvEyWZ0JWdvSc/QrqYgHZQgDu5C
 FrDPRiZLOZ8Pe/SjFsRGaWRkKM9M2g==
 =HCHE
 -----END PGP SIGNATURE-----

regulator: Merge axp20x changes

There will be at least one incremental change on top of some MFD
overlapping device additions for this driver so merge now.

Merge tag 'ib-mfd-regulator-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into regulator-6.10
2024-03-28 12:51:21 +00:00
Andre Przywara d2ac3df75c regulator: axp20x: add support for the AXP717
The X-Powers AXP717 is a typical PMIC from X-Powers, featuring four
DC/DC converters and 15 LDOs, on the regulator side.

Describe the chip's voltage settings and switch registers, how the
voltages are encoded, and connect this to the MFD device via its
regulator ID.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Mark Brown <broonie@kernel.org>
Tested-by: Ryan Walklin <ryan@testtoast.com>
Link: https://lore.kernel.org/r/20240310010211.28653-5-andre.przywara@arm.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-28 09:51:03 +00:00
Andre Przywara 4628b80455 regulator: axp20x: fix typo-ed identifier
The registers to set the X-Powers AXP313 regulators are of course
"CONTROL" registers, not "CONRTOL" ones.

Fix the typo in the header file and in its users. No functional change.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Tested-by: Ryan Walklin <ryan@testtoast.com>
Link: https://lore.kernel.org/r/20240310010211.28653-2-andre.przywara@arm.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-28 09:50:32 +00:00
Mark Brown 54b8d0956a
regulator: convert to use maple tree register
Merge series from Bo Liu <liubo03@inspur.com>:

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.

Bo Liu (13):
  regulator: da9121: convert to use maple tree register cache
  regulator: da9211: convert to use maple tree register cache
  regulator: isl9305: convert to use maple tree register cache
  regulator: max8973: convert to use maple tree register cache
  regulator: mt6311: convert to use maple tree register cache
  regulator: pca9450: convert to use maple tree register cache
  regulator: pf8x00: convert to use maple tree register cache
  regulator: pfuze100: convert to use maple tree register cache
  regulator: rtmv20: convert to use maple tree register cache
  regulator: rtq6752: convert to use maple tree register cache
  regulator: tps51632: convert to use maple tree register cache
  regulator: tps62360: convert to use maple tree register cache
  regulator: rpi-panel-attiny: convert to use maple tree register cache

 drivers/regulator/da9121-regulator.c           | 4 ++--
 drivers/regulator/da9211-regulator.c           | 2 +-
 drivers/regulator/isl9305.c                    | 2 +-
 drivers/regulator/max8973-regulator.c          | 2 +-
 drivers/regulator/mt6311-regulator.c           | 2 +-
 drivers/regulator/pca9450-regulator.c          | 2 +-
 drivers/regulator/pf8x00-regulator.c           | 2 +-
 drivers/regulator/pfuze100-regulator.c         | 2 +-
 drivers/regulator/rpi-panel-attiny-regulator.c | 2 +-
 drivers/regulator/rtmv20-regulator.c           | 2 +-
 drivers/regulator/rtq6752-regulator.c          | 2 +-
 drivers/regulator/tps51632-regulator.c         | 2 +-
 drivers/regulator/tps62360-regulator.c         | 2 +-
 13 files changed, 14 insertions(+), 14 deletions(-)

--
2.18.2
2024-03-26 11:51:35 +00:00
André Apitzsch a469158eaf
regulator: tps65132: Add of_match table
Add of_match table for "ti,tps65132" compatible string.
This fixes automatic driver loading when using device-tree,
and if built as a module like major linux distributions do.

Signed-off-by: André Apitzsch <git@apitzsch.eu>
Link: https://msgid.link/r/20240325-of_tps65132-v1-1-86a5f7ef4ede@apitzsch.eu
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 19:28:27 +00:00
Joy Zou 5edeb7d312
regulator: pca9450: add pca9451a support
Adding support for new pmic pca9451a.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Link: https://msgid.link/r/20240318095633.4079027-3-joy.zou@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:35 +00:00
Bo Liu ab470abe58
regulator: rpi-panel-attiny: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-14-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:27 +00:00
Bo Liu fe258f54c0
regulator: tps62360: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-13-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:26 +00:00
Bo Liu 9500d38e50
regulator: tps51632: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-12-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:25 +00:00
Bo Liu 81c180e77d
regulator: rtq6752: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-11-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:24 +00:00
Bo Liu 43edba6b67
regulator: rtmv20: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-10-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:23 +00:00
Bo Liu 0332f074f5
regulator: pfuze100: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-9-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:22 +00:00
Bo Liu cea065dced
regulator: pf8x00: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-8-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:22 +00:00
Bo Liu 0b03e9cb8b
regulator: pca9450: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-7-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:21 +00:00
Bo Liu bc12512512
regulator: mt6311: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-6-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:20 +00:00
Bo Liu 36649db5b2
regulator: max8973: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-5-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:19 +00:00
Bo Liu 66a4ead5ed
regulator: isl9305: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-4-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:18 +00:00
Bo Liu 03ddbcbe2f
regulator: da9211: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-3-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:17 +00:00
Bo Liu d92eb7c333
regulator: da9121: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Link: https://msgid.link/r/20240320085740.4604-2-liubo03@inspur.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-25 00:48:16 +00:00
Linus Torvalds 8c826bd99a regulator: Fix for v6.9
One fix that came in during the merge window, fixing a problem with
 bootstrapping the state of exclusive regulators which have a parent
 regulator.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmX9kqoACgkQJNaLcl1U
 h9BzzAf+M6O+WUIbcNj84x+dz13IOdNolkb5kGjVJLY+yh5HGEnmRRLZVj4TF+pO
 4L+EJa7pKY9a6YpODy/pDpyzdQgYbdsLj88/G4ug0p2FMaQqpl1GEpYyEfaNtVW8
 6BlQlw4L/429k2FVble/0zDyzJjpvQsGwk8qAmHcA3mUJSY+BMqlpeU9t6zMXR7l
 yYH+mVgqAx2sY8z20CWvZDRgqOVBrrE1IZ8RKuW5Xm0/cWGY0ihj6uy4Z3zFuq9I
 pjAZ++FSBmNRj1XDNm8UqRdjVtCTIuaCNJZ0ayqEGxDb3yNAVpjpVKURELBA17CR
 fCw3+3Yyj1d+5hb8mrXeKrC2Ro5WVQ==
 =vvdo
 -----END PGP SIGNATURE-----

Merge tag 'regulator-fix-v6.9-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fix from Mark Brown:
 "One fix that came in during the merge window, fixing a problem with
  bootstrapping the state of exclusive regulators which have a parent
  regulator"

* tag 'regulator-fix-v6.9-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: core: Propagate the regulator state in case of exclusive get
2024-03-22 09:52:37 -07:00
Linus Torvalds e5eb28f6d1 - Kuan-Wei Chiu has developed the well-named series "lib min_heap: Min
heap optimizations".
 
 - Kuan-Wei Chiu has also sped up the library sorting code in the series
   "lib/sort: Optimize the number of swaps and comparisons".
 
 - Alexey Gladkov has added the ability for code running within an IPC
   namespace to alter its IPC and MQ limits.  The series is "Allow to
   change ipc/mq sysctls inside ipc namespace".
 
 - Geert Uytterhoeven has contributed some dhrystone maintenance work in
   the series "lib: dhry: miscellaneous cleanups".
 
 - Ryusuke Konishi continues nilfs2 maintenance work in the series
 
 	"nilfs2: eliminate kmap and kmap_atomic calls"
 	"nilfs2: fix kernel bug at submit_bh_wbc()"
 
 - Nathan Chancellor has updated our build tools requirements in the
   series "Bump the minimum supported version of LLVM to 13.0.1".
 
 - Muhammad Usama Anjum continues with the selftests maintenance work in
   the series "selftests/mm: Improve run_vmtests.sh".
 
 - Oleg Nesterov has done some maintenance work against the signal code
   in the series "get_signal: minor cleanups and fix".
 
 Plus the usual shower of singleton patches in various parts of the tree.
 Please see the individual changelogs for details.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQTTMBEPP41GrTpTJgfdBJ7gKXxAjgUCZfMnvgAKCRDdBJ7gKXxA
 jjKMAP4/Upq07D4wjkMVPb+QrkipbbLpdcgJ++q3z6rba4zhPQD+M3SFriIJk/Xh
 tKVmvihFxfAhdDthseXcIf1nBjMALwY=
 =8rVc
 -----END PGP SIGNATURE-----

Merge tag 'mm-nonmm-stable-2024-03-14-09-36' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull non-MM updates from Andrew Morton:

 - Kuan-Wei Chiu has developed the well-named series "lib min_heap: Min
   heap optimizations".

 - Kuan-Wei Chiu has also sped up the library sorting code in the series
   "lib/sort: Optimize the number of swaps and comparisons".

 - Alexey Gladkov has added the ability for code running within an IPC
   namespace to alter its IPC and MQ limits. The series is "Allow to
   change ipc/mq sysctls inside ipc namespace".

 - Geert Uytterhoeven has contributed some dhrystone maintenance work in
   the series "lib: dhry: miscellaneous cleanups".

 - Ryusuke Konishi continues nilfs2 maintenance work in the series

	"nilfs2: eliminate kmap and kmap_atomic calls"
	"nilfs2: fix kernel bug at submit_bh_wbc()"

 - Nathan Chancellor has updated our build tools requirements in the
   series "Bump the minimum supported version of LLVM to 13.0.1".

 - Muhammad Usama Anjum continues with the selftests maintenance work in
   the series "selftests/mm: Improve run_vmtests.sh".

 - Oleg Nesterov has done some maintenance work against the signal code
   in the series "get_signal: minor cleanups and fix".

Plus the usual shower of singleton patches in various parts of the tree.
Please see the individual changelogs for details.

* tag 'mm-nonmm-stable-2024-03-14-09-36' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (77 commits)
  nilfs2: prevent kernel bug at submit_bh_wbc()
  nilfs2: fix failure to detect DAT corruption in btree and direct mappings
  ocfs2: enable ocfs2_listxattr for special files
  ocfs2: remove SLAB_MEM_SPREAD flag usage
  assoc_array: fix the return value in assoc_array_insert_mid_shortcut()
  buildid: use kmap_local_page()
  watchdog/core: remove sysctl handlers from public header
  nilfs2: use div64_ul() instead of do_div()
  mul_u64_u64_div_u64: increase precision by conditionally swapping a and b
  kexec: copy only happens before uchunk goes to zero
  get_signal: don't initialize ksig->info if SIGNAL_GROUP_EXIT/group_exec_task
  get_signal: hide_si_addr_tag_bits: fix the usage of uninitialized ksig
  get_signal: don't abuse ksig->info.si_signo and ksig->sig
  const_structs.checkpatch: add device_type
  Normalise "name (ad@dr)" MODULE_AUTHORs to "name <ad@dr>"
  dyndbg: replace kstrdup() + strchr() with kstrdup_and_replace()
  list: leverage list_is_head() for list_entry_is_head()
  nilfs2: MAINTAINERS: drop unreachable project mirror site
  smp: make __smp_processor_id() 0-argument macro
  fat: fix uninitialized field in nostale filehandles
  ...
2024-03-14 18:03:09 -07:00
Linus Torvalds 21ac5a9651 regulator: Updates for v6.9
This has been a very quiet release, mostly cleanups, API updates and
 simple device additions.  I messed up slightly and there are a couple of
 duplicated commits resulting from me leaving things in my inbox which
 didn't seem worth removing by the time I noticed them.
 
  - Conversion of several drivers to GPIO descriptors.
  - Build out the features of of the MP8859 driver.
  - Support for Qualcomm PM4125 and PM6150.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmXvFPUACgkQJNaLcl1U
 h9C11wf+LkEBZ/oaidhjWlDdnd6oVHCVG7du5YXRSDcobm9dqigfnhRPvcF3WqlQ
 DfPBq5/VN/yCAxD3tsUS+bhPfCEMfSnEHN4uaYy7NjLulW3zh++Dxib3FPD7HURY
 aw5u8gm4AuB+x4nJOtrA6tiBisfHyCM7uSIfnUcs0LVlksCibdOe0OfHVsO2BNW+
 gbLxZc8gr5VdORfHqb6oeUtcoiA/2gALNvdagMooguzolDtVEs1yLQkbD4CCOGHg
 EPqE7YxdJrTOtbd7hiR5z2G8plPqmsbCG//Jb9jJuEAtefm57pyJ5SfMBGKs0hS9
 p/o5Vk4ygghArRnl0KsItgphFCZt0A==
 =GuVG
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "This has been a very quiet release, mostly cleanups, API updates and
  simple device additions. I messed up slightly and there are a couple
  of duplicated commits resulting from me leaving things in my inbox
  which didn't seem worth removing by the time I noticed them.

   - Conversion of several drivers to GPIO descriptors

   - Build out the features of of the MP8859 driver

   - Support for Qualcomm PM4125 and PM6150"

* tag 'regulator-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (31 commits)
  regulator: lp8788-buck: fix copy and paste bug in lp8788_dvs_gpio_request()
  regulator: core: make regulator_class constant
  regulator: da9121: Remove unused of_gpio.h
  regulator: userspace-consumer: add module device table
  regulator: dt-bindings: gpio-regulator: Fix "gpios-states" and "states" array bounds
  regulator: mp8859: Implement set_current_limit()
  regulator: mp8859: Report slew rate
  regulator: mp8859: Support status and error readback
  regulator: mp8859: Support active discharge control
  regulator: mp8859: Support mode operations
  regulator: mp8859: Support enable control
  regulator: mp8859: Validate and log device identifier information
  regulator: mp8859: Specify register accessibility and enable caching
  regulator: max8998: Convert to GPIO descriptors
  regulator: max8997: Convert to GPIO descriptors
  regulator: lp8788-buck: Fully convert to GPIO descriptors
  regulator: da9055: Fully convert to GPIO descriptors
  regulator: max8973: Finalize switch to GPIO descriptors
  regulator: dt-bindings: qcom,usb-vbus-regulator: add support for PM4125
  regulator: dt-bindings: qcom,usb-vbus-regulator: add support for PM4125
  ...
2024-03-13 11:05:20 -07:00
Kory Maincent e4ead3cdfd
regulator: core: Propagate the regulator state in case of exclusive get
Previously, performing an exclusive get on an already-enabled regulator
resulted in inconsistent state initialization between child and parent
regulators. While the child's counts were updated, its parent's counters
remained unaffected.

Consequently, attempting to disable an already-enabled exclusive regulator
triggered unbalanced disables warnings from its parent regulator.

This commit addresses the issue by propagating the enable state to the
parent regulator using a regulator_enable call. This ensures consistent
state management across the regulator hierarchy, preventing warnings!

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://msgid.link/r/20240312091638.1266167-1-kory.maincent@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-12 13:55:57 +00:00
Dan Carpenter e6f0b08a03
regulator: lp8788-buck: fix copy and paste bug in lp8788_dvs_gpio_request()
"gpio2" as intended here, not "gpio1".

Fixes: 95daa868f2 ("regulator: lp8788-buck: Fully convert to GPIO descriptors")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://msgid.link/r/19f62cc2-bdcf-46f7-a5c5-971ef05e1ea7@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-06 14:03:32 +00:00
Ricardo B. Marliere 4fe6207508
regulator: core: make regulator_class constant
Since commit 43a7206b09 ("driver core: class: make class_register() take
a const *"), the driver core allows for struct class to be in read-only
memory, so move the regulator_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at boot time.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Link: https://msgid.link/r/20240305-class_cleanup-regulator-v1-1-4950345d6d8f@marliere.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-05 19:20:21 +00:00