summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMayuresh Kulkarni <mkulkarni@nvidia.com>2012-06-18 12:35:01 +0530
committerSimone Willett <swillett@nvidia.com>2012-06-25 16:23:31 -0700
commitb8c4bf16077a04daf2c895be7cf8da030e45b60e (patch)
tree74f3cd4af3a41dca67411f1b33d148e293a2d0b2 /include/linux
parent5a85dacd8707c7764785b6f38172c67a8c7ef4b0 (diff)
video: tegra: host: add public APIs for power & syncpoint management
- add public APIs for power & sync-point management - all these APIs end with string _ext - all these APIs can be found in linux/nvhost.h - all these APIs take nvhost_device as first argument - all these APIs are based on the fact that host1x hardware driver is parent of all the host1x client driver - this allows clients of host1x which are outside host1x driver code to just include nvhost.h & use host1x driver interfaces - this also hides the implementation details of power & sync-point inside host1x driver code - move sync point ids for dc and nvavp to nvhost.h Bug 961009 Change-Id: I1a9ca074df87656c4d4bd246853e039a7850d56a Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-on: http://git-master/r/109219 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nvhost.h41
1 files changed, 36 insertions, 5 deletions
diff --git a/include/linux/nvhost.h b/include/linux/nvhost.h
index 2f2d615febae..f84749a75df9 100644
--- a/include/linux/nvhost.h
+++ b/include/linux/nvhost.h
@@ -27,6 +27,7 @@
#include <linux/types.h>
struct nvhost_master;
+
struct nvhost_device_power_attr;
#define NVHOST_MODULE_MAX_CLOCKS 3
@@ -34,6 +35,25 @@ struct nvhost_device_power_attr;
#define NVHOST_MODULE_NO_POWERGATE_IDS .powergate_ids = {-1, -1}
#define NVHOST_DEFAULT_CLOCKGATE_DELAY .clockgate_delay = 25
#define NVHOST_NAME_SIZE 24
+#define NVSYNCPT_INVALID (-1)
+
+/* FIXME:
+ * Sync point ids are now split into 2 files.
+ * 1 if this one and other is in
+ * drivers/video/tegra/host/host1x/host1x_syncpt.h
+ * So if someone decides to add new sync point in future
+ * please check both the header files
+ */
+#define NVSYNCPT_DISP0_A (8)
+#define NVSYNCPT_DISP1_A (9)
+#define NVSYNCPT_AVP_0 (10)
+#define NVSYNCPT_DISP0_B (20)
+#define NVSYNCPT_DISP1_B (21)
+#define NVSYNCPT_DISP0_C (24)
+#define NVSYNCPT_DISP1_C (25)
+#define NVSYNCPT_VBLANK0 (26)
+#define NVSYNCPT_VBLANK1 (27)
+#define NVSYNCPT_DSI (31)
enum nvhost_power_sysfs_attributes {
NVHOST_POWER_SYSFS_ATTRIB_CLOCKGATE_DELAY = 0,
@@ -168,13 +188,24 @@ extern int nvhost_get_irq_byname(struct nvhost_device *, const char *);
#define nvhost_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)
#define nvhost_set_drvdata(_dev, data) dev_set_drvdata(&(_dev)->dev, (data))
-static inline struct nvhost_master *nvhost_get_host(struct nvhost_device *_dev)
+
+int nvhost_bus_add_host(struct nvhost_master *host);
+
+static inline struct nvhost_device *nvhost_get_parent(struct nvhost_device *_dev)
{
- return (_dev->dev.parent) ? \
- ((struct nvhost_master *) dev_get_drvdata(_dev->dev.parent)) : \
- ((struct nvhost_master *) dev_get_drvdata(&(_dev->dev)));
+ return _dev->dev.parent ? to_nvhost_device(_dev->dev.parent) : NULL;
}
-int nvhost_bus_add_host(struct nvhost_master *host);
+/* public host1x power management APIs */
+bool nvhost_module_powered_ext(struct nvhost_device *dev);
+void nvhost_module_busy_ext(struct nvhost_device *dev);
+void nvhost_module_idle_ext(struct nvhost_device *dev);
+
+/* public host1x sync-point management APIs */
+u32 nvhost_syncpt_incr_max_ext(struct nvhost_device *dev, u32 id, u32 incrs);
+void nvhost_syncpt_cpu_incr_ext(struct nvhost_device *dev, u32 id);
+u32 nvhost_syncpt_read_ext(struct nvhost_device *dev, u32 id);
+int nvhost_syncpt_wait_timeout_ext(struct nvhost_device *dev, u32 id, u32 thresh,
+ u32 timeout, u32 *value);
#endif