Commit Graph

955 Commits (b5fb77e0188dc85630b395eb0faddc4987be6ddb)

Author SHA1 Message Date
Axel Lin c2543b5f6c regulator: wm831x-ldo: Use regulator_map_voltage_linear for wm831x_alive_ldo_ops
wm831x_alive_ldo_ops uses simple linear voltage maps.
Thus use regulator_map_voltage_linear is more efficient than using the default
regulator_map_voltage_iterate.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:05 +01:00
Axel Lin f2d103add1 regulator: wm8994: Convert wm8994_ldo1_ops to regulator_[list|map]_voltage_linear
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:05 +01:00
Axel Lin 0713e6abf3 regulator: anatop: Convert to regulator_list_voltage_linear()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:05 +01:00
Axel Lin 8029a00686 regulator: palmas: Use regulator_[list|map]_voltage_linear() for palmas_ops_smps10
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:04 +01:00
Mark Brown 107a3967a8 regulator: wm8350: Convert DCDCs to set_voltage_sel() and linear voltages
The WM8350 DCDCs have a simple linear mapping from selectors to voltages
so can be converted very simply to use the new infrastructure for a nice
reduction in code size.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:04 +01:00
Mark Brown a540f68286 regulator: wm8350: Convert to core regmap-based enable operations
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:04 +01:00
Mark Brown b4ec87aedb regulator: wm8350: Convert to use core regmap vsel readback
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:03 +01:00
Axel Lin 6333e9ddf4 regulator: ab8500: Let regulator core handle the case no delay for setting new voltage if regulator is off
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:03 +01:00
Axel Lin cad8d76e20 regulator: lp3971: Use regulator_list_voltage_table()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:02 +01:00
Axel Lin 055917ac56 regulator: tps6507x: Use regulator_list_voltage_table()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:02 +01:00
Axel Lin c55979b7bd regulator: tps6105x: Use regulator_list_voltage_table()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:01 +01:00
Axel Lin 4f73ccad5c regulator: lp3972: Use regulator_list_voltage_table()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:01 +01:00
Axel Lin ec1cc4d9da regulator: ab8500: Use regulator_list_voltage_table()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:01 +01:00
Axel Lin a3beb74261 regulator: ab3100: Use regulator_list_voltage_table()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:25:01 +01:00
Mark Brown 3a4b0a07fa regulator: core: Use dev_get_regmap() to find the regmap
If no regmap is explicitly specified then use dev_get_regmap() to obtain
one. The driver must explicitly enable any actual usage of the regmap
so there's no concern with unwanted usage.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-06-03 13:20:34 +01:00
Mark Brown 361ff50174 regulator: Use newly added devres_release() rather than open coding
devres_release() will call the destructor for the resource as well as
freeing the devres data.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-06-03 13:20:12 +01:00
Axel Lin 8b7485ef62 regulator: core: Call set_voltage_time_sel() only when the regulator is on
If the regulator is not on, it won't take time setting new voltage.
So only call set_voltage_time_sel() to get the necessary delay when
the regulator is on.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:20:00 +01:00
Axel Lin cffc9592fd regulator: core: Allow drivers to set voltage mapping table in regulator_desc
Some regulator hardware use table based mapping can set volt_table in
regulator_desc and use regulator_list_voltage_table() for their list_voltage
callback.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:19:45 +01:00
Linus Torvalds 4b78147468 MFD changes for 3.5
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPw2QKAAoJEIqAPN1PVmxKfv8P/2L5d38tc3+9wYuGI1l+k7Mz
 xQt2PdAx/kHQGTjLE1DSoeOD6dn4aodFbPaTcsLsU9Eo4IiJnT68b8adr/bqYHKU
 Cod6NSPJMaBxLBJZxXsA7nY69Z6O5SMjXxEQsiDc24gaP0jjwaeY35KJSfMug8nF
 DA6rvEpchkF8QXzBmkO2t2/uPYr1YWqDZQkauLDnLRG01JnGXFz5ajv9N5pYhiFt
 QyYtheg8yEnfwnQ6AlmRtGK75jZRVmrj0kOzRjE9UL7ZwtzswWJes+RE3tlgk89m
 JQ7KASRmmqLpvcVJ9fG9SlGX//yBO6OEp5Km06RTxgmt0XftBDVqBTjk1EG2tfMR
 SR0NIz6gJ0twKAe6U0d+5HMYalOU45H5ha9e3vCqZ8vl9JfmM95RS+TmWbGcRIqj
 04Y5x3I4zq6e9D0u+211BeuRfzkQiefwWJmdPpn0oac3u5LeYbRj/aQ85fqwJWzG
 f99D9VU5xgfFHPAtL3SLFiwgd9yOiMBar6eeIva+okDyOW3KaEUzs8Y4dgDyvYcg
 IU//JGK51vLVmI5kXtGCwYkgRLF/Y7WKZ8TwypT+SY6iv6tPQVvApOZljq7RC9GI
 mXx2z2slA90jlg3TlEFZfxr1WqbZ3TCbonU1riLeMEtkiXUpLtmKC8gbhOqfGvvn
 Nzgt+YqRJXafZdELb/S+
 =Rh0r
 -----END PGP SIGNATURE-----

Merge tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6

Pull MFD changes from Samuel Ortiz:
 "Besides the usual cleanups, this one brings:

   * Support for 5 new chipsets: Intel's ICH LPC and SCH Centerton,
     ST-E's STAX211, Samsung's MAX77693 and TI's LM3533.

   * Device tree support for the twl6040, tps65910, da9502 and ab8500
     drivers.

   * Fairly big tps56910, ab8500 and db8500 updates.

   * i2c support for mc13xxx.

   * Our regular update for the wm8xxx driver from Mark."

Fix up various conflicts with other trees, largely due to ab5500 removal
etc.

* tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (106 commits)
  mfd: Fix build break of max77693 by adding REGMAP_I2C option
  mfd: Fix twl6040 build failure
  mfd: Fix max77693 build failure
  mfd: ab8500-core should depend on MFD_DB8500_PRCMU
  gpio: tps65910: dt: process gpio specific device node info
  mfd: Remove the parsing of dt info for tps65910 gpio
  mfd: Save device node parsed platform data for tps65910 sub devices
  mfd: Add r_select to lm3533 platform data
  gpio: Add Intel Centerton support to gpio-sch
  mfd: Emulate active low IRQs as well as active high IRQs for wm831x
  mfd: Mark two lm3533 zone registers as volatile
  mfd: Fix return type of lm533 attribute is_visible
  mfd: Enable Device Tree support in the ab8500-pwm driver
  mfd: Enable Device Tree support in the ab8500-sysctrl driver
  mfd: Add support for Device Tree to twl6040
  mfd: Register the twl6040 child for the ASoC codec unconditionally
  mfd: Allocate twl6040 IRQ numbers dynamically
  mfd: twl6040 code cleanup in interrupt initialization part
  mfd: Enable ab8500-gpadc driver for Device Tree
  mfd: Prevent unassigned pointer from being used in ab8500-gpadc driver
  ...
2012-05-29 11:53:11 -07:00
Linus Torvalds e8650a0823 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial updates from Jiri Kosina:
 "As usual, it's mostly typo fixes, redundant code elimination and some
  documentation updates."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits)
  edac, mips: don't change code that has been removed in edac/mips tree
  xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer
  lib: Change mail address of Oskar Schirmer
  net: Change mail address of Oskar Schirmer
  arm/m68k: Change mail address of Sebastian Hess
  i2c: Change mail address of Oskar Schirmer
  net: Fix tcp_build_and_update_options comment in struct tcp_sock
  atomic64_32.h: fix parameter naming mismatch
  Kconfig: replace "--- help ---" with "---help---"
  c2port: fix bogus Kconfig "default no"
  edac: Fix spelling errors.
  qla1280: Remove redundant NULL check before release_firmware() call
  remoteproc: remove redundant NULL check before release_firmware()
  qla2xxx: Remove redundant NULL check before release_firmware() call.
  aic94xx: Get rid of redundant NULL check before release_firmware() call
  tehuti: delete redundant NULL check before release_firmware()
  qlogic: get rid of a redundant test for NULL before call to release_firmware()
  bna: remove redundant NULL test before release_firmware()
  tg3: remove redundant NULL test before release_firmware() call
  typhoon: get rid of redundant conditional before all to release_firmware()
  ...
2012-05-22 19:22:50 -07:00
Linus Torvalds ac1806572d regulator updates for 3.5
The major thing here is the addition of some helpers to factor code out
 of drivers, making a fair proportion of regulators much more just data
 rather than code which is nice.
 
 - Helpers in the core for regulators using regmap, providing generic
   implementations of the enable and voltage selection operations which
   just need data to describe them in the drivers.
 - Split out voltage mapping and voltage setting, allowing many more
   drivers to take advantage of the infrastructure for selectors.
 - Loads and loads of cleanups from Axel Lin once again, including many
   changes to take advantage of the above new framework features
 - New drivers for Ricoh RC5T583, TI TPS62362, TI TPS62363, TI TPS65913,
   TI TWL6035 and TI TWL6037.
 
 Some of the registration changes to support the core refactoring caused
 so many conflicts that eventually topic branches were abandoned for this
 release.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJPuhn4AAoJEBus8iNuMP3d6m4P/0gNiGbTwDlOgU/mPDyW2jJc
 xqvABzlOIQbI28/dgFYO/nA9YWW7VxpEaAPlkg4auk4wQ9tEyEjEqlOCfzymMetY
 0k6L4n8LqFsbMAeNQbFPbW7PpWp59oI97J9afJI4kEJmHmOlmlL9U82/TzUFfGrA
 yiPlzue+DotKB7FjsymLMbLyeFoiMSOIjVDk8OTs0u1EqeOo4nJG2ODLa+yGo+QW
 0yqQExEdIp28WXbkZQtmsOmj2V/uhkKAv2i2PDT2TmlduhNdCGxJsgZIiZCl1R4c
 vwirbfb+v93HAxvADdgj8eVdLJXQ0oItxr2ohKt8AgXIBrUJBsMkCQGvulZjRb+a
 /A/7Ea3o7HI+PQx4aIP0yGA/eBwbzo/cmBxU+KGzTA9Mov0fnK1kkUs6gfrYBdli
 U/TcMizDa1539BrKBIF2gmlRCKx8YD9ic27Zl1x4i5cgAP1gdYgdBYBybKHMpo2+
 9Xp1R9C8FvvgytIqJ3QQ34tRomZyQ5iUaIuIuAosoQ6iuF33EQ6I0FvHcIe74iOi
 zcu62ZPiuSwg1di9PrTERLcbrS81lvXpOWt5+EorzqoGXWzVIGoTh1F2kWEEMhaD
 Q6V5iE03VC0k3tj/MmtTiVkyhNkRElQDtekE9sfm15pdVnpu/+b+iicWJa7QFbZQ
 MybS0BBFQKhJXUDttKtS
 =UR7s
 -----END PGP SIGNATURE-----

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

Pull regulator updates from Mark Brown:
 "The major thing here is the addition of some helpers to factor code
  out of drivers, making a fair proportion of regulators much more just
  data rather than code which is nice.

  - Helpers in the core for regulators using regmap, providing generic
    implementations of the enable and voltage selection operations which
    just need data to describe them in the drivers.
  - Split out voltage mapping and voltage setting, allowing many more
    drivers to take advantage of the infrastructure for selectors.
  - Loads and loads of cleanups from Axel Lin once again, including many
    changes to take advantage of the above new framework features
  - New drivers for Ricoh RC5T583, TI TPS62362, TI TPS62363, TI
    TPS65913, TI TWL6035 and TI TWL6037.

  Some of the registration changes to support the core refactoring
  caused so many conflicts that eventually topic branches were abandoned
  for this release."

* tag 'regulator-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (227 commits)
  regulator: tps65910: use of_node of matched regulator being register
  regulator: tps65910: dt: support when "regulators" node found
  regulator: tps65910: add error message in case of failure
  regulator: tps62360: dt: initialize of_node param for regulator register.
  regulator: tps65910: use devm_* for memory allocation
  regulator: tps65910: use small letter for regulator names
  mfd: tpx6586x:  Depend on regulator
  regulator: regulator for Palmas Kconfig
  regulator: regulator driver for Palmas series chips
  regulator: Enable Device Tree for the db8500-prcmu regulator driver
  regulator: db8500-prcmu: Separate regulator registration from probe
  regulator: ab3100: Use regulator_map_voltage_iterate()
  regulator: tps65217: Convert to set_voltage_sel and map_voltage
  regulator: Enable the ab8500 for Device Tree
  regulator: ab8500: Split up probe() into manageable pieces
  regulator: max8925: Remove check_range function and max_uV from struct rc5t583_regulator_info
  regulator: max8649: Remove unused check_range() function
  regulator: rc5t583: Remove max_uV from struct rc5t583_regulator_info
  regulator: da9052: Convert to set_voltage_sel and map_voltage
  regulator: max8952: Use devm_kzalloc
  ...
2012-05-21 16:49:16 -07:00
Laxman Dewangan 84df8c1241 regulator: tps65910: use of_node of matched regulator being register
After getting matched regulators by using of_regulator_match(),
initialize the config.of_node of regulator being register with
of_regulator_match.of_node of that regulator.
This is require for supporting regulator consumers in dt.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-20 18:22:41 +01:00
Laxman Dewangan 92ab953bd6 regulator: tps65910: dt: support when "regulators" node found
The device tree binding for the tps65910 is described as:
	tps65911 {
		reg = <0x2d>
		:::::::::
		regulators {
			compatible = "ti,tps65911";
			ldo1_reg: ldo1 {
				/** regulator entry */
			};

			ldo2_reg: ldo2 {
				/** regulator entry */
			};
			::::::::::
		};
	};

Support the regulators functionality only when there is "regulators"
child node available for tps65910.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-20 18:22:41 +01:00
Laxman Dewangan 7e9a57e626 regulator: tps65910: add error message in case of failure
Prints error message whenever there is failure on resource
allocation.
Also used dev_* to print messages instead of pr_*

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-20 18:22:41 +01:00
Laxman Dewangan 9fc3815e26 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>
2012-05-20 18:22:41 +01:00
Richard Zhao b09530ef84 mfd: Make anatop register accessor more flexible and rename meaningfully
- rename to anatop_read_reg and anatop_write_reg
 - anatop_read_reg directly return reg value
 - anatop_write_reg write reg with mask

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Reviewed-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:07 +02:00
Mark Brown cd99758ba3 mfd: Convert wm831x to irq_domain
The modern idiom is to use irq_domain to allocate interrupts. This is
useful partly to allow further infrastructure to be based on the domains
and partly because it makes it much easier to allocate virtual interrupts
to devices as we don't need to allocate a contiguous range of interrupt
numbers.

Convert the wm831x driver over to this infrastructure, using a legacy
IRQ mapping if an irq_base is specified in platform data and otherwise
using a linear mapping, always registering the interrupts even if they
won't ever be used. Only boards which need to use the GPIOs as
interrupts should need to use an irq_base.

This means that we can't use the MFD irq_base management since the
unless we're using an explicit irq_base from platform data we can't rely
on a linear mapping of interrupts.  Instead we need to map things via
the irq_domain - provide a conveniencem function wm831x_irq() to save a
small amount of typing when doing so. Looking at this I couldn't clearly
see anything the MFD core could do to make this nicer.

Since we're not supporting device tree yet there's no meaningful
advantage if we don't do this conversion in one, the fact that the
interrupt resources are used for repeated IP blocks makes accessor
functions for the irq_domain more trouble to do than they're worth.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:07 +02:00
Rhyland Klein 3f7e82759c mfd: Commonize tps65910 regmap access through header
This change removes the read/write callback functions in favor of common
regmap accessors inside the header file. This change also makes use of
regmap_read/write for single register access which maps better onto what this
driver actually needs.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:25:23 +02:00
Laxman Dewangan 68d8c1cd51 regulator: tps65910: use devm_* for memory allocation
use the devm_* apis for memory allocation.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-19 18:41:29 +01:00
Laxman Dewangan 33a6943d2c regulator: tps65910: use small letter for regulator names
Use the small-letter for names of different regulator to
match the names with dt binding documents.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-19 18:17:53 +01:00
Graeme Gregory 4c5dabce4e regulator: regulator for Palmas Kconfig
Add the Kconfig/Makefile stuff for the palmas regulator driver

Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-19 12:45:25 +01:00
Graeme Gregory e5ce4208f1 regulator: regulator driver for Palmas series chips
Palmas has both Switched Mode (SMPS) and Linear (LDO) regulators in it.
This regulator driver allows software control of these regulators.

The regulators available on Palmas series chips vary depending on the muxing.
This is handled automatically in the driver by reading the mux info from OTP.

Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-19 12:45:18 +01:00
Lee Jones 1bdd670a32 regulator: Enable Device Tree for the db8500-prcmu regulator driver
Here we use the previous regulator register code separated from probe to
register each of the regulators mentioned in Device Tree.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-18 16:38:00 +01:00
Lee Jones 8986cf8852 regulator: db8500-prcmu: Separate regulator registration from probe
This will provide us with a convenient way to register regulators when
booting with Device Tree both enabled & disabled and will save us a
great deal of code duplication in time.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-18 16:36:36 +01:00
Axel Lin b13296d070 regulator: ab3100: Use regulator_map_voltage_iterate()
regulator_map_voltage_iterate() is for drivers implementing set_voltage_sel()
and list_voltage() to use it as their map_voltage() operation.

In this case, regulator_map_voltage_iterate() happen to be doing the same thing
as ab3100_get_best_voltage_index() function. So we can use it to replace
ab3100_get_best_voltage_index() function.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-18 08:39:57 +01:00
Axel Lin 8b22285fd7 regulator: tps65217: Convert to set_voltage_sel and map_voltage
Convert tps65217_pmic_ops to use set_voltage_sel and map_voltage.
After this convertion, we can also use tps65217_pmic_set_voltage_sel()
for set_voltage_sel callback of tps65217_pmic_ldo1_ops.
Thus this patch also removes tps65217_pmic_ldo1_set_voltage_sel() function.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-18 08:38:32 +01:00
Lee Jones 3a8334b948 regulator: Enable the ab8500 for Device Tree
Here we setup the ab8500 regulator driver for DT. We first do
this in the normal way, by providing a match structure during
initialisation, but then we provide information so that
whilst probing we can use existing data structures to do DT
look-ups.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-18 08:37:25 +01:00
Lee Jones a7ac1d9e4e regulator: ab8500: Split up probe() into manageable pieces
ab8500's probe() function is becoming quite large, so in the lead
up to Device Tree enablement which will fork the thread of execution
this patch splits it into 3 main areas; basic error checking will
remain in probe(), but regulator register initialisation and regulator
registration have been moved to their own functions which will
be called in sequence by probe() and the DT equivalent.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-18 08:36:45 +01:00
Axel Lin 68c7ff8f9b regulator: max8925: Remove check_range function and max_uV from struct rc5t583_regulator_info
This driver has been converted to use regulator_map_voltage_linear and
set_voltage_sel now. regulator_map_voltage_linear will check the the voltage
falls within specified range. The check_range() function and max_uV field are
not used now, remove them.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-17 23:00:56 +01:00
Axel Lin 0cbd670218 regulator: max8649: Remove unused check_range() function
This driver has been converted to use regulator_map_voltage_linear and
set_voltage_sel now. regulator_map_voltage_linear will check the the voltage
falls within specified range. The check_range() function is not used, remove it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-17 23:00:55 +01:00
Axel Lin 8b370e086b regulator: rc5t583: Remove max_uV from struct rc5t583_regulator_info
This driver has been converted to set_voltage_sel and regulator_map_voltage_linear.
regulator_map_voltage_linear will check the voltage falls within specified range.
The max_uV field is not used now, remove it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-17 23:00:55 +01:00
Axel Lin 4923b48b27 regulator: da9052: Convert to set_voltage_sel and map_voltage
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-16 09:48:57 +01:00
Axel Lin 372de4aa5e regulator: max8952: Use devm_kzalloc
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-16 09:48:37 +01:00
Axel Lin dde2b724e6 regulator: isl6271a: Convert to set_voltage_sel and regulator_map_voltage_linear
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-16 09:46:58 +01:00
Axel Lin a9b2899b9d regulator: isl6271a: Convert to get_voltage_sel
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-16 09:46:57 +01:00
Axel Lin 2b7a7a4e83 regulator: isl6271a: Use regulator_list_voltage_linear()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-16 09:46:57 +01:00
Axel Lin 5eb3394f86 regulator: max8660: Convert to set_voltage_sel and regulator_map_voltage_linear
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-15 18:35:42 +01:00
Axel Lin 9392c4f06a regulator: max8660: Convert to get_voltage_sel
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-15 18:35:30 +01:00
Axel Lin 134d34a835 regulator: max8660: Convert to regulator_list_voltage_linear()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-15 18:35:29 +01:00
Axel Lin bae5e9c33f regulator: da903x: Kill da903x_[get|set]_[ldo12|ldo14]_voltage_sel() functions
Now the implementation of da903x_set_voltage_sel, da9030_set_ldo14_voltage_sel,
and da9034_set_ldo12_voltage_sel are exactly the same.

da903x_get_voltage_sel, da9030_get_ldo14_voltage_sel and
da9034_get_ldo12_voltage_sel are exactly the same.

So we can use da903x_[get|set]_voltage_sel and kill other functions.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-15 18:32:57 +01:00
Axel Lin c972a02948 regulator: da903x: Convert to set_voltage_sel and map_voltage
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-15 18:32:57 +01:00
Axel Lin 70b4e7862d regulator: da903x: Convert to regulator_list_voltage_linear()
Use regulator_list_voltage_linear() to replace da903x_list_voltage().

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-15 18:32:57 +01:00
Laxman Dewangan 9a00630c3d 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>
2012-05-14 18:03:04 +01:00
Axel Lin 70e5f6456c regulator: rc5t583: Convert to regulator_set_voltage_sel_regmap 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>
2012-05-14 17:49:24 +01:00
Axel Lin 3209be1798 regulator: rc5t583: 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>
2012-05-14 17:49:13 +01:00
Axel Lin 40baecee48 regulator: max8649: Convert to regulator_set_voltage_sel_regmap and regulator_map_voltage_linear
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-14 17:34:48 +01:00
Axel Lin 0fb737b566 regulator: max8649: Convert to regulator_list_voltage_linear()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-14 17:34:48 +01:00
Axel Lin 817d8c2d9b regulator: max8649: Use regulator_get_voltage_sel_regmap()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-14 17:34:47 +01:00
Axel Lin 0f65402b25 regulator: max8649: Convert to get_voltage_sel
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-14 17:34:46 +01:00
Axel Lin be15411d97 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>
2012-05-14 17:34:31 +01:00
Mark Brown b68b45d77d regulator: wm8994: Allow registration with no platform data
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-14 15:25:33 +01:00
Mark Brown b1a868310e regulator: core: Don't open code _regulator_is_enabled()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-05-14 15:25:19 +01:00
Mark Brown f0b067d9b6 regulator: wm831x-dcdc: Add missing checks for pdata before use
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-14 11:41:36 +01:00
Axel Lin cd8318cb9e regulator: max8925: Convert to set_voltage_sel() and map_voltage()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-14 11:00:40 +01:00
Axel Lin 4093e739f7 regulator: max8925: Convert to regulator_list_voltage_linear()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-14 11:00:39 +01:00
Axel Lin 3c8983b9ac regulator: max8925: Convert to get_voltage_sel
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-14 11:00:39 +01:00
Mark Brown e81dba85c6 regulator: core: Release regulator-regulator supplies on error
If we fail while registering a regulator make sure we release the supply
for the regulator if there is one.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@vger.kernel.org
2012-05-14 09:31:35 +01:00
Axel Lin 41097afd64 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>
2012-05-14 09:12:00 +01:00
Axel Lin 7f225ba585 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>
2012-05-14 09:11:51 +01:00
Axel Lin ccfcb1c3cf regulator: core: Ensure simple linear voltage mappings falls within the specified range
Integer division may truncate the result.
Use DIV_ROUND_UP to ensure simple linear voltage mappings falls within the
specified range.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-14 09:11:34 +01:00
Laxman Dewangan 684ae39b91 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>
2012-05-13 13:47:49 +01:00
Laxman Dewangan 8bdca009e6 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>
2012-05-13 13:47:47 +01:00
Rhyland Klein 6790178f55 regulator: tps65910 regulator: add device tree support
Add devicetree based initialization support for TI tps65910 regulators.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-12 11:18:50 +01:00
Axel Lin 9447f35a1e regulator: da903x: Convert to get_voltage_sel
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-12 11:12:41 +01:00
Axel Lin d4eb56a162 regulator: da903x: Fix list voltage for da9030 ldo14
da903x_list_voltage does not return correct voltage for da9030 ldo14.
Implement da9030_list_ldo14_voltage to return correct voltage for da9030 ldo14.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-12 11:12:41 +01:00
Mark Brown 5ceba7bab0 regulator: Staticise non-exported symbol s5m8767_opmode_reg
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-12 11:11:58 +01:00
Mark Brown c54a155d4d regulator: wm8400: Modernise driver
Update the driver to use all the regmap based helpers, saving a nice chunk
of code (especially for the DCDCs).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-12 11:11:48 +01:00
Mark Brown d31e954e07 regulator: wm831x: Convert to regulator_list_voltage_linear()
Only the alive LDOs can actually use this as all the other regulators have
two linear ranges.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-12 11:11:40 +01:00
Mark Brown bca7bbfff3 regulator: core: Allow drivers to set simple linear voltage maps as data
A lot of regulator hardware maps selectors on to voltages with a simple
linear mapping function

    selector = base + (selector * step size)

Provide off the shelf list_voltage() and map_voltage() operations which
use new min_uV and uV_step members in the regulator_desc to implement
this function.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-05-12 11:11:32 +01:00
Mark Brown e843fc4616 regulator: core: Allow regulators to provide a voltage to selector mapping
In order to allow more drivers to factor things out into data allow
drivers to provide a mapping function to convert voltages into selectors.
This allows any driver to use set_voltage_sel(). The existing mapping
based on iterating over list_voltage() is provided as an operation which
can be assigned to the new map_voltage() function though for ease of
transition it is treated as the default.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-05-12 11:11:23 +01:00
Mark Brown 5949a7e9ab Merge remote-tracking branch 'regulator/topic/drivers' into regulator-next
Conflicts:
	drivers/regulator/88pm8607.c (simple overlap with a bugfix in v3.4)
2012-05-12 11:10:25 +01:00
Mark Brown 178e43aef2 Merge remote-tracking branches 'regulator/topic/core', 'regulator/topic/regmap' and 'regulator/topic/register' into regulator-next 2012-05-12 11:09:47 +01:00
Mark Brown dcf701125e regulator: core: Warn on missing struct device
The core really wants a struct device to be supplied for regulators and
there's no reason this should be impossible so provide one so complain
if we didn't get one.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-05-10 10:48:37 +01:00
Mark Brown 0f82b6cf76 regulator: dummy: Specify a struct device
This will be becoming mandatory.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-05-10 10:48:28 +01:00
Mark Brown b7ca87884b regulator: wm831x: Register all normal regulators
Register all normal regulators rather than skipping unconfigured ones now
that the core can handle regulators without init data. Skip the boost and
isink regulators since they are normally controlled by other drivers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-10 00:51:10 +01:00
NeilBrown 411a2df509 regulator: twl-regulator: make TWL4030_ALLOW_UNSUPPORTED more configurable.
The regulators in the twl4030 can provide some voltage settings
that are not offically supported.
These settings are disabled by default, but can be enabled with
  CONFIG_TWL4030_ALLOW_UNSUPPORTED=y
However
 - that config variable is not mentioned in any Kconfig so cannot
   be used, and
 - a global setting is clumsy - a per regulator setting would be
   better.

So define a new 'feature' flag that a board file can set to enable
these unsupported volatages for boards which need them.

This flag cannot (yet) be set using device-tree.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-09 10:04:33 +01:00
Axel Lin 1f904fd1cd regulator: tps65910: Convert to get_voltage_sel
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>
2012-05-09 09:52:13 +01:00
Mark Brown 5d0526eade regulator: wm8994: Use main I2C device as struct device
This makes logging a bit clearer as it gives the actual bus location and
makes things like board hookup a bit smoother.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-08 18:41:07 +01:00
Laxman Dewangan 2935fb18aa 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>
2012-05-08 12:42:32 +01:00
Mark Brown 053fa1b752 regulator: wm831x-dcdc: Convert to gpio_request_one()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-07 18:23:50 +01:00
Mark Brown 09e3fd202d regulator: wm8994: Convert to gpio_request_one()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-07 18:23:44 +01:00
Laxman Dewangan a60cfce051 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>
2012-05-07 15:21:53 +01:00
Laxman Dewangan 16ea003bd1 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>
2012-05-07 15:21:53 +01:00
Mark Brown 968c2c1707 regulator: Actually free the regulator in devm_regulator_put()
It turns out that (quite surprisingly) devres_destroy() only undoes the
devres mapping, it doesn't destroy the underlying resource, meaning that
anything using devm_regulator_put() would leak. While we wait for the new
devres_release() which does what we want to get merged open code it in
devm_regulator_put().

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-05-07 13:14:44 +01:00
Ying-Chun Liu (PaulLiu) 8e8a507c24 regulator: da9052: fix bug in device tree iteration loop
The driver of da9052 is buggy due to the iteration loop of device tree.
This patch fix the loop condition to make the driver work with device tree.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-07 12:51:36 +01:00
Laxman Dewangan 9a50dba509 regulator: fixed: add property for gpio open drain flag
Add property for the gpio flag open drain when registering
fixed regulator.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-07 12:31:05 +01:00
Axel Lin c006b21f7f 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>
2012-05-04 13:32:06 +01:00
Axel Lin 15b397d7e7 regulator: rc5t583: Use regulator_get_voltage_sel_regmap()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-04 13:29:26 +01:00
Axel Lin 09812bc40c regulator: da9052: Use regulator_get_voltage_sel_regmap()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-04 13:29:25 +01:00
Thierry Reding 62f6b08793 tps6586x: Add device tree support
This commit adds device tree support for the TPS6586x regulator.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-04 13:25:16 +01:00