Skip to content

Commit 995cda6

Browse files
committed
Merge tag 'mmc-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC updates from Ulf Hansson: "MMC core: - Convert drivers to use the ->remove_new() callback - Propagate the removable attribute for the card's device MMC host: - Convert drivers to use the ->remove_new() callback - atmel-mci: Convert to gpio descriptors and cleanup the code - davinci: Make SDIO irq truly optional - renesas_sdhi: Register irqs before registering controller - sdhci: Simplify the sdhci_pltfm_* interface a bit - sdhci-esdhc-imx: Improve support for the 1.8V errata - sdhci-of-at91: Add support for the microchip sam9x7 variant - sdhci-of-dwcmshc: Add support for runtime PM - sdhci-pci-o2micro: Add support for the new Bayhub GG8 variant - sdhci-sprd: Add support for SD high-speed mode tuning - uniphier-sd: Register irqs before registering controller" * tag 'mmc-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (108 commits) mmc: atmel-mci: Move card detect gpio polarity quirk to gpiolib mmc: atmel-mci: move atmel MCI header file mmc: atmel-mci: Convert to gpio descriptors mmc: sdhci-sprd: Add SD HS mode online tuning mmc: core: Add host specific tuning support for SD HS mode mmc: sdhci-of-dwcmshc: Add runtime PM operations mmc: sdhci-of-dwcmshc: Add error handling in dwcmshc_resume mmc: sdhci-esdhc-imx: improve ESDHC_FLAG_ERR010450 mmc: sdhci-pltfm: Rename sdhci_pltfm_register() mmc: sdhci-pltfm: Remove sdhci_pltfm_unregister() mmc: sdhci-st: Use sdhci_pltfm_remove() mmc: sdhci-pxav2: Use sdhci_pltfm_remove() mmc: sdhci-of-sparx5: Use sdhci_pltfm_remove() mmc: sdhci-of-hlwd: Use sdhci_pltfm_remove() mmc: sdhci-of-esdhc: Use sdhci_pltfm_remove() mmc: sdhci-of-at91: Use sdhci_pltfm_remove() mmc: sdhci-of-arasan: Use sdhci_pltfm_remove() mmc: sdhci-iproc: Use sdhci_pltfm_remove() mmc: sdhci_f_sdh30: Use sdhci_pltfm_remove() mmc: sdhci-dove: Use sdhci_pltfm_remove() ...
2 parents 3b6bf5b + 98ac9e4 commit 995cda6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+816
-579
lines changed

Documentation/devicetree/bindings/mmc/arasan,sdhci.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ properties:
160160
description:
161161
The MIO bank number in which the command and data lines are configured.
162162

163+
iommus:
164+
maxItems: 1
165+
166+
power-domains:
167+
maxItems: 1
168+
163169
dependencies:
164170
'#clock-cells': [ clock-output-names ]
165171

Documentation/devicetree/bindings/mmc/mmc-controller.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ properties:
269269
post-power-on-delay-ms:
270270
description:
271271
It was invented for MMC pwrseq-simple which could be referred to
272-
mmc-pwrseq-simple.txt. But now it\'s reused as a tunable delay
272+
mmc-pwrseq-simple.yaml. But now it\'s reused as a tunable delay
273273
waiting for I/O signalling and card power supply to be stable,
274274
regardless of whether pwrseq-simple is used. Default to 10ms if
275275
no available.

Documentation/devicetree/bindings/mmc/mtk-sd.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,6 @@ properties:
9191
should switch dat1 pin to GPIO mode.
9292
maxItems: 1
9393

94-
assigned-clocks:
95-
description:
96-
PLL of the source clock.
97-
maxItems: 1
98-
99-
assigned-clock-parents:
100-
description:
101-
parent of source clock, used for HS400 mode to get 400Mhz source clock.
102-
maxItems: 1
103-
10494
hs400-ds-delay:
10595
$ref: /schemas/types.yaml#/definitions/uint32
10696
description:

Documentation/devicetree/bindings/mmc/sdhci-atmel.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ Documentation/devicetree/bindings/mmc/mmc.txt and the properties used by the
55
sdhci-of-at91 driver.
66

77
Required properties:
8-
- compatible: Must be "atmel,sama5d2-sdhci" or "microchip,sam9x60-sdhci".
8+
- compatible: Must be "atmel,sama5d2-sdhci" or "microchip,sam9x60-sdhci"
9+
or "microchip,sam9x7-sdhci", "microchip,sam9x60-sdhci".
910
- clocks: Phandlers to the clocks.
1011
- clock-names: Must be "hclock", "multclk", "baseclk" for
1112
"atmel,sama5d2-sdhci".
1213
Must be "hclock", "multclk" for "microchip,sam9x60-sdhci".
14+
Must be "hclock", "multclk" for "microchip,sam9x7-sdhci".
1315

1416
Optional properties:
1517
- assigned-clocks: The same with "multclk".

drivers/gpio/gpiolib-of.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ static void of_gpio_set_polarity_by_property(const struct device_node *np,
209209
const char *propname,
210210
enum of_gpio_flags *flags)
211211
{
212+
const struct device_node *np_compat = np;
213+
const struct device_node *np_propname = np;
212214
static const struct {
213215
const char *compatible;
214216
const char *gpio_propname;
@@ -252,15 +254,29 @@ static void of_gpio_set_polarity_by_property(const struct device_node *np,
252254
#if IS_ENABLED(CONFIG_REGULATOR_GPIO)
253255
{ "regulator-gpio", "enable-gpio", "enable-active-high" },
254256
{ "regulator-gpio", "enable-gpios", "enable-active-high" },
257+
#endif
258+
#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
259+
{ "atmel,hsmci", "cd-gpios", "cd-inverted" },
255260
#endif
256261
};
257262
unsigned int i;
258263
bool active_high;
259264

265+
#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
266+
/*
267+
* The Atmel HSMCI has compatible property in the parent node and
268+
* gpio property in a child node
269+
*/
270+
if (of_device_is_compatible(np->parent, "atmel,hsmci")) {
271+
np_compat = np->parent;
272+
np_propname = np;
273+
}
274+
#endif
275+
260276
for (i = 0; i < ARRAY_SIZE(gpios); i++) {
261-
if (of_device_is_compatible(np, gpios[i].compatible) &&
277+
if (of_device_is_compatible(np_compat, gpios[i].compatible) &&
262278
!strcmp(propname, gpios[i].gpio_propname)) {
263-
active_high = of_property_read_bool(np,
279+
active_high = of_property_read_bool(np_propname,
264280
gpios[i].polarity_propname);
265281
of_gpio_quirk_polarity(np, active_high, flags);
266282
break;

drivers/mmc/core/block.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -918,17 +918,9 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks)
918918

919919
struct scatterlist sg;
920920

921-
cmd.opcode = MMC_APP_CMD;
922-
cmd.arg = card->rca << 16;
923-
cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
924-
925-
err = mmc_wait_for_cmd(card->host, &cmd, 0);
921+
err = mmc_app_cmd(card->host, card);
926922
if (err)
927923
return err;
928-
if (!mmc_host_is_spi(card->host) && !(cmd.resp[0] & R1_APP_CMD))
929-
return -EIO;
930-
931-
memset(&cmd, 0, sizeof(struct mmc_command));
932924

933925
cmd.opcode = SD_APP_SEND_NUM_WR_BLKS;
934926
cmd.arg = 0;
@@ -3026,7 +3018,6 @@ static void mmc_blk_remove(struct mmc_card *card)
30263018
pm_runtime_disable(&card->dev);
30273019
pm_runtime_put_noidle(&card->dev);
30283020
mmc_blk_remove_req(md);
3029-
dev_set_drvdata(&card->dev, NULL);
30303021
destroy_workqueue(card->complete_wq);
30313022
}
30323023

drivers/mmc/core/bus.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ int mmc_add_card(struct mmc_card *card)
310310

311311

312312
dev_set_name(&card->dev, "%s:%04x", mmc_hostname(card->host), card->rca);
313+
dev_set_removable(&card->dev,
314+
mmc_card_is_removable(card->host) ?
315+
DEVICE_REMOVABLE : DEVICE_FIXED);
313316

314317
switch (card->type) {
315318
case MMC_TYPE_MMC:

drivers/mmc/core/mmc_ops.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ int mmc_send_adtc_data(struct mmc_card *card, struct mmc_host *host, u32 opcode,
3232
u32 args, void *buf, unsigned len);
3333
int mmc_send_csd(struct mmc_card *card, u32 *csd);
3434
int __mmc_send_status(struct mmc_card *card, u32 *status, unsigned int retries);
35-
int mmc_send_status(struct mmc_card *card, u32 *status);
3635
int mmc_send_cid(struct mmc_host *host, u32 *cid);
3736
int mmc_spi_read_ocr(struct mmc_host *host, int highcap, u32 *ocrp);
3837
int mmc_spi_set_crc(struct mmc_host *host, int use_crc);

drivers/mmc/core/pwrseq_emmc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,12 @@ static int mmc_pwrseq_emmc_probe(struct platform_device *pdev)
9090
return mmc_pwrseq_register(&pwrseq->pwrseq);
9191
}
9292

93-
static int mmc_pwrseq_emmc_remove(struct platform_device *pdev)
93+
static void mmc_pwrseq_emmc_remove(struct platform_device *pdev)
9494
{
9595
struct mmc_pwrseq_emmc *pwrseq = platform_get_drvdata(pdev);
9696

9797
unregister_restart_handler(&pwrseq->reset_nb);
9898
mmc_pwrseq_unregister(&pwrseq->pwrseq);
99-
100-
return 0;
10199
}
102100

103101
static const struct of_device_id mmc_pwrseq_emmc_of_match[] = {
@@ -109,7 +107,7 @@ MODULE_DEVICE_TABLE(of, mmc_pwrseq_emmc_of_match);
109107

110108
static struct platform_driver mmc_pwrseq_emmc_driver = {
111109
.probe = mmc_pwrseq_emmc_probe,
112-
.remove = mmc_pwrseq_emmc_remove,
110+
.remove_new = mmc_pwrseq_emmc_remove,
113111
.driver = {
114112
.name = "pwrseq_emmc",
115113
.of_match_table = mmc_pwrseq_emmc_of_match,

drivers/mmc/core/pwrseq_sd8787.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,16 @@ static int mmc_pwrseq_sd8787_probe(struct platform_device *pdev)
113113
return mmc_pwrseq_register(&pwrseq->pwrseq);
114114
}
115115

116-
static int mmc_pwrseq_sd8787_remove(struct platform_device *pdev)
116+
static void mmc_pwrseq_sd8787_remove(struct platform_device *pdev)
117117
{
118118
struct mmc_pwrseq_sd8787 *pwrseq = platform_get_drvdata(pdev);
119119

120120
mmc_pwrseq_unregister(&pwrseq->pwrseq);
121-
122-
return 0;
123121
}
124122

125123
static struct platform_driver mmc_pwrseq_sd8787_driver = {
126124
.probe = mmc_pwrseq_sd8787_probe,
127-
.remove = mmc_pwrseq_sd8787_remove,
125+
.remove_new = mmc_pwrseq_sd8787_remove,
128126
.driver = {
129127
.name = "pwrseq_sd8787",
130128
.of_match_table = mmc_pwrseq_sd8787_of_match,

0 commit comments

Comments
 (0)