| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * 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. |
|---|
| 8 | 4 | */ |
|---|
| 9 | 5 | |
|---|
| 10 | 6 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 14 | 10 | #include <linux/of_address.h> |
|---|
| 15 | 11 | #include <linux/mmc/slot-gpio.h> |
|---|
| 16 | 12 | #include <linux/pm_runtime.h> |
|---|
| 13 | +#include <linux/rockchip/cpu.h> |
|---|
| 17 | 14 | #include <linux/slab.h> |
|---|
| 18 | 15 | |
|---|
| 19 | 16 | #include "dw_mmc.h" |
|---|
| .. | .. |
|---|
| 394 | 391 | "rockchip,rk3288-dw-mshc")) |
|---|
| 395 | 392 | host->bus_hz /= RK3288_CLKGEN_DIV; |
|---|
| 396 | 393 | |
|---|
| 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 | + |
|---|
| 397 | 407 | host->need_xfer_timer = true; |
|---|
| 398 | 408 | return 0; |
|---|
| 399 | 409 | } |
|---|
| .. | .. |
|---|
| 450 | 460 | * pm_runtime_force_resume calls rpm resume callback |
|---|
| 451 | 461 | */ |
|---|
| 452 | 462 | pm_runtime_get_noresume(&pdev->dev); |
|---|
| 463 | + pm_runtime_set_active(&pdev->dev); |
|---|
| 453 | 464 | |
|---|
| 454 | 465 | if (use_rpm) { |
|---|
| 455 | | - pm_runtime_set_active(&pdev->dev); |
|---|
| 456 | 466 | pm_runtime_enable(&pdev->dev); |
|---|
| 457 | 467 | pm_runtime_set_autosuspend_delay(&pdev->dev, 50); |
|---|
| 458 | 468 | pm_runtime_use_autosuspend(&pdev->dev); |
|---|
| .. | .. |
|---|
| 496 | 506 | .remove = dw_mci_rockchip_remove, |
|---|
| 497 | 507 | .driver = { |
|---|
| 498 | 508 | .name = "dwmmc_rockchip", |
|---|
| 509 | + .probe_type = PROBE_PREFER_ASYNCHRONOUS, |
|---|
| 499 | 510 | .of_match_table = dw_mci_rockchip_match, |
|---|
| 500 | 511 | .pm = &dw_mci_rockchip_dev_pm_ops, |
|---|
| 501 | 512 | }, |
|---|