]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
mfd: Provide pm_runtime_no_callbacks flag in cell data
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 26 Nov 2010 17:19:34 +0000 (17:19 +0000)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 14 Jan 2011 11:37:42 +0000 (12:37 +0100)
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 <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/mfd-core.c
include/linux/mfd/core.h

index ec99f681e77368b33bfa23718663c520508e0f6b..d83ad0f141af3ef7bc26d8322e508a46351d8cf9 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/platform_device.h>
 #include <linux/acpi.h>
 #include <linux/mfd/core.h>
+#include <linux/pm_runtime.h>
 #include <linux/slab.h>
 
 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;
index 5582ab3d3e487e0f45365a84df8f0ef61455958a..835996e167e138560a69ffe107b3a46e49d67506 100644 (file)
@@ -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,