From: Shubhrajyoti D <shubhrajyoti@ti.com>
To: <spi-devel-general@lists.sourceforge.net>
Cc: <linux-omap@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Shubhrajyoti D <shubhrajyoti@ti.com>
Subject: [PATCH v2 5/5] spi: omap2-mcspi: add support for pm_runtime autosuspend
Date: Mon, 26 Mar 2012 19:14:40 +0530 [thread overview]
Message-ID: <1332769480-28069-6-git-send-email-shubhrajyoti@ti.com> (raw)
In-Reply-To: <1332769480-28069-1-git-send-email-shubhrajyoti@ti.com>
Adds support for configuring the omap2-mcspi driver use autosuspend for
runtime power management. This can reduce the latency in starting an
spi transfer by not suspending the device immediately following
completion of a transfer. If another transfer then takes place before
the autosuspend timeout (2 secs), the call to resume the device can
return immediately saving some save/ restore cycles.
Acked-by: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
drivers/spi/spi-omap2-mcspi.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 1907ed2..0b0da2f 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -44,6 +44,7 @@
#include <plat/mcspi.h>
#define OMAP2_MCSPI_MAX_FREQ 48000000
+#define SPI_AUTOSUSPEND_TIMEOUT 2000
#define OMAP2_MCSPI_REVISION 0x00
#define OMAP2_MCSPI_SYSSTATUS 0x14
@@ -265,7 +266,8 @@ static void omap2_mcspi_restore_ctx(struct omap2_mcspi *mcspi)
}
static void omap2_mcspi_disable_clocks(struct omap2_mcspi *mcspi)
{
- pm_runtime_put_sync(mcspi->dev);
+ pm_runtime_mark_last_busy(mcspi->dev);
+ pm_runtime_put_autosuspend(mcspi->dev);
}
static int omap2_mcspi_enable_clocks(struct omap2_mcspi *mcspi)
@@ -1212,6 +1214,8 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
if (status < 0)
goto dma_chnl_free;
+ pm_runtime_use_autosuspend(&pdev->dev);
+ pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT);
pm_runtime_enable(&pdev->dev);
if (status || omap2_mcspi_master_setup(mcspi) < 0)
--
1.7.1
next prev parent reply other threads:[~2012-03-26 13:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-26 13:44 [PATCH 0/5] spi: omap2-mcspi: driver updates Shubhrajyoti D
2012-03-26 13:44 ` [PATCH v2 1/5] spi/omap: Remove bus_num usage for instance index Shubhrajyoti D
2012-03-28 8:45 ` DebBarma, Tarun Kanti
2012-03-29 8:31 ` Shubhrajyoti Datta
2012-03-26 13:44 ` [PATCH v2 2/5] spi: omap2-mcspi: make it behave as a module Shubhrajyoti D
2012-03-26 13:44 ` [PATCH v2 3/5] spi: omap2-mcspi: convert to module_platform_driver Shubhrajyoti D
2012-03-26 13:44 ` [PATCH v2 4/5] spi: omap2-mcspi: use devm_* functions Shubhrajyoti D
2012-03-26 13:44 ` Shubhrajyoti D [this message]
2012-03-27 21:58 ` [PATCH 0/5] spi: omap2-mcspi: driver updates Grant Likely
2012-03-28 5:48 ` Shubhrajyoti Datta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1332769480-28069-6-git-send-email-shubhrajyoti@ti.com \
--to=shubhrajyoti@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=spi-devel-general@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®