From: Mark Brown Date: Fri, 26 Nov 2010 17:19:34 +0000 (+0000) Subject: mfd: Provide pm_runtime_no_callbacks flag in cell data X-Git-Tag: v2.6.38-rc1~61^2~46 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c90aa94f6b3e33f57faaf19ef9819195dff61d3;p=platform%2Fupstream%2Fkernel-adaptation-pc.git mfd: Provide pm_runtime_no_callbacks flag in cell data Allow MFD cells to have pm_runtime_no_callbacks() called on them during registration. This causes the runtime PM framework to ignore them, allowing use of runtime PM to suspend the device as a whole even if not all drivers for the MFD can usefully implement runtime PM. For example, RTCs are likely to run continuously regardless of the power state of the system. Signed-off-by: Mark Brown Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index ec99f68..d83ad0f 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -15,6 +15,7 @@ #include #include #include +#include #include static int mfd_add_device(struct device *parent, int id, @@ -82,6 +83,9 @@ static int mfd_add_device(struct device *parent, int id, if (ret) goto fail_res; + if (cell->pm_runtime_no_callbacks) + pm_runtime_no_callbacks(&pdev->dev); + kfree(res); return 0; diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index 5582ab3..835996e 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -47,6 +47,12 @@ struct mfd_cell { /* don't check for resource conflicts */ bool ignore_resource_conflicts; + + /* + * Disable runtime PM callbacks for this subdevice - see + * pm_runtime_no_callbacks(). + */ + bool pm_runtime_no_callbacks; }; extern int mfd_add_devices(struct device *parent, int id,