diff mbox

Applied "regulator: rk808: remove linear range definitions with a single range" to the regulator tree

Message ID E1aukkg-0007km-6s@debutante (mailing list archive)
State New, archived
Headers show

Commit Message

Mark Brown April 25, 2016, 5:56 p.m. UTC
The patch

   regulator: rk808: remove linear range definitions with a single range

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From afcd666d9db0ebfbf2751cce1e07b548547ca82e Mon Sep 17 00:00:00 2001
From: Wadim Egorov <w.egorov@phytec.de>
Date: Mon, 25 Apr 2016 15:20:43 +0200
Subject: [PATCH] regulator: rk808: remove linear range definitions with a
 single range

The driver was using only linear ranges. Now we remove linear range
definitions with a single range. So we have to add an ops struct for
ranges and adjust all other ops functions accordingly.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/rk808-regulator.c | 90 +++++++++++++++++++++----------------
 1 file changed, 51 insertions(+), 39 deletions(-)

Comments

Heiko Stübner April 26, 2016, 7:33 p.m. UTC | #1
Am Montag, 25. April 2016, 18:56:54 schrieb Mark Brown:
> The patch
> 
>    regulator: rk808: remove linear range definitions with a single range
> 
> has been applied to the regulator tree at
> 
>    git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git

with this patch applied, 4.6.0-rc5-next-20160426 fails to boot on 
rk3288-veyron devices with the bug below. Reverting this one patch
results in the system booting again:

[    1.059661] ------------[ cut here ]------------
[    1.064272] kernel BUG at drivers/regulator/helpers.c:255!
[    1.069750] Internal error: Oops - BUG: 0 [#1] SMP ARM
[    1.074880] Modules linked in:
[    1.077943] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.6.0-rc5-next-20160426 #133
[    1.085504] Hardware name: Rockchip (Device Tree)
[    1.090201] task: ee078000 ti: ee066000 task.ti: ee066000
[    1.095597] PC is at regulator_map_voltage_linear+0xcc/0xd4
[    1.101163] LR is at regulator_map_voltage+0x1c/0x5c
[    1.106121] pc : [<c06aed10>]    lr : [<c06ab374>]    psr: 60000013
[    1.106121] sp : ee0679b0  ip : c13a05b8  fp : ee64a220
[    1.117583] r10: 000f4240  r9 : c13a05b8  r8 : 000f4240
[    1.122800] r7 : 000f4240  r6 : c0cdc768  r5 : ee5f7800  r4 : 000f4240
[    1.129317] r3 : 00000000  r2 : 000f4240  r1 : 000f4240  r0 : ee5f7800
[    1.135836] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[    1.142960] Control: 10c5387d  Table: 0020406a  DAC: 00000051
[    1.148697] Process swapper/0 (pid: 1, stack limit = 0xee066220)
[    1.154695] Stack: (0xee0679b0 to 0xee068000)
[    1.159046] 79a0:                                     ee5f7800 ffffffff 000f4240 000f4240
[    1.167217] 79c0: 000f4240 c06ab374 ee5f7800 c06ab4a4 c0f3386c ee0679f4 ee631580 c03cddd0
[    1.175386] 79e0: ee62ea10 ee5f7800 c0cdc768 ee631580 00000000 000f4240 000f4240 c06acab4
[    1.183557] 7a00: 000f4240 c0612e14 c0f13724 ee5f7800 c13a05b8 c1395f08 ee64a220 ee631480
[    1.191726] 7a20: ee62dc10 ee633900 ee5f7860 c0413184 ee62ef50 c06af210 ee067aac ee5f79fc
[    1.199897] 7a40: ee5f7814 ee5f781c ee62ef50 ee64a810 ee067aac c0cdc768 ee633750 ee62ea10
[    1.208066] 7a60: ee62ef50 ee067aac ee64a220 c06af258 ee64a810 c13a0428 00000006 c0cdc814
[    1.216236] 7a80: ee62ea10 c06b9704 ee03f000 80000001 00000004 00000000 ee6305f0 ee64a800
[    1.224406] 7aa0: eefd9f8c ee64a400 c145ad98 ee64a220 ee62dc10 ee62ef50 eefdb068 ee64a400
[    1.232576] 7ac0: 00000000 00000000 00000000 00000000 00000001 ee64a810 c06b9574 c13a0368
[    1.240746] 7ae0: c13a0354 00000000 00000000 c145ad98 00000000 c079eef0 ee64a810 c145ad90
[    1.248916] 7b00: 00000000 c13a0368 00000000 c079d77c 00000100 ef5bc901 ee64a96c 00000000
[    1.257085] 7b20: ee64a810 ee067b60 ee067b40 c079d8ec 00000000 00000000 00000000 c079bc78
[    1.265255] 7b40: ee04bf70 ee3af338 ee64a810 ee64a810 ee64a844 00000001 c145ad6c c079daa0
[    1.273425] 7b60: ee64a810 00000001 ee64a810 ee64a810 ee64a810 c13b15b8 c145ad6c c079c7bc
[    1.281595] 7b80: ee64a810 ee64a818 ee64a220 c079b334 00000000 c05a7b20 ee64a800 ee64a810
[    1.289765] 7ba0: ee64a800 ee64a810 00000000 00000010 ee64a810 ee62ed44 00000000 c079f140
[    1.297935] 7bc0: c0d22b00 ee64a220 ee64a800 00000010 ee64a810 c07ca2c4 00000000 00000042
[    1.306105] 7be0: ee64a220 c0413d60 00000009 ee62ed48 c0d22b44 00000001 00000003 ee64a220
[    1.314275] 7c00: 00000000 ffffffff ee62ca80 c07ca578 00000000 00000000 ee62ca80 c07ca4c8
[    1.322444] 7c20: 00000000 ee62ed40 ffffffff 00000000 c0d22ac4 ee64a220 ee62ed10 c0d22abc
[    1.330614] 7c40: ffffffff 00000003 c0d22ac4 00000000 ee64a220 c07ca62c 00000000 00000000
[    1.338784] 7c60: ee62ca80 ee64a200 c0d22ac4 00000000 ee64a200 00000021 ee62ea10 c07d8fb0
[    1.346954] 7c80: 00000000 00000000 ee62ca80 c07a7c24 00000042 eefd9a34 ee62e9c0 c0d22d10
[    1.355124] 7ca0: ee64a204 ee64a200 ee64a220 c07d8e90 00000000 c145ad98 0000011e c099b888
[    1.363294] 7cc0: ee64a220 c145ad90 00000000 c13b5fa8 00000000 c079d77c c13b5fa8 00000000
[    1.371464] 7ce0: ee64a37c 00000000 ee64a220 ee067d28 ee067d08 c079d8ec 00000000 00000000
[    1.379634] 7d00: 00000000 c079bc78 ee166870 ee59fd38 ee64a220 ee64a220 ee64a254 00000001
[    1.387804] 7d20: c145ad6c c079daa0 ee64a220 00000001 ee64a220 ee64a220 ee64a220 c13c8ca0
[    1.395974] 7d40: c145ad6c c079c7bc ee64a220 ee64a228 ee5f6038 c079b334 c145ad6c c079a5b8
[    1.404144] 7d60: ee64a200 ee067db0 ee64a200 ee067db0 ee5f6010 ee64a220 ee64a200 00000000
[    1.412314] 7d80: ee64a204 c099c95c eefd9a34 c0a29e9c eefd9a34 eefd9a34 ee067db0 ee067ddc
[    1.420483] 7da0: ee5f6010 00000000 c145ad98 c099ccac 30386b72 00000038 00000000 00000000
[    1.428653] 7dc0: 00000000 001b0080 00000000 ee067ddc eefd9a34 00000000 00000000 00000000
[    1.436823] 7de0: 00000000 00000000 00000000 00000004 eefd9a34 00000000 ee5f6010 eefd9a34
[    1.444993] 7e00: ee5f6038 c099d090 00000000 ee5f621c ee5f6010 ee193010 ee5f6240 00000000
[    1.453162] 7e20: 00000000 c09a917c 00000000 ee178680 ee5f6010 ee193010 ee193010 c09a8f68
[    1.461333] 7e40: c13c9344 c13c9330 00000000 c079eef0 ee193010 c145ad90 00000000 c13c9344
[    1.469502] 7e60: 00000000 c079d77c c11a6034 c0a29d84 ee19316c 00000000 ee193000 ee193010
[    1.477672] 7e80: c13c9344 ee193044 00000000 c110072c c11a6034 c079d8e8 c13c9344 c079d844
[    1.485842] 7ea0: ee067ea8 c079bd18 ee04bf5c ee1756b4 00000007 c13c9344 ee624e80 c13b15b8
[    1.494012] 7ec0: 00000000 c079c58c c0f8a70c c11437f0 c13c9344 c13c9344 00000000 c1143800
[    1.502182] 7ee0: 00000007 c079df40 c11a602c 00000000 c1143800 c0301ecc 00000023 c1010978
[    1.510352] 7f00: 0000002d ee067f20 c035cf00 c05ab5dc 20000013 ffffffff 00000051 c1336720
[    1.518521] 7f20: efffcc0b efffcbfc efffcc0b c035d574 00000000 c0f833e0 c10106bc 00000000
[    1.526692] 7f40: 00000006 00000006 c13366e8 c11a602c c120ec4c c141b000 00000007 c110072c
[    1.534861] 7f60: 00000000 c11a6034 0000011e c1100654 00000006 00000006 00000000 c110072c
[    1.543031] 7f80: c0b99714 00000000 c0b99714 00000000 00000000 00000000 00000000 00000000
[    1.551201] 7fa0: 00000000 c0b9971c 00000000 c03083f8 00000000 00000000 00000000 00000000
[    1.559371] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    1.567540] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[    1.575716] [<c06aed10>] (regulator_map_voltage_linear) from [<c06ab374>] (regulator_map_voltage+0x1c/0x5c)
[    1.585447] [<c06ab374>] (regulator_map_voltage) from [<c06ab4a4>] (_regulator_do_set_voltage+0xf0/0x368)
[    1.595005] [<c06ab4a4>] (_regulator_do_set_voltage) from [<c06acab4>] (regulator_register+0xb10/0x1038)
[    1.604476] [<c06acab4>] (regulator_register) from [<c06af258>] (devm_regulator_register+0x40/0x74)
[    1.613515] [<c06af258>] (devm_regulator_register) from [<c06b9704>] (rk808_regulator_probe+0x190/0x228)
[    1.622988] [<c06b9704>] (rk808_regulator_probe) from [<c079eef0>] (platform_drv_probe+0x54/0xa4)
[    1.631853] [<c079eef0>] (platform_drv_probe) from [<c079d77c>] (driver_probe_device+0x1f8/0x2c0)
[    1.640718] [<c079d77c>] (driver_probe_device) from [<c079bc78>] (bus_for_each_drv+0x60/0x8c)
[    1.649235] [<c079bc78>] (bus_for_each_drv) from [<c079daa0>] (__device_attach+0x9c/0xfc)
[    1.657406] [<c079daa0>] (__device_attach) from [<c079c7bc>] (bus_probe_device+0x84/0x8c)
[    1.665577] [<c079c7bc>] (bus_probe_device) from [<c079b334>] (device_add+0x34c/0x514)
[    1.673489] [<c079b334>] (device_add) from [<c079f140>] (platform_device_add+0x170/0x218)
[    1.681661] [<c079f140>] (platform_device_add) from [<c07ca2c4>] (mfd_add_device+0x25c/0x32c)
[    1.690180] [<c07ca2c4>] (mfd_add_device) from [<c07ca578>] (mfd_add_devices+0xac/0xf8)
[    1.698177] [<c07ca578>] (mfd_add_devices) from [<c07ca62c>] (devm_mfd_add_devices+0x68/0x9c)
[    1.706695] [<c07ca62c>] (devm_mfd_add_devices) from [<c07d8fb0>] (rk808_probe+0x120/0x1f0)
[    1.715040] [<c07d8fb0>] (rk808_probe) from [<c099b888>] (i2c_device_probe+0x19c/0x21c)
[    1.723038] [<c099b888>] (i2c_device_probe) from [<c079d77c>] (driver_probe_device+0x1f8/0x2c0)
[    1.731728] [<c079d77c>] (driver_probe_device) from [<c079bc78>] (bus_for_each_drv+0x60/0x8c)
[    1.740246] [<c079bc78>] (bus_for_each_drv) from [<c079daa0>] (__device_attach+0x9c/0xfc)
[    1.748416] [<c079daa0>] (__device_attach) from [<c079c7bc>] (bus_probe_device+0x84/0x8c)
[    1.756587] [<c079c7bc>] (bus_probe_device) from [<c079b334>] (device_add+0x34c/0x514)
[    1.764498] [<c079b334>] (device_add) from [<c099c95c>] (i2c_new_device+0x11c/0x190)
[    1.772236] [<c099c95c>] (i2c_new_device) from [<c099ccac>] (of_i2c_register_device+0x120/0x1bc)
[    1.781013] [<c099ccac>] (of_i2c_register_device) from [<c099d090>] (i2c_register_adapter+0x19c/0x354)
[    1.790312] [<c099d090>] (i2c_register_adapter) from [<c09a917c>] (rk3x_i2c_probe+0x214/0x314)
[    1.798915] [<c09a917c>] (rk3x_i2c_probe) from [<c079eef0>] (platform_drv_probe+0x54/0xa4)
[    1.807172] [<c079eef0>] (platform_drv_probe) from [<c079d77c>] (driver_probe_device+0x1f8/0x2c0)
[    1.816035] [<c079d77c>] (driver_probe_device) from [<c079d8e8>] (__driver_attach+0xa4/0xa8)
[    1.824465] [<c079d8e8>] (__driver_attach) from [<c079bd18>] (bus_for_each_dev+0x74/0x98)
[    1.832637] [<c079bd18>] (bus_for_each_dev) from [<c079c58c>] (bus_add_driver+0x170/0x1f4)
[    1.840894] [<c079c58c>] (bus_add_driver) from [<c079df40>] (driver_register+0x78/0xf8)
[    1.848892] [<c079df40>] (driver_register) from [<c0301ecc>] (do_one_initcall+0x40/0x178)
[    1.857065] [<c0301ecc>] (do_one_initcall) from [<c1100654>] (kernel_init_freeable+0x114/0x1ec)
[    1.865758] [<c1100654>] (kernel_init_freeable) from [<c0b9971c>] (kernel_init+0x8/0x118)
[    1.873930] [<c0b9971c>] (kernel_init) from [<c03083f8>] (ret_from_fork+0x14/0x3c)
[    1.881494] Code: e3540000 01a03005 0affffe4 eaffffed (e7f001f2) 
[    1.887587] ---[ end trace 5b1e9b1610f54a8c ]---
Wadim Egorov April 27, 2016, 6:35 a.m. UTC | #2
On 26.04.2016 21:33, Heiko Stübner wrote:
> Am Montag, 25. April 2016, 18:56:54 schrieb Mark Brown:
>> The patch
>>
>>    regulator: rk808: remove linear range definitions with a single range
>>
>> has been applied to the regulator tree at
>>
>>    git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
> with this patch applied, 4.6.0-rc5-next-20160426 fails to boot on 
> rk3288-veyron devices with the bug below. Reverting this one patch
> results in the system booting again:
>
This is because I missed to add the correct ops for LDO_REG3 in this patch.
Mark Brown April 27, 2016, 1:50 p.m. UTC | #3
On Wed, Apr 27, 2016 at 08:35:46AM +0200, Wadim Egorov wrote:
> On 26.04.2016 21:33, Heiko Stübner wrote:

> > with this patch applied, 4.6.0-rc5-next-20160426 fails to boot on 
> > rk3288-veyron devices with the bug below. Reverting this one patch
> > results in the system booting again:

> This is because I missed to add the correct ops for LDO_REG3 in this patch.

Any ETA on a fix or should I revert?
Heiko Stübner April 27, 2016, 1:56 p.m. UTC | #4
Am Mittwoch, 27. April 2016, 14:50:48 schrieb Mark Brown:
> On Wed, Apr 27, 2016 at 08:35:46AM +0200, Wadim Egorov wrote:
> > On 26.04.2016 21:33, Heiko Stübner wrote:
> > > with this patch applied, 4.6.0-rc5-next-20160426 fails to boot on
> > > rk3288-veyron devices with the bug below. Reverting this one patch
> > 
> > > results in the system booting again:
> > This is because I missed to add the correct ops for LDO_REG3 in this
> > patch.
> 
> Any ETA on a fix or should I revert?

I guess
	[PATCH v4 1/7] regulator: rk808: Add rk808_reg_ops_ranges for LDO3
from yesterday [0] might be the fix? At least it fits Wadim's description above 
but I haven't had time to test it yet.




[0] https://patchwork.kernel.org/patch/8939741/
Wadim Egorov April 27, 2016, 2:06 p.m. UTC | #5
On 27.04.2016 15:50, Mark Brown wrote:
> On Wed, Apr 27, 2016 at 08:35:46AM +0200, Wadim Egorov wrote:
>> On 26.04.2016 21:33, Heiko Stübner wrote:
>>> with this patch applied, 4.6.0-rc5-next-20160426 fails to boot on 
>>> rk3288-veyron devices with the bug below. Reverting this one patch
>>> results in the system booting again:
>> This is because I missed to add the correct ops for LDO_REG3 in this patch.
> Any ETA on a fix or should I revert?
this patch

http://lists.infradead.org/pipermail/linux-rockchip/2016-April/008674.html

will fix the issue.

The regulator patches from v4 are based on top of
commit 4a5ed8c1adc3 ("regulator: rk808: remove unused rk808_reg_ops_ranges")
Mark Brown April 27, 2016, 4:41 p.m. UTC | #6
On Wed, Apr 27, 2016 at 03:56:56PM +0200, Heiko Stübner wrote:
> Am Mittwoch, 27. April 2016, 14:50:48 schrieb Mark Brown:

> > Any ETA on a fix or should I revert?

> I guess
> 	[PATCH v4 1/7] regulator: rk808: Add rk808_reg_ops_ranges for LDO3
> from yesterday [0] might be the fix? At least it fits Wadim's description above 
> but I haven't had time to test it yet.

Oh, probably yeah.  It's easier if fixes are pulled out of serieses.
diff mbox

Patch

diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
index d86a3dcd61e2..964b95eed271 100644
--- a/drivers/regulator/rk808-regulator.c
+++ b/drivers/regulator/rk808-regulator.c
@@ -66,27 +66,11 @@  static const int rk808_buck_config_regs[] = {
 	RK808_BUCK4_CONFIG_REG,
 };
 
-static const struct regulator_linear_range rk808_buck_voltage_ranges[] = {
-	REGULATOR_LINEAR_RANGE(712500, 0, 63, 12500),
-};
-
-static const struct regulator_linear_range rk808_buck4_voltage_ranges[] = {
-	REGULATOR_LINEAR_RANGE(1800000, 0, 15, 100000),
-};
-
-static const struct regulator_linear_range rk808_ldo_voltage_ranges[] = {
-	REGULATOR_LINEAR_RANGE(1800000, 0, 16, 100000),
-};
-
 static const struct regulator_linear_range rk808_ldo3_voltage_ranges[] = {
 	REGULATOR_LINEAR_RANGE(800000, 0, 13, 100000),
 	REGULATOR_LINEAR_RANGE(2500000, 15, 15, 0),
 };
 
-static const struct regulator_linear_range rk808_ldo6_voltage_ranges[] = {
-	REGULATOR_LINEAR_RANGE(800000, 0, 17, 100000),
-};
-
 static int rk808_buck1_2_get_voltage_sel_regmap(struct regulator_dev *rdev)
 {
 	struct rk808_regulator_data *pdata = rdev_get_drvdata(rdev);
@@ -242,6 +226,21 @@  static int rk808_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
 static int rk808_set_suspend_voltage(struct regulator_dev *rdev, int uv)
 {
 	unsigned int reg;
+	int sel = regulator_map_voltage_linear(rdev, uv, uv);
+
+	if (sel < 0)
+		return -EINVAL;
+
+	reg = rdev->desc->vsel_reg + RK808_SLP_REG_OFFSET;
+
+	return regmap_update_bits(rdev->regmap, reg,
+				  rdev->desc->vsel_mask,
+				  sel);
+}
+
+static int rk808_set_suspend_voltage_range(struct regulator_dev *rdev, int uv)
+{
+	unsigned int reg;
 	int sel = regulator_map_voltage_linear_range(rdev, uv, uv);
 
 	if (sel < 0)
@@ -277,8 +276,8 @@  static int rk808_set_suspend_disable(struct regulator_dev *rdev)
 }
 
 static struct regulator_ops rk808_buck1_2_ops = {
-	.list_voltage		= regulator_list_voltage_linear_range,
-	.map_voltage		= regulator_map_voltage_linear_range,
+	.list_voltage		= regulator_list_voltage_linear,
+	.map_voltage		= regulator_map_voltage_linear,
 	.get_voltage_sel	= rk808_buck1_2_get_voltage_sel_regmap,
 	.set_voltage_sel	= rk808_buck1_2_set_voltage_sel,
 	.set_voltage_time_sel	= rk808_buck1_2_set_voltage_time_sel,
@@ -292,6 +291,19 @@  static struct regulator_ops rk808_buck1_2_ops = {
 };
 
 static struct regulator_ops rk808_reg_ops = {
+	.list_voltage		= regulator_list_voltage_linear,
+	.map_voltage		= regulator_map_voltage_linear,
+	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
+	.set_voltage_sel	= regulator_set_voltage_sel_regmap,
+	.enable			= regulator_enable_regmap,
+	.disable		= regulator_disable_regmap,
+	.is_enabled		= regulator_is_enabled_regmap,
+	.set_suspend_voltage	= rk808_set_suspend_voltage,
+	.set_suspend_enable	= rk808_set_suspend_enable,
+	.set_suspend_disable	= rk808_set_suspend_disable,
+};
+
+static struct regulator_ops rk808_reg_ops_ranges = {
 	.list_voltage		= regulator_list_voltage_linear_range,
 	.map_voltage		= regulator_map_voltage_linear_range,
 	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
@@ -299,7 +311,7 @@  static struct regulator_ops rk808_reg_ops = {
 	.enable			= regulator_enable_regmap,
 	.disable		= regulator_disable_regmap,
 	.is_enabled		= regulator_is_enabled_regmap,
-	.set_suspend_voltage	= rk808_set_suspend_voltage,
+	.set_suspend_voltage	= rk808_set_suspend_voltage_range,
 	.set_suspend_enable	= rk808_set_suspend_enable,
 	.set_suspend_disable	= rk808_set_suspend_disable,
 };
@@ -319,9 +331,9 @@  static const struct regulator_desc rk808_reg[] = {
 		.id = RK808_ID_DCDC1,
 		.ops = &rk808_buck1_2_ops,
 		.type = REGULATOR_VOLTAGE,
+		.min_uV = 712500,
+		.uV_step = 12500,
 		.n_voltages = 64,
-		.linear_ranges = rk808_buck_voltage_ranges,
-		.n_linear_ranges = ARRAY_SIZE(rk808_buck_voltage_ranges),
 		.vsel_reg = RK808_BUCK1_ON_VSEL_REG,
 		.vsel_mask = RK808_BUCK_VSEL_MASK,
 		.enable_reg = RK808_DCDC_EN_REG,
@@ -333,9 +345,9 @@  static const struct regulator_desc rk808_reg[] = {
 		.id = RK808_ID_DCDC2,
 		.ops = &rk808_buck1_2_ops,
 		.type = REGULATOR_VOLTAGE,
+		.min_uV = 712500,
+		.uV_step = 12500,
 		.n_voltages = 64,
-		.linear_ranges = rk808_buck_voltage_ranges,
-		.n_linear_ranges = ARRAY_SIZE(rk808_buck_voltage_ranges),
 		.vsel_reg = RK808_BUCK2_ON_VSEL_REG,
 		.vsel_mask = RK808_BUCK_VSEL_MASK,
 		.enable_reg = RK808_DCDC_EN_REG,
@@ -357,9 +369,9 @@  static const struct regulator_desc rk808_reg[] = {
 		.id = RK808_ID_DCDC4,
 		.ops = &rk808_reg_ops,
 		.type = REGULATOR_VOLTAGE,
+		.min_uV = 1800000,
+		.uV_step = 100000,
 		.n_voltages = 16,
-		.linear_ranges = rk808_buck4_voltage_ranges,
-		.n_linear_ranges = ARRAY_SIZE(rk808_buck4_voltage_ranges),
 		.vsel_reg = RK808_BUCK4_ON_VSEL_REG,
 		.vsel_mask = RK808_BUCK4_VSEL_MASK,
 		.enable_reg = RK808_DCDC_EN_REG,
@@ -371,9 +383,9 @@  static const struct regulator_desc rk808_reg[] = {
 		.id = RK808_ID_LDO1,
 		.ops = &rk808_reg_ops,
 		.type = REGULATOR_VOLTAGE,
+		.min_uV = 1800000,
+		.uV_step = 100000,
 		.n_voltages = 17,
-		.linear_ranges = rk808_ldo_voltage_ranges,
-		.n_linear_ranges = ARRAY_SIZE(rk808_ldo_voltage_ranges),
 		.vsel_reg = RK808_LDO1_ON_VSEL_REG,
 		.vsel_mask = RK808_LDO_VSEL_MASK,
 		.enable_reg = RK808_LDO_EN_REG,
@@ -386,9 +398,9 @@  static const struct regulator_desc rk808_reg[] = {
 		.id = RK808_ID_LDO2,
 		.ops = &rk808_reg_ops,
 		.type = REGULATOR_VOLTAGE,
+		.min_uV = 1800000,
+		.uV_step = 100000,
 		.n_voltages = 17,
-		.linear_ranges = rk808_ldo_voltage_ranges,
-		.n_linear_ranges = ARRAY_SIZE(rk808_ldo_voltage_ranges),
 		.vsel_reg = RK808_LDO2_ON_VSEL_REG,
 		.vsel_mask = RK808_LDO_VSEL_MASK,
 		.enable_reg = RK808_LDO_EN_REG,
@@ -416,9 +428,9 @@  static const struct regulator_desc rk808_reg[] = {
 		.id = RK808_ID_LDO4,
 		.ops = &rk808_reg_ops,
 		.type = REGULATOR_VOLTAGE,
+		.min_uV = 1800000,
+		.uV_step = 100000,
 		.n_voltages = 17,
-		.linear_ranges = rk808_ldo_voltage_ranges,
-		.n_linear_ranges = ARRAY_SIZE(rk808_ldo_voltage_ranges),
 		.vsel_reg = RK808_LDO4_ON_VSEL_REG,
 		.vsel_mask = RK808_LDO_VSEL_MASK,
 		.enable_reg = RK808_LDO_EN_REG,
@@ -431,9 +443,9 @@  static const struct regulator_desc rk808_reg[] = {
 		.id = RK808_ID_LDO5,
 		.ops = &rk808_reg_ops,
 		.type = REGULATOR_VOLTAGE,
+		.min_uV = 1800000,
+		.uV_step = 100000,
 		.n_voltages = 17,
-		.linear_ranges = rk808_ldo_voltage_ranges,
-		.n_linear_ranges = ARRAY_SIZE(rk808_ldo_voltage_ranges),
 		.vsel_reg = RK808_LDO5_ON_VSEL_REG,
 		.vsel_mask = RK808_LDO_VSEL_MASK,
 		.enable_reg = RK808_LDO_EN_REG,
@@ -446,9 +458,9 @@  static const struct regulator_desc rk808_reg[] = {
 		.id = RK808_ID_LDO6,
 		.ops = &rk808_reg_ops,
 		.type = REGULATOR_VOLTAGE,
+		.min_uV = 800000,
+		.uV_step = 100000,
 		.n_voltages = 18,
-		.linear_ranges = rk808_ldo6_voltage_ranges,
-		.n_linear_ranges = ARRAY_SIZE(rk808_ldo6_voltage_ranges),
 		.vsel_reg = RK808_LDO6_ON_VSEL_REG,
 		.vsel_mask = RK808_LDO_VSEL_MASK,
 		.enable_reg = RK808_LDO_EN_REG,
@@ -461,9 +473,9 @@  static const struct regulator_desc rk808_reg[] = {
 		.id = RK808_ID_LDO7,
 		.ops = &rk808_reg_ops,
 		.type = REGULATOR_VOLTAGE,
+		.min_uV = 800000,
+		.uV_step = 100000,
 		.n_voltages = 18,
-		.linear_ranges = rk808_ldo6_voltage_ranges,
-		.n_linear_ranges = ARRAY_SIZE(rk808_ldo6_voltage_ranges),
 		.vsel_reg = RK808_LDO7_ON_VSEL_REG,
 		.vsel_mask = RK808_LDO_VSEL_MASK,
 		.enable_reg = RK808_LDO_EN_REG,
@@ -476,9 +488,9 @@  static const struct regulator_desc rk808_reg[] = {
 		.id = RK808_ID_LDO8,
 		.ops = &rk808_reg_ops,
 		.type = REGULATOR_VOLTAGE,
+		.min_uV = 1800000,
+		.uV_step = 100000,
 		.n_voltages = 17,
-		.linear_ranges = rk808_ldo_voltage_ranges,
-		.n_linear_ranges = ARRAY_SIZE(rk808_ldo_voltage_ranges),
 		.vsel_reg = RK808_LDO8_ON_VSEL_REG,
 		.vsel_mask = RK808_LDO_VSEL_MASK,
 		.enable_reg = RK808_LDO_EN_REG,