]> git.dujemihanovic.xyz Git - u-boot.git/commit
mmc: renesas-sdhi: Disable clock after tuning reset when possible
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Sun, 5 Nov 2023 22:42:45 +0000 (23:42 +0100)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Mon, 13 Nov 2023 03:12:47 +0000 (04:12 +0100)
commit70d2c9940e54ada6bf9e1e538c958f13ccc97c38
tree0010356208f1de8b26cf12df71f707d0b277f3c7
parent17e9db18f17b6cad278694d4a61df95e96bdf4f5
mmc: renesas-sdhi: Disable clock after tuning reset when possible

Currently the renesas_sdhi_reset_tuning() unconditionally leaves SDHI
clock enabled after the tuning reset. This is not always necessary.

After the driver performed tuning reset at the end of probe function,
or in the unlikely case that tuning failed during regular operation,
the SDHI clock can be disabled after the tuning reset. The following
set_ios call would reconfigure the clock as needed.

In case of regular set_ios call which requires a tuning reset, keep
the clock enabled or disabled according to the mmc->clk_disable state.

With this in place, the controllers which have not been accessed via
block subsystem after boot are left in quiescent state. However, if an
MMC device is used e.g. for environment storage, that controller would
be accessed during the environment load and left active, including its
clock which would still be generated. This is due to the design of the
MMC subsystem, which does not deinit a controller after it was started
once, the controller is only deinited in case of mmc rescan, or before
OS boot.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Tested-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Thuan Nguyen Hong <thuan.nguyen-hong@banvien.com.vn>
drivers/mmc/renesas-sdhi.c