summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMayuresh Kulkarni <mkulkarni@nvidia.com>2012-06-12 18:22:26 +0530
committerSimone Willett <swillett@nvidia.com>2012-06-18 18:44:11 -0700
commit6cc2ba059bc9760f185834e67d9456af36bf5a9f (patch)
tree5a7b473179c57ea9ae493c6969cd000e35ee57e3 /include
parente43dc6b9b19919885908c6f02b6cc5416da06456 (diff)
video: tegra: host: expose power management paramters via sysfs
this commit exposes following power management parameter through sysfs: - clockgate_delay: delay after which module is clock gated after it goes idle. this read/write attribute & unit is ms. - powergate_delay: delay after which module is power gated after it is clock gated. this is read/write attribute & unit is ms. - refcount: current reference count on the module. this is read-only attribute. path is: /sys/devices/host1x/<device-name>/acm/ where <device-name> = name of device node like gr2d or gr3d etc Bug 845598 Change-Id: I6011eb90ee85b5fc576320272e657ce31f9e264d Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-on: http://git-master/r/108827 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Francis Hart <fhart@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nvhost.h29
1 files changed, 22 insertions, 7 deletions
diff --git a/include/linux/nvhost.h b/include/linux/nvhost.h
index 382a54f2370c..2f2d615febae 100644
--- a/include/linux/nvhost.h
+++ b/include/linux/nvhost.h
@@ -3,7 +3,7 @@
*
* Tegra graphics host driver
*
- * Copyright (c) 2009-2012, NVIDIA Corporation.
+ * Copyright (c) 2009-2012, NVIDIA Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,12 +27,20 @@
#include <linux/types.h>
struct nvhost_master;
-
-#define NVHOST_MODULE_MAX_CLOCKS 3
-#define NVHOST_MODULE_MAX_POWERGATE_IDS 2
-#define NVHOST_MODULE_NO_POWERGATE_IDS .powergate_ids = {-1, -1}
-#define NVHOST_DEFAULT_CLOCKGATE_DELAY .clockgate_delay = 25
-#define NVHOST_NAME_SIZE 24
+struct nvhost_device_power_attr;
+
+#define NVHOST_MODULE_MAX_CLOCKS 3
+#define NVHOST_MODULE_MAX_POWERGATE_IDS 2
+#define NVHOST_MODULE_NO_POWERGATE_IDS .powergate_ids = {-1, -1}
+#define NVHOST_DEFAULT_CLOCKGATE_DELAY .clockgate_delay = 25
+#define NVHOST_NAME_SIZE 24
+
+enum nvhost_power_sysfs_attributes {
+ NVHOST_POWER_SYSFS_ATTRIB_CLOCKGATE_DELAY = 0,
+ NVHOST_POWER_SYSFS_ATTRIB_POWERGATE_DELAY,
+ NVHOST_POWER_SYSFS_ATTRIB_REFCOUNT,
+ NVHOST_POWER_SYSFS_ATTRIB_MAX
+};
struct nvhost_device_id {
char name[NVHOST_NAME_SIZE];
@@ -89,6 +97,13 @@ struct nvhost_device {
struct list_head client_list; /* List of clients and rate requests */
struct nvhost_channel *channel; /* Channel assigned for the module */
+ struct kobject *power_kobj; /* kobject to hold power sysfs entries */
+ struct nvhost_device_power_attr *power_attrib; /* sysfs attributes */
+};
+
+struct nvhost_device_power_attr {
+ struct nvhost_device *ndev;
+ struct kobj_attribute power_attr[NVHOST_POWER_SYSFS_ATTRIB_MAX];
};
/* Register devices to nvhost bus */