Skip to content

Commit

Permalink
mfd: Provide pm_runtime_no_callbacks flag in cell data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Jan 14, 2011
1 parent d7b9f32 commit 4c90aa9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/mfd/mfd-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions include/linux/mfd/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4c90aa9

Please sign in to comment.