diff mbox

[2/3] ARM: shmobile: ape6evm: update MMC0, SDHI0 and SDHI1 with correct regulators

Message ID 1375342881-2155-3-git-send-email-g.liakhovetski@gmx.de (mailing list archive)
State Superseded
Commit 02823096d2d5f38b7d6c7badc1215a38e1113f3d
Headers show

Commit Message

Guennadi Liakhovetski Aug. 1, 2013, 7:41 a.m. UTC
Currently a dummy fixed always-on regulator is used for all 3 SD/MMC
interfaces on ape6evm. This patch updates the board to use correct supplies
for MMC0, SDHI0 and SDHI1 VDD. SDHI0 VccQ supply regulator should be
implemented in a separate patch.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
---

v4: make SDHI0 Vcc 3.3V instead of 3.0V

 arch/arm/mach-shmobile/board-ape6evm.c |   54 +++++++++++++++++++++++++++-----
 1 files changed, 46 insertions(+), 8 deletions(-)

Comments

Simon Horman Aug. 21, 2013, 8:39 a.m. UTC | #1
On Thu, Aug 01, 2013 at 09:41:20AM +0200, Guennadi Liakhovetski wrote:
> Currently a dummy fixed always-on regulator is used for all 3 SD/MMC
> interfaces on ape6evm. This patch updates the board to use correct supplies
> for MMC0, SDHI0 and SDHI1 VDD. SDHI0 VccQ supply regulator should be
> implemented in a separate patch.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> ---
> 
> v4: make SDHI0 Vcc 3.3V instead of 3.0V

Hi Laurent,

as you had a comment on a previous version of this patch could
you review this version?

> 
>  arch/arm/mach-shmobile/board-ape6evm.c |   54 +++++++++++++++++++++++++++-----
>  1 files changed, 46 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c
> index c5e6cba..b613b594 100644
> --- a/arch/arm/mach-shmobile/board-ape6evm.c
> +++ b/arch/arm/mach-shmobile/board-ape6evm.c
> @@ -59,16 +59,49 @@ static const struct smsc911x_platform_config lan9220_data __initconst = {
>  };
>  
>  /*
> - * On APE6EVM power is supplied to MMCIF by a tps80032 regulator. For now we
> - * model a VDD supply to MMCIF, using a fixed 3.3V regulator. Also use the
> - * static power supply for SDHI0 and SDHI1, whereas SDHI0's VccQ is also
> - * supplied by the same tps80032 regulator and thus can also be adjusted
> - * dynamically.
> + * MMC0 power supplies:
> + * Both Vcc and VccQ to eMMC on APE6EVM are supplied by a tps80032 voltage
> + * regulator. Until support for it is added to this file we simulate the
> + * Vcc supply by a fixed always-on regulator
>   */
> -static struct regulator_consumer_supply fixed3v3_power_consumers[] =
> +static struct regulator_consumer_supply vcc_mmc0_consumers[] =
>  {
>  	REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
> +};
> +
> +/*
> + * SDHI0 power supplies:
> + * Vcc to SDHI0 on APE6EVM is supplied by a GPIO-switchable regulator. VccQ is
> + * provided by the same tps80032 regulator as both MMC0 voltages - see comment
> + * above
> + */
> +static struct regulator_consumer_supply vcc_sdhi0_consumers[] =
> +{
>  	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
> +};
> +
> +static struct regulator_init_data vcc_sdhi0_init_data = {
> +	.constraints = {
> +		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
> +	},
> +	.num_consumer_supplies  = ARRAY_SIZE(vcc_sdhi0_consumers),
> +	.consumer_supplies      = vcc_sdhi0_consumers,
> +};
> +
> +static const struct fixed_voltage_config vcc_sdhi0_info __initconst = {
> +	.supply_name = "SDHI0 Vcc",
> +	.microvolts = 3300000,
> +	.gpio = 76,
> +	.enable_high = 1,
> +	.init_data = &vcc_sdhi0_init_data,
> +};
> +
> +/*
> + * SDHI1 power supplies:
> + * Vcc and VccQ to SDHI1 on APE6EVM are both fixed at 3.3V
> + */
> +static struct regulator_consumer_supply vcc_sdhi1_consumers[] =
> +{
>  	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
>  };
>  
> @@ -161,14 +194,19 @@ static void __init ape6evm_add_standard_devices(void)
>  	platform_device_register_resndata(&platform_bus, "smsc911x", -1,
>  					  lan9220_res, ARRAY_SIZE(lan9220_res),
>  					  &lan9220_data, sizeof(lan9220_data));
> -	regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
> -				     ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
> +
> +	regulator_register_always_on(1, "MMC0 Vcc", vcc_mmc0_consumers,
> +				     ARRAY_SIZE(vcc_mmc0_consumers), 2800000);
>  	platform_device_register_resndata(&platform_bus, "sh_mmcif", 0,
>  					  mmcif0_resources, ARRAY_SIZE(mmcif0_resources),
>  					  &mmcif0_pdata, sizeof(mmcif0_pdata));
> +	platform_device_register_data(&platform_bus, "reg-fixed-voltage", 2,
> +				      &vcc_sdhi0_info, sizeof(vcc_sdhi0_info));
>  	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
>  					  sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
>  					  &sdhi0_pdata, sizeof(sdhi0_pdata));
> +	regulator_register_always_on(3, "SDHI1 Vcc", vcc_sdhi1_consumers,
> +				     ARRAY_SIZE(vcc_sdhi1_consumers), 3300000);
>  	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1,
>  					  sdhi1_resources, ARRAY_SIZE(sdhi1_resources),
>  					  &sdhi1_pdata, sizeof(sdhi1_pdata));
> -- 
> 1.7.2.5
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laurent Pinchart Aug. 22, 2013, 12:50 a.m. UTC | #2
Hi Guennadi,

Thank you for the patch.

On Thursday 01 August 2013 09:41:20 Guennadi Liakhovetski wrote:
> Currently a dummy fixed always-on regulator is used for all 3 SD/MMC
> interfaces on ape6evm. This patch updates the board to use correct supplies
> for MMC0, SDHI0 and SDHI1 VDD. SDHI0 VccQ supply regulator should be
> implemented in a separate patch.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> 
> v4: make SDHI0 Vcc 3.3V instead of 3.0V
> 
>  arch/arm/mach-shmobile/board-ape6evm.c |   54
> +++++++++++++++++++++++++++----- 1 files changed, 46 insertions(+), 8
> deletions(-)
> 
> diff --git a/arch/arm/mach-shmobile/board-ape6evm.c
> b/arch/arm/mach-shmobile/board-ape6evm.c index c5e6cba..b613b594 100644
> --- a/arch/arm/mach-shmobile/board-ape6evm.c
> +++ b/arch/arm/mach-shmobile/board-ape6evm.c
> @@ -59,16 +59,49 @@ static const struct smsc911x_platform_config
> lan9220_data __initconst = { };
> 
>  /*
> - * On APE6EVM power is supplied to MMCIF by a tps80032 regulator. For now
> we - * model a VDD supply to MMCIF, using a fixed 3.3V regulator. Also use
> the - * static power supply for SDHI0 and SDHI1, whereas SDHI0's VccQ is
> also - * supplied by the same tps80032 regulator and thus can also be
> adjusted - * dynamically.
> + * MMC0 power supplies:
> + * Both Vcc and VccQ to eMMC on APE6EVM are supplied by a tps80032 voltage
> + * regulator. Until support for it is added to this file we simulate the
> + * Vcc supply by a fixed always-on regulator
>   */
> -static struct regulator_consumer_supply fixed3v3_power_consumers[] =
> +static struct regulator_consumer_supply vcc_mmc0_consumers[] =
>  {
>  	REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
> +};
> +
> +/*
> + * SDHI0 power supplies:
> + * Vcc to SDHI0 on APE6EVM is supplied by a GPIO-switchable regulator. VccQ
> is + * provided by the same tps80032 regulator as both MMC0 voltages - see
> comment + * above
> + */
> +static struct regulator_consumer_supply vcc_sdhi0_consumers[] =
> +{
>  	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
> +};
> +
> +static struct regulator_init_data vcc_sdhi0_init_data = {
> +	.constraints = {
> +		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
> +	},
> +	.num_consumer_supplies  = ARRAY_SIZE(vcc_sdhi0_consumers),
> +	.consumer_supplies      = vcc_sdhi0_consumers,
> +};
> +
> +static const struct fixed_voltage_config vcc_sdhi0_info __initconst = {
> +	.supply_name = "SDHI0 Vcc",
> +	.microvolts = 3300000,
> +	.gpio = 76,
> +	.enable_high = 1,
> +	.init_data = &vcc_sdhi0_init_data,
> +};
> +
> +/*
> + * SDHI1 power supplies:
> + * Vcc and VccQ to SDHI1 on APE6EVM are both fixed at 3.3V
> + */
> +static struct regulator_consumer_supply vcc_sdhi1_consumers[] =
> +{
>  	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
>  };
> 
> @@ -161,14 +194,19 @@ static void __init ape6evm_add_standard_devices(void)
>  	platform_device_register_resndata(&platform_bus, "smsc911x", -1,
>  					  lan9220_res, ARRAY_SIZE(lan9220_res),
>  					  &lan9220_data, sizeof(lan9220_data));
> -	regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
> -				     ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
> +
> +	regulator_register_always_on(1, "MMC0 Vcc", vcc_mmc0_consumers,
> +				     ARRAY_SIZE(vcc_mmc0_consumers), 2800000);
>  	platform_device_register_resndata(&platform_bus, "sh_mmcif", 0,
>  					  mmcif0_resources, ARRAY_SIZE(mmcif0_resources),
>  					  &mmcif0_pdata, sizeof(mmcif0_pdata));
> +	platform_device_register_data(&platform_bus, "reg-fixed-voltage", 2,
> +				      &vcc_sdhi0_info, sizeof(vcc_sdhi0_info));
>  	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
>  					  sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
>  					  &sdhi0_pdata, sizeof(sdhi0_pdata));
> +	regulator_register_always_on(3, "SDHI1 Vcc", vcc_sdhi1_consumers,
> +				     ARRAY_SIZE(vcc_sdhi1_consumers), 3300000);
>  	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1,
>  					  sdhi1_resources, ARRAY_SIZE(sdhi1_resources),
>  					  &sdhi1_pdata, sizeof(sdhi1_pdata));
Simon Horman Aug. 22, 2013, 6:27 a.m. UTC | #3
On Thu, Aug 22, 2013 at 02:50:04AM +0200, Laurent Pinchart wrote:
> Hi Guennadi,
> 
> Thank you for the patch.
> 
> On Thursday 01 August 2013 09:41:20 Guennadi Liakhovetski wrote:
> > Currently a dummy fixed always-on regulator is used for all 3 SD/MMC
> > interfaces on ape6evm. This patch updates the board to use correct supplies
> > for MMC0, SDHI0 and SDHI1 VDD. SDHI0 VccQ supply regulator should be
> > implemented in a separate patch.
> > 
> > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> 
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks, I have queued this up in the boards3 branch.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c
index c5e6cba..b613b594 100644
--- a/arch/arm/mach-shmobile/board-ape6evm.c
+++ b/arch/arm/mach-shmobile/board-ape6evm.c
@@ -59,16 +59,49 @@  static const struct smsc911x_platform_config lan9220_data __initconst = {
 };
 
 /*
- * On APE6EVM power is supplied to MMCIF by a tps80032 regulator. For now we
- * model a VDD supply to MMCIF, using a fixed 3.3V regulator. Also use the
- * static power supply for SDHI0 and SDHI1, whereas SDHI0's VccQ is also
- * supplied by the same tps80032 regulator and thus can also be adjusted
- * dynamically.
+ * MMC0 power supplies:
+ * Both Vcc and VccQ to eMMC on APE6EVM are supplied by a tps80032 voltage
+ * regulator. Until support for it is added to this file we simulate the
+ * Vcc supply by a fixed always-on regulator
  */
-static struct regulator_consumer_supply fixed3v3_power_consumers[] =
+static struct regulator_consumer_supply vcc_mmc0_consumers[] =
 {
 	REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
+};
+
+/*
+ * SDHI0 power supplies:
+ * Vcc to SDHI0 on APE6EVM is supplied by a GPIO-switchable regulator. VccQ is
+ * provided by the same tps80032 regulator as both MMC0 voltages - see comment
+ * above
+ */
+static struct regulator_consumer_supply vcc_sdhi0_consumers[] =
+{
 	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
+};
+
+static struct regulator_init_data vcc_sdhi0_init_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies  = ARRAY_SIZE(vcc_sdhi0_consumers),
+	.consumer_supplies      = vcc_sdhi0_consumers,
+};
+
+static const struct fixed_voltage_config vcc_sdhi0_info __initconst = {
+	.supply_name = "SDHI0 Vcc",
+	.microvolts = 3300000,
+	.gpio = 76,
+	.enable_high = 1,
+	.init_data = &vcc_sdhi0_init_data,
+};
+
+/*
+ * SDHI1 power supplies:
+ * Vcc and VccQ to SDHI1 on APE6EVM are both fixed at 3.3V
+ */
+static struct regulator_consumer_supply vcc_sdhi1_consumers[] =
+{
 	REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
 };
 
@@ -161,14 +194,19 @@  static void __init ape6evm_add_standard_devices(void)
 	platform_device_register_resndata(&platform_bus, "smsc911x", -1,
 					  lan9220_res, ARRAY_SIZE(lan9220_res),
 					  &lan9220_data, sizeof(lan9220_data));
-	regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
-				     ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
+
+	regulator_register_always_on(1, "MMC0 Vcc", vcc_mmc0_consumers,
+				     ARRAY_SIZE(vcc_mmc0_consumers), 2800000);
 	platform_device_register_resndata(&platform_bus, "sh_mmcif", 0,
 					  mmcif0_resources, ARRAY_SIZE(mmcif0_resources),
 					  &mmcif0_pdata, sizeof(mmcif0_pdata));
+	platform_device_register_data(&platform_bus, "reg-fixed-voltage", 2,
+				      &vcc_sdhi0_info, sizeof(vcc_sdhi0_info));
 	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
 					  sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
 					  &sdhi0_pdata, sizeof(sdhi0_pdata));
+	regulator_register_always_on(3, "SDHI1 Vcc", vcc_sdhi1_consumers,
+				     ARRAY_SIZE(vcc_sdhi1_consumers), 3300000);
 	platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1,
 					  sdhi1_resources, ARRAY_SIZE(sdhi1_resources),
 					  &sdhi1_pdata, sizeof(sdhi1_pdata));