summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/dw_mmc-k3.c
AgeCommit message (Collapse)AuthorFilesLines
2023-06-12mmc: dw_mmc: Make dw_mci_pltfm_remove() return voidUwe Kleine-König1-1/+1
dw_mci_pltfm_remove() returned zero unconditionally. Make it return void instead which makes its semantics a bit clearer. Convert the drivers that use this function as .remove() callback to .remove_new() which has the right prototype. This helps getting rid of the platform_driver's remove callback that returns an int (which is error prone). The other users didn't check the return value anyhow. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230505221506.1247424-1-u.kleine-koenig@pengutronix.de Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-03-31mmc: dw_mmc-k3: use the correct HiSilicon copyrightHao Fang1-1/+1
s/Hisilicon/HiSilicon/g. It should use capital S, according to https://www.hisilicon.com/en/terms-of-use. Signed-off-by: Hao Fang <fanghao11@huawei.com> Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org> Link: https://lore.kernel.org/r/1617086448-51054-1-git-send-email-fanghao11@huawei.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2020-09-07mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4Douglas Anderson1-0/+1
This is like commit 3d3451124f3d ("mmc: sdhci-msm: Prefer asynchronous probe") but applied to a whole pile of drivers. This batch converts the drivers that appeared to be around in the v4.4 timeframe. Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> # SH_MMCIF Tested-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20200903162412.1.Id501e96fa63224f77bb86b2135a5e8324ffb9c43@changeid Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2020-08-24treewide: Use fallthrough pseudo-keywordGustavo A. R. Silva1-1/+1
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2020-05-28mmc: host: Prepare host drivers for mmc_regulator_set_vqmmc() returning > 0Marek Vasut1-1/+1
Patch all drivers which use mmc_regulator_set_vqmmc() and prepare them for the fact that mmc_regulator_set_vqmmc() can return a value > 0, which would happen if the signal voltage switch did NOT happen, because the voltage was already set correctly. Signed-off-by: Marek Vasut <marex@denx.de> Link: https://lore.kernel.org/r/20200416163649.336967-1-marex@denx.de [Ulf: Re-worked/simplified the code a bit] Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner1-5/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-27mmc: dw_mmc: Fix out-of-bounds access for slot's capsShawn Lin1-0/+1
Add num_caps field for dw_mci_drv_data to validate the controller id from DT alias and non-DT ways. Reported-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Fixes: 800d78bfccb3 ("mmc: dw_mmc: add support for implementation specific callbacks") Cc: <stable@vger.kernel.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2018-02-27mmc: dw_mmc-k3: Fix out-of-bounds access through DT aliasGeert Uytterhoeven1-0/+3
The hs_timing_cfg[] array is indexed using a value derived from the "mshcN" alias in DT, which may lead to an out-of-bounds access. Fix this by adding a range check. Fixes: 361c7fe9b02eee7e ("mmc: dw_mmc-k3: add sd support for hi3660") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> Cc: <stable@vger.kernel.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-10-30mmc: dw_mmc-k3: make array hs_timing_cfg staticColin Ian King1-1/+1
The array hs_timing_cfg is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'hs_timing_cfg' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-08-30mmc: dw_mmc-k3: add sd support for hi3660liwei1-0/+298
Add sd card support for hi3660 soc Signed-off-by: Li Wei <liwei213@huawei.com> Signed-off-by: Chen Jun <chenjun14@huawei.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-02-13mmc: dw_mmc: Remove the public dw_mmc header fileUlf Hansson1-1/+0
There are currently no external users of the public dw_mmc header file, except the dw_mmc driver itself. Therefore let's move the definitions from the public dw_mmc header file into the existing private dw_mmc header file and then remove the public one. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2016-11-29mmc: dw_mmc-k3: deploy runtime PM facilitiesShawn Lin1-30/+9
Let's migrate it to use runtime PM and remove the system PM callback from this driver. With this patch, it could handle system PM properly and could also use runtime PM if we enable it. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-09-26mmc: dw_mmc: k3: UHS-SD card for Hisilicon HikeyJin Guojun1-0/+6
Hisilicon Hikey have no tuning function in dw_mmc-k3.c, so we must do the tuning function stub when we init UHS card. Signed-off-by: Jin Guojun <kid.jin@hisilicon.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-07-25mmc: dw_mmc: k3: add MMC_CAP_CMD23Jérôme Forissier1-0/+7
Enables RPMB support for the on-board eMMC of the HiKey board as well as for eMMC modules connected to the microSD slot. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-06-01mmc: dw_mmc: k3: Fix modalias to make module auto-loading workZhangfei Gao1-1/+1
Make the modalias match driver name, this is required to make module auto-loading work. Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-06-01mmc: dw_mmc: k3: support hi6220Zhangfei Gao1-2/+101
Support hi6220, tested on hikey board emmc: support hs sd: support hs, sdr12, sdr25 Signed-off-by: Jorge A. Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> Signed-off-by: Dan Yuan <yuandan@hisilicon.com> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2014-03-03mmc: dw_mmc: fix possible build errorFelipe Balbi1-0/+2
Fix the following build errors: drivers/mmc/host/dw_mmc-k3.c: In function ‘dw_mci_k3_suspend’: drivers/mmc/host/dw_mmc-k3.c:58:2: error: implicit declaration of function ‘dw_mci_suspend’ [-Werror=implicit-function-declaration] ret = dw_mci_suspend(host); ^ drivers/mmc/host/dw_mmc-k3.c: In function ‘dw_mci_k3_resume’: drivers/mmc/host/dw_mmc-k3.c:76:2: error: implicit declaration of function ‘dw_mci_resume’ [-Werror=implicit-function-declaration] return dw_mci_resume(host); ^ drivers/mmc/host/dw_mmc-k3.c: At top level: drivers/mmc/host/dw_mmc-k3.c:53:12: warning: ‘dw_mci_k3_suspend’ defined but not used [-Wunused-function] static int dw_mci_k3_suspend(struct device *dev) ^ drivers/mmc/host/dw_mmc-k3.c:65:12: warning: ‘dw_mci_k3_resume’ defined but not used [-Wunused-function] static int dw_mci_k3_resume(struct device *dev) ^ Signed-off-by: Felipe Balbi <balbi@ti.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Chris Ball <chris@printf.net>
2014-01-18mmc: dw_mmc: k3: remove clk_tableZhangfei Gao1-39/+2
Remove clk_table and directly use ios->clock as clock source rate. Abstract init clock rate and max clock limitation in clk.c Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Acked-by: Seungwon Jeon <tgih.jun@samsung.com> Signed-off-by: Chris Ball <chris@printf.net>
2014-01-14mmc: dw_mmc: fix sparse non static symbol warningWei Yongjun1-1/+1
Fixes the following sparse warning: drivers/mmc/host/dw_mmc-k3.c:116:1: warning: symbol 'dw_mci_k3_pmops' was not declared. Should it be static? Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Chris Ball <chris@printf.net>
2014-01-13mmc: dw_mmc: add dw_mmc-k3 for k3 platformZhangfei Gao1-0/+132
Add dw_mmc-k3.c for k3v2, support sd/emmc Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Signed-off-by: Zhigang Wang <brooke.wangzhigang@huawei.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Chris Ball <chris@printf.net>