mmc: sdhci: add power management capability.

Current mmc stack doesn't use the framework provided by power
management subsystem. It doesn't let each device suspend itself
and the pm operations are solely handled by the platform driver.
This may lead to races, since the concurrency of pm framework is
not used. The pm core does its best to reduce the probability of
a race between system suspend/resume and runtime PM by
decrementing/incrementing the usage counters of respective
devices during system-pm operations.
Moreover, it disables runtime PM altogether after suspending the
device and re-enables the same on resume.

To avoid this, the parent child relationship between the platform,
mmc_host and mmc_card devices is used. In this case, the relation
is defined as,
mmc_card -> (child of) -> mmc_host -> (child of) -> platform_dev

Each device is now responsible for its power management.
 * mmc_card
	-> schedules the runtime-suspend
 * mmc_host
	-> actually suspends/resume the host & card i.e. invokes
		mmc_[suspend/resume]_host
 * pltform_dev
	-> disables irqs

Typically, the card device serves as a trigger for scheduling the
runtime-suspend and invoking runtime-resume.

Two new runtime-pm functions have been introduced:
 * mmc_rpm_hold
	-> resumes the device passed as a parameter
 * mmc_rpm_release
	-> suspends the device passed as a parameter

The above two functions are invoked from the below contexts:
 * mmc_rescan
 * bkops
 * mmc-queue

Change-Id: Icf9dd34a445abfaf8dbb974ab1255feeda2581c9
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
12 files changed