History log of /linux-master/drivers/regulator/tps6524x-regulator.c
Revision Date Author Comments
# 259b93b2 16-Mar-2023 Douglas Anderson <dianders@chromium.org>

regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in 4.14

Probing of regulators can be a slow operation and can contribute to
slower boot times. This is especially true if a regulator is turned on
at probe time (with regulator-boot-on or regulator-always-on) and the
regulator requires delays (off-on-time, ramp time, etc).

While the overall kernel is not ready to switch to async probe by
default, as per the discussion on the mailing lists [1] it is believed
that the regulator subsystem is in good shape and we can move
regulator drivers over wholesale. There is no way to just magically
opt in all regulators (regulators are just normal drivers like
platform_driver), so we set PROBE_PREFER_ASYNCHRONOUS for all
regulators found in 'drivers/regulator' individually.

Given the number of drivers touched and the impossibility to test this
ahead of time, it wouldn't be shocking at all if this caused a
regression for someone. If there is a regression caused by this patch,
it's likely to be one of the cases talked about in [1]. As a "quick
fix", drivers involved in the regression could be fixed by changing
them to PROBE_FORCE_SYNCHRONOUS. That being said, the correct fix
would be to directly fix the problem that caused the issue with async
probe.

The approach here follows a similar approach that was used for the mmc
subsystem several years ago [2]. In fact, I ran nearly the same python
script to auto-generate the changes. The only thing I changed was to
search for "i2c_driver", "spmi_driver", and "spi_driver" in addition
to "platform_driver".

[1] https://lore.kernel.org/r/06db017f-e985-4434-8d1d-02ca2100cca0@sirena.org.uk
[2] https://lore.kernel.org/r/20200903232441.2694866-1-dianders@chromium.org/

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230316125351.1.I2a4677392a38db5758dee0788b2cea5872562a82@changeid
Signed-off-by: Mark Brown <broonie@kernel.org>


# 7a8b0e66 13-Apr-2019 Axel Lin <axel.lin@ingics.com>

regulator: tps6524x: Remove *rdev[N_REGULATORS] from struct tps6524x

Current code is using devm_regulator_register() so we don't need to store
*rdev for clean up, use a local variable instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 357db027 13-Apr-2019 Axel Lin <axel.lin@ingics.com>

regulator: tps6524x: Constify regulator_ops

The regulator_ops is never changed, make it const.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# ae714c3b 19-Apr-2016 Mark Brown <broonie@kernel.org>

regulator: tps6524x: Fix broken use of spi_dev_get()

The tps6524x driver uses spi_dev_get() to take a copy of the SPI device
it uses but has no obvious reason to do so and never calls spi_dev_put()
to release the reference. Fix this to just a straight copy.

Signed-off-by: Mark Brown <broonie@kernel.org>


# 3821a065 23-Oct-2015 Andrew F. Davis <afd@ti.com>

spi: Drop owner assignment from spi_drivers

An spi_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 516add1d 20-Feb-2014 Sachin Kamat <sachin.kamat@linaro.org>

regulator: tps6524x: Remove redundant error message

kzalloc prints its own OOM message upon failure.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 5e085575 29-Sep-2013 Jingoo Han <jg1.han@samsung.com>

regulator: tps6524x: use devm_regulator_register()

Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 78925b3a 19-Sep-2013 Sachin Kamat <sachin.kamat@linaro.org>

regulator: tps6524x: Remove redundant spi_set_drvdata

Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>


# dff91d0b 30-Jul-2013 Jingoo Han <jg1.han@samsung.com>

regulator: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 020501f1 26-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: Remove NULL test before calling regulator_unregister()

It's safe to call regulator_unregister() with NULL, thus remove the NULL test
before regulator_unregister() calls.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@sirena.org.uk>


# b92f567d 26-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: tps6524x: Use regulator_map_voltage_ascend

All regulators have ascendant voltage list in this driver.
Use regulator_map_voltage_ascend for them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# a5023574 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu>

regulator: remove use of __devinit

CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 5eb9f2b9 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu>

regulator: remove use of __devexit_p

CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 73f4f3d3 08-Aug-2012 Axel Lin <axel.lin@gmail.com>

regulator: tps6524x: set_current_limit should select the maximum current in specific range

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 1e12dfc9 20-Jun-2012 Axel Lin <axel.lin@gmail.com>

regulator: tps6524x: Convert fixed ilimsel to table based

This patch refactors the code to get rid of the fixed_ilimsel and FIXED_ILIMSEL
flag usage, and convert all the fixed ilimsel to table based (with one entry in
the table).

We can differentiate fixed ilimsel by checking info->n_ilimsels == 1,
thus FIXED_ILIMSEL flag can be removed.

This change makes the logic of the code simpler as all the ilimsels are table
based now.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# cac87fd3 20-Jun-2012 Axel Lin <axel.lin@gmail.com>

regulator: tps6524x: Convert to regulator_list_voltage_table()

This patch adds fixed_5000000_voltage table for fixed voltage,
so we can convert regulator_ops to regulator_list_voltage_table.

We can differentiate fixed voltage by checking rdev->desc->n_voltages == 1,
thus remove the FIXED_VOLTAGE flag usage.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 8386a00f 14-Jun-2012 Axel Lin <axel.lin@gmail.com>

regulator: tps6524x: Fix get_voltage_sel for fixed voltage

get_voltage_sel() should return selector rather than voltage.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 9eb0c421 11-Apr-2012 Axel Lin <axel.lin@gmail.com>

regulator: Convert tps65xxx regulator drivers to use devm_kzalloc

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# c172708d 03-Apr-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

regulator: core: Use a struct to pass in regulator runtime configuration

Rather than adding new arguments to regulator_register() every time we
want to add a new bit of dynamic information at runtime change the function
to take these via a struct. By doing this we avoid needing to do further
changes like the recent addition of device tree support which required each
regulator driver to be updated to take an additional parameter.

The regulator_desc which should (mostly) be static data is still passed
separately as most drivers are able to configure this statically at build
time.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 173f24d1 03-Apr-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

regulator: tps6524x: Use module_spi_driver()

Unusual to see a regulator driver not using subsys_initcall() but the
deferred probe support should make this viable.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 4af7c1d3 28-Mar-2012 Axel Lin <axel.lin@gmail.com>

regulator: Convert tps6524x to get_voltage_sel

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# f8ee3393 28-Mar-2012 Axel Lin <axel.lin@gmail.com>

regulator: Convert tps6524x to set_voltage_sel

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 4d984d1c 08-Mar-2012 Axel Lin <axel.lin@gmail.com>

regulator: tps6524x: Remove unneeded comment for N_REGULATORS

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# f03570cf 07-Mar-2012 Axel Lin <axel.lin@gmail.com>

regulator: Fix setting selector in tps6524x set_voltage function

Don't assign the voltage to selector.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org


# 2c043bcb 18-Nov-2011 Rajendra Nayak <rnayak@ti.com>

regulator: pass additional of_node to regulator_register()

With device tree support for regulators, its needed that the
regulator_dev->dev device has the right of_node attached.
To be able to do this add an additional parameter to the
regulator_register() api, wherein the dt-adapted driver can
then pass this additional info onto the regulator core.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 5362b098 24-Mar-2011 Randy Dunlap <randy.dunlap@oracle.com>

regulator: fix tps6524x section mismatch

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Fix section mismatch that is caused by init code calling exit code:
pmic_remove() cannot be marked as __devexit.

WARNING: drivers/regulator/tps6524x-regulator.o(.devinit.text+0x205): Section mismatch in reference from the function pmic_probe() to the function .devexit.text:pmic_remove()
The function __devinit pmic_probe() references
a function __devexit pmic_remove().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
pmic_remove() so it may be used outside an exit section.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 1394fd28 06-Dec-2010 Cyril Chemparathy <cyril@ti.com>

regulator: add driver for tps6524x regulator

TPS6524X provides three step-down converters and two general-purpose LDO
voltage regulators. This device is interfaced using SPI.

Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>