nvavp: Add ioctl for wake_avp
Mandar Potdar [Mon, 2 Apr 2012 14:06:05 +0000 (19:06 +0530)]
Add wake_avp ioctl which provides way for user-mode driver to
simply wake-up the AVP.

bug 914504

Change-Id: I3075ba944d39749559f2c340a4851902821c344f
Signed-off-by: Mandar Potdar <mpotdar@nvidia.com>
Reviewed-on: http://git-master/r/93877
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Gajanan Bhat <gbhat@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>

drivers/media/video/tegra/nvavp/nvavp_dev.c
include/linux/tegra_nvavp.h

index 407e35b..c842fc0 100644 (file)
@@ -1013,6 +1013,16 @@ err_cmdbuf_mmap:
        return ret;
 }
 
+static int nvavp_wake_avp_ioctl(struct file *filp, unsigned int cmd,
+                                                       unsigned long arg)
+{
+       wmb();
+       /* wake up avp */
+       writel(0xA0000001, NVAVP_OS_OUTBOX);
+       return 0;
+}
+
+
 static int tegra_nvavp_open(struct inode *inode, struct file *filp)
 {
        struct miscdevice *miscdev = filp->private_data;
@@ -1103,6 +1113,9 @@ static long tegra_nvavp_ioctl(struct file *filp, unsigned int cmd,
        case NVAVP_IOCTL_GET_CLOCK:
                ret = nvavp_get_clock_ioctl(filp, cmd, arg);
                break;
+       case NVAVP_IOCTL_WAKE_AVP:
+               ret = nvavp_wake_avp_ioctl(filp, cmd, arg);
+               break;
        default:
                ret = -EINVAL;
                break;
index 32dc4c6..9710544 100644 (file)
@@ -76,9 +76,10 @@ struct nvavp_clock_args {
                                        struct nvavp_clock_args)
 #define NVAVP_IOCTL_GET_CLOCK          _IOR(NVAVP_IOCTL_MAGIC, 0x65, \
                                        struct nvavp_clock_args)
-
+#define NVAVP_IOCTL_WAKE_AVP           _IOR(NVAVP_IOCTL_MAGIC, 0x66, \
+                                       __u32)
 
 #define NVAVP_IOCTL_MIN_NR             _IOC_NR(NVAVP_IOCTL_SET_NVMAP_FD)
-#define NVAVP_IOCTL_MAX_NR             _IOC_NR(NVAVP_IOCTL_GET_CLOCK)
+#define NVAVP_IOCTL_MAX_NR             _IOC_NR(NVAVP_IOCTL_WAKE_AVP)
 
 #endif /* __LINUX_TEGRA_NVAVP_H */