aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@stericsson.com>2011-12-13 10:54:55 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-01-19 19:00:55 -0500
commit7d72a1d48af95211677ea83157945a8ef76b0751 (patch)
treee0d5e5c2ae716bde176c8e2d5083c0e933e14466 /drivers/mmc
parent5074d25dc97ac2d93fca7852563b7e204f03464a (diff)
ARM: 7217/1: mmc: mmci: Put power register deviations in variant data
Use variant data to store hardware controller deviations concerning power registers to improve readability of the code. Signed-off-by: Sebastian Rasmussen <sebastian.rasmussen@stericsson.com> Tested-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mmci.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 0e04138b1759..7cc89beee87f 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -53,6 +53,7 @@ static unsigned int fmax = 515633;
53 * @sdio: variant supports SDIO 53 * @sdio: variant supports SDIO
54 * @st_clkdiv: true if using a ST-specific clock divider algorithm 54 * @st_clkdiv: true if using a ST-specific clock divider algorithm
55 * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register 55 * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register
56 * @pwrreg_powerup: power up value for MMCIPOWER register
56 */ 57 */
57struct variant_data { 58struct variant_data {
58 unsigned int clkreg; 59 unsigned int clkreg;
@@ -63,18 +64,21 @@ struct variant_data {
63 bool sdio; 64 bool sdio;
64 bool st_clkdiv; 65 bool st_clkdiv;
65 bool blksz_datactrl16; 66 bool blksz_datactrl16;
67 u32 pwrreg_powerup;
66}; 68};
67 69
68static struct variant_data variant_arm = { 70static struct variant_data variant_arm = {
69 .fifosize = 16 * 4, 71 .fifosize = 16 * 4,
70 .fifohalfsize = 8 * 4, 72 .fifohalfsize = 8 * 4,
71 .datalength_bits = 16, 73 .datalength_bits = 16,
74 .pwrreg_powerup = MCI_PWR_UP,
72}; 75};
73 76
74static struct variant_data variant_arm_extended_fifo = { 77static struct variant_data variant_arm_extended_fifo = {
75 .fifosize = 128 * 4, 78 .fifosize = 128 * 4,
76 .fifohalfsize = 64 * 4, 79 .fifohalfsize = 64 * 4,
77 .datalength_bits = 16, 80 .datalength_bits = 16,
81 .pwrreg_powerup = MCI_PWR_UP,
78}; 82};
79 83
80static struct variant_data variant_u300 = { 84static struct variant_data variant_u300 = {
@@ -83,6 +87,7 @@ static struct variant_data variant_u300 = {
83 .clkreg_enable = MCI_ST_U300_HWFCEN, 87 .clkreg_enable = MCI_ST_U300_HWFCEN,
84 .datalength_bits = 16, 88 .datalength_bits = 16,
85 .sdio = true, 89 .sdio = true,
90 .pwrreg_powerup = MCI_PWR_ON,
86}; 91};
87 92
88static struct variant_data variant_ux500 = { 93static struct variant_data variant_ux500 = {
@@ -93,6 +98,7 @@ static struct variant_data variant_ux500 = {
93 .datalength_bits = 24, 98 .datalength_bits = 24,
94 .sdio = true, 99 .sdio = true,
95 .st_clkdiv = true, 100 .st_clkdiv = true,
101 .pwrreg_powerup = MCI_PWR_ON,
96}; 102};
97 103
98static struct variant_data variant_ux500v2 = { 104static struct variant_data variant_ux500v2 = {
@@ -104,6 +110,7 @@ static struct variant_data variant_ux500v2 = {
104 .sdio = true, 110 .sdio = true,
105 .st_clkdiv = true, 111 .st_clkdiv = true,
106 .blksz_datactrl16 = true, 112 .blksz_datactrl16 = true,
113 .pwrreg_powerup = MCI_PWR_ON,
107}; 114};
108 115
109/* 116/*
@@ -1009,6 +1016,7 @@ static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq)
1009static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) 1016static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1010{ 1017{
1011 struct mmci_host *host = mmc_priv(mmc); 1018 struct mmci_host *host = mmc_priv(mmc);
1019 struct variant_data *variant = host->variant;
1012 u32 pwr = 0; 1020 u32 pwr = 0;
1013 unsigned long flags; 1021 unsigned long flags;
1014 int ret; 1022 int ret;
@@ -1035,11 +1043,15 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1035 if (host->plat->vdd_handler) 1043 if (host->plat->vdd_handler)
1036 pwr |= host->plat->vdd_handler(mmc_dev(mmc), ios->vdd, 1044 pwr |= host->plat->vdd_handler(mmc_dev(mmc), ios->vdd,
1037 ios->power_mode); 1045 ios->power_mode);
1038 /* The ST version does not have this, fall through to POWER_ON */ 1046
1039 if (host->hw_designer != AMBA_VENDOR_ST) { 1047 /*
1040 pwr |= MCI_PWR_UP; 1048 * The ST Micro variant doesn't have the PL180s MCI_PWR_UP
1041 break; 1049 * and instead uses MCI_PWR_ON so apply whatever value is
1042 } 1050 * configured in the variant data.
1051 */
1052 pwr |= variant->pwrreg_powerup;
1053
1054 break;
1043 case MMC_POWER_ON: 1055 case MMC_POWER_ON:
1044 pwr |= MCI_PWR_ON; 1056 pwr |= MCI_PWR_ON;
1045 break; 1057 break;