summaryrefslogtreecommitdiff
path: root/drivers/edp
diff options
context:
space:
mode:
authorSivaram Nair <sivaramn@nvidia.com>2013-09-10 13:23:48 +0300
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-26 19:45:56 -0700
commit4562191023cd3ea57e820c69d7ebfb2b40f4c202 (patch)
treedff22e368605aaf615eff00c745edb912440d4c7 /drivers/edp
parentacfcccb79573472d7b35de217380907156dca445 (diff)
EDP: tegra: export VSYS_MIN debugfs attr
Adding a new debugfs attr for vsys_min psy depletion platform data for tuning. Bug 1306298 Change-Id: Id9b7a6affae2216e7bafde55eea2f8eacbe24572 Signed-off-by: Sivaram Nair <sivaramn@nvidia.com> Reviewed-on: http://git-master/r/272489 (cherry picked from commit 9361d0eaef4f7616e443fdbbefebeda92c496b87) Reviewed-on: http://git-master/r/275628 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Diffstat (limited to 'drivers/edp')
-rw-r--r--drivers/edp/psy_depletion.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/edp/psy_depletion.c b/drivers/edp/psy_depletion.c
index 11ba4fc22b64..ae2d3e803ae7 100644
--- a/drivers/edp/psy_depletion.c
+++ b/drivers/edp/psy_depletion.c
@@ -289,7 +289,25 @@ static int capacity_get(void *data, u64 *val)
return 0;
}
+static int vsysmin_set(void *data, u64 val)
+{
+ struct depl_driver *drv = data;
+
+ drv->pdata->vsys_min = val;
+ flush_delayed_work_sync(&drv->work);
+
+ return 0;
+}
+
+static int vsysmin_get(void *data, u64 *val)
+{
+ struct depl_driver *drv = data;
+ *val = drv->pdata->vsys_min;
+ return 0;
+}
+
DEFINE_SIMPLE_ATTRIBUTE(capacity_fops, capacity_get, capacity_set, "%lld\n");
+DEFINE_SIMPLE_ATTRIBUTE(vsysmin_fops, vsysmin_get, vsysmin_set, "%lld\n");
static void init_debug(struct depl_driver *drv)
{
@@ -300,6 +318,13 @@ static void init_debug(struct depl_driver *drv)
return;
}
+ d = debugfs_create_file("vsys_min", S_IRUGO | S_IWUSR,
+ drv->client.dentry, drv, &vsysmin_fops);
+ WARN_ON(IS_ERR_OR_NULL(d));
+
+ if (!drv->emulator_mode)
+ return;
+
d = debugfs_create_file("capacity", S_IRUGO | S_IWUSR,
drv->client.dentry, drv, &capacity_fops);
WARN_ON(IS_ERR_OR_NULL(d));
@@ -362,8 +387,7 @@ static int depl_probe(struct platform_device *pdev)
INIT_DEFERRABLE_WORK(&drv->work, depl_update);
schedule_delayed_work(&drv->work, 0);
- if (drv->emulator_mode)
- init_debug(drv);
+ init_debug(drv);
return 0;