[PATCH] spi: omap2_mcspi: Make the runtime functions depend on CONFIG_PM_RUNTIME
From: Shubhrajyoti D
Date: Wed Mar 21 2012 - 02:03:30 EST
Makes the function omap_mcspi_runtime_resume depend on CONFIG_PM_RUNTIME.
Signed-off-by: Felipe Balbi <balbi@xxxxxx>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@xxxxxx>
---
drivers/spi/spi-omap2-mcspi.c | 41 +++++++++++++++++++++++------------------
1 files changed, 23 insertions(+), 18 deletions(-)
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index cb2c0e3..f9d694d 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -248,23 +248,6 @@ static void omap2_mcspi_set_master_mode(struct spi_master *master)
omap2_mcspi_ctx[master->bus_num - 1].modulctrl = l;
}
-static void omap2_mcspi_restore_ctx(struct omap2_mcspi *mcspi)
-{
- struct spi_master *spi_cntrl;
- struct omap2_mcspi_cs *cs;
- spi_cntrl = mcspi->master;
-
- /* McSPI: context restore */
- mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_MODULCTRL,
- omap2_mcspi_ctx[spi_cntrl->bus_num - 1].modulctrl);
-
- mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_WAKEUPENABLE,
- omap2_mcspi_ctx[spi_cntrl->bus_num - 1].wakeupenable);
-
- list_for_each_entry(cs, &omap2_mcspi_ctx[spi_cntrl->bus_num - 1].cs,
- node)
- __raw_writel(cs->chconf0, cs->base + OMAP2_MCSPI_CHCONF0);
-}
static void omap2_mcspi_disable_clocks(struct omap2_mcspi *mcspi)
{
pm_runtime_put_sync(mcspi->dev);
@@ -1066,6 +1049,26 @@ static int __init omap2_mcspi_master_setup(struct omap2_mcspi *mcspi)
return 0;
}
+#ifdef CONFIG_PM_RUNTIME
+static void omap2_mcspi_restore_ctx(struct omap2_mcspi *mcspi)
+{
+ struct spi_master *spi_cntrl;
+ struct omap2_mcspi_cs *cs;
+
+ spi_cntrl = mcspi->master;
+
+ /* McSPI: context restore */
+ mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_MODULCTRL,
+ omap2_mcspi_ctx[spi_cntrl->bus_num - 1].modulctrl);
+
+ mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_WAKEUPENABLE,
+ omap2_mcspi_ctx[spi_cntrl->bus_num - 1].wakeupenable);
+
+ list_for_each_entry(cs, &omap2_mcspi_ctx[spi_cntrl->bus_num - 1].cs,
+ node)
+ __raw_writel(cs->chconf0, cs->base + OMAP2_MCSPI_CHCONF0);
+}
+
static int omap_mcspi_runtime_resume(struct device *dev)
{
struct omap2_mcspi *mcspi;
@@ -1077,7 +1080,9 @@ static int omap_mcspi_runtime_resume(struct device *dev)
return 0;
}
-
+#else
+#define omap_mcspi_runtime_resume NULL
+#endif
static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
{
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/