All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: ux500: Move struct
@ 2015-01-21 23:09 ` Rickard Strandqvist
  0 siblings, 0 replies; 12+ messages in thread
From: Rickard Strandqvist @ 2015-01-21 23:09 UTC (permalink / raw)
  To: Linus Walleij, Russell King, Arnd Bergmann, Lee Jones
  Cc: Rickard Strandqvist, linux-arm-kernel, linux-kernel

Move struct ab8500_ext_regulator_cfg to  the only file that is now used in.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/regulator/ab8500-ext.c   |    6 ++++++
 include/linux/regulator/ab8500.h |    5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c
index 84c1ee3..a40c701 100644
--- a/drivers/regulator/ab8500-ext.c
+++ b/drivers/regulator/ab8500-ext.c
@@ -25,6 +25,12 @@
 #include <linux/mfd/abx500/ab8500.h>
 #include <linux/regulator/ab8500.h>
 
+
+/* AB8500 external regulators */
+struct ab8500_ext_regulator_cfg {
+	bool hwreq; /* requires hw mode or high power mode */
+};
+
 /**
  * struct ab8500_ext_regulator_info - ab8500 regulator information
  * @dev: device pointer
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h
index d8ecefa..802529b 100644
--- a/include/linux/regulator/ab8500.h
+++ b/include/linux/regulator/ab8500.h
@@ -300,11 +300,6 @@ enum ab8540_regulator_reg {
 	AB8540_NUM_REGULATOR_REGISTERS,
 };
 
-/* AB8500 external regulators */
-struct ab8500_ext_regulator_cfg {
-	bool hwreq; /* requires hw mode or high power mode */
-};
-
 enum ab8500_ext_regulator_id {
 	AB8500_EXT_SUPPLY1,
 	AB8500_EXT_SUPPLY2,
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 1/2] ARM: ux500: Move struct
@ 2015-01-21 23:09 ` Rickard Strandqvist
  0 siblings, 0 replies; 12+ messages in thread
From: Rickard Strandqvist @ 2015-01-21 23:09 UTC (permalink / raw)
  To: linux-arm-kernel

Move struct ab8500_ext_regulator_cfg to  the only file that is now used in.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/regulator/ab8500-ext.c   |    6 ++++++
 include/linux/regulator/ab8500.h |    5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c
index 84c1ee3..a40c701 100644
--- a/drivers/regulator/ab8500-ext.c
+++ b/drivers/regulator/ab8500-ext.c
@@ -25,6 +25,12 @@
 #include <linux/mfd/abx500/ab8500.h>
 #include <linux/regulator/ab8500.h>
 
+
+/* AB8500 external regulators */
+struct ab8500_ext_regulator_cfg {
+	bool hwreq; /* requires hw mode or high power mode */
+};
+
 /**
  * struct ab8500_ext_regulator_info - ab8500 regulator information
  * @dev: device pointer
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h
index d8ecefa..802529b 100644
--- a/include/linux/regulator/ab8500.h
+++ b/include/linux/regulator/ab8500.h
@@ -300,11 +300,6 @@ enum ab8540_regulator_reg {
 	AB8540_NUM_REGULATOR_REGISTERS,
 };
 
-/* AB8500 external regulators */
-struct ab8500_ext_regulator_cfg {
-	bool hwreq; /* requires hw mode or high power mode */
-};
-
 enum ab8500_ext_regulator_id {
 	AB8500_EXT_SUPPLY1,
 	AB8500_EXT_SUPPLY2,
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/2] ARM: ux500: Remove unused functions and structs
  2015-01-21 23:09 ` Rickard Strandqvist
@ 2015-01-21 23:09   ` Rickard Strandqvist
  -1 siblings, 0 replies; 12+ messages in thread
From: Rickard Strandqvist @ 2015-01-21 23:09 UTC (permalink / raw)
  To: Linus Walleij, Russell King, Arnd Bergmann, Lee Jones
  Cc: Rickard Strandqvist, linux-arm-kernel, linux-kernel

Remove same unused functions and structs.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 arch/arm/mach-ux500/board-mop500-regulators.c |  106 -------------------------
 arch/arm/mach-ux500/board-mop500-regulators.h |    5 --
 2 files changed, 111 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
index 32d744e..2b8f685 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.c
+++ b/arch/arm/mach-ux500/board-mop500-regulators.c
@@ -19,17 +19,6 @@ static struct regulator_consumer_supply gpio_en_3v3_consumers[] = {
        REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
 };
 
-struct regulator_init_data gpio_en_3v3_regulator = {
-       .constraints = {
-               .name = "EN-3V3",
-               .min_uV = 3300000,
-               .max_uV = 3300000,
-               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
-       },
-       .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers),
-       .consumer_supplies = gpio_en_3v3_consumers,
-};
-
 /*
  * TPS61052 regulator
  */
@@ -43,17 +32,6 @@ static struct regulator_consumer_supply tps61052_vaudio_consumers[] = {
 	REGULATOR_SUPPLY("vintdclassint", "ab8500-codec.0"),
 };
 
-struct regulator_init_data tps61052_regulator = {
-	.constraints = {
-		.name = "vaudio-hf",
-		.min_uV = 4500000,
-		.max_uV = 4500000,
-		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
-	},
-	.num_consumer_supplies = ARRAY_SIZE(tps61052_vaudio_consumers),
-	.consumer_supplies = tps61052_vaudio_consumers,
-};
-
 static struct regulator_consumer_supply ab8500_vaux1_consumers[] = {
 	/* Main display, u8500 R3 uib */
 	REGULATOR_SUPPLY("vddi", "mcde_disp_sony_acx424akp.0"),
@@ -483,11 +461,6 @@ static struct regulator_consumer_supply ab8500_ext_supply3_consumers[] = {
 	REGULATOR_SUPPLY("vinvsim", "sim-detect.0"),
 };
 
-/* extended configuration for VextSupply2, only used for HREFP_V20 boards */
-static struct ab8500_ext_regulator_cfg ab8500_ext_supply2 = {
-	.hwreq = true,
-};
-
 /*
  * AB8500 external regulators
  */
@@ -984,82 +957,3 @@ struct ab8500_regulator_platform_data ab8500_regulator_plat_data = {
 	.ext_regulator          = ab8500_ext_regulators,
 	.num_ext_regulator      = ARRAY_SIZE(ab8500_ext_regulators),
 };
-
-struct ab8500_regulator_platform_data ab8505_regulator_plat_data = {
-	.reg_init               = ab8505_reg_init,
-	.num_reg_init           = ARRAY_SIZE(ab8505_reg_init),
-	.regulator              = ab8505_regulators,
-	.num_regulator          = ARRAY_SIZE(ab8505_regulators),
-};
-
-static void ab8500_modify_reg_init(int id, u8 mask, u8 value)
-{
-	int i;
-
-	if (cpu_is_u8520()) {
-		for (i = ARRAY_SIZE(ab8505_reg_init) - 1; i >= 0; i--) {
-			if (ab8505_reg_init[i].id == id) {
-				u8 initval = ab8505_reg_init[i].value;
-				initval = (initval & ~mask) | (value & mask);
-				ab8505_reg_init[i].value = initval;
-
-				BUG_ON(mask & ~ab8505_reg_init[i].mask);
-				return;
-			}
-		}
-	} else {
-		for (i = ARRAY_SIZE(ab8500_reg_init) - 1; i >= 0; i--) {
-			if (ab8500_reg_init[i].id == id) {
-				u8 initval = ab8500_reg_init[i].value;
-				initval = (initval & ~mask) | (value & mask);
-				ab8500_reg_init[i].value = initval;
-
-				BUG_ON(mask & ~ab8500_reg_init[i].mask);
-				return;
-			}
-		}
-	}
-
-	BUG_ON(1);
-}
-
-void mop500_regulator_init(void)
-{
-	struct regulator_init_data *regulator;
-
-	/*
-	 * Temporarily turn on Vaux2 on 8520 machine
-	 */
-	if (cpu_is_u8520()) {
-		/* Vaux2 initialized to be on */
-		ab8500_modify_reg_init(AB8505_VAUX12REGU, 0x0f, 0x05);
-	}
-
-	/*
-	 * Handle AB8500_EXT_SUPPLY2 on HREFP_V20_V50 boards (do it for
-	 * all HREFP_V20 boards)
-	 */
-	if (cpu_is_u8500v20()) {
-		/* VextSupply2RequestCtrl =  HP/OFF depending on VxRequest */
-		ab8500_modify_reg_init(AB8500_REGUREQUESTCTRL3, 0x01, 0x01);
-
-		/* VextSupply2SysClkReq1HPValid = SysClkReq1 controlled */
-		ab8500_modify_reg_init(AB8500_REGUSYSCLKREQ1HPVALID2,
-			0x20, 0x20);
-
-		/* VextSupply2 = force HP at initialization */
-		ab8500_modify_reg_init(AB8500_EXTSUPPLYREGU, 0x0c, 0x04);
-
-		/* enable VextSupply2 during platform active */
-		regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2];
-		regulator->constraints.always_on = 1;
-
-		/* disable VextSupply2 in suspend */
-		regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2];
-		regulator->constraints.state_mem.disabled = 1;
-		regulator->constraints.state_standby.disabled = 1;
-
-		/* enable VextSupply2 HW control (used in suspend) */
-		regulator->driver_data = (void *)&ab8500_ext_supply2;
-	}
-}
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
index 9bece38..88da2b8 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.h
+++ b/arch/arm/mach-ux500/board-mop500-regulators.h
@@ -15,10 +15,5 @@
 #include <linux/regulator/ab8500.h>
 
 extern struct ab8500_regulator_platform_data ab8500_regulator_plat_data;
-extern struct ab8500_regulator_platform_data ab8505_regulator_plat_data;
-extern struct regulator_init_data tps61052_regulator;
-extern struct regulator_init_data gpio_en_3v3_regulator;
-
-void mop500_regulator_init(void);
 
 #endif
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/2] ARM: ux500: Remove unused functions and structs
@ 2015-01-21 23:09   ` Rickard Strandqvist
  0 siblings, 0 replies; 12+ messages in thread
From: Rickard Strandqvist @ 2015-01-21 23:09 UTC (permalink / raw)
  To: linux-arm-kernel

Remove same unused functions and structs.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 arch/arm/mach-ux500/board-mop500-regulators.c |  106 -------------------------
 arch/arm/mach-ux500/board-mop500-regulators.h |    5 --
 2 files changed, 111 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
index 32d744e..2b8f685 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.c
+++ b/arch/arm/mach-ux500/board-mop500-regulators.c
@@ -19,17 +19,6 @@ static struct regulator_consumer_supply gpio_en_3v3_consumers[] = {
        REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
 };
 
-struct regulator_init_data gpio_en_3v3_regulator = {
-       .constraints = {
-               .name = "EN-3V3",
-               .min_uV = 3300000,
-               .max_uV = 3300000,
-               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
-       },
-       .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers),
-       .consumer_supplies = gpio_en_3v3_consumers,
-};
-
 /*
  * TPS61052 regulator
  */
@@ -43,17 +32,6 @@ static struct regulator_consumer_supply tps61052_vaudio_consumers[] = {
 	REGULATOR_SUPPLY("vintdclassint", "ab8500-codec.0"),
 };
 
-struct regulator_init_data tps61052_regulator = {
-	.constraints = {
-		.name = "vaudio-hf",
-		.min_uV = 4500000,
-		.max_uV = 4500000,
-		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
-	},
-	.num_consumer_supplies = ARRAY_SIZE(tps61052_vaudio_consumers),
-	.consumer_supplies = tps61052_vaudio_consumers,
-};
-
 static struct regulator_consumer_supply ab8500_vaux1_consumers[] = {
 	/* Main display, u8500 R3 uib */
 	REGULATOR_SUPPLY("vddi", "mcde_disp_sony_acx424akp.0"),
@@ -483,11 +461,6 @@ static struct regulator_consumer_supply ab8500_ext_supply3_consumers[] = {
 	REGULATOR_SUPPLY("vinvsim", "sim-detect.0"),
 };
 
-/* extended configuration for VextSupply2, only used for HREFP_V20 boards */
-static struct ab8500_ext_regulator_cfg ab8500_ext_supply2 = {
-	.hwreq = true,
-};
-
 /*
  * AB8500 external regulators
  */
@@ -984,82 +957,3 @@ struct ab8500_regulator_platform_data ab8500_regulator_plat_data = {
 	.ext_regulator          = ab8500_ext_regulators,
 	.num_ext_regulator      = ARRAY_SIZE(ab8500_ext_regulators),
 };
-
-struct ab8500_regulator_platform_data ab8505_regulator_plat_data = {
-	.reg_init               = ab8505_reg_init,
-	.num_reg_init           = ARRAY_SIZE(ab8505_reg_init),
-	.regulator              = ab8505_regulators,
-	.num_regulator          = ARRAY_SIZE(ab8505_regulators),
-};
-
-static void ab8500_modify_reg_init(int id, u8 mask, u8 value)
-{
-	int i;
-
-	if (cpu_is_u8520()) {
-		for (i = ARRAY_SIZE(ab8505_reg_init) - 1; i >= 0; i--) {
-			if (ab8505_reg_init[i].id == id) {
-				u8 initval = ab8505_reg_init[i].value;
-				initval = (initval & ~mask) | (value & mask);
-				ab8505_reg_init[i].value = initval;
-
-				BUG_ON(mask & ~ab8505_reg_init[i].mask);
-				return;
-			}
-		}
-	} else {
-		for (i = ARRAY_SIZE(ab8500_reg_init) - 1; i >= 0; i--) {
-			if (ab8500_reg_init[i].id == id) {
-				u8 initval = ab8500_reg_init[i].value;
-				initval = (initval & ~mask) | (value & mask);
-				ab8500_reg_init[i].value = initval;
-
-				BUG_ON(mask & ~ab8500_reg_init[i].mask);
-				return;
-			}
-		}
-	}
-
-	BUG_ON(1);
-}
-
-void mop500_regulator_init(void)
-{
-	struct regulator_init_data *regulator;
-
-	/*
-	 * Temporarily turn on Vaux2 on 8520 machine
-	 */
-	if (cpu_is_u8520()) {
-		/* Vaux2 initialized to be on */
-		ab8500_modify_reg_init(AB8505_VAUX12REGU, 0x0f, 0x05);
-	}
-
-	/*
-	 * Handle AB8500_EXT_SUPPLY2 on HREFP_V20_V50 boards (do it for
-	 * all HREFP_V20 boards)
-	 */
-	if (cpu_is_u8500v20()) {
-		/* VextSupply2RequestCtrl =  HP/OFF depending on VxRequest */
-		ab8500_modify_reg_init(AB8500_REGUREQUESTCTRL3, 0x01, 0x01);
-
-		/* VextSupply2SysClkReq1HPValid = SysClkReq1 controlled */
-		ab8500_modify_reg_init(AB8500_REGUSYSCLKREQ1HPVALID2,
-			0x20, 0x20);
-
-		/* VextSupply2 = force HP at initialization */
-		ab8500_modify_reg_init(AB8500_EXTSUPPLYREGU, 0x0c, 0x04);
-
-		/* enable VextSupply2 during platform active */
-		regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2];
-		regulator->constraints.always_on = 1;
-
-		/* disable VextSupply2 in suspend */
-		regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2];
-		regulator->constraints.state_mem.disabled = 1;
-		regulator->constraints.state_standby.disabled = 1;
-
-		/* enable VextSupply2 HW control (used in suspend) */
-		regulator->driver_data = (void *)&ab8500_ext_supply2;
-	}
-}
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
index 9bece38..88da2b8 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.h
+++ b/arch/arm/mach-ux500/board-mop500-regulators.h
@@ -15,10 +15,5 @@
 #include <linux/regulator/ab8500.h>
 
 extern struct ab8500_regulator_platform_data ab8500_regulator_plat_data;
-extern struct ab8500_regulator_platform_data ab8505_regulator_plat_data;
-extern struct regulator_init_data tps61052_regulator;
-extern struct regulator_init_data gpio_en_3v3_regulator;
-
-void mop500_regulator_init(void);
 
 #endif
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] ARM: ux500: Move struct
  2015-01-21 23:09 ` Rickard Strandqvist
@ 2015-01-22  7:44   ` Lee Jones
  -1 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2015-01-22  7:44 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Linus Walleij, Russell King, Arnd Bergmann, linux-arm-kernel,
	linux-kernel

The subject line is not a good one.  Please elaborate.

> Move struct ab8500_ext_regulator_cfg to  the only file that is now used in.

                   Attention to detail --^

> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/regulator/ab8500-ext.c   |    6 ++++++
>  include/linux/regulator/ab8500.h |    5 -----
>  2 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c
> index 84c1ee3..a40c701 100644
> --- a/drivers/regulator/ab8500-ext.c
> +++ b/drivers/regulator/ab8500-ext.c
> @@ -25,6 +25,12 @@
>  #include <linux/mfd/abx500/ab8500.h>
>  #include <linux/regulator/ab8500.h>
>  
> +

Superfluous '\n'.

> +/* AB8500 external regulators */

No need for this commit now.

> +struct ab8500_ext_regulator_cfg {
> +	bool hwreq; /* requires hw mode or high power mode */
> +};
> +

Are you sure a struct is required at all now?  It only contains a
single bool after all.

>  /**
>   * struct ab8500_ext_regulator_info - ab8500 regulator information
>   * @dev: device pointer
> diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h
> index d8ecefa..802529b 100644
> --- a/include/linux/regulator/ab8500.h
> +++ b/include/linux/regulator/ab8500.h
> @@ -300,11 +300,6 @@ enum ab8540_regulator_reg {
>  	AB8540_NUM_REGULATOR_REGISTERS,
>  };
>  
> -/* AB8500 external regulators */
> -struct ab8500_ext_regulator_cfg {
> -	bool hwreq; /* requires hw mode or high power mode */
> -};
> -
>  enum ab8500_ext_regulator_id {
>  	AB8500_EXT_SUPPLY1,
>  	AB8500_EXT_SUPPLY2,

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] ARM: ux500: Move struct
@ 2015-01-22  7:44   ` Lee Jones
  0 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2015-01-22  7:44 UTC (permalink / raw)
  To: linux-arm-kernel

The subject line is not a good one.  Please elaborate.

> Move struct ab8500_ext_regulator_cfg to  the only file that is now used in.

                   Attention to detail --^

> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/regulator/ab8500-ext.c   |    6 ++++++
>  include/linux/regulator/ab8500.h |    5 -----
>  2 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/regulator/ab8500-ext.c b/drivers/regulator/ab8500-ext.c
> index 84c1ee3..a40c701 100644
> --- a/drivers/regulator/ab8500-ext.c
> +++ b/drivers/regulator/ab8500-ext.c
> @@ -25,6 +25,12 @@
>  #include <linux/mfd/abx500/ab8500.h>
>  #include <linux/regulator/ab8500.h>
>  
> +

Superfluous '\n'.

> +/* AB8500 external regulators */

No need for this commit now.

> +struct ab8500_ext_regulator_cfg {
> +	bool hwreq; /* requires hw mode or high power mode */
> +};
> +

Are you sure a struct is required at all now?  It only contains a
single bool after all.

>  /**
>   * struct ab8500_ext_regulator_info - ab8500 regulator information
>   * @dev: device pointer
> diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h
> index d8ecefa..802529b 100644
> --- a/include/linux/regulator/ab8500.h
> +++ b/include/linux/regulator/ab8500.h
> @@ -300,11 +300,6 @@ enum ab8540_regulator_reg {
>  	AB8540_NUM_REGULATOR_REGISTERS,
>  };
>  
> -/* AB8500 external regulators */
> -struct ab8500_ext_regulator_cfg {
> -	bool hwreq; /* requires hw mode or high power mode */
> -};
> -
>  enum ab8500_ext_regulator_id {
>  	AB8500_EXT_SUPPLY1,
>  	AB8500_EXT_SUPPLY2,

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] ARM: ux500: Remove unused functions and structs
  2015-01-21 23:09   ` Rickard Strandqvist
@ 2015-01-22  7:49     ` Lee Jones
  -1 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2015-01-22  7:49 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Linus Walleij, Russell King, Arnd Bergmann, linux-arm-kernel,
	linux-kernel

On Thu, 22 Jan 2015, Rickard Strandqvist wrote:

> Remove same unused functions and structs.

Repeating the subject line in the commit message is seldom
appropriate.  Please elaborate.

> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  arch/arm/mach-ux500/board-mop500-regulators.c |  106 -------------------------
>  arch/arm/mach-ux500/board-mop500-regulators.h |    5 --
>  2 files changed, 111 deletions(-)
> 
> diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
> index 32d744e..2b8f685 100644
> --- a/arch/arm/mach-ux500/board-mop500-regulators.c
> +++ b/arch/arm/mach-ux500/board-mop500-regulators.c
> @@ -19,17 +19,6 @@ static struct regulator_consumer_supply gpio_en_3v3_consumers[] = {
>         REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
>  };
>  
> -struct regulator_init_data gpio_en_3v3_regulator = {
> -       .constraints = {
> -               .name = "EN-3V3",
> -               .min_uV = 3300000,
> -               .max_uV = 3300000,
> -               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
> -       },
> -       .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers),
> -       .consumer_supplies = gpio_en_3v3_consumers,
> -};
> -
>  /*
>   * TPS61052 regulator
>   */
> @@ -43,17 +32,6 @@ static struct regulator_consumer_supply tps61052_vaudio_consumers[] = {
>  	REGULATOR_SUPPLY("vintdclassint", "ab8500-codec.0"),
>  };
>  
> -struct regulator_init_data tps61052_regulator = {
> -	.constraints = {
> -		.name = "vaudio-hf",
> -		.min_uV = 4500000,
> -		.max_uV = 4500000,
> -		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
> -	},
> -	.num_consumer_supplies = ARRAY_SIZE(tps61052_vaudio_consumers),
> -	.consumer_supplies = tps61052_vaudio_consumers,
> -};
> -

I guess we issue all of this stuff from DT now.

>  static struct regulator_consumer_supply ab8500_vaux1_consumers[] = {
>  	/* Main display, u8500 R3 uib */
>  	REGULATOR_SUPPLY("vddi", "mcde_disp_sony_acx424akp.0"),
> @@ -483,11 +461,6 @@ static struct regulator_consumer_supply ab8500_ext_supply3_consumers[] = {
>  	REGULATOR_SUPPLY("vinvsim", "sim-detect.0"),
>  };
>  
> -/* extended configuration for VextSupply2, only used for HREFP_V20 boards */
> -static struct ab8500_ext_regulator_cfg ab8500_ext_supply2 = {
> -	.hwreq = true,
> -};
> -

So if we're not passing this stuff from platform data anymore, why is
the struct required at all?  It's the one you moved in patch 1 right?

>  /*
>   * AB8500 external regulators
>   */
> @@ -984,82 +957,3 @@ struct ab8500_regulator_platform_data ab8500_regulator_plat_data = {
>  	.ext_regulator          = ab8500_ext_regulators,
>  	.num_ext_regulator      = ARRAY_SIZE(ab8500_ext_regulators),
>  };
> -
> -struct ab8500_regulator_platform_data ab8505_regulator_plat_data = {
> -	.reg_init               = ab8505_reg_init,
> -	.num_reg_init           = ARRAY_SIZE(ab8505_reg_init),
> -	.regulator              = ab8505_regulators,
> -	.num_regulator          = ARRAY_SIZE(ab8505_regulators),
> -};
> -
> -static void ab8500_modify_reg_init(int id, u8 mask, u8 value)
> -{
> -	int i;
> -
> -	if (cpu_is_u8520()) {
> -		for (i = ARRAY_SIZE(ab8505_reg_init) - 1; i >= 0; i--) {
> -			if (ab8505_reg_init[i].id == id) {
> -				u8 initval = ab8505_reg_init[i].value;
> -				initval = (initval & ~mask) | (value & mask);
> -				ab8505_reg_init[i].value = initval;
> -
> -				BUG_ON(mask & ~ab8505_reg_init[i].mask);
> -				return;
> -			}
> -		}
> -	} else {
> -		for (i = ARRAY_SIZE(ab8500_reg_init) - 1; i >= 0; i--) {
> -			if (ab8500_reg_init[i].id == id) {
> -				u8 initval = ab8500_reg_init[i].value;
> -				initval = (initval & ~mask) | (value & mask);
> -				ab8500_reg_init[i].value = initval;
> -
> -				BUG_ON(mask & ~ab8500_reg_init[i].mask);
> -				return;
> -			}
> -		}
> -	}
> -
> -	BUG_ON(1);
> -}
> -
> -void mop500_regulator_init(void)
> -{
> -	struct regulator_init_data *regulator;
> -
> -	/*
> -	 * Temporarily turn on Vaux2 on 8520 machine
> -	 */
> -	if (cpu_is_u8520()) {
> -		/* Vaux2 initialized to be on */
> -		ab8500_modify_reg_init(AB8505_VAUX12REGU, 0x0f, 0x05);
> -	}
> -
> -	/*
> -	 * Handle AB8500_EXT_SUPPLY2 on HREFP_V20_V50 boards (do it for
> -	 * all HREFP_V20 boards)
> -	 */
> -	if (cpu_is_u8500v20()) {
> -		/* VextSupply2RequestCtrl =  HP/OFF depending on VxRequest */
> -		ab8500_modify_reg_init(AB8500_REGUREQUESTCTRL3, 0x01, 0x01);
> -
> -		/* VextSupply2SysClkReq1HPValid = SysClkReq1 controlled */
> -		ab8500_modify_reg_init(AB8500_REGUSYSCLKREQ1HPVALID2,
> -			0x20, 0x20);
> -
> -		/* VextSupply2 = force HP at initialization */
> -		ab8500_modify_reg_init(AB8500_EXTSUPPLYREGU, 0x0c, 0x04);
> -
> -		/* enable VextSupply2 during platform active */
> -		regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2];
> -		regulator->constraints.always_on = 1;
> -
> -		/* disable VextSupply2 in suspend */
> -		regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2];
> -		regulator->constraints.state_mem.disabled = 1;
> -		regulator->constraints.state_standby.disabled = 1;
> -
> -		/* enable VextSupply2 HW control (used in suspend) */
> -		regulator->driver_data = (void *)&ab8500_ext_supply2;
> -	}
> -}
> diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
> index 9bece38..88da2b8 100644
> --- a/arch/arm/mach-ux500/board-mop500-regulators.h
> +++ b/arch/arm/mach-ux500/board-mop500-regulators.h
> @@ -15,10 +15,5 @@
>  #include <linux/regulator/ab8500.h>
>  
>  extern struct ab8500_regulator_platform_data ab8500_regulator_plat_data;
> -extern struct ab8500_regulator_platform_data ab8505_regulator_plat_data;
> -extern struct regulator_init_data tps61052_regulator;
> -extern struct regulator_init_data gpio_en_3v3_regulator;
> -
> -void mop500_regulator_init(void);
>  
>  #endif

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/2] ARM: ux500: Remove unused functions and structs
@ 2015-01-22  7:49     ` Lee Jones
  0 siblings, 0 replies; 12+ messages in thread
From: Lee Jones @ 2015-01-22  7:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 22 Jan 2015, Rickard Strandqvist wrote:

> Remove same unused functions and structs.

Repeating the subject line in the commit message is seldom
appropriate.  Please elaborate.

> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  arch/arm/mach-ux500/board-mop500-regulators.c |  106 -------------------------
>  arch/arm/mach-ux500/board-mop500-regulators.h |    5 --
>  2 files changed, 111 deletions(-)
> 
> diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
> index 32d744e..2b8f685 100644
> --- a/arch/arm/mach-ux500/board-mop500-regulators.c
> +++ b/arch/arm/mach-ux500/board-mop500-regulators.c
> @@ -19,17 +19,6 @@ static struct regulator_consumer_supply gpio_en_3v3_consumers[] = {
>         REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
>  };
>  
> -struct regulator_init_data gpio_en_3v3_regulator = {
> -       .constraints = {
> -               .name = "EN-3V3",
> -               .min_uV = 3300000,
> -               .max_uV = 3300000,
> -               .valid_ops_mask = REGULATOR_CHANGE_STATUS,
> -       },
> -       .num_consumer_supplies = ARRAY_SIZE(gpio_en_3v3_consumers),
> -       .consumer_supplies = gpio_en_3v3_consumers,
> -};
> -
>  /*
>   * TPS61052 regulator
>   */
> @@ -43,17 +32,6 @@ static struct regulator_consumer_supply tps61052_vaudio_consumers[] = {
>  	REGULATOR_SUPPLY("vintdclassint", "ab8500-codec.0"),
>  };
>  
> -struct regulator_init_data tps61052_regulator = {
> -	.constraints = {
> -		.name = "vaudio-hf",
> -		.min_uV = 4500000,
> -		.max_uV = 4500000,
> -		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
> -	},
> -	.num_consumer_supplies = ARRAY_SIZE(tps61052_vaudio_consumers),
> -	.consumer_supplies = tps61052_vaudio_consumers,
> -};
> -

I guess we issue all of this stuff from DT now.

>  static struct regulator_consumer_supply ab8500_vaux1_consumers[] = {
>  	/* Main display, u8500 R3 uib */
>  	REGULATOR_SUPPLY("vddi", "mcde_disp_sony_acx424akp.0"),
> @@ -483,11 +461,6 @@ static struct regulator_consumer_supply ab8500_ext_supply3_consumers[] = {
>  	REGULATOR_SUPPLY("vinvsim", "sim-detect.0"),
>  };
>  
> -/* extended configuration for VextSupply2, only used for HREFP_V20 boards */
> -static struct ab8500_ext_regulator_cfg ab8500_ext_supply2 = {
> -	.hwreq = true,
> -};
> -

So if we're not passing this stuff from platform data anymore, why is
the struct required at all?  It's the one you moved in patch 1 right?

>  /*
>   * AB8500 external regulators
>   */
> @@ -984,82 +957,3 @@ struct ab8500_regulator_platform_data ab8500_regulator_plat_data = {
>  	.ext_regulator          = ab8500_ext_regulators,
>  	.num_ext_regulator      = ARRAY_SIZE(ab8500_ext_regulators),
>  };
> -
> -struct ab8500_regulator_platform_data ab8505_regulator_plat_data = {
> -	.reg_init               = ab8505_reg_init,
> -	.num_reg_init           = ARRAY_SIZE(ab8505_reg_init),
> -	.regulator              = ab8505_regulators,
> -	.num_regulator          = ARRAY_SIZE(ab8505_regulators),
> -};
> -
> -static void ab8500_modify_reg_init(int id, u8 mask, u8 value)
> -{
> -	int i;
> -
> -	if (cpu_is_u8520()) {
> -		for (i = ARRAY_SIZE(ab8505_reg_init) - 1; i >= 0; i--) {
> -			if (ab8505_reg_init[i].id == id) {
> -				u8 initval = ab8505_reg_init[i].value;
> -				initval = (initval & ~mask) | (value & mask);
> -				ab8505_reg_init[i].value = initval;
> -
> -				BUG_ON(mask & ~ab8505_reg_init[i].mask);
> -				return;
> -			}
> -		}
> -	} else {
> -		for (i = ARRAY_SIZE(ab8500_reg_init) - 1; i >= 0; i--) {
> -			if (ab8500_reg_init[i].id == id) {
> -				u8 initval = ab8500_reg_init[i].value;
> -				initval = (initval & ~mask) | (value & mask);
> -				ab8500_reg_init[i].value = initval;
> -
> -				BUG_ON(mask & ~ab8500_reg_init[i].mask);
> -				return;
> -			}
> -		}
> -	}
> -
> -	BUG_ON(1);
> -}
> -
> -void mop500_regulator_init(void)
> -{
> -	struct regulator_init_data *regulator;
> -
> -	/*
> -	 * Temporarily turn on Vaux2 on 8520 machine
> -	 */
> -	if (cpu_is_u8520()) {
> -		/* Vaux2 initialized to be on */
> -		ab8500_modify_reg_init(AB8505_VAUX12REGU, 0x0f, 0x05);
> -	}
> -
> -	/*
> -	 * Handle AB8500_EXT_SUPPLY2 on HREFP_V20_V50 boards (do it for
> -	 * all HREFP_V20 boards)
> -	 */
> -	if (cpu_is_u8500v20()) {
> -		/* VextSupply2RequestCtrl =  HP/OFF depending on VxRequest */
> -		ab8500_modify_reg_init(AB8500_REGUREQUESTCTRL3, 0x01, 0x01);
> -
> -		/* VextSupply2SysClkReq1HPValid = SysClkReq1 controlled */
> -		ab8500_modify_reg_init(AB8500_REGUSYSCLKREQ1HPVALID2,
> -			0x20, 0x20);
> -
> -		/* VextSupply2 = force HP at initialization */
> -		ab8500_modify_reg_init(AB8500_EXTSUPPLYREGU, 0x0c, 0x04);
> -
> -		/* enable VextSupply2 during platform active */
> -		regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2];
> -		regulator->constraints.always_on = 1;
> -
> -		/* disable VextSupply2 in suspend */
> -		regulator = &ab8500_ext_regulators[AB8500_EXT_SUPPLY2];
> -		regulator->constraints.state_mem.disabled = 1;
> -		regulator->constraints.state_standby.disabled = 1;
> -
> -		/* enable VextSupply2 HW control (used in suspend) */
> -		regulator->driver_data = (void *)&ab8500_ext_supply2;
> -	}
> -}
> diff --git a/arch/arm/mach-ux500/board-mop500-regulators.h b/arch/arm/mach-ux500/board-mop500-regulators.h
> index 9bece38..88da2b8 100644
> --- a/arch/arm/mach-ux500/board-mop500-regulators.h
> +++ b/arch/arm/mach-ux500/board-mop500-regulators.h
> @@ -15,10 +15,5 @@
>  #include <linux/regulator/ab8500.h>
>  
>  extern struct ab8500_regulator_platform_data ab8500_regulator_plat_data;
> -extern struct ab8500_regulator_platform_data ab8505_regulator_plat_data;
> -extern struct regulator_init_data tps61052_regulator;
> -extern struct regulator_init_data gpio_en_3v3_regulator;
> -
> -void mop500_regulator_init(void);
>  
>  #endif

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] ARM: ux500: Move struct
  2015-01-22  7:44   ` Lee Jones
@ 2015-01-24 17:33     ` Rickard Strandqvist
  -1 siblings, 0 replies; 12+ messages in thread
From: Rickard Strandqvist @ 2015-01-24 17:33 UTC (permalink / raw)
  To: Lee Jones
  Cc: Linus Walleij, Russell King, Arnd Bergmann, linux-arm-kernel,
	Linux Kernel Mailing List

2015-01-22 8:44 GMT+01:00 Lee Jones <lee.jones@linaro.org>:
>
> Are you sure a struct is required at all now?  It only contains a
> single bool after all.


Hi Lee

Okay, I will gladly remove ab8500_ext_regulator_cfg completely.
And I will try to update the comments, but since I'm not so familiar
with what this code was meant to do it is a little more difficult.

Kind regards
Rickard Strandqvist

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] ARM: ux500: Move struct
@ 2015-01-24 17:33     ` Rickard Strandqvist
  0 siblings, 0 replies; 12+ messages in thread
From: Rickard Strandqvist @ 2015-01-24 17:33 UTC (permalink / raw)
  To: linux-arm-kernel

2015-01-22 8:44 GMT+01:00 Lee Jones <lee.jones@linaro.org>:
>
> Are you sure a struct is required at all now?  It only contains a
> single bool after all.


Hi Lee

Okay, I will gladly remove ab8500_ext_regulator_cfg completely.
And I will try to update the comments, but since I'm not so familiar
with what this code was meant to do it is a little more difficult.

Kind regards
Rickard Strandqvist

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] ARM: ux500: Move struct
  2015-01-24 17:33     ` Rickard Strandqvist
@ 2015-01-24 21:40       ` Arnd Bergmann
  -1 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2015-01-24 21:40 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Lee Jones, Linus Walleij, Russell King, linux-arm-kernel,
	Linux Kernel Mailing List

On Saturday 24 January 2015 18:33:00 Rickard Strandqvist wrote:
> 2015-01-22 8:44 GMT+01:00 Lee Jones <lee.jones@linaro.org>:
> >
> > Are you sure a struct is required at all now?  It only contains a
> > single bool after all.
> 
> 
> Hi Lee
> 
> Okay, I will gladly remove ab8500_ext_regulator_cfg completely.
> And I will try to update the comments, but since I'm not so familiar
> with what this code was meant to do it is a little more difficult.
> 

Try to take small steps then: See if there is something in this code
that is either never called, or data structures that are only
written but never read, or pointers that are verifiably always 
NULL, then eliminate one piece of the code at a time, with a patch
that explains what you found.

Try to make sure everything still builds after each patch, and note
that this was not the case with your first patch, though it would have
worked in the reverse order.

I suspect the best way forward is to actually move all of
ab8500_regulator_plat_data and whatever it references into
drivers/regulator/ab8500-ext.c because there now is only one
remaining instance of that. After this move, you can delete
a lot of code in arch/arm/mach-ux500 and possibly move all of
include/linux/regulator/ab8500.h into drivers/regulator/ab8500-ext.c
as well.

	Arnd

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] ARM: ux500: Move struct
@ 2015-01-24 21:40       ` Arnd Bergmann
  0 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2015-01-24 21:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Saturday 24 January 2015 18:33:00 Rickard Strandqvist wrote:
> 2015-01-22 8:44 GMT+01:00 Lee Jones <lee.jones@linaro.org>:
> >
> > Are you sure a struct is required at all now?  It only contains a
> > single bool after all.
> 
> 
> Hi Lee
> 
> Okay, I will gladly remove ab8500_ext_regulator_cfg completely.
> And I will try to update the comments, but since I'm not so familiar
> with what this code was meant to do it is a little more difficult.
> 

Try to take small steps then: See if there is something in this code
that is either never called, or data structures that are only
written but never read, or pointers that are verifiably always 
NULL, then eliminate one piece of the code at a time, with a patch
that explains what you found.

Try to make sure everything still builds after each patch, and note
that this was not the case with your first patch, though it would have
worked in the reverse order.

I suspect the best way forward is to actually move all of
ab8500_regulator_plat_data and whatever it references into
drivers/regulator/ab8500-ext.c because there now is only one
remaining instance of that. After this move, you can delete
a lot of code in arch/arm/mach-ux500 and possibly move all of
include/linux/regulator/ab8500.h into drivers/regulator/ab8500-ext.c
as well.

	Arnd

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-01-24 21:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-21 23:09 [PATCH 1/2] ARM: ux500: Move struct Rickard Strandqvist
2015-01-21 23:09 ` Rickard Strandqvist
2015-01-21 23:09 ` [PATCH 2/2] ARM: ux500: Remove unused functions and structs Rickard Strandqvist
2015-01-21 23:09   ` Rickard Strandqvist
2015-01-22  7:49   ` Lee Jones
2015-01-22  7:49     ` Lee Jones
2015-01-22  7:44 ` [PATCH 1/2] ARM: ux500: Move struct Lee Jones
2015-01-22  7:44   ` Lee Jones
2015-01-24 17:33   ` Rickard Strandqvist
2015-01-24 17:33     ` Rickard Strandqvist
2015-01-24 21:40     ` Arnd Bergmann
2015-01-24 21:40       ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.