From 6cc2ba059bc9760f185834e67d9456af36bf5a9f Mon Sep 17 00:00:00 2001 From: Mayuresh Kulkarni Date: Tue, 12 Jun 2012 18:22:26 +0530 Subject: 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//acm/ where = name of device node like gr2d or gr3d etc Bug 845598 Change-Id: I6011eb90ee85b5fc576320272e657ce31f9e264d Signed-off-by: Mayuresh Kulkarni Reviewed-on: http://git-master/r/108827 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Francis Hart Reviewed-by: Terje Bergstrom --- include/linux/nvhost.h | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'include') 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 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 */ -- cgit v1.2.3