diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2013-01-09 11:19:54 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-01-23 05:17:00 -0500 |
commit | f4670daef5e81aa312f5a18f571dbd8169ce079e (patch) | |
tree | c4e2bb8d20c215851312ff7955154e32af7a0f48 /drivers/mmc | |
parent | 8259293aee1d44d7ebf0c644ef48db835653ebc3 (diff) |
ARM: 7623/1: mmc: mmci: Fixup clock gating when freq is 0 for ST-variants
In the ST Micro variant, the MMCICLOCK register must not be used to
gate the clock. Instead use MMCIPOWER register and by clearing the
PWR_ON bit to do this.
Signed-off-by: Johan Rudholm <johan.rudholm@stericsson.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/mmci.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index b43e1ab5cb5c..04efcdfeb5e1 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -60,6 +60,7 @@ static unsigned int fmax = 515633; | |||
60 | * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register | 60 | * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register |
61 | * @pwrreg_powerup: power up value for MMCIPOWER register | 61 | * @pwrreg_powerup: power up value for MMCIPOWER register |
62 | * @signal_direction: input/out direction of bus signals can be indicated | 62 | * @signal_direction: input/out direction of bus signals can be indicated |
63 | * @pwrreg_clkgate: MMCIPOWER register must be used to gate the clock | ||
63 | */ | 64 | */ |
64 | struct variant_data { | 65 | struct variant_data { |
65 | unsigned int clkreg; | 66 | unsigned int clkreg; |
@@ -72,6 +73,7 @@ struct variant_data { | |||
72 | bool blksz_datactrl16; | 73 | bool blksz_datactrl16; |
73 | u32 pwrreg_powerup; | 74 | u32 pwrreg_powerup; |
74 | bool signal_direction; | 75 | bool signal_direction; |
76 | bool pwrreg_clkgate; | ||
75 | }; | 77 | }; |
76 | 78 | ||
77 | static struct variant_data variant_arm = { | 79 | static struct variant_data variant_arm = { |
@@ -96,6 +98,7 @@ static struct variant_data variant_u300 = { | |||
96 | .sdio = true, | 98 | .sdio = true, |
97 | .pwrreg_powerup = MCI_PWR_ON, | 99 | .pwrreg_powerup = MCI_PWR_ON, |
98 | .signal_direction = true, | 100 | .signal_direction = true, |
101 | .pwrreg_clkgate = true, | ||
99 | }; | 102 | }; |
100 | 103 | ||
101 | static struct variant_data variant_nomadik = { | 104 | static struct variant_data variant_nomadik = { |
@@ -107,6 +110,7 @@ static struct variant_data variant_nomadik = { | |||
107 | .st_clkdiv = true, | 110 | .st_clkdiv = true, |
108 | .pwrreg_powerup = MCI_PWR_ON, | 111 | .pwrreg_powerup = MCI_PWR_ON, |
109 | .signal_direction = true, | 112 | .signal_direction = true, |
113 | .pwrreg_clkgate = true, | ||
110 | }; | 114 | }; |
111 | 115 | ||
112 | static struct variant_data variant_ux500 = { | 116 | static struct variant_data variant_ux500 = { |
@@ -119,6 +123,7 @@ static struct variant_data variant_ux500 = { | |||
119 | .st_clkdiv = true, | 123 | .st_clkdiv = true, |
120 | .pwrreg_powerup = MCI_PWR_ON, | 124 | .pwrreg_powerup = MCI_PWR_ON, |
121 | .signal_direction = true, | 125 | .signal_direction = true, |
126 | .pwrreg_clkgate = true, | ||
122 | }; | 127 | }; |
123 | 128 | ||
124 | static struct variant_data variant_ux500v2 = { | 129 | static struct variant_data variant_ux500v2 = { |
@@ -132,6 +137,7 @@ static struct variant_data variant_ux500v2 = { | |||
132 | .blksz_datactrl16 = true, | 137 | .blksz_datactrl16 = true, |
133 | .pwrreg_powerup = MCI_PWR_ON, | 138 | .pwrreg_powerup = MCI_PWR_ON, |
134 | .signal_direction = true, | 139 | .signal_direction = true, |
140 | .pwrreg_clkgate = true, | ||
135 | }; | 141 | }; |
136 | 142 | ||
137 | /* | 143 | /* |
@@ -1150,6 +1156,13 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
1150 | } | 1156 | } |
1151 | } | 1157 | } |
1152 | 1158 | ||
1159 | /* | ||
1160 | * If clock = 0 and the variant requires the MMCIPOWER to be used for | ||
1161 | * gating the clock, the MCI_PWR_ON bit is cleared. | ||
1162 | */ | ||
1163 | if (!ios->clock && variant->pwrreg_clkgate) | ||
1164 | pwr &= ~MCI_PWR_ON; | ||
1165 | |||
1153 | spin_lock_irqsave(&host->lock, flags); | 1166 | spin_lock_irqsave(&host->lock, flags); |
1154 | 1167 | ||
1155 | mmci_set_clkreg(host, ios->clock); | 1168 | mmci_set_clkreg(host, ios->clock); |