mmc: 8064: Add and enable support for SDC1 and SDC3
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
diff --git a/arch/arm/configs/apq8064_defconfig b/arch/arm/configs/apq8064_defconfig
index 05e21a8..93a6164 100644
--- a/arch/arm/configs/apq8064_defconfig
+++ b/arch/arm/configs/apq8064_defconfig
@@ -150,6 +150,10 @@
# CONFIG_NOP_USB_XCEIV is not set
CONFIG_USB_MSM_OTG=y
# CONFIG_USB_MSM_ACA is not set
+CONFIG_MMC=y
+CONFIG_MMC_MSM=y
+# CONFIG_MMC_MSM_SDC2_SUPPORT is not set
+CONFIG_MMC_MSM_SDC3_SUPPORT=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
# CONFIG_LEDS_MSM_PMIC is not set
diff --git a/arch/arm/mach-msm/board-apq8064.c b/arch/arm/mach-msm/board-apq8064.c
index 6bfdee8..47ba002 100644
--- a/arch/arm/mach-msm/board-apq8064.c
+++ b/arch/arm/mach-msm/board-apq8064.c
@@ -19,6 +19,7 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/hardware/gic.h>
+#include <asm/mach/mmc.h>
#include <mach/board.h>
#include <mach/msm_iomap.h>
@@ -45,6 +46,44 @@
return 0;
}
+#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
+static unsigned int sdc1_sup_clk_rates[] = {
+ 400000, 24000000, 48000000, 96000000
+};
+
+static struct mmc_platform_data sdc1_data = {
+ .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
+ .mmc_bus_width = MMC_CAP_4_BIT_DATA,
+ .sup_clk_table = sdc1_sup_clk_rates,
+ .sup_clk_cnt = ARRAY_SIZE(sdc1_sup_clk_rates),
+};
+static struct mmc_platform_data *apq8064_sdc1_pdata = &sdc1_data;
+#else
+static struct mmc_platform_data *apq8064_sdc1_pdata;
+#endif
+
+#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
+static unsigned int sdc3_sup_clk_rates[] = {
+ 400000, 24000000, 48000000, 96000000
+};
+
+static struct mmc_platform_data sdc3_data = {
+ .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
+ .mmc_bus_width = MMC_CAP_4_BIT_DATA,
+ .sup_clk_table = sdc3_sup_clk_rates,
+ .sup_clk_cnt = ARRAY_SIZE(sdc3_sup_clk_rates),
+};
+static struct mmc_platform_data *apq8064_sdc3_pdata = &sdc3_data;
+#else
+static struct mmc_platform_data *apq8064_sdc3_pdata;
+#endif
+
+static void __init apq8064_init_mmc(void)
+{
+ apq8064_add_sdcc(1, apq8064_sdc1_pdata);
+ apq8064_add_sdcc(3, apq8064_sdc3_pdata);
+}
+
static void __init apq8064_map_io(void)
{
msm_map_apq8064_io();
@@ -144,6 +183,7 @@
pm8921_platform_data.num_regulators =
msm8064_pm8921_regulator_pdata_len;
platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
+ apq8064_init_mmc();
}
static void __init apq8064_sim_init(void)
diff --git a/arch/arm/mach-msm/board-apq8064.h b/arch/arm/mach-msm/board-apq8064.h
index 6a4aafa..39513db 100644
--- a/arch/arm/mach-msm/board-apq8064.h
+++ b/arch/arm/mach-msm/board-apq8064.h
@@ -19,4 +19,9 @@
msm8064_pm8921_regulator_pdata[] __devinitdata;
extern int msm8064_pm8921_regulator_pdata_len __devinitdata;
+
+struct mmc_platform_data;
+int __init apq8064_add_sdcc(unsigned int controller,
+ struct mmc_platform_data *plat);
+
#endif