Skip to contentSkip to conversation

mmc: uniphier-sd: Add vqmmc regulator support

PATCH New Marek Vasut 3 participants 8 messages Sep 15, 2017 – Sep 29, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: uniphier-sd: Add vqmmc regulator support

Add initial support for setting the vqmmc regulator. Since we do not support 1V8 modes, set the regulator to 3V3 and enable it.

Cc Masahiro Yamada <[email protected]>
Cc Jaehoon Chung <[email protected]>
---
 drivers/mmc/uniphier-sd.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/mmc/uniphier-sd.c +13 -0
index 3c52161067..0d1203cb76 100644
@@ -14,6 +14,7 @@
 #include <linux/dma-direction.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
+#include <power/regulator.h>
 #include <asm/unaligned.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -756,6 +757,9 @@ static int uniphier_sd_probe(struct udevice *dev)
 	fdt_addr_t base;
 	struct clk clk;
 	int ret;
+#ifdef CONFIG_DM_REGULATOR
+	struct udevice *vqmmc_dev;
+#endif
 
 	base = devfdt_get_addr(dev);
 	if (base == FDT_ADDR_T_NONE)
@@ -765,6 +769,15 @@ static int uniphier_sd_probe(struct udevice *dev)
 	if (!priv->regbase)
 		return -ENOMEM;
 
+#ifdef CONFIG_DM_REGULATOR
+	ret = device_get_supply_regulator(dev, "vqmmc-supply", &vqmmc_dev);
+	if (!ret) {
+		/* Set the regulator to 3.3V until we support 1.8V modes */
+		regulator_set_value(vqmmc_dev, 3300000);
+		regulator_set_enable(vqmmc_dev, true);
+	}
+#endif
+
 	ret = clk_get_by_index(dev, 0, &clk);
 	if (ret < 0) {
 		dev_err(dev, "failed to get host clock\n");
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 mmc: uniphier-sd: Add vqmmc regulator support

Quoted 6 lines · Marek Vasut

Add initial support for setting the vqmmc regulator. Since we do not support 1V8 modes, set the regulator to 3V3 and enable it.

Cc Masahiro Yamada <[email protected]>
Cc Jaehoon Chung <[email protected]>

Anything ?! I don't see this in the PR ...

Quoted 43 lines
---
 drivers/mmc/uniphier-sd.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/mmc/uniphier-sd.c +13 -0
index 3c52161067..0d1203cb76 100644
@@ -14,6 +14,7 @@
 #include <linux/dma-direction.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
+#include <power/regulator.h>
 #include <asm/unaligned.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -756,6 +757,9 @@ static int uniphier_sd_probe(struct udevice *dev)
 	fdt_addr_t base;
 	struct clk clk;
 	int ret;
+#ifdef CONFIG_DM_REGULATOR
+	struct udevice *vqmmc_dev;
+#endif
 
 	base = devfdt_get_addr(dev);
 	if (base == FDT_ADDR_T_NONE)
@@ -765,6 +769,15 @@ static int uniphier_sd_probe(struct udevice *dev)
 	if (!priv->regbase)
 		return -ENOMEM;
 
+#ifdef CONFIG_DM_REGULATOR
+	ret = device_get_supply_regulator(dev, "vqmmc-supply", &vqmmc_dev);
+	if (!ret) {
+		/* Set the regulator to 3.3V until we support 1.8V modes */
+		regulator_set_value(vqmmc_dev, 3300000);
+		regulator_set_enable(vqmmc_dev, true);
+	}
+#endif
+
 	ret = clk_get_by_index(dev, 0, &clk);
 	if (ret < 0) {
 		dev_err(dev, "failed to get host clock\n");
Signature · 2 lines
Best regards,
Marek Vasut
#2 lore raw

PATCH 1/1 mmc: uniphier-sd: Add vqmmc regulator support

Hi Marek,

Quoted 9 lines · Marek Vasut
Quoted 6 lines · Marek Vasut

Add initial support for setting the vqmmc regulator. Since we do not support 1V8 modes, set the regulator to 3V3 and enable it.

Cc Masahiro Yamada <[email protected]>
Cc Jaehoon Chung <[email protected]>

Anything ?! I don't see this in the PR ...

Sorry...I missed this patch..First, i have checked on patchwork. Will pick this patch into u-boot-mmc.

Best Regards,
Jaehoon Chung

Quoted 46 lines
Quoted 44 lines
---
 drivers/mmc/uniphier-sd.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/mmc/uniphier-sd.c +13 -0
index 3c52161067..0d1203cb76 100644
@@ -14,6 +14,7 @@
 #include <linux/dma-direction.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
+#include <power/regulator.h>
 #include <asm/unaligned.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -756,6 +757,9 @@ static int uniphier_sd_probe(struct udevice *dev)
 	fdt_addr_t base;
 	struct clk clk;
 	int ret;
+#ifdef CONFIG_DM_REGULATOR
+	struct udevice *vqmmc_dev;
+#endif
 
 	base = devfdt_get_addr(dev);
 	if (base == FDT_ADDR_T_NONE)
@@ -765,6 +769,15 @@ static int uniphier_sd_probe(struct udevice *dev)
 	if (!priv->regbase)
 		return -ENOMEM;
 
+#ifdef CONFIG_DM_REGULATOR
+	ret = device_get_supply_regulator(dev, "vqmmc-supply", &vqmmc_dev);
+	if (!ret) {
+		/* Set the regulator to 3.3V until we support 1.8V modes */
+		regulator_set_value(vqmmc_dev, 3300000);
+		regulator_set_enable(vqmmc_dev, true);
+	}
+#endif
+
 	ret = clk_get_by_index(dev, 0, &clk);
 	if (ret < 0) {
 		dev_err(dev, "failed to get host clock\n");
#3 lore raw

PATCH 1/1 mmc: uniphier-sd: Add vqmmc regulator support

2017-09-26 16:41 GMT+09:00 Jaehoon Chung <[email protected]>:

Quoted 11 lines

Hi Marek,

Quoted 8 lines · Marek Vasut
Quoted 6 lines · Marek Vasut

Add initial support for setting the vqmmc regulator. Since we do not support 1V8 modes, set the regulator to 3V3 and enable it.

Cc Masahiro Yamada <[email protected]>
Cc Jaehoon Chung <[email protected]>
Quoted 8 lines
Quoted 1 line

Anything ?! I don't see this in the PR ...

Sorry...I missed this patch..First, i have checked on patchwork. Will pick this patch into u-boot-mmc.

Best Regards,
Jaehoon Chung

UniPhier SoCs have different mechanism for 3.3/1.8 switching, but it is not a problem for me because I do not have a plan for enabling CONFIG_DM_REGULATOR.

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw

PATCH 1/1 mmc: uniphier-sd: Add vqmmc regulator support

Quoted 22 lines · Masahiro Yamada

2017-09-26 16:41 GMT+09:00 Jaehoon Chung <[email protected]>:

Quoted 11 lines

Hi Marek,

Quoted 8 lines · Marek Vasut
Quoted 6 lines · Marek Vasut

Add initial support for setting the vqmmc regulator. Since we do not support 1V8 modes, set the regulator to 3V3 and enable it.

Cc Masahiro Yamada <[email protected]>
Cc Jaehoon Chung <[email protected]>
Quoted 8 lines
Quoted 1 line

Anything ?! I don't see this in the PR ...

Sorry...I missed this patch..First, i have checked on patchwork. Will pick this patch into u-boot-mmc.

Best Regards,
Jaehoon Chung

Quoted 5 lines

UniPhier SoCs have different mechanism for 3.3/1.8 switching, but it is not a problem for me because I do not have a plan for enabling CONFIG_DM_REGULATOR.

Cool, thanks!

Is there a documentation for the uniphier mechanism somewhere ?

Signature · 2 lines
Best regards,
Marek Vasut
#5 lore raw

PATCH 1/1 mmc: uniphier-sd: Add vqmmc regulator support

2017-09-28 0:50 GMT+09:00 Marek Vasut <[email protected]>:

Quoted 27 lines · Masahiro Yamada
Quoted 26 lines

2017-09-26 16:41 GMT+09:00 Jaehoon Chung <[email protected]>:

Quoted 11 lines

Hi Marek,

Quoted 8 lines · Marek Vasut
Quoted 6 lines · Marek Vasut

Add initial support for setting the vqmmc regulator. Since we do not support 1V8 modes, set the regulator to 3V3 and enable it.

Cc Masahiro Yamada <[email protected]>
Cc Jaehoon Chung <[email protected]>
Quoted 8 lines
Quoted 1 line

Anything ?! I don't see this in the PR ...

Sorry...I missed this patch..First, i have checked on patchwork. Will pick this patch into u-boot-mmc.

Best Regards,
Jaehoon Chung

UniPhier SoCs have different mechanism for 3.3/1.8 switching, but it is not a problem for me because I do not have a plan for enabling CONFIG_DM_REGULATOR.

Quoted 6 lines
Quoted 1 line

Cool, thanks!

Is there a documentation for the uniphier mechanism somewhere ?

No document available.

Only crappy private documents.

They say SoC spec books are CONFIDENTIAL!!
Sigh.

Signature · 2 lines
Best Regards
Masahiro Yamada
#6 lore raw

PATCH 1/1 mmc: uniphier-sd: Add vqmmc regulator support

Quoted 28 lines · Masahiro Yamada

2017-09-28 0:50 GMT+09:00 Marek Vasut <[email protected]>:

Quoted 27 lines · Masahiro Yamada
Quoted 26 lines

2017-09-26 16:41 GMT+09:00 Jaehoon Chung <[email protected]>:

Quoted 11 lines

Hi Marek,

Quoted 8 lines · Marek Vasut
Quoted 6 lines · Marek Vasut

Add initial support for setting the vqmmc regulator. Since we do not support 1V8 modes, set the regulator to 3V3 and enable it.

Cc Masahiro Yamada <[email protected]>
Cc Jaehoon Chung <[email protected]>
Quoted 8 lines
Quoted 1 line

Anything ?! I don't see this in the PR ...

Sorry...I missed this patch..First, i have checked on patchwork. Will pick this patch into u-boot-mmc.

Best Regards,
Jaehoon Chung

UniPhier SoCs have different mechanism for 3.3/1.8 switching, but it is not a problem for me because I do not have a plan for enabling CONFIG_DM_REGULATOR.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Cool, thanks!

Is there a documentation for the uniphier mechanism somewhere ?

No document available.

I hope that new 96borad will have documentation available, *ahem* :-)

Quoted 4 lines

Only crappy private documents.

They say SoC spec books are CONFIDENTIAL!!
Sigh.

OK, I'll keep in mind there's a uniphier-specific way to toggle the 1V8 when adding HS200 support, so you can fill that in when you have time.

Thanks!

Signature · 2 lines
Best regards,
Marek Vasut
#7 lore raw

PATCH 1/1 mmc: uniphier-sd: Add vqmmc regulator support

In reply to Marek Vasut
Quoted 9 lines · Marek Vasut
Quoted 6 lines · Marek Vasut

Add initial support for setting the vqmmc regulator. Since we do not support 1V8 modes, set the regulator to 3V3 and enable it.

Cc Masahiro Yamada <[email protected]>
Cc Jaehoon Chung <[email protected]>

Anything ?! I don't see this in the PR ...

Applied to u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung

Quoted 46 lines
Quoted 44 lines
---
 drivers/mmc/uniphier-sd.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/mmc/uniphier-sd.c +13 -0
index 3c52161067..0d1203cb76 100644
@@ -14,6 +14,7 @@
 #include <linux/dma-direction.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
+#include <power/regulator.h>
 #include <asm/unaligned.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -756,6 +757,9 @@ static int uniphier_sd_probe(struct udevice *dev)
 	fdt_addr_t base;
 	struct clk clk;
 	int ret;
+#ifdef CONFIG_DM_REGULATOR
+	struct udevice *vqmmc_dev;
+#endif
 
 	base = devfdt_get_addr(dev);
 	if (base == FDT_ADDR_T_NONE)
@@ -765,6 +769,15 @@ static int uniphier_sd_probe(struct udevice *dev)
 	if (!priv->regbase)
 		return -ENOMEM;
 
+#ifdef CONFIG_DM_REGULATOR
+	ret = device_get_supply_regulator(dev, "vqmmc-supply", &vqmmc_dev);
+	if (!ret) {
+		/* Set the regulator to 3.3V until we support 1.8V modes */
+		regulator_set_value(vqmmc_dev, 3300000);
+		regulator_set_enable(vqmmc_dev, true);
+	}
+#endif
+
 	ret = clk_get_by_index(dev, 0, &clk);
 	if (ret < 0) {
 		dev_err(dev, "failed to get host clock\n");