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

Commit 564b905a authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

PM / Domains: Rename struct dev_power_domain to struct dev_pm_domain



The naming convention used by commit 7538e3db6e015e890825fbd9f86599b
(PM: Add support for device power domains), which introduced the
struct dev_power_domain type for representing device power domains,
evidently confuses some developers who tend to think that objects
of this type must correspond to "power domains" as defined by
hardware, which is not the case.  Namely, at the kernel level, a
struct dev_power_domain object can represent arbitrary set of devices
that are mutually dependent power management-wise and need not belong
to one hardware power domain.  To avoid that confusion, rename struct
dev_power_domain to struct dev_pm_domain and rename the related
pointers in struct device and struct pm_clk_notifier_block from
pwr_domain to pm_domain.

Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarKevin Hilman <khilman@ti.com>
parent f5da24db
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -506,8 +506,8 @@ routines. Nevertheless, different callback pointers are used in case there is a
situation where it actually matters.


Device Power Domains
--------------------
Device Power Management Domains
-------------------------------
Sometimes devices share reference clocks or other power resources.  In those
cases it generally is not possible to put devices into low-power states
individually.  Instead, a set of devices sharing a power resource can be put
@@ -516,8 +516,8 @@ power resource. Of course, they also need to be put into the full-power state
together, by turning the shared power resource on.  A set of devices with this
property is often referred to as a power domain.

Support for power domains is provided through the pwr_domain field of struct
device.  This field is a pointer to an object of type struct dev_power_domain,
Support for power domains is provided through the pm_domain field of struct
device.  This field is a pointer to an object of type struct dev_pm_domain,
defined in include/linux/pm.h, providing a set of power management callbacks
analogous to the subsystem-level and device driver callbacks that are executed
for the given device during all power transitions, instead of the respective
+4 −4
Original line number Diff line number Diff line
@@ -49,20 +49,20 @@ static int omap1_pm_runtime_resume(struct device *dev)
	return pm_generic_runtime_resume(dev);
}

static struct dev_power_domain default_power_domain = {
static struct dev_pm_domain default_pm_domain = {
	.ops = {
		.runtime_suspend = omap1_pm_runtime_suspend,
		.runtime_resume = omap1_pm_runtime_resume,
		USE_PLATFORM_PM_SLEEP_OPS
	},
};
#define OMAP1_PWR_DOMAIN (&default_power_domain)
#define OMAP1_PM_DOMAIN (&default_pm_domain)
#else
#define OMAP1_PWR_DOMAIN NULL
#define OMAP1_PM_DOMAIN NULL
#endif /* CONFIG_PM_RUNTIME */

static struct pm_clk_notifier_block platform_bus_notifier = {
	.pwr_domain = OMAP1_PWR_DOMAIN,
	.pm_domain = OMAP1_PM_DOMAIN,
	.con_ids = { "ick", "fck", NULL, },
};

+4 −4
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ static int default_platform_runtime_idle(struct device *dev)
	return pm_runtime_suspend(dev);
}

static struct dev_power_domain default_power_domain = {
static struct dev_pm_domain default_pm_domain = {
	.ops = {
		.runtime_suspend = pm_runtime_clk_suspend,
		.runtime_resume = pm_runtime_clk_resume,
@@ -37,16 +37,16 @@ static struct dev_power_domain default_power_domain = {
	},
};

#define DEFAULT_PWR_DOMAIN_PTR	(&default_power_domain)
#define DEFAULT_PM_DOMAIN_PTR	(&default_pm_domain)

#else

#define DEFAULT_PWR_DOMAIN_PTR	NULL
#define DEFAULT_PM_DOMAIN_PTR	NULL

#endif /* CONFIG_PM_RUNTIME */

static struct pm_clk_notifier_block platform_bus_notifier = {
	.pwr_domain = DEFAULT_PWR_DOMAIN_PTR,
	.pm_domain = DEFAULT_PM_DOMAIN_PTR,
	.con_ids = { NULL, },
};

+2 −2
Original line number Diff line number Diff line
@@ -564,7 +564,7 @@ static int _od_runtime_resume(struct device *dev)
	return pm_generic_runtime_resume(dev);
}

static struct dev_power_domain omap_device_power_domain = {
static struct dev_pm_domain omap_device_pm_domain = {
	.ops = {
		.runtime_suspend = _od_runtime_suspend,
		.runtime_idle = _od_runtime_idle,
@@ -586,7 +586,7 @@ int omap_device_register(struct omap_device *od)
	pr_debug("omap_device: %s: registering\n", od->pdev.name);

	od->pdev.dev.parent = &omap_device_parent;
	od->pdev.dev.pwr_domain = &omap_device_power_domain;
	od->pdev.dev.pm_domain = &omap_device_pm_domain;
	return platform_device_register(&od->pdev);
}

+3 −3
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ static int default_platform_runtime_idle(struct device *dev)
	return ret;
}

static struct dev_power_domain default_power_domain = {
static struct dev_pm_domain default_pm_domain = {
	.ops = {
		.runtime_suspend = default_platform_runtime_suspend,
		.runtime_resume = default_platform_runtime_resume,
@@ -285,7 +285,7 @@ static int platform_bus_notify(struct notifier_block *nb,
		hwblk_disable(hwblk_info, hwblk);
		/* make sure driver re-inits itself once */
		__set_bit(PDEV_ARCHDATA_FLAG_INIT, &pdev->archdata.flags);
		dev->pwr_domain = &default_power_domain;
		dev->pm_domain = &default_pm_domain;
		break;
	/* TODO: add BUS_NOTIFY_BIND_DRIVER and increase idle count */
	case BUS_NOTIFY_BOUND_DRIVER:
@@ -299,7 +299,7 @@ static int platform_bus_notify(struct notifier_block *nb,
		__set_bit(PDEV_ARCHDATA_FLAG_INIT, &pdev->archdata.flags);
		break;
	case BUS_NOTIFY_DEL_DEVICE:
		dev->pwr_domain = NULL;
		dev->pm_domain = NULL;
		break;
	}
	return 0;
Loading