diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-10 16:33:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-10 16:33:09 -0400 |
commit | d0048f0b91ee35ab940ec6cbdfdd238c55b12a14 (patch) | |
tree | 72914692414729a14ec1308c326d92359a3825a3 /drivers/mmc/core/core.c | |
parent | 7426d62871dafbeeed087d609c6469a515c88389 (diff) | |
parent | 9d731e7539713acc0ec7b67a5a91357c455d2334 (diff) |
Merge tag 'mmc-updates-for-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
Pull MMC updates from Chris Ball:
"MMC highlights for 3.12:
Core:
- Support Allocation Units 8MB-64MB in SD3.0, previous max was 4MB.
- The slot-gpio helper can now handle GPIO debouncing card-detect.
- Read supported voltages from DT "voltage-ranges" property.
Drivers:
- dw_mmc: Add support for ARC architecture, and support exynos5420.
- mmc_spi: Support CD/RO GPIOs.
- sh_mobile_sdhi: Add compatibility for more Renesas SoCs.
- sh_mmcif: Add DT support for DMA channels"
* tag 'mmc-updates-for-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (50 commits)
Revert "mmc: tmio-mmc: Remove .set_pwr() callback from platform data"
mmc: dw_mmc: Add support for ARC
mmc: sdhci-s3c: initialize host->quirks2 for using quirks2
mmc: sdhci-s3c: fix the wrong register value, when clock is disabled
mmc: esdhc: add support to get voltage from device-tree
mmc: sdhci: get voltage from sdhc host
mmc: core: parse voltage from device-tree
mmc: omap_hsmmc: use the generic config for omap2plus devices
mmc: omap_hsmmc: clear status flags before starting a new command
mmc: dw_mmc: exynos: Add a new compatible string for exynos5420
mmc: sh_mmcif: revision-specific CLK_CTRL2 handling
mmc: sh_mmcif: revision-specific Command Completion Signal handling
mmc: sh_mmcif: add support for Device Tree DMA bindings
mmc: sh_mmcif: move header include from header into .c
mmc: SDHI: add DT compatibility strings for further SoCs
mmc: dw_mmc-pci: enable bus-mastering mode
mmc: dw_mmc-pci: get resources from a proper BAR
mmc: tmio-mmc: Remove .set_pwr() callback from platform data
mmc: tmio-mmc: Remove .get_cd() callback from platform data
mmc: sh_mobile_sdhi: Remove .set_pwr() callback from platform data
...
Diffstat (limited to 'drivers/mmc/core/core.c')
-rw-r--r-- | drivers/mmc/core/core.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 5d088551196b..bf18b6bfce48 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/fault-inject.h> | 27 | #include <linux/fault-inject.h> |
28 | #include <linux/random.h> | 28 | #include <linux/random.h> |
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/of.h> | ||
30 | 31 | ||
31 | #include <linux/mmc/card.h> | 32 | #include <linux/mmc/card.h> |
32 | #include <linux/mmc/host.h> | 33 | #include <linux/mmc/host.h> |
@@ -1196,6 +1197,49 @@ u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max) | |||
1196 | } | 1197 | } |
1197 | EXPORT_SYMBOL(mmc_vddrange_to_ocrmask); | 1198 | EXPORT_SYMBOL(mmc_vddrange_to_ocrmask); |
1198 | 1199 | ||
1200 | #ifdef CONFIG_OF | ||
1201 | |||
1202 | /** | ||
1203 | * mmc_of_parse_voltage - return mask of supported voltages | ||
1204 | * @np: The device node need to be parsed. | ||
1205 | * @mask: mask of voltages available for MMC/SD/SDIO | ||
1206 | * | ||
1207 | * 1. Return zero on success. | ||
1208 | * 2. Return negative errno: voltage-range is invalid. | ||
1209 | */ | ||
1210 | int mmc_of_parse_voltage(struct device_node *np, u32 *mask) | ||
1211 | { | ||
1212 | const u32 *voltage_ranges; | ||
1213 | int num_ranges, i; | ||
1214 | |||
1215 | voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges); | ||
1216 | num_ranges = num_ranges / sizeof(*voltage_ranges) / 2; | ||
1217 | if (!voltage_ranges || !num_ranges) { | ||
1218 | pr_info("%s: voltage-ranges unspecified\n", np->full_name); | ||
1219 | return -EINVAL; | ||
1220 | } | ||
1221 | |||
1222 | for (i = 0; i < num_ranges; i++) { | ||
1223 | const int j = i * 2; | ||
1224 | u32 ocr_mask; | ||
1225 | |||
1226 | ocr_mask = mmc_vddrange_to_ocrmask( | ||
1227 | be32_to_cpu(voltage_ranges[j]), | ||
1228 | be32_to_cpu(voltage_ranges[j + 1])); | ||
1229 | if (!ocr_mask) { | ||
1230 | pr_err("%s: voltage-range #%d is invalid\n", | ||
1231 | np->full_name, i); | ||
1232 | return -EINVAL; | ||
1233 | } | ||
1234 | *mask |= ocr_mask; | ||
1235 | } | ||
1236 | |||
1237 | return 0; | ||
1238 | } | ||
1239 | EXPORT_SYMBOL(mmc_of_parse_voltage); | ||
1240 | |||
1241 | #endif /* CONFIG_OF */ | ||
1242 | |||
1199 | #ifdef CONFIG_REGULATOR | 1243 | #ifdef CONFIG_REGULATOR |
1200 | 1244 | ||
1201 | /** | 1245 | /** |