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 <redacted>
---
drivers/mmc/core/core.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
include/linux/mmc/core.h | 1 +
2 files changed, 49 insertions(+)
We use host->ocr_mask to hold the voltage get from device-tree
node, In case host->ocr_mask was available, we use host->ocr_mask
as the final available voltage can be used by MMC/SD/SDIO card.
Signed-off-by: Haijun Zhang <redacted>
---
drivers/mmc/host/sdhci.c | 3 +++
include/linux/mmc/sdhci.h | 1 +
2 files changed, 4 insertions(+)
@@ -171,6 +171,7 @@ struct sdhci_host {unsignedintocr_avail_sdio;/* OCR bit masks */unsignedintocr_avail_sd;unsignedintocr_avail_mmc;+u32ocr_mask;/* available voltages */wait_queue_head_tbuf_ready_int;/* Waitqueue for Buffer Read Ready interrupt */unsignedinttuning_done;/* Condition flag set when CMD19 succeeds */
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 <redacted>
---
drivers/mmc/host/sdhci-of-esdhc.c | 1 +
1 file changed, 1 insertion(+)
@@ -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(host->mmc);ret=sdhci_add_host(host);if(ret)
From: Scott Wood <hidden> Date: 2013-07-29 22:07:27
On 07/28/2013 09:56:33 PM, Haijun Zhang wrote:
Add function to support get voltage from device-tree.
If there are voltage-range specified in device-tree node, this =20
function
will parse it and return the avail voltage mask.
=20
Signed-off-by: Haijun Zhang <redacted>
---
drivers/mmc/core/core.c | 48 =20
++++++++++++++++++++++++++++++++++++++++++++++++
include/linux/mmc/core.h | 1 +
2 files changed, 49 insertions(+)
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 <redacted>
---
drivers/mmc/core/core.c | 48
++++++++++++++++++++++++++++++++++++++++++++++++
include/linux/mmc/core.h | 1 +
2 files changed, 49 insertions(+)
From: Scott Wood <hidden> Date: 2013-07-30 19:59:10
On 07/29/2013 08:34:29 PM, Zhang Haijun wrote:
On 07/30/2013 06:07 AM, Scott Wood wrote:
quoted
On 07/28/2013 09:56:33 PM, Haijun Zhang wrote:
quoted
Add function to support get voltage from device-tree.
If there are voltage-range specified in device-tree node, this =20
function
will parse it and return the avail voltage mask.
=20
Signed-off-by: Haijun Zhang <redacted>
---
drivers/mmc/core/core.c | 48 =20
++++++++++++++++++++++++++++++++++++++++++++++++
include/linux/mmc/core.h | 1 +
2 files changed, 49 insertions(+)
=20
Move the code rather than copying it.
=20
-Scott
Hi, Scott
=20
You mean?
The point of factoring this out is to avoid duplicating the code. If =20
you don't remove it from the place you copied it from (and have that =20
code call here instead), then you're not avoiding the duplication.
-Scott=