Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: sdhci-iproc: support standard byte register accesses

Add bytewise register accesses support for newer versions of IPROC
SDHCI controllers.
Previous sdhci-iproc versions of SDIO controllers
(such as Raspberry Pi and Cygnus) only allowed for 32-bit register
accesses.

Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Scott Branden and committed by
Ulf Hansson
c833e92b 40fe0d43

+33 -2
+33 -2
drivers/mmc/host/sdhci-iproc.c
··· 143 143 } 144 144 145 145 static const struct sdhci_ops sdhci_iproc_ops = { 146 + .set_clock = sdhci_set_clock, 147 + .get_max_clock = sdhci_pltfm_clk_get_max_clock, 148 + .set_bus_width = sdhci_set_bus_width, 149 + .reset = sdhci_reset, 150 + .set_uhs_signaling = sdhci_set_uhs_signaling, 151 + }; 152 + 153 + static const struct sdhci_ops sdhci_iproc_32only_ops = { 146 154 .read_l = sdhci_iproc_readl, 147 155 .read_w = sdhci_iproc_readw, 148 156 .read_b = sdhci_iproc_readb, ··· 162 154 .set_bus_width = sdhci_set_bus_width, 163 155 .reset = sdhci_reset, 164 156 .set_uhs_signaling = sdhci_set_uhs_signaling, 157 + }; 158 + 159 + static const struct sdhci_pltfm_data sdhci_iproc_cygnus_pltfm_data = { 160 + .quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK, 161 + .quirks2 = SDHCI_QUIRK2_ACMD23_BROKEN, 162 + .ops = &sdhci_iproc_32only_ops, 163 + }; 164 + 165 + static const struct sdhci_iproc_data iproc_cygnus_data = { 166 + .pdata = &sdhci_iproc_cygnus_pltfm_data, 167 + .caps = ((0x1 << SDHCI_MAX_BLOCK_SHIFT) 168 + & SDHCI_MAX_BLOCK_MASK) | 169 + SDHCI_CAN_VDD_330 | 170 + SDHCI_CAN_VDD_180 | 171 + SDHCI_CAN_DO_SUSPEND | 172 + SDHCI_CAN_DO_HISPD | 173 + SDHCI_CAN_DO_ADMA2 | 174 + SDHCI_CAN_DO_SDMA, 175 + .caps1 = SDHCI_DRIVER_TYPE_C | 176 + SDHCI_DRIVER_TYPE_D | 177 + SDHCI_SUPPORT_DDR50, 178 + .mmc_caps = MMC_CAP_1_8V_DDR, 165 179 }; 166 180 167 181 static const struct sdhci_pltfm_data sdhci_iproc_pltfm_data = { ··· 212 182 .quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION | 213 183 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | 214 184 SDHCI_QUIRK_MISSING_CAPS, 215 - .ops = &sdhci_iproc_ops, 185 + .ops = &sdhci_iproc_32only_ops, 216 186 }; 217 187 218 188 static const struct sdhci_iproc_data bcm2835_data = { ··· 224 194 225 195 static const struct of_device_id sdhci_iproc_of_match[] = { 226 196 { .compatible = "brcm,bcm2835-sdhci", .data = &bcm2835_data }, 227 - { .compatible = "brcm,sdhci-iproc-cygnus", .data = &iproc_data }, 197 + { .compatible = "brcm,sdhci-iproc-cygnus", .data = &iproc_cygnus_data}, 198 + { .compatible = "brcm,sdhci-iproc", .data = &iproc_data }, 228 199 { } 229 200 }; 230 201 MODULE_DEVICE_TABLE(of, sdhci_iproc_of_match);