hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/mmc/host/dw_mmc-rockchip.c
....@@ -1,10 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
84 */
95
106 #include <linux/module.h>
....@@ -14,6 +10,7 @@
1410 #include <linux/of_address.h>
1511 #include <linux/mmc/slot-gpio.h>
1612 #include <linux/pm_runtime.h>
13
+#include <linux/rockchip/cpu.h>
1714 #include <linux/slab.h>
1815
1916 #include "dw_mmc.h"
....@@ -394,6 +391,19 @@
394391 "rockchip,rk3288-dw-mshc"))
395392 host->bus_hz /= RK3288_CLKGEN_DIV;
396393
394
+ if (of_device_is_compatible(host->dev->of_node,
395
+ "rockchip,rv1106-dw-mshc") &&
396
+ rockchip_get_cpu_version() == 0 &&
397
+ !strcmp(dev_name(host->dev), "ffaa0000.mmc")) {
398
+ if (device_property_read_bool(host->dev, "no-sd")) {
399
+ dev_err(host->dev, "Invalid usage, should be SD card only\n");
400
+ return -EINVAL;
401
+ }
402
+
403
+ host->is_rv1106_sd = true;
404
+ dev_info(host->dev, "is rv1106 sd\n");
405
+ }
406
+
397407 host->need_xfer_timer = true;
398408 return 0;
399409 }
....@@ -450,9 +460,9 @@
450460 * pm_runtime_force_resume calls rpm resume callback
451461 */
452462 pm_runtime_get_noresume(&pdev->dev);
463
+ pm_runtime_set_active(&pdev->dev);
453464
454465 if (use_rpm) {
455
- pm_runtime_set_active(&pdev->dev);
456466 pm_runtime_enable(&pdev->dev);
457467 pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
458468 pm_runtime_use_autosuspend(&pdev->dev);
....@@ -496,6 +506,7 @@
496506 .remove = dw_mci_rockchip_remove,
497507 .driver = {
498508 .name = "dwmmc_rockchip",
509
+ .probe_type = PROBE_PREFER_ASYNCHRONOUS,
499510 .of_match_table = dw_mci_rockchip_match,
500511 .pm = &dw_mci_rockchip_dev_pm_ops,
501512 },