]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
mmc: sdhci-msm: Add sdhci msm register write APIs which wait for pwr irq
authorVijay Viswanath <vviswana@codeaurora.org>
Wed, 27 Sep 2017 05:34:43 +0000 (11:04 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 30 Oct 2017 10:45:59 +0000 (11:45 +0100)
commitc0309b3803fed96cc9adb0a8701e271177f5cb04
tree7c9fec175616fb50109c8759bb74dfa6660237ab
parent99d570da309813f67e9c741edeff55bafc6c1d5e
mmc: sdhci-msm: Add sdhci msm register write APIs which wait for pwr irq

Register writes which change voltage of IO lines or turn the IO bus
on/off require controller to be ready before progressing further. When
the controller is ready, it will generate a power irq which needs to be
handled. The thread which initiated the register write should wait for
power irq to complete. This will be done through the new sdhc msm write
APIs which will check whether the particular write can trigger a power
irq and wait for it with a timeout if it is expected.
The SDHC core power control IRQ gets triggered when -
* There is a state change in power control bit (bit 0)
  of SDHCI_POWER_CONTROL register.
* There is a state change in 1.8V enable bit (bit 3) of
  SDHCI_HOST_CONTROL2 register.
* Bit 1 of SDHCI_SOFTWARE_RESET is set.

Also add support APIs which are used by sdhc msm write APIs to check
if power irq is expected to be generated and wait for the power irq
to come and complete if the irq is expected.

This patch requires CONFIG_MMC_SDHCI_IO_ACCESSORS to be enabled.

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Vijay Viswanath <vviswana@codeaurora.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-msm.c