Skip to content

Commit 854ff79

Browse files
committed
Merge tag 'mmc-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC updates from Ulf Hansson: "MMC core: - Remove redundant pm_runtime_mark_last_busy() calls MMC host: - Convert drivers to use devm_mmc_alloc_host() - Remove redundant pm_runtime_mark_last_busy() calls - renesas_sdhi: - Add support for the RZ/T2H and RZ/N2H variants - Fix incorrect auto retuning for an SDIO card - rtsx_usb_sdmmc: - Add 74 clocks in poweron flow - Re-work the code in sd_set_power_mode() - loongson2: - Add driver for the Loongson-2K SD/SDIO controller - Add support for the Loongson-2K2000 SD/SDIO/eMMC controller - sdhci: - Drop sdhci_free_host()/sdhci_pltfm_free() interface - Remove the sdhci_free_host() and sdhci_pltfm_free() helpers - sdhci-cadence: Add support for the Mobileye EyeQ controller - sdhci-esdhc-imx: - Optimize clock loopback selection - Don't change pinctrl in suspend if wakeup source - sdhci-msm: - Add support for the Milos variant - Add support for the qcs8300 variant - Ensure SD card power isn't ON when card gets removed - sdhci-of-k1: Disable HW busy detection" * tag 'mmc-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (102 commits) mmc: loongson2: Unify the function prefixes for loongson2_mmc_pdata mmc: loongson2: Fix error code in loongson2_mmc_resource_request() dt-bindings: mmc: sdhci-msm: document the Milos SDHCI Controller mmc: loongson2: prevent integer overflow in ret variable mmc: Remove redundant pm_runtime_mark_last_busy() calls mmc: sdhci-msm: Ensure SD card power isn't ON when card removed dt-bindings: mmc: Add sdhci compatible for qcs8300 mmc: sdhci-cadence: use of_property_present mmc: loongson2: Add Loongson-2K2000 SD/SDIO/eMMC controller driver dt-bindings: mmc: loongson,ls2k0500-mmc: Add compatible for Loongson-2K2000 mmc: loongson2: Add Loongson-2K SD/SDIO controller driver dt-bindings: mmc: Add Loongson-2K SD/SDIO/eMMC controller binding mmc: Convert ternary operator to str_true_false() helper dt-bindings: mmc: renesas,sdhi: Document RZ/T2H and RZ/N2H support mmc: sdhci-cadence: add Mobileye eyeQ support dt-bindings: mmc: cdns: add Mobileye EyeQ MMC/SDHCI controller mmc: rtsx_usb_sdmmc: Fix clang -Wimplicit-fallthrough in sd_set_power_mode() mmc: cb710-mmc: Convert ternary operator to str_plural() helper mmc: rtsx_usb_sdmmc: Add 74 clocks in poweron flow mmc: rtsx_usb_sdmmc: Re-work the code in sd_set_power_mode() ...
2 parents fc8f502 + c3ad4ec commit 854ff79

85 files changed

Lines changed: 1796 additions & 1007 deletions

Some content is hidden

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ properties:
1616
- amd,pensando-elba-sd4hc
1717
- microchip,mpfs-sd4hc
1818
- microchip,pic64gx-sd4hc
19+
- mobileye,eyeq-sd4hc
1920
- socionext,uniphier-sd4hc
2021
- const: cdns,sd4hc
2122

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mmc/loongson,ls2k0500-mmc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: The SD/SDIO/eMMC host controller for Loongson-2K family SoCs
8+
9+
description:
10+
The MMC host controller on the Loongson-2K0500/2K1000 (using an externally
11+
shared apbdma controller) provides the SD and SDIO device interfaces.
12+
The two MMC host controllers on the Loongson-2K2000 are similar,
13+
except that they use internal exclusive DMA. one controller provides
14+
the eMMC interface and the other provides the SD/SDIO interface.
15+
16+
maintainers:
17+
- Binbin Zhou <zhoubinbin@loongson.cn>
18+
19+
allOf:
20+
- $ref: mmc-controller.yaml#
21+
22+
properties:
23+
compatible:
24+
enum:
25+
- loongson,ls2k0500-mmc
26+
- loongson,ls2k1000-mmc
27+
- loongson,ls2k2000-mmc
28+
29+
reg:
30+
minItems: 1
31+
items:
32+
- description: Loongson-2K MMC controller registers.
33+
- description: APB DMA config register for Loongson-2K MMC controller.
34+
35+
interrupts:
36+
maxItems: 1
37+
38+
clocks:
39+
maxItems: 1
40+
41+
dmas:
42+
maxItems: 1
43+
44+
dma-names:
45+
const: rx-tx
46+
47+
required:
48+
- compatible
49+
- reg
50+
- interrupts
51+
- clocks
52+
53+
unevaluatedProperties: false
54+
55+
if:
56+
properties:
57+
compatible:
58+
contains:
59+
enum:
60+
- loongson,ls2k0500-mmc
61+
- loongson,ls2k1000-mmc
62+
63+
then:
64+
properties:
65+
reg:
66+
minItems: 2
67+
68+
required:
69+
- dmas
70+
- dma-names
71+
72+
else:
73+
properties:
74+
reg:
75+
maxItems: 1
76+
77+
examples:
78+
- |
79+
#include <dt-bindings/gpio/gpio.h>
80+
#include <dt-bindings/interrupt-controller/irq.h>
81+
#include <dt-bindings/clock/loongson,ls2k-clk.h>
82+
83+
mmc@1fe2c000 {
84+
compatible = "loongson,ls2k1000-mmc";
85+
reg = <0x1fe2c000 0x68>,
86+
<0x1fe00438 0x8>;
87+
interrupt-parent = <&liointc0>;
88+
interrupts = <31 IRQ_TYPE_LEVEL_HIGH>;
89+
clocks = <&clk LOONGSON2_APB_CLK>;
90+
dmas = <&apbdma1 0>;
91+
dma-names = "rx-tx";
92+
bus-width = <4>;
93+
cd-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
94+
};
95+
96+
- |
97+
#include <dt-bindings/interrupt-controller/irq.h>
98+
#include <dt-bindings/clock/loongson,ls2k-clk.h>
99+
100+
mmc@79990000 {
101+
compatible = "loongson,ls2k2000-mmc";
102+
reg = <0x79990000 0x1000>;
103+
interrupt-parent = <&pic>;
104+
interrupts = <51 IRQ_TYPE_LEVEL_HIGH>;
105+
clocks = <&clk LOONGSON2_EMMC_CLK>;
106+
bus-width = <8>;
107+
non-removable;
108+
cap-mmc-highspeed;
109+
mmc-hs200-1_8v;
110+
no-sd;
111+
no-sdio;
112+
};

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ description: |
1717
and the properties used by the mxsmmc driver.
1818
1919
allOf:
20-
- $ref: mmc-controller.yaml
20+
- $ref: mmc-controller-common.yaml#
2121

2222
properties:
2323
compatible:
@@ -31,6 +31,9 @@ properties:
3131
interrupts:
3232
maxItems: 1
3333

34+
clocks:
35+
maxItems: 1
36+
3437
dmas:
3538
maxItems: 1
3639

@@ -41,6 +44,7 @@ required:
4144
- compatible
4245
- reg
4346
- interrupts
47+
- clocks
4448
- dmas
4549
- dma-names
4650

@@ -52,6 +56,7 @@ examples:
5256
compatible = "fsl,imx28-mmc";
5357
reg = <0x80010000 2000>;
5458
interrupts = <96>;
59+
clocks = <&clks 46>;
5560
dmas = <&dma_apbh 0>;
5661
dma-names = "rx-tx";
5762
bus-width = <8>;

Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ properties:
7272
- enum:
7373
- renesas,sdhi-r9a09g047 # RZ/G3E
7474
- renesas,sdhi-r9a09g056 # RZ/V2N
75+
- renesas,sdhi-r9a09g077 # RZ/T2H
76+
- renesas,sdhi-r9a09g087 # RZ/N2H
7577
- const: renesas,sdhi-r9a09g057 # RZ/V2H(P)
7678

7779
reg:
@@ -129,59 +131,78 @@ allOf:
129131
compatible:
130132
contains:
131133
enum:
132-
- renesas,sdhi-r9a09g057
133-
- renesas,rzg2l-sdhi
134+
- renesas,sdhi-r9a09g077
135+
- renesas,sdhi-r9a09g087
134136
then:
135137
properties:
138+
resets: false
136139
clocks:
137140
items:
138-
- description: IMCLK, SDHI channel main clock1.
139-
- description: CLK_HS, SDHI channel High speed clock which operates
140-
4 times that of SDHI channel main clock1.
141-
- description: IMCLK2, SDHI channel main clock2. When this clock is
142-
turned off, external SD card detection cannot be
143-
detected.
144-
- description: ACLK, SDHI channel bus clock.
141+
- description: ACLK, IMCLK, SDHI channel bus and main clocks.
142+
- description: CLK_HS, SDHI channel High speed clock.
145143
clock-names:
146144
items:
147-
- const: core
148-
- const: clkh
149-
- const: cd
150145
- const: aclk
151-
required:
152-
- clock-names
153-
- resets
146+
- const: clkh
154147
else:
155148
if:
156149
properties:
157150
compatible:
158151
contains:
159152
enum:
160-
- renesas,rcar-gen2-sdhi
161-
- renesas,rcar-gen3-sdhi
162-
- renesas,rcar-gen4-sdhi
153+
- renesas,sdhi-r9a09g057
154+
- renesas,rzg2l-sdhi
163155
then:
164156
properties:
165157
clocks:
166-
minItems: 1
167-
maxItems: 3
168-
clock-names:
169-
minItems: 1
170-
uniqueItems: true
171158
items:
172-
- const: core
173-
- enum: [ clkh, cd ]
174-
- const: cd
175-
else:
176-
properties:
177-
clocks:
178-
minItems: 1
179-
maxItems: 2
159+
- description: IMCLK, SDHI channel main clock1.
160+
- description: CLK_HS, SDHI channel High speed clock which operates
161+
4 times that of SDHI channel main clock1.
162+
- description: IMCLK2, SDHI channel main clock2. When this clock is
163+
turned off, external SD card detection cannot be
164+
detected.
165+
- description: ACLK, SDHI channel bus clock.
180166
clock-names:
181-
minItems: 1
182167
items:
183168
- const: core
169+
- const: clkh
184170
- const: cd
171+
- const: aclk
172+
required:
173+
- clock-names
174+
- resets
175+
else:
176+
if:
177+
properties:
178+
compatible:
179+
contains:
180+
enum:
181+
- renesas,rcar-gen2-sdhi
182+
- renesas,rcar-gen3-sdhi
183+
- renesas,rcar-gen4-sdhi
184+
then:
185+
properties:
186+
clocks:
187+
minItems: 1
188+
maxItems: 3
189+
clock-names:
190+
minItems: 1
191+
uniqueItems: true
192+
items:
193+
- const: core
194+
- enum: [ clkh, cd ]
195+
- const: cd
196+
else:
197+
properties:
198+
clocks:
199+
minItems: 1
200+
maxItems: 2
201+
clock-names:
202+
minItems: 1
203+
items:
204+
- const: core
205+
- const: cd
185206

186207
- if:
187208
properties:

Documentation/devicetree/bindings/mmc/sdhci-msm.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ properties:
4242
- qcom,ipq5424-sdhci
4343
- qcom,ipq6018-sdhci
4444
- qcom,ipq9574-sdhci
45+
- qcom,milos-sdhci
4546
- qcom,qcm2290-sdhci
4647
- qcom,qcs404-sdhci
4748
- qcom,qcs615-sdhci
49+
- qcom,qcs8300-sdhci
4850
- qcom,qdu1000-sdhci
4951
- qcom,sar2130p-sdhci
5052
- qcom,sc7180-sdhci

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14268,6 +14268,13 @@ S: Maintained
1426814268
F: Documentation/devicetree/bindings/hwinfo/loongson,ls2k-chipid.yaml
1426914269
F: drivers/soc/loongson/loongson2_guts.c
1427014270

14271+
LOONGSON-2 SOC SERIES MMC/SD/SDIO CONTROLLER DRIVER
14272+
M: Binbin Zhou <zhoubinbin@loongson.cn>
14273+
L: linux-mmc@vger.kernel.org
14274+
S: Maintained
14275+
F: Documentation/devicetree/bindings/mmc/loongson,ls2k0500-mmc.yaml
14276+
F: drivers/mmc/host/loongson2-mmc.c
14277+
1427114278
LOONGSON-2 SOC SERIES PM DRIVER
1427214279
M: Yinbo Zhu <zhuyinbo@loongson.cn>
1427314280
L: linux-pm@vger.kernel.org

drivers/mmc/core/core.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,6 @@ void mmc_put_card(struct mmc_card *card, struct mmc_ctx *ctx)
882882
WARN_ON(ctx && host->claimer != ctx);
883883

884884
mmc_release_host(host);
885-
pm_runtime_mark_last_busy(&card->dev);
886885
pm_runtime_put_autosuspend(&card->dev);
887886
}
888887
EXPORT_SYMBOL(mmc_put_card);

drivers/mmc/host/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,19 @@ config MMC_OWL
11111111
This selects support for the SD/MMC Host Controller on
11121112
Actions Semi Owl SoCs.
11131113

1114+
config MMC_LOONGSON2
1115+
tristate "Loongson-2K SD/SDIO/eMMC Host Interface support"
1116+
depends on LOONGARCH || COMPILE_TEST
1117+
depends on HAS_DMA
1118+
help
1119+
This selects support for the SD/SDIO/eMMC Host Controller on
1120+
Loongson-2K series CPUs.
1121+
1122+
To compile this driver as a module, choose M here: the
1123+
module will be called mmc_loongson2.
1124+
1125+
If unsure, say N.
1126+
11141127
config MMC_SDHCI_EXTERNAL_DMA
11151128
bool
11161129

drivers/mmc/host/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ obj-$(CONFIG_MMC_USDHI6ROL0) += usdhi6rol0.o
7272
obj-$(CONFIG_MMC_TOSHIBA_PCI) += toshsd.o
7373
obj-$(CONFIG_MMC_BCM2835) += bcm2835.o
7474
obj-$(CONFIG_MMC_OWL) += owl-mmc.o
75+
obj-$(CONFIG_MMC_LOONGSON2) += loongson2-mmc.o
7576

7677
obj-$(CONFIG_MMC_REALTEK_PCI) += rtsx_pci_sdmmc.o
7778
obj-$(CONFIG_MMC_REALTEK_USB) += rtsx_usb_sdmmc.o

drivers/mmc/host/alcor.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ static int alcor_pci_sdmmc_drv_probe(struct platform_device *pdev)
10841084
struct alcor_sdmmc_host *host;
10851085
int ret;
10861086

1087-
mmc = mmc_alloc_host(sizeof(*host), &pdev->dev);
1087+
mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(*host));
10881088
if (!mmc) {
10891089
dev_err(&pdev->dev, "Can't allocate MMC\n");
10901090
return -ENOMEM;
@@ -1102,11 +1102,9 @@ static int alcor_pci_sdmmc_drv_probe(struct platform_device *pdev)
11021102
ret = devm_request_threaded_irq(&pdev->dev, priv->irq,
11031103
alcor_irq, alcor_irq_thread, IRQF_SHARED,
11041104
DRV_NAME_ALCOR_PCI_SDMMC, host);
1105-
1106-
if (ret) {
1107-
dev_err(&pdev->dev, "Failed to get irq for data line\n");
1108-
goto free_host;
1109-
}
1105+
if (ret)
1106+
return dev_err_probe(&pdev->dev, ret,
1107+
"Failed to get irq for data line\n");
11101108

11111109
mutex_init(&host->cmd_mutex);
11121110
INIT_DELAYED_WORK(&host->timeout_work, alcor_timeout_timer);
@@ -1115,15 +1113,8 @@ static int alcor_pci_sdmmc_drv_probe(struct platform_device *pdev)
11151113
alcor_hw_init(host);
11161114

11171115
dev_set_drvdata(&pdev->dev, host);
1118-
ret = mmc_add_host(mmc);
1119-
if (ret)
1120-
goto free_host;
11211116

1122-
return 0;
1123-
1124-
free_host:
1125-
mmc_free_host(mmc);
1126-
return ret;
1117+
return mmc_add_host(mmc);
11271118
}
11281119

11291120
static void alcor_pci_sdmmc_drv_remove(struct platform_device *pdev)
@@ -1136,7 +1127,6 @@ static void alcor_pci_sdmmc_drv_remove(struct platform_device *pdev)
11361127

11371128
alcor_hw_uninit(host);
11381129
mmc_remove_host(mmc);
1139-
mmc_free_host(mmc);
11401130
}
11411131

11421132
#ifdef CONFIG_PM_SLEEP

0 commit comments

Comments
 (0)