Commit graph

14 commits

Author SHA1 Message Date
Nicolas Boichat
fac49ce575 mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
We've introduced a new helper in the MMC core:
mmc_regulator_set_vqmmc().  Let's use this in mtk-sd.  Using this new
helper has some advantages:

    1. We get the mmc_regulator_set_vqmmc() behavior of trying to match
       VQMMC and VMMC when the signal voltage is 3.3V.  This ensures max
       compatibility.

    2. We get rid of a few more warnings when probing unsupported
       voltages.

    3. We get rid of some non-mediatek specific code in mtk-sd.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-03-17 14:54:36 +01:00
Nicolas Boichat
f9bab9d2b1 mmc: mediatek: Change signal voltage error to dev_dbg()
In commit ceae98f20e ("mmc: core: Try other signal levels
during power up") we can see that there are times when it's
valid to try several signal voltages.  Don't print an ugly
error in the logs when that happens.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-03-17 14:54:35 +01:00
Chaotian Jing
8d53e41238 mmc: mediatek: add SD write protect support
use mmc core layer's API to support sd write protect

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-02-29 11:03:24 +01:00
Chaotian Jing
2066fd285e mmc: mediatek: change some dev_err to dev_dbg
there are too many error logs shown when use CMD21/CMD19 to do tune,
and it will appear at each resume time, print out so many logs to the
uart console cost too mush time. so change it to dev_dbg.

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-12-22 11:32:17 +01:00
Ulf Hansson
7b6471a968 mmc: core: Remove MMC_CAP_RUNTIME_RESUME as it's redundant
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-12-22 11:32:03 +01:00
Geert Uytterhoeven
62d494ca27 mmc: mediatek: Preinitialize delay_phase in get_best_delay()
drivers/mmc/host/mtk-sd.c: In function ‘get_best_delay’:
drivers/mmc/host/mtk-sd.c:1284: warning: ‘delay_phase.start’ is used uninitialized in this function
drivers/mmc/host/mtk-sd.c:1284: warning: ‘delay_phase.maxlen’ is used uninitialized in this function

If delay is zero, these fields are indeed not initialized.
Let the compiler preinitialize the whole struct to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-11-09 13:16:44 +01:00
Chaotian Jing
6397b7f5f4 mmc: mediatek: add HS400 support
add HS400 mode and tune support

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-10-27 10:40:38 +01:00
Chaotian Jing
c9b5061e77 mmc: mediatek: add implement of ops->hw_reset()
add implement of ops->hw_reset() for eMMC

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-10-27 10:21:16 +01:00
Chaotian Jing
62b0d27af8 mmc: mediatek: fix got GPD checksum error interrupt when data transfer
Even if we only use one gpd, we need alloc 2 gpd and make
the gpd->next pointer to the second gpd, or may get gpd checksum
error, this was checked by hardware

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-10-27 10:21:16 +01:00
Chaotian Jing
6e622947e1 mmc: mediatek: change the argument "ddr" to "timing"
use the ios->timing directly is better
It can reflect current timing and do settings by timing

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-10-27 10:21:16 +01:00
Chaotian Jing
726a9aac31 mmc: mediatek: make cmd_ints_mask to const
cmd_ints_mask and data_ints_mask are constant value,
so make it to const

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-10-27 10:21:15 +01:00
Chaotian Jing
8131e815f7 mmc: mediatek: Add MMC_CAP_RUNTIME_RESUME support
Add MMC_CAP_RUNTIME_RESUME support to save resume time
Drop unnecessary SDC_ARG write

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-10-26 15:59:59 +01:00
Chaotian Jing
4b8a43e90c mmc: mediatek: Add PM support for MMC driver
Add PM support for Mediatek MMC driver
Save/restore registers when PM

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-06-18 09:21:04 +02:00
Chaotian Jing
208489032b mmc: mediatek: Add Mediatek MMC driver
Add Mediatek MMC driver code
Support eMMC/SD/SDIO

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2015-06-18 09:20:48 +02:00