* [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
@ 2013-07-31 6:25 ` Haijun Zhang
0 siblings, 0 replies; 20+ messages in thread
From: Haijun Zhang @ 2013-07-31 6:25 UTC (permalink / raw)
To: linux-mmc, linuxppc-dev
Cc: scottwood, cjb, AFLEMING, Haijun Zhang, cbouatmailru
Add function to support get voltage from device-tree.
If there are voltage-range specified in device-tree node, this function
will parse it and return the avail voltage mask.
Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
---
changes for v2:
- Update the parameters of function
drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
include/linux/mmc/core.h | 1 +
2 files changed, 47 insertions(+)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 49a5bca..ce9c957 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -27,6 +27,7 @@
#include <linux/fault-inject.h>
#include <linux/random.h>
#include <linux/slab.h>
+#include <linux/of.h>
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
@@ -1196,6 +1197,51 @@ u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max)
}
EXPORT_SYMBOL(mmc_vddrange_to_ocrmask);
+#ifdef CONFIG_OF
+
+/*
+ * mmc_of_parse_voltage - return mask of supported voltages
+ * @np: The device node need to be parsed.
+ *
+ * 1. Return zero: voltage-ranges unspecified in device-tree.
+ * 2. Return negative errno: voltage-range is invalid.
+ * 3. Return ocr_mask: a mask of voltages that parse from device-tree
+ * node can be provided to MMC/SD/SDIO devices.
+ */
+
+u32 mmc_of_parse_voltage(struct device_node *np)
+{
+ const u32 *voltage_ranges;
+ int num_ranges, i;
+ u32 ocr_mask = 0;
+
+ voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
+ num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
+ if (!voltage_ranges || !num_ranges) {
+ pr_info("%s: voltage-ranges unspecified\n", np->full_name);
+ return 0;
+ }
+
+ for (i = 0; i < num_ranges; i++) {
+ const int j = i * 2;
+ u32 mask;
+
+ mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
+ be32_to_cpu(voltage_ranges[j + 1]));
+ if (!mask) {
+ pr_err("%s: voltage-range #%d is invalid\n",
+ np->full_name, i);
+ return -EINVAL;
+ }
+ ocr_mask |= mask;
+ }
+
+ return ocr_mask;
+}
+EXPORT_SYMBOL(mmc_of_parse_voltage);
+
+#endif /* CONFIG_OF */
+
#ifdef CONFIG_REGULATOR
/**
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 443243b..e3f8fe3 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -209,5 +209,6 @@ static inline void mmc_claim_host(struct mmc_host *host)
}
extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
+extern u32 mmc_of_parse_voltage(struct device_node *np);
#endif /* LINUX_MMC_CORE_H */
--
1.8.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 3/3 V2] mmc:esdhc: add support to get voltage from device-tree
2013-07-31 6:25 ` Haijun Zhang
@ 2013-07-31 6:25 ` Haijun Zhang
-1 siblings, 0 replies; 20+ messages in thread
From: Haijun Zhang @ 2013-07-31 6:25 UTC (permalink / raw)
To: linux-mmc, linuxppc-dev
Cc: cbouatmailru, cjb, scottwood, AFLEMING, Haijun Zhang, Haijun Zhang
Add suppport to get voltage from device-tree node for esdhc host,
if voltage-ranges was specified in device-tree node we can get
ocr_mask instead of read from host capacity register. If not voltages
still can be get from host capacity register.
Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
---
changes for v2:
- Update the parameters of function
drivers/mmc/host/sdhci-of-esdhc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index 15039e2..8a7e2af 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -316,6 +316,7 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)
/* call to generic mmc_of_parse to support additional capabilities */
mmc_of_parse(host->mmc);
+ host->ocr_mask = mmc_of_parse_voltage(np);
ret = sdhci_add_host(host);
if (ret)
--
1.8.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 3/3 V2] mmc:esdhc: add support to get voltage from device-tree
@ 2013-07-31 6:25 ` Haijun Zhang
0 siblings, 0 replies; 20+ messages in thread
From: Haijun Zhang @ 2013-07-31 6:25 UTC (permalink / raw)
To: linux-mmc, linuxppc-dev
Cc: scottwood, cjb, AFLEMING, Haijun Zhang, cbouatmailru
Add suppport to get voltage from device-tree node for esdhc host,
if voltage-ranges was specified in device-tree node we can get
ocr_mask instead of read from host capacity register. If not voltages
still can be get from host capacity register.
Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
---
changes for v2:
- Update the parameters of function
drivers/mmc/host/sdhci-of-esdhc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index 15039e2..8a7e2af 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -316,6 +316,7 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)
/* call to generic mmc_of_parse to support additional capabilities */
mmc_of_parse(host->mmc);
+ host->ocr_mask = mmc_of_parse_voltage(np);
ret = sdhci_add_host(host);
if (ret)
--
1.8.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH] mmc:of_spi: Update the code of getting voltage-ranges
2013-07-31 6:25 ` Haijun Zhang
@ 2013-07-31 6:25 ` Haijun Zhang
-1 siblings, 0 replies; 20+ messages in thread
From: Haijun Zhang @ 2013-07-31 6:25 UTC (permalink / raw)
To: linux-mmc, linuxppc-dev
Cc: cbouatmailru, cjb, scottwood, AFLEMING, Haijun Zhang, Haijun Zhang
Using function mmc_of_parse_voltage() to get voltage-ranges.
Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
---
drivers/mmc/host/of_mmc_spi.c | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
index d720b5e..7d10991 100644
--- a/drivers/mmc/host/of_mmc_spi.c
+++ b/drivers/mmc/host/of_mmc_spi.c
@@ -92,6 +92,7 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
struct of_mmc_spi *oms;
const u32 *voltage_ranges;
int num_ranges;
+ u32 ocr_mask;
int i;
int ret = -EINVAL;
@@ -102,26 +103,11 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
if (!oms)
return NULL;
- voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
- num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
- if (!voltage_ranges || !num_ranges) {
- dev_err(dev, "OF: voltage-ranges unspecified\n");
+ ocr_mask = mmc_of_parse_voltage(np);
+ if (ocr_mask <= 0)
goto err_ocr;
- }
-
- for (i = 0; i < num_ranges; i++) {
- const int j = i * 2;
- u32 mask;
- mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
- be32_to_cpu(voltage_ranges[j + 1]));
- if (!mask) {
- ret = -EINVAL;
- dev_err(dev, "OF: voltage-range #%d is invalid\n", i);
- goto err_ocr;
- }
- oms->pdata.ocr_mask |= mask;
- }
+ oms->pdata.ocr_mask |= ocr_mask;
for (i = 0; i < ARRAY_SIZE(oms->gpios); i++) {
enum of_gpio_flags gpio_flags;
--
1.8.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH] mmc:of_spi: Update the code of getting voltage-ranges
@ 2013-07-31 6:25 ` Haijun Zhang
0 siblings, 0 replies; 20+ messages in thread
From: Haijun Zhang @ 2013-07-31 6:25 UTC (permalink / raw)
To: linux-mmc, linuxppc-dev
Cc: scottwood, cjb, AFLEMING, Haijun Zhang, cbouatmailru
Using function mmc_of_parse_voltage() to get voltage-ranges.
Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
---
drivers/mmc/host/of_mmc_spi.c | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
index d720b5e..7d10991 100644
--- a/drivers/mmc/host/of_mmc_spi.c
+++ b/drivers/mmc/host/of_mmc_spi.c
@@ -92,6 +92,7 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
struct of_mmc_spi *oms;
const u32 *voltage_ranges;
int num_ranges;
+ u32 ocr_mask;
int i;
int ret = -EINVAL;
@@ -102,26 +103,11 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
if (!oms)
return NULL;
- voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
- num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
- if (!voltage_ranges || !num_ranges) {
- dev_err(dev, "OF: voltage-ranges unspecified\n");
+ ocr_mask = mmc_of_parse_voltage(np);
+ if (ocr_mask <= 0)
goto err_ocr;
- }
-
- for (i = 0; i < num_ranges; i++) {
- const int j = i * 2;
- u32 mask;
- mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
- be32_to_cpu(voltage_ranges[j + 1]));
- if (!mask) {
- ret = -EINVAL;
- dev_err(dev, "OF: voltage-range #%d is invalid\n", i);
- goto err_ocr;
- }
- oms->pdata.ocr_mask |= mask;
- }
+ oms->pdata.ocr_mask |= ocr_mask;
for (i = 0; i < ARRAY_SIZE(oms->gpios); i++) {
enum of_gpio_flags gpio_flags;
--
1.8.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH] mmc:of_spi: Update the code of getting voltage-ranges
2013-07-31 6:25 ` Haijun Zhang
@ 2013-08-09 0:08 ` Anton Vorontsov
-1 siblings, 0 replies; 20+ messages in thread
From: Anton Vorontsov @ 2013-08-09 0:08 UTC (permalink / raw)
To: Haijun Zhang; +Cc: linux-mmc, linuxppc-dev, cjb, scottwood, AFLEMING
On Wed, Jul 31, 2013 at 02:25:27PM +0800, Haijun Zhang wrote:
> int num_ranges;
> + u32 ocr_mask;
> int i;
> int ret = -EINVAL;
>
> @@ -102,26 +103,11 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
> if (!oms)
> return NULL;
>
> - voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
> - num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
> - if (!voltage_ranges || !num_ranges) {
> - dev_err(dev, "OF: voltage-ranges unspecified\n");
> + ocr_mask = mmc_of_parse_voltage(np);
> + if (ocr_mask <= 0)
'< 0' check for an unsigned type? :) I'd write just !ocr_mask...
But other than that the patch looks good to me...
Reviewed-by: Anton Vorontsov <anton@enomsg.org>
Thanks!
> goto err_ocr;
> - }
> -
> - for (i = 0; i < num_ranges; i++) {
> - const int j = i * 2;
> - u32 mask;
>
> - mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
> - be32_to_cpu(voltage_ranges[j + 1]));
> - if (!mask) {
> - ret = -EINVAL;
> - dev_err(dev, "OF: voltage-range #%d is invalid\n", i);
> - goto err_ocr;
> - }
> - oms->pdata.ocr_mask |= mask;
> - }
> + oms->pdata.ocr_mask |= ocr_mask;
>
> for (i = 0; i < ARRAY_SIZE(oms->gpios); i++) {
> enum of_gpio_flags gpio_flags;
> --
> 1.8.0
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] mmc:of_spi: Update the code of getting voltage-ranges
@ 2013-08-09 0:08 ` Anton Vorontsov
0 siblings, 0 replies; 20+ messages in thread
From: Anton Vorontsov @ 2013-08-09 0:08 UTC (permalink / raw)
To: Haijun Zhang; +Cc: scottwood, linuxppc-dev, cjb, linux-mmc, AFLEMING
On Wed, Jul 31, 2013 at 02:25:27PM +0800, Haijun Zhang wrote:
> int num_ranges;
> + u32 ocr_mask;
> int i;
> int ret = -EINVAL;
>
> @@ -102,26 +103,11 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
> if (!oms)
> return NULL;
>
> - voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
> - num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
> - if (!voltage_ranges || !num_ranges) {
> - dev_err(dev, "OF: voltage-ranges unspecified\n");
> + ocr_mask = mmc_of_parse_voltage(np);
> + if (ocr_mask <= 0)
'< 0' check for an unsigned type? :) I'd write just !ocr_mask...
But other than that the patch looks good to me...
Reviewed-by: Anton Vorontsov <anton@enomsg.org>
Thanks!
> goto err_ocr;
> - }
> -
> - for (i = 0; i < num_ranges; i++) {
> - const int j = i * 2;
> - u32 mask;
>
> - mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
> - be32_to_cpu(voltage_ranges[j + 1]));
> - if (!mask) {
> - ret = -EINVAL;
> - dev_err(dev, "OF: voltage-range #%d is invalid\n", i);
> - goto err_ocr;
> - }
> - oms->pdata.ocr_mask |= mask;
> - }
> + oms->pdata.ocr_mask |= ocr_mask;
>
> for (i = 0; i < ARRAY_SIZE(oms->gpios); i++) {
> enum of_gpio_flags gpio_flags;
> --
> 1.8.0
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
2013-07-31 6:25 ` Haijun Zhang
@ 2013-08-07 1:28 ` Zhang Haijun
-1 siblings, 0 replies; 20+ messages in thread
From: Zhang Haijun @ 2013-08-07 1:28 UTC (permalink / raw)
To: Haijun Zhang
Cc: linux-mmc, linuxppc-dev, cbouatmailru, cjb, scottwood, AFLEMING,
Xie Xiaobo-R63061
On 07/31/2013 02:25 PM, Haijun Zhang wrote:
> Add function to support get voltage from device-tree.
> If there are voltage-range specified in device-tree node, this function
> will parse it and return the avail voltage mask.
>
> Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
> ---
> changes for v2:
> - Update the parameters of function
>
> drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> include/linux/mmc/core.h | 1 +
> 2 files changed, 47 insertions(+)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 49a5bca..ce9c957 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -27,6 +27,7 @@
> #include <linux/fault-inject.h>
> #include <linux/random.h>
> #include <linux/slab.h>
> +#include <linux/of.h>
>
> #include <linux/mmc/card.h>
> #include <linux/mmc/host.h>
> @@ -1196,6 +1197,51 @@ u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max)
> }
> EXPORT_SYMBOL(mmc_vddrange_to_ocrmask);
>
> +#ifdef CONFIG_OF
> +
> +/*
> + * mmc_of_parse_voltage - return mask of supported voltages
> + * @np: The device node need to be parsed.
> + *
> + * 1. Return zero: voltage-ranges unspecified in device-tree.
> + * 2. Return negative errno: voltage-range is invalid.
> + * 3. Return ocr_mask: a mask of voltages that parse from device-tree
> + * node can be provided to MMC/SD/SDIO devices.
> + */
> +
> +u32 mmc_of_parse_voltage(struct device_node *np)
> +{
> + const u32 *voltage_ranges;
> + int num_ranges, i;
> + u32 ocr_mask = 0;
> +
> + voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
> + num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
> + if (!voltage_ranges || !num_ranges) {
> + pr_info("%s: voltage-ranges unspecified\n", np->full_name);
> + return 0;
> + }
> +
> + for (i = 0; i < num_ranges; i++) {
> + const int j = i * 2;
> + u32 mask;
> +
> + mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
> + be32_to_cpu(voltage_ranges[j + 1]));
> + if (!mask) {
> + pr_err("%s: voltage-range #%d is invalid\n",
> + np->full_name, i);
> + return -EINVAL;
> + }
> + ocr_mask |= mask;
> + }
> +
> + return ocr_mask;
> +}
> +EXPORT_SYMBOL(mmc_of_parse_voltage);
> +
> +#endif /* CONFIG_OF */
> +
> #ifdef CONFIG_REGULATOR
>
> /**
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index 443243b..e3f8fe3 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -209,5 +209,6 @@ static inline void mmc_claim_host(struct mmc_host *host)
> }
>
> extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
> +extern u32 mmc_of_parse_voltage(struct device_node *np);
>
> #endif /* LINUX_MMC_CORE_H */
Hi, Anton
Could you give some advice for this patch set?
--
Thanks & Regards
Haijun
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
@ 2013-08-07 1:28 ` Zhang Haijun
0 siblings, 0 replies; 20+ messages in thread
From: Zhang Haijun @ 2013-08-07 1:28 UTC (permalink / raw)
To: Haijun Zhang
Cc: linux-mmc, AFLEMING, cbouatmailru, scottwood, cjb, linuxppc-dev,
Xie Xiaobo-R63061
On 07/31/2013 02:25 PM, Haijun Zhang wrote:
> Add function to support get voltage from device-tree.
> If there are voltage-range specified in device-tree node, this function
> will parse it and return the avail voltage mask.
>
> Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
> ---
> changes for v2:
> - Update the parameters of function
>
> drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> include/linux/mmc/core.h | 1 +
> 2 files changed, 47 insertions(+)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 49a5bca..ce9c957 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -27,6 +27,7 @@
> #include <linux/fault-inject.h>
> #include <linux/random.h>
> #include <linux/slab.h>
> +#include <linux/of.h>
>
> #include <linux/mmc/card.h>
> #include <linux/mmc/host.h>
> @@ -1196,6 +1197,51 @@ u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max)
> }
> EXPORT_SYMBOL(mmc_vddrange_to_ocrmask);
>
> +#ifdef CONFIG_OF
> +
> +/*
> + * mmc_of_parse_voltage - return mask of supported voltages
> + * @np: The device node need to be parsed.
> + *
> + * 1. Return zero: voltage-ranges unspecified in device-tree.
> + * 2. Return negative errno: voltage-range is invalid.
> + * 3. Return ocr_mask: a mask of voltages that parse from device-tree
> + * node can be provided to MMC/SD/SDIO devices.
> + */
> +
> +u32 mmc_of_parse_voltage(struct device_node *np)
> +{
> + const u32 *voltage_ranges;
> + int num_ranges, i;
> + u32 ocr_mask = 0;
> +
> + voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
> + num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
> + if (!voltage_ranges || !num_ranges) {
> + pr_info("%s: voltage-ranges unspecified\n", np->full_name);
> + return 0;
> + }
> +
> + for (i = 0; i < num_ranges; i++) {
> + const int j = i * 2;
> + u32 mask;
> +
> + mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
> + be32_to_cpu(voltage_ranges[j + 1]));
> + if (!mask) {
> + pr_err("%s: voltage-range #%d is invalid\n",
> + np->full_name, i);
> + return -EINVAL;
> + }
> + ocr_mask |= mask;
> + }
> +
> + return ocr_mask;
> +}
> +EXPORT_SYMBOL(mmc_of_parse_voltage);
> +
> +#endif /* CONFIG_OF */
> +
> #ifdef CONFIG_REGULATOR
>
> /**
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index 443243b..e3f8fe3 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -209,5 +209,6 @@ static inline void mmc_claim_host(struct mmc_host *host)
> }
>
> extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
> +extern u32 mmc_of_parse_voltage(struct device_node *np);
>
> #endif /* LINUX_MMC_CORE_H */
Hi, Anton
Could you give some advice for this patch set?
--
Thanks & Regards
Haijun
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
2013-07-31 6:25 ` Haijun Zhang
@ 2013-08-09 0:15 ` Anton Vorontsov
-1 siblings, 0 replies; 20+ messages in thread
From: Anton Vorontsov @ 2013-08-09 0:15 UTC (permalink / raw)
To: Haijun Zhang; +Cc: linux-mmc, linuxppc-dev, cjb, scottwood, AFLEMING
On Wed, Jul 31, 2013 at 02:25:25PM +0800, Haijun Zhang wrote:
> Add function to support get voltage from device-tree.
> If there are voltage-range specified in device-tree node, this function
> will parse it and return the avail voltage mask.
>
> Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
> ---
> changes for v2:
> - Update the parameters of function
>
> drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> include/linux/mmc/core.h | 1 +
> 2 files changed, 47 insertions(+)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 49a5bca..ce9c957 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -27,6 +27,7 @@
> #include <linux/fault-inject.h>
> #include <linux/random.h>
> #include <linux/slab.h>
> +#include <linux/of.h>
>
> #include <linux/mmc/card.h>
> #include <linux/mmc/host.h>
> @@ -1196,6 +1197,51 @@ u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max)
> }
> EXPORT_SYMBOL(mmc_vddrange_to_ocrmask);
>
> +#ifdef CONFIG_OF
> +
> +/*
This is not kernel-doc formatted comment for the function.. it should
start with /**...
> + * mmc_of_parse_voltage - return mask of supported voltages
> + * @np: The device node need to be parsed.
> + *
> + * 1. Return zero: voltage-ranges unspecified in device-tree.
> + * 2. Return negative errno: voltage-range is invalid.
This doesn't seem right... the function returns the unsigned mask... You
can change the prototype of this func to something like this:
int mmc_of_parse_voltage(struct device_node *np, u32 *mask);
So the function will fill the mask and return 0 on success, and will
return negtive errno on errors.
> + * 3. Return ocr_mask: a mask of voltages that parse from device-tree
> + * node can be provided to MMC/SD/SDIO devices.
> + */
> +
No need for this empty line...
> +u32 mmc_of_parse_voltage(struct device_node *np)
> +{
> + const u32 *voltage_ranges;
> + int num_ranges, i;
> + u32 ocr_mask = 0;
> +
> + voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
> + num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
> + if (!voltage_ranges || !num_ranges) {
> + pr_info("%s: voltage-ranges unspecified\n", np->full_name);
> + return 0;
> + }
> +
> + for (i = 0; i < num_ranges; i++) {
> + const int j = i * 2;
> + u32 mask;
> +
> + mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
> + be32_to_cpu(voltage_ranges[j + 1]));
You lost some [pretty] formatting to line up the two arguments. :)
> + if (!mask) {
> + pr_err("%s: voltage-range #%d is invalid\n",
> + np->full_name, i);
> + return -EINVAL;
> + }
> + ocr_mask |= mask;
> + }
> +
> + return ocr_mask;
> +}
> +EXPORT_SYMBOL(mmc_of_parse_voltage);
> +
> +#endif /* CONFIG_OF */
> +
> #ifdef CONFIG_REGULATOR
>
> /**
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index 443243b..e3f8fe3 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -209,5 +209,6 @@ static inline void mmc_claim_host(struct mmc_host *host)
> }
>
> extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
> +extern u32 mmc_of_parse_voltage(struct device_node *np);
You need to add a 'struct device_node;' forward-declaration, otherwise
non-OF code might fail to compile...
Thanks,
Anton
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
@ 2013-08-09 0:15 ` Anton Vorontsov
0 siblings, 0 replies; 20+ messages in thread
From: Anton Vorontsov @ 2013-08-09 0:15 UTC (permalink / raw)
To: Haijun Zhang; +Cc: scottwood, linuxppc-dev, cjb, linux-mmc, AFLEMING
On Wed, Jul 31, 2013 at 02:25:25PM +0800, Haijun Zhang wrote:
> Add function to support get voltage from device-tree.
> If there are voltage-range specified in device-tree node, this function
> will parse it and return the avail voltage mask.
>
> Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
> ---
> changes for v2:
> - Update the parameters of function
>
> drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> include/linux/mmc/core.h | 1 +
> 2 files changed, 47 insertions(+)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 49a5bca..ce9c957 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -27,6 +27,7 @@
> #include <linux/fault-inject.h>
> #include <linux/random.h>
> #include <linux/slab.h>
> +#include <linux/of.h>
>
> #include <linux/mmc/card.h>
> #include <linux/mmc/host.h>
> @@ -1196,6 +1197,51 @@ u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max)
> }
> EXPORT_SYMBOL(mmc_vddrange_to_ocrmask);
>
> +#ifdef CONFIG_OF
> +
> +/*
This is not kernel-doc formatted comment for the function.. it should
start with /**...
> + * mmc_of_parse_voltage - return mask of supported voltages
> + * @np: The device node need to be parsed.
> + *
> + * 1. Return zero: voltage-ranges unspecified in device-tree.
> + * 2. Return negative errno: voltage-range is invalid.
This doesn't seem right... the function returns the unsigned mask... You
can change the prototype of this func to something like this:
int mmc_of_parse_voltage(struct device_node *np, u32 *mask);
So the function will fill the mask and return 0 on success, and will
return negtive errno on errors.
> + * 3. Return ocr_mask: a mask of voltages that parse from device-tree
> + * node can be provided to MMC/SD/SDIO devices.
> + */
> +
No need for this empty line...
> +u32 mmc_of_parse_voltage(struct device_node *np)
> +{
> + const u32 *voltage_ranges;
> + int num_ranges, i;
> + u32 ocr_mask = 0;
> +
> + voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
> + num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
> + if (!voltage_ranges || !num_ranges) {
> + pr_info("%s: voltage-ranges unspecified\n", np->full_name);
> + return 0;
> + }
> +
> + for (i = 0; i < num_ranges; i++) {
> + const int j = i * 2;
> + u32 mask;
> +
> + mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
> + be32_to_cpu(voltage_ranges[j + 1]));
You lost some [pretty] formatting to line up the two arguments. :)
> + if (!mask) {
> + pr_err("%s: voltage-range #%d is invalid\n",
> + np->full_name, i);
> + return -EINVAL;
> + }
> + ocr_mask |= mask;
> + }
> +
> + return ocr_mask;
> +}
> +EXPORT_SYMBOL(mmc_of_parse_voltage);
> +
> +#endif /* CONFIG_OF */
> +
> #ifdef CONFIG_REGULATOR
>
> /**
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index 443243b..e3f8fe3 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -209,5 +209,6 @@ static inline void mmc_claim_host(struct mmc_host *host)
> }
>
> extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
> +extern u32 mmc_of_parse_voltage(struct device_node *np);
You need to add a 'struct device_node;' forward-declaration, otherwise
non-OF code might fail to compile...
Thanks,
Anton
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
2013-08-09 0:15 ` Anton Vorontsov
@ 2013-08-09 3:34 ` Zhang Haijun
-1 siblings, 0 replies; 20+ messages in thread
From: Zhang Haijun @ 2013-08-09 3:34 UTC (permalink / raw)
To: Anton Vorontsov
Cc: Haijun Zhang, linux-mmc, linuxppc-dev, cjb, scottwood, AFLEMING
On 08/09/2013 08:15 AM, Anton Vorontsov wrote:
> On Wed, Jul 31, 2013 at 02:25:25PM +0800, Haijun Zhang wrote:
>> Add function to support get voltage from device-tree.
>> If there are voltage-range specified in device-tree node, this function
>> will parse it and return the avail voltage mask.
>>
>> Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
>> ---
>> changes for v2:
>> - Update the parameters of function
>>
>> drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>> include/linux/mmc/core.h | 1 +
>> 2 files changed, 47 insertions(+)
>>
>> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
>> index 49a5bca..ce9c957 100644
>> --- a/drivers/mmc/core/core.c
>> +++ b/drivers/mmc/core/core.c
>> @@ -27,6 +27,7 @@
>> #include <linux/fault-inject.h>
>> #include <linux/random.h>
>> #include <linux/slab.h>
>> +#include <linux/of.h>
>>
>> #include <linux/mmc/card.h>
>> #include <linux/mmc/host.h>
>> @@ -1196,6 +1197,51 @@ u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max)
>> }
>> EXPORT_SYMBOL(mmc_vddrange_to_ocrmask);
>>
>> +#ifdef CONFIG_OF
>> +
>> +/*
> This is not kernel-doc formatted comment for the function.. it should
> start with /**...
>
>> + * mmc_of_parse_voltage - return mask of supported voltages
>> + * @np: The device node need to be parsed.
>> + *
>> + * 1. Return zero: voltage-ranges unspecified in device-tree.
>> + * 2. Return negative errno: voltage-range is invalid.
> This doesn't seem right... the function returns the unsigned mask... You
> can change the prototype of this func to something like this:
>
> int mmc_of_parse_voltage(struct device_node *np, u32 *mask);
>
> So the function will fill the mask and return 0 on success, and will
> return negtive errno on errors.
Thanks, Anton.
I'll correct the return prototype of the function.
In case voltage unspecified in device node is not an error in my
platform. So i hope to reserve the zero as unspecified case and give an
prompt, an available value in case success, negative errno in case
error. It's easy to figure out the root cause.
>> + * 3. Return ocr_mask: a mask of voltages that parse from device-tree
>> + * node can be provided to MMC/SD/SDIO devices.
>> + */
>> +
> No need for this empty line...
>
>> +u32 mmc_of_parse_voltage(struct device_node *np)
>> +{
>> + const u32 *voltage_ranges;
>> + int num_ranges, i;
>> + u32 ocr_mask = 0;
>> +
>> + voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
>> + num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
>> + if (!voltage_ranges || !num_ranges) {
>> + pr_info("%s: voltage-ranges unspecified\n", np->full_name);
>> + return 0;
>> + }
>> +
>> + for (i = 0; i < num_ranges; i++) {
>> + const int j = i * 2;
>> + u32 mask;
>> +
>> + mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
>> + be32_to_cpu(voltage_ranges[j + 1]));
> You lost some [pretty] formatting to line up the two arguments. :)
I'll correct these. Thanks.
>> + if (!mask) {
>> + pr_err("%s: voltage-range #%d is invalid\n",
>> + np->full_name, i);
>> + return -EINVAL;
>> + }
>> + ocr_mask |= mask;
>> + }
>> +
>> + return ocr_mask;
>> +}
>> +EXPORT_SYMBOL(mmc_of_parse_voltage);
>> +
>> +#endif /* CONFIG_OF */
>> +
>> #ifdef CONFIG_REGULATOR
>>
>> /**
>> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
>> index 443243b..e3f8fe3 100644
>> --- a/include/linux/mmc/core.h
>> +++ b/include/linux/mmc/core.h
>> @@ -209,5 +209,6 @@ static inline void mmc_claim_host(struct mmc_host *host)
>> }
>>
>> extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
>> +extern u32 mmc_of_parse_voltage(struct device_node *np);
> You need to add a 'struct device_node;' forward-declaration, otherwise
> non-OF code might fail to compile...
I'll move of.h from core.c to core.h
>
> Thanks,
>
> Anton
>
--
Thanks & Regards
Haijun
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
@ 2013-08-09 3:34 ` Zhang Haijun
0 siblings, 0 replies; 20+ messages in thread
From: Zhang Haijun @ 2013-08-09 3:34 UTC (permalink / raw)
To: Anton Vorontsov
Cc: linux-mmc, AFLEMING, scottwood, cjb, linuxppc-dev, Haijun Zhang
On 08/09/2013 08:15 AM, Anton Vorontsov wrote:
> On Wed, Jul 31, 2013 at 02:25:25PM +0800, Haijun Zhang wrote:
>> Add function to support get voltage from device-tree.
>> If there are voltage-range specified in device-tree node, this function
>> will parse it and return the avail voltage mask.
>>
>> Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
>> ---
>> changes for v2:
>> - Update the parameters of function
>>
>> drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>> include/linux/mmc/core.h | 1 +
>> 2 files changed, 47 insertions(+)
>>
>> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
>> index 49a5bca..ce9c957 100644
>> --- a/drivers/mmc/core/core.c
>> +++ b/drivers/mmc/core/core.c
>> @@ -27,6 +27,7 @@
>> #include <linux/fault-inject.h>
>> #include <linux/random.h>
>> #include <linux/slab.h>
>> +#include <linux/of.h>
>>
>> #include <linux/mmc/card.h>
>> #include <linux/mmc/host.h>
>> @@ -1196,6 +1197,51 @@ u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max)
>> }
>> EXPORT_SYMBOL(mmc_vddrange_to_ocrmask);
>>
>> +#ifdef CONFIG_OF
>> +
>> +/*
> This is not kernel-doc formatted comment for the function.. it should
> start with /**...
>
>> + * mmc_of_parse_voltage - return mask of supported voltages
>> + * @np: The device node need to be parsed.
>> + *
>> + * 1. Return zero: voltage-ranges unspecified in device-tree.
>> + * 2. Return negative errno: voltage-range is invalid.
> This doesn't seem right... the function returns the unsigned mask... You
> can change the prototype of this func to something like this:
>
> int mmc_of_parse_voltage(struct device_node *np, u32 *mask);
>
> So the function will fill the mask and return 0 on success, and will
> return negtive errno on errors.
Thanks, Anton.
I'll correct the return prototype of the function.
In case voltage unspecified in device node is not an error in my
platform. So i hope to reserve the zero as unspecified case and give an
prompt, an available value in case success, negative errno in case
error. It's easy to figure out the root cause.
>> + * 3. Return ocr_mask: a mask of voltages that parse from device-tree
>> + * node can be provided to MMC/SD/SDIO devices.
>> + */
>> +
> No need for this empty line...
>
>> +u32 mmc_of_parse_voltage(struct device_node *np)
>> +{
>> + const u32 *voltage_ranges;
>> + int num_ranges, i;
>> + u32 ocr_mask = 0;
>> +
>> + voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
>> + num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
>> + if (!voltage_ranges || !num_ranges) {
>> + pr_info("%s: voltage-ranges unspecified\n", np->full_name);
>> + return 0;
>> + }
>> +
>> + for (i = 0; i < num_ranges; i++) {
>> + const int j = i * 2;
>> + u32 mask;
>> +
>> + mask = mmc_vddrange_to_ocrmask(be32_to_cpu(voltage_ranges[j]),
>> + be32_to_cpu(voltage_ranges[j + 1]));
> You lost some [pretty] formatting to line up the two arguments. :)
I'll correct these. Thanks.
>> + if (!mask) {
>> + pr_err("%s: voltage-range #%d is invalid\n",
>> + np->full_name, i);
>> + return -EINVAL;
>> + }
>> + ocr_mask |= mask;
>> + }
>> +
>> + return ocr_mask;
>> +}
>> +EXPORT_SYMBOL(mmc_of_parse_voltage);
>> +
>> +#endif /* CONFIG_OF */
>> +
>> #ifdef CONFIG_REGULATOR
>>
>> /**
>> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
>> index 443243b..e3f8fe3 100644
>> --- a/include/linux/mmc/core.h
>> +++ b/include/linux/mmc/core.h
>> @@ -209,5 +209,6 @@ static inline void mmc_claim_host(struct mmc_host *host)
>> }
>>
>> extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
>> +extern u32 mmc_of_parse_voltage(struct device_node *np);
> You need to add a 'struct device_node;' forward-declaration, otherwise
> non-OF code might fail to compile...
I'll move of.h from core.c to core.h
>
> Thanks,
>
> Anton
>
--
Thanks & Regards
Haijun
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
2013-07-31 6:25 ` Haijun Zhang
@ 2013-08-09 14:48 ` Kumar Gala
-1 siblings, 0 replies; 20+ messages in thread
From: Kumar Gala @ 2013-08-09 14:48 UTC (permalink / raw)
To: Haijun Zhang
Cc: linux-mmc, linuxppc-dev, scottwood, cjb, AFLEMING, cbouatmailru
On Jul 31, 2013, at 1:25 AM, Haijun Zhang wrote:
> Add function to support get voltage from device-tree.
> If there are voltage-range specified in device-tree node, this function
> will parse it and return the avail voltage mask.
>
> Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
> ---
> changes for v2:
> - Update the parameters of function
>
> drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> include/linux/mmc/core.h | 1 +
> 2 files changed, 47 insertions(+)
There should be a device tree binding spec update to go with this patch series.
- k
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
@ 2013-08-09 14:48 ` Kumar Gala
0 siblings, 0 replies; 20+ messages in thread
From: Kumar Gala @ 2013-08-09 14:48 UTC (permalink / raw)
To: Haijun Zhang
Cc: linux-mmc, AFLEMING, cbouatmailru, scottwood, cjb, linuxppc-dev
On Jul 31, 2013, at 1:25 AM, Haijun Zhang wrote:
> Add function to support get voltage from device-tree.
> If there are voltage-range specified in device-tree node, this =
function
> will parse it and return the avail voltage mask.
>=20
> Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
> ---
> changes for v2:
> - Update the parameters of function
>=20
> drivers/mmc/core/core.c | 46 =
++++++++++++++++++++++++++++++++++++++++++++++
> include/linux/mmc/core.h | 1 +
> 2 files changed, 47 insertions(+)
There should be a device tree binding spec update to go with this patch =
series.
- k=
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
2013-08-09 14:48 ` Kumar Gala
@ 2013-08-12 2:46 ` Zhang Haijun
-1 siblings, 0 replies; 20+ messages in thread
From: Zhang Haijun @ 2013-08-12 2:46 UTC (permalink / raw)
To: Kumar Gala
Cc: linux-mmc, cbouatmailru, scottwood, cjb, linuxppc-dev, Haijun Zhang
[-- Attachment #1.1: Type: text/plain, Size: 770 bytes --]
On 08/09/2013 10:48 PM, Kumar Gala wrote:
> On Jul 31, 2013, at 1:25 AM, Haijun Zhang wrote:
>
>> Add function to support get voltage from device-tree.
>> If there are voltage-range specified in device-tree node, this function
>> will parse it and return the avail voltage mask.
>>
>> Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
>> ---
>> changes for v2:
>> - Update the parameters of function
>>
>> drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>> include/linux/mmc/core.h | 1 +
>> 2 files changed, 47 insertions(+)
> There should be a device tree binding spec update to go with this patch series.
>
> - k
Hi, kumar
I'll update this tree binding spec after the patch set is accept by Anton.
--
Thanks & Regards
Haijun
[-- Attachment #1.2: Type: text/html, Size: 1578 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
@ 2013-08-12 2:46 ` Zhang Haijun
0 siblings, 0 replies; 20+ messages in thread
From: Zhang Haijun @ 2013-08-12 2:46 UTC (permalink / raw)
To: Kumar Gala
Cc: linux-mmc, cbouatmailru, scottwood, cjb, linuxppc-dev, Haijun Zhang
[-- Attachment #1: Type: text/plain, Size: 770 bytes --]
On 08/09/2013 10:48 PM, Kumar Gala wrote:
> On Jul 31, 2013, at 1:25 AM, Haijun Zhang wrote:
>
>> Add function to support get voltage from device-tree.
>> If there are voltage-range specified in device-tree node, this function
>> will parse it and return the avail voltage mask.
>>
>> Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
>> ---
>> changes for v2:
>> - Update the parameters of function
>>
>> drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>> include/linux/mmc/core.h | 1 +
>> 2 files changed, 47 insertions(+)
> There should be a device tree binding spec update to go with this patch series.
>
> - k
Hi, kumar
I'll update this tree binding spec after the patch set is accept by Anton.
--
Thanks & Regards
Haijun
[-- Attachment #2: Type: text/html, Size: 1578 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
2013-08-12 2:46 ` Zhang Haijun
@ 2013-08-12 16:11 ` Scott Wood
-1 siblings, 0 replies; 20+ messages in thread
From: Scott Wood @ 2013-08-12 16:11 UTC (permalink / raw)
To: Zhang Haijun
Cc: Kumar Gala, Haijun Zhang, linux-mmc, linuxppc-dev, cjb, cbouatmailru
On Mon, 2013-08-12 at 10:46 +0800, Zhang Haijun wrote:
> On 08/09/2013 10:48 PM, Kumar Gala wrote:
>
> > On Jul 31, 2013, at 1:25 AM, Haijun Zhang wrote:
> >
> > > Add function to support get voltage from device-tree.
> > > If there are voltage-range specified in device-tree node, this function
> > > will parse it and return the avail voltage mask.
> > >
> > > Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
> > > ---
> > > changes for v2:
> > > - Update the parameters of function
> > >
> > > drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> > > include/linux/mmc/core.h | 1 +
> > > 2 files changed, 47 insertions(+)
> > There should be a device tree binding spec update to go with this patch series.
> >
> > - k
> Hi, kumar
>
> I'll update this tree binding spec after the patch set is accept by
> Anton.
Bindings should come first (or at least, at the same time).
-Scott
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/3 V2] mmc:core: parse voltage from device-tree
@ 2013-08-12 16:11 ` Scott Wood
0 siblings, 0 replies; 20+ messages in thread
From: Scott Wood @ 2013-08-12 16:11 UTC (permalink / raw)
To: Zhang Haijun; +Cc: linux-mmc, cbouatmailru, cjb, linuxppc-dev, Haijun Zhang
On Mon, 2013-08-12 at 10:46 +0800, Zhang Haijun wrote:
> On 08/09/2013 10:48 PM, Kumar Gala wrote:
>
> > On Jul 31, 2013, at 1:25 AM, Haijun Zhang wrote:
> >
> > > Add function to support get voltage from device-tree.
> > > If there are voltage-range specified in device-tree node, this function
> > > will parse it and return the avail voltage mask.
> > >
> > > Signed-off-by: Haijun Zhang <haijun.zhang@freescale.com>
> > > ---
> > > changes for v2:
> > > - Update the parameters of function
> > >
> > > drivers/mmc/core/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> > > include/linux/mmc/core.h | 1 +
> > > 2 files changed, 47 insertions(+)
> > There should be a device tree binding spec update to go with this patch series.
> >
> > - k
> Hi, kumar
>
> I'll update this tree binding spec after the patch set is accept by
> Anton.
Bindings should come first (or at least, at the same time).
-Scott
^ permalink raw reply [flat|nested] 20+ messages in thread