diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2015-07-27 18:03:56 +0300 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2015-07-28 08:50:41 +0100 |
commit | 13b2c4a0c3b1cd37ee6bcfbb5b6e2b94e9a75364 (patch) | |
tree | 016216659f73b115aeaaa4ce712021dd67e2c551 /drivers/base/power/sysfs.c | |
parent | bc0195aad0daa2ad5b0d76cce22b167bc3435590 (diff) | |
download | op-kernel-dev-13b2c4a0c3b1cd37ee6bcfbb5b6e2b94e9a75364.zip op-kernel-dev-13b2c4a0c3b1cd37ee6bcfbb5b6e2b94e9a75364.tar.gz |
PM / QoS: Make it possible to expose device latency tolerance to userspace
Typically when a device is created the bus core it belongs to (for example
PCI) does not know if the device supports things like latency tolerance.
This is left to the driver that binds to the device in question. However,
at that time the device has already been created and there is no way to set
its dev->power.set_latency_tolerance anymore.
So follow what has been done for other PM QoS attributes as well and allow
drivers to expose and hide latency tolerance from userspace, if the device
supports it.
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/base/power/sysfs.c')
-rw-r--r-- | drivers/base/power/sysfs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c index d2be3f9..a7b4679 100644 --- a/drivers/base/power/sysfs.c +++ b/drivers/base/power/sysfs.c @@ -738,6 +738,17 @@ void pm_qos_sysfs_remove_flags(struct device *dev) sysfs_unmerge_group(&dev->kobj, &pm_qos_flags_attr_group); } +int pm_qos_sysfs_add_latency_tolerance(struct device *dev) +{ + return sysfs_merge_group(&dev->kobj, + &pm_qos_latency_tolerance_attr_group); +} + +void pm_qos_sysfs_remove_latency_tolerance(struct device *dev) +{ + sysfs_unmerge_group(&dev->kobj, &pm_qos_latency_tolerance_attr_group); +} + void rpm_sysfs_remove(struct device *dev) { sysfs_unmerge_group(&dev->kobj, &pm_runtime_attr_group); |