History log of /linux-master/drivers/regulator/tps62360-regulator.c
Revision Date Author Comments
# 964e1865 05-May-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

regulator: Switch i2c drivers back to use .probe()

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/20230505220218.1239542-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org


# 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>


# 5bd73a16 10-Mar-2023 Rob Herring <robh@kernel.org>

regulator: Use of_property_read_bool() for boolean properties

It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to to of_property_read_bool().

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230310144722.1544843-1-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 18804160 18-Nov-2022 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

regulator: tps62360-regulator: Convert to i2c's .probe_new()

.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in the probe function.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-for-MFD-by: Lee Jones <lee@kernel.org>
Acked-for-Backlight-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20221118224540.619276-558-uwe@kleine-koenig.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# e634cf4e 07-Jun-2022 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_318.RULE

Based on the normalized pattern:

this program is free software you can redistribute it and/or modify it
under the terms of the gnu general public license as published by the
free software foundation version 2 this program is distributed as is
without any warranty of any kind whether express or implied without
even the implied warranty of merchantability or fitness for a
particular purpose see the gnu general public license for more details
you should have received a copy of the gnu general public license
along with this program if not write to the free software foundation
inc 59 temple place suite 330 boston ma 02111-1307 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference.

Reviewed-by: Allison Randal <allison@lohutok.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6a8b5bb0 17-Oct-2021 Maíra Canal <maira.canal@usp.br>

regulator: tps62360: replacing legacy gpio interface for gpiod

Removing all linux/gpio.h and linux/of_gpio.h dependencies and replacing
them with the gpiod interface.

Signed-off-by: Maíra Canal <maira.canal@usp.br>
Link: https://lore.kernel.org/r/YWxmL2baF5AdzyHv@fedora
Signed-off-by: Mark Brown <broonie@kernel.org>


# 01167e88 29-Aug-2020 Rikard Falkeborn <rikard.falkeborn@gmail.com>

regulator: tps62360: Constify tps62360_dcdc_ops

The only usage of tps62360_dcdc_ops is to assign its address to the ops
field in the regulator_desc struct, which is a const pointer. Make it
const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20200829221104.20870-4-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>


# a807a6cc 09-Jul-2015 Krzysztof Kozlowski <krzk@kernel.org>

regulator: drivers: Drop owner assignment from i2c_driver

i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 072e78b1 10-Nov-2014 Javier Martinez Canillas <javier@osg.samsung.com>

regulator: of: Add regulator desc param to of_get_regulator_init_data()

The of_get_regulator_init_data() function is used to extract the regulator
init_data but information on how to extract certain data is defined in the
static regulator descriptor (e.g: how to map the hardware operating modes).

Add a const struct regulator_desc * parameter to the function signature so
the parsing logic could use the information in the struct regulator_desc.

of_get_regulator_init_data() relies on of_get_regulation_constraints() to
actually extract the init_data so it has to pass the struct regulator_desc
but that is modified on a later patch.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 33e63ba6 20-Feb-2014 Sachin Kamat <sachin.kamat@linaro.org>

regulator: tps62360: 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>


# 541f597f 03-Jan-2014 David Howells <dhowells@redhat.com>

regulator: tps62360: Fix up a pointer-integer size mismatch warning

Fix up the following pointer-integer size mismatch warning in tps62360_probe():

drivers/regulator/tps62360-regulator.c: In function 'tps62360_probe':
drivers/regulator/tps62360-regulator.c:363:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
chip_id = (int)match->data;
^

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 58c6e938 04-Sep-2013 Sachin Kamat <sachin.kamat@linaro.org>

regulator: tps62360: Use devm_regulator_register

devm_* simplifies the code.

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>


# 0a62d03b 18-Jun-2013 Tuomas Tynkkynen <ttynkkynen@nvidia.com>

regulator: tps62360: Fix crash in i2c_driver .probe

Commit "i2c: core: make it possible to match a pure device tree driver"
changed semantics of the i2c probing for device tree devices.
Device tree probed devices now get a NULL i2c_device_id pointer.
This caused kernel panics due to NULL dereference.

Tested-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# 1864b670 22-Apr-2013 Axel Lin <axel.lin@ingics.com>

regulator: tps62360: Fix off-by-one shift for ramp_ctrl

According to the datasheet[1]

Register 0x06h Description: RmpCtrl (REGISTER ADDRESS: 0x06h Read/Write)
BIT[5..7]:
RMP[2:0] Output voltage ramp timing
D7-D5 Slope
000 32mV/us
001 16mV/us
010 8mV/us
...
110 0.5mV/us
111 0.25mV/us

Thus to get correct ramp_ctrl value, we need to right-shift 5 bits.

[1] http://www.ti.com/lit/ds/symlink/tps62360.pdf

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


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

regulator: remove use of __devexit

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

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
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>


# 8a8e3d59 02-Jul-2012 Laxman Dewangan <ldewangan@nvidia.com>

regulator: tps62360: use devm_* for gpio request

Use devm_ version of gpio APIs gpio_request_one() for
requesting gpios.
This avoid extra code for freeing gpios.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


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

regulator: tps62360: Convert to regulator_set_voltage_time_sel()

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


# b5152415 13-Jun-2012 Axel Lin <axel.lin@gmail.com>

regulator: tps62360: Remove chip_id and voltage_base from struct tps62360_chip

The chip_id is not used.
The voltage_base is not necessary, set base voltage to tps->desc.min_uV instead.

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


# e08ef739 08-Jun-2012 Axel Lin <axel.lin@gmail.com>

regulator: tps62360: Simplify tps62360_set_voltage_time_sel implementation

For linear mappings, we can use below equation to get the voltage difference
between new_selector and old_selector:

abs(new_selector - old_selector) * rdev->desc->uV_step

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


# 9fc3815e 20-May-2012 Laxman Dewangan <ldewangan@nvidia.com>

regulator: tps62360: dt: initialize of_node param for regulator register.

Initialize config.of_node for regulator before registering.
This is needed for DT based regulator support.
Regulator stores this of_node value in rdev->dev.of_node
and used for lookup when client ask for regulator_get().

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 9a00630c 14-May-2012 Laxman Dewangan <ldewangan@nvidia.com>

regulator: tps62360: support force PWM mode via regulator mode

Change the mechanism of enabling the force PWM mode through
regulator set mode. This can be dynamically configured now.
In the REGULATOR_MODE_FAST the force PWM is enabled and in
REGULATOR_MODE_NORMAL the force PWM is disabled.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# be15411d 14-May-2012 Axel Lin <axel.lin@gmail.com>

regulator: tps62360: Fix build error due to missing semicolon

Fix below build error:
CC [M] drivers/regulator/tps62360-regulator.o
drivers/regulator/tps62360-regulator.c:351:1: error: expected ',' or ';' before 'extern'
make[2]: *** [drivers/regulator/tps62360-regulator.o] Error 1
make[1]: *** [drivers/regulator] Error 2
make: *** [drivers] Error 2

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


# 41097afd 13-May-2012 Axel Lin <axel.lin@gmail.com>

regulator: tps62360: Convert to set_voltage_sel and regulator_map_voltage_linear

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


# 7f225ba5 13-May-2012 Axel Lin <axel.lin@gmail.com>

regulator: tps62360: Convert to regulator_list_voltage_linear()

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


# 684ae39b 10-May-2012 Laxman Dewangan <ldewangan@nvidia.com>

regulator: tps62360: add dt support

Add dt support for the pmu device tps62360 and
Add binding documentation with example.
With this patch driver will support both device-tree and
non-device tree registration.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 8bdca009 10-May-2012 Laxman Dewangan <ldewangan@nvidia.com>

regulator: tps62360: make init_data of platform data to pointer.

Convert platform data member regulator_init_data to pointer type.
This will avoid the copy of entire regualator init data into
platform data member when adding dt support and it can be achieve
by simple assignment:
pdata->init_data = of_get_regulator_init_data(dev, dev->of_node);

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 2935fb18 08-May-2012 Laxman Dewangan <ldewangan@nvidia.com>

regulator: tps62360: fix stylistic issue and optimize code

Fix multiple stylistic issue like:
- The print message should be not break into multiple line.
- line gap after variable declaration and statement.
- checkpatch error.
- some typo.

Some enhancement on error message printing to print error value
also along with proper text.

Avoid voltage_base conversion to microvolts every time.
Put init functions in init section.
Using efficient function inplace of calling multiple function
to reduce the code size.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# a60cfce0 07-May-2012 Laxman Dewangan <ldewangan@nvidia.com>

regulator: tps62360: Provide settling time for voltage change

Settling time is require when there is voltage output change.
Implement set_voltage_time_sel() callback which returns delay time
for voltage change to settle down to new value.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 16ea003b 07-May-2012 Laxman Dewangan <ldewangan@nvidia.com>

regulator: tps62360: enable register cache

Enable cache of device register using regmap cache RBTREE.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 6c9eeb0f 17-Apr-2012 Axel Lin <axel.lin@gmail.com>

regulator: Remove unneeded include of linux/delay.h from regulator drivers

All the drivers that need delay for the regulator voltage output voltage to
stabilize after being enabled or after being set to a new value has been
converted to implement enable_time and set_voltage_time_sel callbacks.
Then regulator core will take care of the necessary delay.

For the drivers that don't need the delay, don't need to include linux/delay.h.
This patch removes the unneeded include of linux/delay.h in regulator drivers.

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


# 9a4bdd87 07-Apr-2012 Axel Lin <axel.lin@gmail.com>

regulator: tps62360: Convert to devm_regmap_init_i2c()

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>


# d1cf4f65 02-Apr-2012 Axel Lin <axel.lin@gmail.com>

regulator: Add support for tps62362 and tps62363 in tps62360-regulator driver

According to the datasheet[1], tps62360 is register compatible with tps62362.
tps62361B is register compatible with tps62363.
Thus this patch adds support for tps62362 and tps62363.

[1] http://www.ti.com/litv/pdf/slvsau9b

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


# c60f1718 27-Mar-2012 Axel Lin <axel.lin@gmail.com>

regulator: Remove unused name and client fields from struct tps62360_chip

The client field of struct tps62360_chip is not used after converting to regmap.
The name field of struct tps62360_chip is not used in this driver.

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


# 46783a04 06-Feb-2012 Axel Lin <axel.lin@gmail.com>

regulator: tps62360: Remove pointless test for unsigned less than zero

The variable 'selector' is a 'unsigned int', so it can never be less than zero.

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


# 6219929f 09-Jan-2012 Laxman Dewangan <ldewangan@nvidia.com>

regulator: TPS62360: Add tps62360 regulator driver

The regulator module consists of 1 DCDC. The output voltage
is configurable and is meant for supply power to the core
voltage of Soc.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>