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

Commit 80c6d1e6 authored by Kevin Hilman's avatar Kevin Hilman Committed by Rafael J. Wysocki
Browse files

OMAP: PM: omap_device: add API to disable idle on suspend



By default, omap_devices will be automatically idled on suspend
(and re-enabled on resume.)  Using this new API, device init code
can disable this feature if desired.

NOTE: any driver/device that has been runtime PM converted should
      not be using this API.

Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent c03f007a
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -46,6 +46,7 @@ extern struct device omap_device_parent;


/* omap_device.flags values */
/* omap_device.flags values */
#define OMAP_DEVICE_SUSPENDED BIT(0)
#define OMAP_DEVICE_SUSPENDED BIT(0)
#define OMAP_DEVICE_NO_IDLE_ON_SUSPEND BIT(1)


/**
/**
 * struct omap_device - omap_device wrapper for platform_devices
 * struct omap_device - omap_device wrapper for platform_devices
@@ -121,6 +122,10 @@ int omap_device_enable_hwmods(struct omap_device *od);
int omap_device_disable_clocks(struct omap_device *od);
int omap_device_disable_clocks(struct omap_device *od);
int omap_device_enable_clocks(struct omap_device *od);
int omap_device_enable_clocks(struct omap_device *od);


static inline void omap_device_disable_idle_on_suspend(struct omap_device *od)
{
	od->flags |= OMAP_DEVICE_NO_IDLE_ON_SUSPEND;
}


/*
/*
 * Entries should be kept in latency order ascending
 * Entries should be kept in latency order ascending
+6 −0
Original line number Original line Diff line number Diff line
@@ -573,6 +573,9 @@ static int _od_suspend_noirq(struct device *dev)
	struct omap_device *od = to_omap_device(pdev);
	struct omap_device *od = to_omap_device(pdev);
	int ret;
	int ret;


	if (od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND)
		return pm_generic_suspend_noirq(dev);

	ret = pm_generic_suspend_noirq(dev);
	ret = pm_generic_suspend_noirq(dev);


	if (!ret && !pm_runtime_status_suspended(dev)) {
	if (!ret && !pm_runtime_status_suspended(dev)) {
@@ -590,6 +593,9 @@ static int _od_resume_noirq(struct device *dev)
	struct platform_device *pdev = to_platform_device(dev);
	struct platform_device *pdev = to_platform_device(dev);
	struct omap_device *od = to_omap_device(pdev);
	struct omap_device *od = to_omap_device(pdev);


	if (od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND)
		return pm_generic_resume_noirq(dev);

	if ((od->flags & OMAP_DEVICE_SUSPENDED) &&
	if ((od->flags & OMAP_DEVICE_SUSPENDED) &&
	    !pm_runtime_status_suspended(dev)) {
	    !pm_runtime_status_suspended(dev)) {
		od->flags &= ~OMAP_DEVICE_SUSPENDED;
		od->flags &= ~OMAP_DEVICE_SUSPENDED;