* [PATCH 13/27] mmc: omap: Remove redundant suspend and resume callbacks
[not found] <1380207292-16968-1-git-send-email-ulf.hansson@linaro.org>
@ 2013-09-26 14:54 ` Ulf Hansson
2013-09-26 14:54 ` [PATCH 14/27] mmc: omap_hsmmc: Move away from using deprecated APIs Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2013-09-26 14:54 UTC (permalink / raw)
To: linux-kernel, linux-mmc, Chris Ball
Cc: Ulf Hansson, Jarkko Lavinen, linux-omap
Suspend and resume of cards are handled by the protocol layer and
consequently the mmc_suspend|resume_host APIs are marked as deprecated.
While moving away from using the deprecated APIs, there are nothing
left to be done for the suspend and resume callbacks, so remove them.
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/mmc/host/omap.c | 53 -----------------------------------------------
1 file changed, 53 deletions(-)
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index b94f38e..0b10a90 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -128,7 +128,6 @@ struct mmc_omap_slot {
struct mmc_omap_host {
int initialized;
- int suspended;
struct mmc_request * mrq;
struct mmc_command * cmd;
struct mmc_data * data;
@@ -1513,61 +1512,9 @@ static int mmc_omap_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
-static int mmc_omap_suspend(struct platform_device *pdev, pm_message_t mesg)
-{
- int i, ret = 0;
- struct mmc_omap_host *host = platform_get_drvdata(pdev);
-
- if (host == NULL || host->suspended)
- return 0;
-
- for (i = 0; i < host->nr_slots; i++) {
- struct mmc_omap_slot *slot;
-
- slot = host->slots[i];
- ret = mmc_suspend_host(slot->mmc);
- if (ret < 0) {
- while (--i >= 0) {
- slot = host->slots[i];
- mmc_resume_host(slot->mmc);
- }
- return ret;
- }
- }
- host->suspended = 1;
- return 0;
-}
-
-static int mmc_omap_resume(struct platform_device *pdev)
-{
- int i, ret = 0;
- struct mmc_omap_host *host = platform_get_drvdata(pdev);
-
- if (host == NULL || !host->suspended)
- return 0;
-
- for (i = 0; i < host->nr_slots; i++) {
- struct mmc_omap_slot *slot;
- slot = host->slots[i];
- ret = mmc_resume_host(slot->mmc);
- if (ret < 0)
- return ret;
-
- host->suspended = 0;
- }
- return 0;
-}
-#else
-#define mmc_omap_suspend NULL
-#define mmc_omap_resume NULL
-#endif
-
static struct platform_driver mmc_omap_driver = {
.probe = mmc_omap_probe,
.remove = mmc_omap_remove,
- .suspend = mmc_omap_suspend,
- .resume = mmc_omap_resume,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 14/27] mmc: omap_hsmmc: Move away from using deprecated APIs
[not found] <1380207292-16968-1-git-send-email-ulf.hansson@linaro.org>
2013-09-26 14:54 ` [PATCH 13/27] mmc: omap: Remove redundant suspend and resume callbacks Ulf Hansson
@ 2013-09-26 14:54 ` Ulf Hansson
2013-10-10 14:06 ` Balaji T K
1 sibling, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2013-09-26 14:54 UTC (permalink / raw)
To: linux-kernel, linux-mmc, Chris Ball; +Cc: Ulf Hansson, Balaji T K, linux-omap
Suspend and resume of cards are being handled from the protocol layer
and consequently the mmc_suspend|resume_host APIs are deprecated.
This means we can simplify the suspend|resume callbacks by removing the
use of the deprecated APIs. Additional cleanup done for keeping track
suspended state.
Cc: Balaji T K <balajitk@ti.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/mmc/host/omap_hsmmc.c | 37 +++----------------------------------
1 file changed, 3 insertions(+), 34 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 6ac63df..eb6fb28 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -170,7 +170,6 @@ struct omap_hsmmc_host {
unsigned int dma_sg_idx;
unsigned char bus_mode;
unsigned char power_mode;
- int suspended;
int irq;
int use_dma, dma_ch;
struct dma_chan *tx_chan;
@@ -1178,9 +1177,6 @@ static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
struct omap_mmc_slot_data *slot = &mmc_slot(host);
int carddetect;
- if (host->suspended)
- return IRQ_HANDLED;
-
sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
if (slot->card_detect)
@@ -1643,11 +1639,6 @@ static int omap_hsmmc_regs_show(struct seq_file *s, void *data)
seq_printf(s, "mmc%d:\n ctx_loss:\t%d:%d\n\nregs:\n",
mmc->index, host->context_loss, context_loss);
- if (host->suspended) {
- seq_printf(s, "host suspended, can't read registers\n");
- return 0;
- }
-
pm_runtime_get_sync(host->dev);
seq_printf(s, "CON:\t\t0x%08x\n",
@@ -2119,23 +2110,12 @@ static void omap_hsmmc_complete(struct device *dev)
static int omap_hsmmc_suspend(struct device *dev)
{
- int ret = 0;
struct omap_hsmmc_host *host = dev_get_drvdata(dev);
if (!host)
return 0;
- if (host && host->suspended)
- return 0;
-
pm_runtime_get_sync(host->dev);
- host->suspended = 1;
- ret = mmc_suspend_host(host->mmc);
-
- if (ret) {
- host->suspended = 0;
- goto err;
- }
if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) {
omap_hsmmc_disable_irq(host);
@@ -2145,23 +2125,19 @@ static int omap_hsmmc_suspend(struct device *dev)
if (host->dbclk)
clk_disable_unprepare(host->dbclk);
-err:
+
pm_runtime_put_sync(host->dev);
- return ret;
+ return 0;
}
/* Routine to resume the MMC device */
static int omap_hsmmc_resume(struct device *dev)
{
- int ret = 0;
struct omap_hsmmc_host *host = dev_get_drvdata(dev);
if (!host)
return 0;
- if (host && !host->suspended)
- return 0;
-
pm_runtime_get_sync(host->dev);
if (host->dbclk)
@@ -2172,16 +2148,9 @@ static int omap_hsmmc_resume(struct device *dev)
omap_hsmmc_protect_card(host);
- /* Notify the core to resume the host */
- ret = mmc_resume_host(host->mmc);
- if (ret == 0)
- host->suspended = 0;
-
pm_runtime_mark_last_busy(host->dev);
pm_runtime_put_autosuspend(host->dev);
-
- return ret;
-
+ return 0;
}
#else
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 14/27] mmc: omap_hsmmc: Move away from using deprecated APIs
2013-09-26 14:54 ` [PATCH 14/27] mmc: omap_hsmmc: Move away from using deprecated APIs Ulf Hansson
@ 2013-10-10 14:06 ` Balaji T K
0 siblings, 0 replies; 3+ messages in thread
From: Balaji T K @ 2013-10-10 14:06 UTC (permalink / raw)
To: Ulf Hansson; +Cc: linux-kernel, linux-mmc, Chris Ball, linux-omap
On Thursday 26 September 2013 08:24 PM, Ulf Hansson wrote:
> Suspend and resume of cards are being handled from the protocol layer
> and consequently the mmc_suspend|resume_host APIs are deprecated.
>
> This means we can simplify the suspend|resume callbacks by removing the
> use of the deprecated APIs. Additional cleanup done for keeping track
> suspended state.
>
> Cc: Balaji T K <balajitk@ti.com>
> Cc: linux-omap@vger.kernel.org
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Balaji T K <balajitk@ti.com>
> ---
> drivers/mmc/host/omap_hsmmc.c | 37 +++----------------------------------
> 1 file changed, 3 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 6ac63df..eb6fb28 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -170,7 +170,6 @@ struct omap_hsmmc_host {
> unsigned int dma_sg_idx;
> unsigned char bus_mode;
> unsigned char power_mode;
> - int suspended;
> int irq;
> int use_dma, dma_ch;
> struct dma_chan *tx_chan;
> @@ -1178,9 +1177,6 @@ static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
> struct omap_mmc_slot_data *slot = &mmc_slot(host);
> int carddetect;
>
> - if (host->suspended)
> - return IRQ_HANDLED;
> -
> sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
>
> if (slot->card_detect)
> @@ -1643,11 +1639,6 @@ static int omap_hsmmc_regs_show(struct seq_file *s, void *data)
> seq_printf(s, "mmc%d:\n ctx_loss:\t%d:%d\n\nregs:\n",
> mmc->index, host->context_loss, context_loss);
>
> - if (host->suspended) {
> - seq_printf(s, "host suspended, can't read registers\n");
> - return 0;
> - }
> -
> pm_runtime_get_sync(host->dev);
>
> seq_printf(s, "CON:\t\t0x%08x\n",
> @@ -2119,23 +2110,12 @@ static void omap_hsmmc_complete(struct device *dev)
>
> static int omap_hsmmc_suspend(struct device *dev)
> {
> - int ret = 0;
> struct omap_hsmmc_host *host = dev_get_drvdata(dev);
>
> if (!host)
> return 0;
>
> - if (host && host->suspended)
> - return 0;
> -
> pm_runtime_get_sync(host->dev);
> - host->suspended = 1;
> - ret = mmc_suspend_host(host->mmc);
> -
> - if (ret) {
> - host->suspended = 0;
> - goto err;
> - }
>
> if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) {
> omap_hsmmc_disable_irq(host);
> @@ -2145,23 +2125,19 @@ static int omap_hsmmc_suspend(struct device *dev)
>
> if (host->dbclk)
> clk_disable_unprepare(host->dbclk);
> -err:
> +
> pm_runtime_put_sync(host->dev);
> - return ret;
> + return 0;
> }
>
> /* Routine to resume the MMC device */
> static int omap_hsmmc_resume(struct device *dev)
> {
> - int ret = 0;
> struct omap_hsmmc_host *host = dev_get_drvdata(dev);
>
> if (!host)
> return 0;
>
> - if (host && !host->suspended)
> - return 0;
> -
> pm_runtime_get_sync(host->dev);
>
> if (host->dbclk)
> @@ -2172,16 +2148,9 @@ static int omap_hsmmc_resume(struct device *dev)
>
> omap_hsmmc_protect_card(host);
>
> - /* Notify the core to resume the host */
> - ret = mmc_resume_host(host->mmc);
> - if (ret == 0)
> - host->suspended = 0;
> -
> pm_runtime_mark_last_busy(host->dev);
> pm_runtime_put_autosuspend(host->dev);
> -
> - return ret;
> -
> + return 0;
> }
>
> #else
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-10 14:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1380207292-16968-1-git-send-email-ulf.hansson@linaro.org>
2013-09-26 14:54 ` [PATCH 13/27] mmc: omap: Remove redundant suspend and resume callbacks Ulf Hansson
2013-09-26 14:54 ` [PATCH 14/27] mmc: omap_hsmmc: Move away from using deprecated APIs Ulf Hansson
2013-10-10 14:06 ` Balaji T K
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).