History log of /linux-master/drivers/regulator/88pm8607.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>


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500

Based on 2 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e6626427 19-Mar-2019 Axel Lin <axel.lin@ingics.com>

regulator: 88pm8607: Convert to regulator core's simplified DT parsing code

Use regulator core's simplified DT parsing code to simply the driver
implementation.

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


# 0e819b51 26-Feb-2019 Axel Lin <axel.lin@ingics.com>

regulator: 88pm8607: Remove unused fields from struct pm8607_regulator_info

The *i2c and *i2c_8606 are no longer used since this driver was converted
to use regmap helpers. The *chip and *regulator are not really required.
So remove these unused fields.

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


# 2654d368 26-Feb-2019 Axel Lin <axel.lin@ingics.com>

regulator: 88pm8607: Simplify pm8607_list_voltage implementation

Set volt_table filed then we can use regulator_list_voltage_table.
Since we have volt_table setting, now we can remove vol_table from
struct pm8607_regulator_info.

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


# c32569e3 05-Dec-2018 Rob Herring <robh@kernel.org>

regulator: Use of_node_name_eq for node name comparisons

Convert string compares of DT node names to use of_node_name_eq helper
instead. This removes direct access to the node name pointer.

For instances using of_node_cmp, this has the side effect of now using
case sensitive comparisons. This should not matter for any FDT based
system which all of these are.

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Support Opensource <support.opensource@diasemi.com>
Cc: Sangbeom Kim <sbkim73@samsung.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 32cb5d30 28-Jan-2017 Bhumika Goyal <bhumirks@gmail.com>

regulator: 88pm8607: constify regulator_ops structure

Declare regulator_ops structures as const as it is only stored in the
ops field of a regulator_desc structure. This field is of type const, so
regulator_ops structures having this property can be made const too.

File size before: drivers/regulator/88pm8607.o
text data bss dec hex filename
3466 5488 0 8954 22fa drivers/regulator/88pm8607.o

File size after: drivers/regulator/88pm8607.o
text data bss dec hex filename
3978 4976 0 8954 22fa drivers/regulator/88pm8607.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 0cfeddbd 01-May-2015 Krzysztof Kozlowski <krzk@kernel.org>

regulator: 88pm8607: Constify platform_device_id

The platform_device_id is not modified by the driver and core uses it as
const.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.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>


# 6c794b26 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

regulator: drop owner assignment from platform_drivers

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

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# b8b27a44 09-Sep-2014 Guodong Xu <guodong.xu@linaro.org>

regulator: remove unnecessary of_node_get() to parent

These of_node_get() were added to balance refcount decrements inside of
of_find_node_by_name().
See: commit c92f5dd2c42f ("regulator: Add missing of_node_put()")

However of_find_node_by_name() was then replaced by of_get_child_by_name(),
which doesn't call of_node_put() against its input parameter.

So, need to remove these unnecessary of_node_get() calls.

Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# e54f19bf 25-Feb-2014 Jingoo Han <jg1.han@samsung.com>

regulator: 88pm8607: fix indent code style

Fix indent code style in order to fix the following checkpatch
issues.

ERROR: code indent should use tabs where possible
WARNING: please, no space before tabs
WARNING: please, no spaces at the start of a line

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>


# ca1e3f33 14-Feb-2014 Sachin Kamat <sachin.kamat@linaro.org>

regulator: 88pm8607: Use of_get_child_by_name

of_find_node_by_name walks the allnodes list, and can thus walk
outside of the parent node. Use of_get_child_by_name instead.

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


# bcb5fe44 03-Sep-2013 Axel Lin <axel.lin@ingics.com>

regulator: 88pm8607: Convert to devm_regulator_register

Signed-off-by: Axel Lin <axel.lin@ingics.com>
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>


# 405c5400 03-May-2013 Axel Lin <axel.lin@ingics.com>

regulator: Remove all platform_set_drvdata(pdev, NULL) in drivers

Since 0998d06310 "device-core: Ensure drvdata = NULL when no driver is bound",
this is done by driver core after device_release or on probe failure.
Thus we can remove all platform_set_drvdata(pdev, NULL) in drivers.

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


# 318c658b 04-Mar-2013 Axel Lin <axel.lin@ingics.com>

regulator: 88pm8607: Use enable_is_inverted flag with regulator_enable_regmap and friends APIs

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# c92f5dd2 27-Jan-2013 Axel Lin <axel.lin@ingics.com>

regulator: Add missing of_node_put()

of_find_node_by_name() returns a node pointer with refcount incremented, use
of_node_put() on it when done.

of_find_node_by_name() will call of_node_put() against from parameter,
thus we also need to call of_node_get(from) before calling
of_find_node_by_name().

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


# c6f0a0ef 23-Dec-2012 Axel Lin <axel.lin@ingics.com>

regulator: 88pm8607: Use apply_[reg|bit] with regmap based voltage_sel operations

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# adbf7eab 23-Dec-2012 Axel Lin <axel.lin@ingics.com>

regulator: 88pm8607: Update update_bit for BUCK2 in pm8607_set_voltage_sel

BUCK2 has the update_bit setting, but current code does not set update_bit
in pm8607_set_voltage_sel.

Signed-off-by: Axel Lin <axel.lin@ingics.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>


# 2e57d567 21-Sep-2012 Haojian Zhuang <haojian.zhuang@gmail.com>

mfd: 88pm860x: Device tree support

Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# ff13e9e2 16-Sep-2012 Haojian Zhuang <haojian.zhuang@marvell.com>

mfd: 88pm860x: Avoid to check resource for preg regulator

Since PREG regulator is the only one regulator in 88PM8606, and other
regulators are in 88PM8607. Checking resource as identifying regulator
is not a good way. We can use NULL resource to indentify PREG regulator.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# e7a7810a 16-Sep-2012 Jett.Zhou <jtzhou@marvell.com>

regulator: 88pm860x: Add pre-regulator support for 88pm860x regulator

Pre-regulator of 88pm8606 is mainly for support charging based on vbus,
it needs to be enabled for charging battery, and will be disabled in
some exception condition like over-temp.
Add the pre-regulator support for 88pm860x regulator driver.

Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# a70abacb 08-Aug-2012 Haojian Zhuang <haojian.zhuang@gmail.com>

mfd: 88pm860x: Use REG resource in regulator

Since IORESOURCE_IO is changed to IORESOURCE_REG in 88pm860x driver,
update self-defined IORESOURCE_IO resource to register offset that
is IORESOURCE_REG in regulator driver. And split regulator platform
data array into scattered platform data.

Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 02367029 07-Aug-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: 88pm860x: Convert to IORESOURCE_REG

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Tested-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# c006b21f 23-Apr-2012 Axel Lin <axel.lin@gmail.com>

regulator: 88pm8607: Use regulator_get_voltage_sel_regmap()

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


# ef26e0db 16-Apr-2012 Axel Lin <axel.lin@gmail.com>

regulator: 88pm8607: Use generic regmap enable/disable operations

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


# a67f7e6b 18-Apr-2012 Axel Lin <axel.lin@gmail.com>

regulator: 88pm8607: Fix writting value to vol_reg in pm8607_set_voltage_sel

commit 4ca1e1d "regulator: Convert 88pm8607 to set_voltage_sel" accidentally
changed the value writing to vol_reg.
What we want is to write val instead of selector to vol_reg.

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>


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

regulator: Convert 88pm8607 to get_voltage_sel

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


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

regulator: Convert 88pm8607 to set_voltage_sel

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


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

regulator: Add missing n_voltages setting for 88pm8607

Then we can remove the vol_nbits field from struct pm8607_regulator_info.

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


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

regulator: Set list_voltage callback for 88pm8607

Current code implements pm8607_list_voltage but does not set the list_voltage
callback function in pm8607_regulator_ops. Fix it.

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


# 3380643b 23-Feb-2012 Jett.Zhou <jtzhou@marvell.com>

regulator: fix the ldo configure according to 88pm860x spec

Signed-off-by: Jett.Zhou <jtzhou@marvell.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>


# 65602c32 17-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

regulator: Add module.h to drivers/regulator users as required

Another group of drivers that are taking advantage of the implicit
presence of module.h -- and will break when we pull the carpet out
from under them during a cleanup. Fix 'em now.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


# 99cd25ce 04-Aug-2011 Axel Lin <axel.lin@gmail.com>

regulator: 88pm8607: Fix off-by-one value range checking in the case of no id is matched

In the case of no id is matched, the variable i is equal to
ARRAY_SIZE(pm8607_regulator_info).

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 09969108 26-May-2011 Randy Dunlap <randy.dunlap@oracle.com>

regulator: Fix 88pm8607.c printk format warning

Fix printk format warning (seen on x86_64) and change to unsigned
output format:

drivers/regulator/88pm8607.c:417: warning: format '%d' expects type 'int', but argument 3 has type 'resource_size_t'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 586e1a17 06-May-2011 Haojian Zhuang <haojian.zhuang@marvell.com>

mfd: Avoid to use constraint name in 88pm860x regulator driver

Avoid to use constraint name in regulator driver. So use regulator id is used
instead in platform driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 07259a70 06-Apr-2011 Samuel Ortiz <sameo@linux.intel.com>

mfd: Use mfd cell platform_data for 88pm860x cells platform bits

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 22aad001 07-Mar-2011 Haojian Zhuang <haojian.zhuang@marvell.com>

mfd: Adopt mfd_data in 88pm860x regulator

Copy 88pm860x platform data into different mfd_data structure for
regulator driver. So move the identification of device node from
regulator driver to mfd driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 3a93f2a9 10-Nov-2010 Mark Brown <broonie@opensource.wolfsonmicro.com>

regulator: Report actual configured voltage to set_voltage()

Change the interface used by set_voltage() to report the selected value
to the regulator core in terms of a selector used by list_voltage().
This allows the regulator core to know the voltage that was chosen
without having to do an explict get_voltage(), which would be much more
expensive as it will generally access hardware.

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


# d06563cb 04-Sep-2010 Axel Lin <axel.lin@gmail.com>

regulator: 88pm8607 - fix value range checking for accessing info->vol_table

In choose_voltage(), we use i as array index of info->vol_table.
The valid value range for i should be 0 .. ARRAY_SIZE(info->vol_table) - 1.

Take LDO1 as example, ARRAY_SIZE(LDO1_table) is 4, vol_nbits of LDO1 is 2.
for (i = 0; i < (2 << info->vol_nbits); i++) is equivalent to
for (i = 0; i < 8; i++)
which is wrong.

The same value range checking also applies for index in pm8607_list_voltage().

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@openource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 9f79e9db 04-May-2010 Haojian Zhuang <haojian.zhuang@marvell.com>

regulator: use voltage number array in 88pm860x

A lot of condition comparision statements are used in original driver. These
statements are used to check the boundary of voltage numbers since voltage
number isn't linear.

Now use array of voltage numbers instead. Clean code with simpler way.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 192bbb95 29-Apr-2010 Haojian Zhuang <haojian.zhuang@marvell.com>

regulator: make 88pm860x sharing one driver structure

Remove a lot of driver structures in 88pm860x driver. Make regulators share
one driver structure.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>


# 34a4b239 10-Dec-2009 Haojian Zhuang <haojian.zhuang@marvell.com>

regulator: Unsupport 88pm8607 A0 and A1

Remove the support 88PM8607 A0/A1 stepping. There's some register
definition changes in B0 stepping. It can make software more efficient.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 53dbab7a 08-Jan-2010 Haojian Zhuang <haojian.zhuang@marvell.com>

mfd: Support 88pm8606 in 860x driver

88PM8606 and 88PM8607 are two discrete chips used for power management.
Hardware designer can use them together or only one of them according to
requirement.

There's some logic tightly linked between these two chips. For example, USB
charger driver needs to access both chips by I2C interface.

Now share one driver to these two devices. Only one I2C client is identified
in platform init data. If another chip is also used, user should mark it in
companion_addr field of platform init data. Then driver could create another
I2C client for the companion chip.

All I2C operations are accessed by 860x-i2c driver. In order to support both
I2C client address, the read/write API is changed in below.

reg_read(client, offset)
reg_write(client, offset, data)

The benefit is that client drivers only need one kind of read/write API. I2C
and MFD driver can be shared in both 8606 and 8607.

Since API is changed, update API in 8607 regulator driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# ddec6810 22-Oct-2009 Mark Brown <broonie@opensource.wolfsonmicro.com>

regulator: Ensure val is initialised in 88pm8607 choose_voltage()

If we fall through it means that we hit an unknown regulator/chip
combination so set -ENOENT as an explicit flag (the return code
is only used internally).

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


# be0e2d3e 08-Oct-2009 Haojian Zhuang <haojian.zhuang@gmail.com>

regulator: add 88PM8607 PMIC driver

Hi Liam,

Since Samuel merged a new version of mfd 88pm8607 driver, I format a
new patch on regulator 88pm8607. I paste the new patch in mail. Please
help to review again. And I also attach the mfd driver in mail.

From: Haojian Zhuang <haojian.zhuang@marvell.com>
Date: Thu, 8 Oct 2009 09:36:53 -0400
Subject: [PATCH] regulator: Add 88PM8607 PMIC driver

This patch adds regulator drivers for Marvell 88PM8607 PMIC.
This controller contains 3 DVC and 14 LDO regulators. This controller
uses I2C interface.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>