forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/mmc/host/sdhci_f_sdh30.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/drivers/mmc/host/sdhci_f_sdh30.c
34 *
45 * Copyright (C) 2013 - 2015 Fujitsu Semiconductor, Ltd
56 * Vincent Yang <vincent.yang@tw.fujitsu.com>
67 * Copyright (C) 2015 Linaro Ltd Andy Green <andy.green@linaro.org>
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation, version 2 of the License.
118 */
129
1310 #include <linux/acpi.h>
....@@ -19,31 +16,7 @@
1916 #include <linux/clk.h>
2017
2118 #include "sdhci-pltfm.h"
22
-
23
-/* F_SDH30 extended Controller registers */
24
-#define F_SDH30_AHB_CONFIG 0x100
25
-#define F_SDH30_AHB_BIGED 0x00000040
26
-#define F_SDH30_BUSLOCK_DMA 0x00000020
27
-#define F_SDH30_BUSLOCK_EN 0x00000010
28
-#define F_SDH30_SIN 0x00000008
29
-#define F_SDH30_AHB_INCR_16 0x00000004
30
-#define F_SDH30_AHB_INCR_8 0x00000002
31
-#define F_SDH30_AHB_INCR_4 0x00000001
32
-
33
-#define F_SDH30_TUNING_SETTING 0x108
34
-#define F_SDH30_CMD_CHK_DIS 0x00010000
35
-
36
-#define F_SDH30_IO_CONTROL2 0x114
37
-#define F_SDH30_CRES_O_DN 0x00080000
38
-#define F_SDH30_MSEL_O_1_8 0x00040000
39
-
40
-#define F_SDH30_ESD_CONTROL 0x124
41
-#define F_SDH30_EMMC_RST 0x00000002
42
-#define F_SDH30_EMMC_HS200 0x01000000
43
-
44
-#define F_SDH30_CMD_DAT_DELAY 0x200
45
-
46
-#define F_SDH30_MIN_CLOCK 400000
19
+#include "sdhci_f_sdh30.h"
4720
4821 struct f_sdhost_priv {
4922 struct clk *clk_iface;
....@@ -116,16 +89,13 @@
11689 {
11790 struct sdhci_host *host;
11891 struct device *dev = &pdev->dev;
119
- struct resource *res;
12092 int irq, ctrl = 0, ret = 0;
12193 struct f_sdhost_priv *priv;
12294 u32 reg = 0;
12395
12496 irq = platform_get_irq(pdev, 0);
125
- if (irq < 0) {
126
- dev_err(dev, "%s: no irq specified\n", __func__);
97
+ if (irq < 0)
12798 return irq;
128
- }
12999
130100 host = sdhci_alloc_host(dev, sizeof(struct f_sdhost_priv));
131101 if (IS_ERR(host))
....@@ -152,8 +122,7 @@
152122 host->ops = &sdhci_f_sdh30_ops;
153123 host->irq = irq;
154124
155
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
156
- host->ioaddr = devm_ioremap_resource(&pdev->dev, res);
125
+ host->ioaddr = devm_platform_ioremap_resource(pdev, 0);
157126 if (IS_ERR(host->ioaddr)) {
158127 ret = PTR_ERR(host->ioaddr);
159128 goto err;
....@@ -250,6 +219,7 @@
250219 static struct platform_driver sdhci_f_sdh30_driver = {
251220 .driver = {
252221 .name = "f_sdh30",
222
+ .probe_type = PROBE_PREFER_ASYNCHRONOUS,
253223 .of_match_table = of_match_ptr(f_sdh30_dt_ids),
254224 .acpi_match_table = ACPI_PTR(f_sdh30_acpi_ids),
255225 .pm = &sdhci_pltfm_pmops,