Skip to contentSkip to conversation

regulator: ab8500: Fix build error

PATCH In review Axel Lin 3 participants 5 messages Feb 18, 2013 – Feb 19, 2013 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/2 regulator: ab8500: Fix build error

This build error is introduced by commit 6a9fe8319 "regulator: ab8500: Added get_optimum_mode on regulators with idle mode".

CC drivers/regulator/ab8500.o
drivers/regulator/ab8500.c:500:23: error: 'ab8500_regulator_fixed_ops' undeclared here (not in a function) drivers/regulator/ab8500.c:510:3: error: unknown field 'update_val_enable' specified in initializer make[2]: *** [drivers/regulator/ab8500.o] Error 1
make[1]: *** [drivers/regulator] Error 2
make: *** [drivers] Error 2

---
 drivers/regulator/ab8500.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/regulator/ab8500.c +5 -6
index d0ce436..ffabff7 100644
@@ -494,10 +494,13 @@ static struct ab8500_regulator_info
 		.update_val_idle	= 0x82,
 		.update_val_normal	= 0x02,
 	},
+	/*
+	 * Regulators with fixed voltage and normal mode
+	 */
 	[AB8500_LDO_USB] = {
 		.desc = {
 			.name           = "LDO-USB",
-			.ops            = &ab8500_regulator_fixed_ops,
+			.ops            = &ab8500_regulator_ops,
 			.type           = REGULATOR_VOLTAGE,
 			.id             = AB8500_LDO_USB,
 			.owner          = THIS_MODULE,
@@ -507,12 +510,8 @@ static struct ab8500_regulator_info
 		.update_bank            = 0x03,
 		.update_reg             = 0x82,
 		.update_mask            = 0x03,
-		.update_val_enable      = 0x01,
+		.update_val             = 0x01,
 	},
-
-	/*
-	 * Regulators with fixed voltage and normal mode
-	 */
 	[AB8500_LDO_AUDIO] = {
 		.desc = {
 			.name		= "LDO-AUDIO",
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 2/2 regulator: ab8500: Use regulator_list_voltage_linear for fixed voltage

Both ab8500_regulator_mode_ops and ab8500_regulator_ops do not have volt_table setting, thus we can not use regulator_list_voltage_table for them. However, they have min_uV setting with n_voltages = 1, so use regulator_list_voltage_linear instead.

---
 drivers/regulator/ab8500.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/ab8500.c +2 -2
index ffabff7..24d490e 100644
@@ -363,7 +363,7 @@ static struct regulator_ops ab8500_regulator_mode_ops = {
 	.set_mode		= ab8500_regulator_set_mode,
 	.get_mode		= ab8500_regulator_get_mode,
 	.get_voltage_sel 	= ab8500_regulator_get_voltage_sel,
-	.list_voltage		= regulator_list_voltage_table,
+	.list_voltage		= regulator_list_voltage_linear,
 	.set_voltage_time_sel 	= ab8500_regulator_set_voltage_time_sel,
 };
 
@@ -372,7 +372,7 @@ static struct regulator_ops ab8500_regulator_ops = {
 	.disable		= ab8500_regulator_disable,
 	.is_enabled		= ab8500_regulator_is_enabled,
 	.get_voltage_sel 	= ab8500_regulator_get_voltage_sel,
-	.list_voltage		= regulator_list_voltage_table,
+	.list_voltage		= regulator_list_voltage_linear,
 };
 
 static struct ab8500_regulator_info
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 1/1 regulator: ab8500: Remove get_voltage_sel for fixed voltage

In reply to Axel Lin

Current code sets get_voltage_sel to ab8500_regulator_get_voltage_sel, however both ab8500_regulator_mode_ops and ab8500_regulator_ops do not have voltage_bank, voltage_reg and voltage_mask settings. So it looks wrong to use ab8500_regulator_get_voltage_sel as get_voltage_sel callback in these cases.

A simple fix is just not implement get_voltage_sel, regulator core will report microvolts in sysfs even with only list_voltage().

---
Just found this needs to be fixed after I sent previous ab8500 patches, this patch is on top of previous ab8500 fixes.

Axel

 drivers/regulator/ab8500.c |    2 --
 1 file changed, 2 deletions(-)
drivers/regulator/ab8500.c +0 -2
index 24d490e..67b4412 100644
@@ -362,7 +362,6 @@ static struct regulator_ops ab8500_regulator_mode_ops = {
 	.get_optimum_mode	= ab8500_regulator_get_optimum_mode,
 	.set_mode		= ab8500_regulator_set_mode,
 	.get_mode		= ab8500_regulator_get_mode,
-	.get_voltage_sel 	= ab8500_regulator_get_voltage_sel,
 	.list_voltage		= regulator_list_voltage_linear,
 	.set_voltage_time_sel 	= ab8500_regulator_set_voltage_time_sel,
 };
@@ -371,7 +370,6 @@ static struct regulator_ops ab8500_regulator_ops = {
 	.enable			= ab8500_regulator_enable,
 	.disable		= ab8500_regulator_disable,
 	.is_enabled		= ab8500_regulator_is_enabled,
-	.get_voltage_sel 	= ab8500_regulator_get_voltage_sel,
 	.list_voltage		= regulator_list_voltage_linear,
 };
 
Signature · 1 line
1.7.9.5
#3 lore raw
In reply to Axel Lin

Hi Axel,

Quoted 11 lines

This build error is introduced by commit 6a9fe8319 "regulator: ab8500: Added get_optimum_mode on regulators with idle mode".

CC drivers/regulator/ab8500.o
drivers/regulator/ab8500.c:500:23: error: 'ab8500_regulator_fixed_ops' undeclared here (not in a function) drivers/regulator/ab8500.c:510:3: error: unknown field 'update_val_enable' specified in initializer make[2]: *** [drivers/regulator/ab8500.o] Error 1
make[1]: *** [drivers/regulator] Error 2
make: *** [drivers] Error 2

The patches which caused the issues addressed by this patch-set have since been rewritten. I have subsequently requested that Mark deletes the AB8500 for-next branch. We're going to start again after this merge window.

Thank you for your efforts though Axel, they are appreciated.

Kind regards,
Lee

Signature · 4 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#4 lore raw
Quoted 4 lines · Lee Jones

The patches which caused the issues addressed by this patch-set have since been rewritten. I have subsequently requested that Mark deletes the AB8500 for-next branch. We're going to start again after this merge window.

So, as discussed you really shouldn't have done that - unless there's a very serious problem you should be assuming that patches that have been applied are going to stay applied and working from the latest upstream tree. Once something is in -next the expectation is that it's going to be sent during the next merge window. As well as the issues with maintainers getting fed up having to look at the same code over and over again it causes people like Axel to waste their time.

However I am probably going to just throw away the current ab8500 work this time. Please resend your patches after the merge window (which just opened).