Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit beca3655 authored by Pascal Huerst's avatar Pascal Huerst Committed by Mark Brown
Browse files

spi: omap2-mcspi: Add calls for pinctrl state select



This adds calls to pinctrl subsystem in order to switch pin states
on suspend/resume if you provide a "sleep" state in DT.

If no "sleep" state is provided in DT, these calls turn
to NOPs.

Signed-off-by: default avatarPascal Huerst <pascal.huerst@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8005c49d
Loading
Loading
Loading
Loading
+11 −1
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@
#include <linux/dma-mapping.h>
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
#include <linux/dmaengine.h>
#include <linux/omap-dma.h>
#include <linux/omap-dma.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/err.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/clk.h>
@@ -1536,14 +1537,23 @@ static int omap2_mcspi_resume(struct device *dev)
	}
	}
	pm_runtime_mark_last_busy(mcspi->dev);
	pm_runtime_mark_last_busy(mcspi->dev);
	pm_runtime_put_autosuspend(mcspi->dev);
	pm_runtime_put_autosuspend(mcspi->dev);
	return 0;

	return pinctrl_pm_select_default_state(dev);
}

static int omap2_mcspi_suspend(struct device *dev)
{
	return pinctrl_pm_select_sleep_state(dev);
}
}

#else
#else
#define omap2_mcspi_suspend	NULL
#define	omap2_mcspi_resume	NULL
#define	omap2_mcspi_resume	NULL
#endif
#endif


static const struct dev_pm_ops omap2_mcspi_pm_ops = {
static const struct dev_pm_ops omap2_mcspi_pm_ops = {
	.resume = omap2_mcspi_resume,
	.resume = omap2_mcspi_resume,
	.suspend = omap2_mcspi_suspend,
	.runtime_resume	= omap_mcspi_runtime_resume,
	.runtime_resume	= omap_mcspi_runtime_resume,
};
};