]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: wmt-sdmmc: Fix settting BM_EIGHTBIT_MODE bit in wmt_mci_set_ios()
authorAxel Lin <axel.lin@ingics.com>
Sun, 27 Apr 2014 10:22:51 +0000 (18:22 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 9 Jul 2014 09:26:07 +0000 (11:26 +0200)
commit1ff60f7b969e620bddb4a7b823bc788d7bb90430
tree4f131698dc2db98948f7be0d2091ef60b4517981
parent3d3190ae6a6bba63ce364745b12ba9a0d464362e
mmc: wmt-sdmmc: Fix settting BM_EIGHTBIT_MODE bit in wmt_mci_set_ios()

For MMC_BUS_WIDTH_8 case, current code missed setting BM_EIGHTBIT_MODE bit.
Also has a small refactor to make the code looks better in readability.

So the bit settings witch below logic:

SDMMC_BUSMODE register:
Set EIGHTBIT_MODE bit for 8 bit mode, Set FOURBIT_MODE bit for 4 bit mode.
Clear both EIGHTBIT_MODE and FOURBIT_MODE bits for 1 bit mode.

SDMMC_EXTCTRL register:
Set EXT_EIGHTBIT bit for 8 bit mode, Clear EXT_EIGHTBIT bit for 1/4 bit mode.

Add define for EXT_EIGHTBIT to avoid using magic number.
BM_ONEBIT_MASK is no longer used, thus remove it.

This patch is untested due to lack of platform with 8-bit hardware.
However since the code is there, it's good to make the code match the document.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/wmt-sdmmc.c