mmc: core: export mmc_host_may_gate_card function

MMC Host driver might want to use the mmc_host_may_gate_card() API
to know whether the clock can be gated to the card or not hence
export this function for usage outside its current scope.

Change-Id: I9ec4173063e2505eca179161cdf8cda033a3fd4b
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
mmc: msm_sdcc: fix clock gating handling using pwrsave control bit

SDCC controller provides the PWRSAVE control bit to automatically
disable the clock to card when there is no activity with card. SDCC
host controller driver always enables this feature but few SDIO
cards may require the clocks to be always running (even during
inactivity period) to raise the interrupt notification to host so
for such cards, enabling PWRSAVE fature may cause functional failures.

This change checks whether it is ok to gate the card clock before
enabling the PWRSAVE feature.

Change-Id: If36a6a20d59aeb555ece2a6959ab5407f90c787c
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
mmc: core: Fix MMC clock scaling in case of tuning failure

When the clock scaling state is changed from MMC_LOAD_LOW to
MMC_LOAD_HIGH, the clocks are first scaled up and then tuning
is performed. But in case of tuning failure, the current code
does nothing but still retain the previous clock scale stats
(state and curr_freq within struct clk_scaling). Hence, correct
it to scale down the clocks in case of tuning failure so that
clock scaling stats reflect the correct status. This also helps
proceed with data transfers at lower clock rate in such cases.

Change-Id: I7e9379d1e3ddc863132af31019604c22a42f8d59
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
mmc: msm_sdcc: fix pwrsave bit handling

SDCC controller provides the PWRSAVE control bit to automatically
disable the clock to card when there is no activity with card.
SDCC driver provides the compile time option to disable this pwrsave
feature completely but some of the recent driver changes ignore this
and may enable the pwrsave feature even when its not required. This
change ensures that we always check if the pwrsave is allowed or not
before really enabling it.

CRs-Fixed: 490017
Change-Id: Ica764565745ea0b54300e38157c58c0aa643291d
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
mmc: core: Enable multiple urgent requests notification

At the moment if the block layer issues an URGENT request notification
before receiving a complete on the URGENT request currently handled by
the device driver - the system crashes with a BUG_ON().
This change enables multiple block layer urgent request notification to
be handled by MMC layer by removing single notification enforcement.

CRs-fixed: 517724
Change-Id: Idfa410d0c2286146f8d58a38b5abd6886036317c
Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>