diff options
author | Sivaram Nair <sivaramn@nvidia.com> | 2013-03-11 18:20:54 -0700 |
---|---|---|
committer | Mrutyunjay Sawant <msawant@nvidia.com> | 2013-03-22 05:28:06 -0700 |
commit | 77141d4a7d24da08f9ce0579d6ceac707b33de3d (patch) | |
tree | a3592c1ecf5630375e2359d7096be409c70f8eb6 /drivers/edp | |
parent | 50f218e81c1346bdeb75248a79a0a080e8c3c9a7 (diff) |
EDP: add notify sysfs
A new sysfs attribute is added to specify whether the throttling and
promotion of an EDP client should be notified to the user level. The
field can be set/modified either by the client driver or an init script.
Bug 1244972
Change-Id: I91b71125647353932b8ef01883dbfee86f4b8587
Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-on: http://git-master/r/208242
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'drivers/edp')
-rw-r--r-- | drivers/edp/sysfs.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/edp/sysfs.c b/drivers/edp/sysfs.c index 4b7db087aded..83f86b23a34a 100644 --- a/drivers/edp/sysfs.c +++ b/drivers/edp/sysfs.c @@ -286,6 +286,23 @@ static ssize_t loans_show(struct edp_client *c, return scnprintf(s, PAGE_SIZE, "%u\n", c->num_loans); } +static ssize_t notify_show(struct edp_client *c, + struct edp_client_attribute *attr, char *s) +{ + return scnprintf(s, PAGE_SIZE, "%u\n", c->notify_ui); +} + +static ssize_t notify_store(struct edp_client *c, + struct edp_client_attribute *attr, const char *s, size_t count) +{ + unsigned int f; + + if (sscanf(s, "%u", &f) != 1) + return -EINVAL; + c->notify_ui = f; + return count; +} + struct edp_client_attribute attr_states = __ATTR_RO(states); struct edp_client_attribute attr_num_states = __ATTR_RO(num_states); struct edp_client_attribute attr_e0 = __ATTR_RO(e0); @@ -301,6 +318,8 @@ struct edp_client_attribute attr_current = { .attr = { .name = "current", .mode = 0444 }, .show = current_show }; +struct edp_client_attribute attr_notify = __ATTR(notify, 0644, notify_show, + notify_store); static struct attribute *client_attrs[] = { &attr_states.attr, @@ -313,6 +332,7 @@ static struct attribute *client_attrs[] = { &attr_threshold.attr, &attr_borrowers.attr, &attr_loans.attr, + &attr_notify.attr, NULL }; |