From patchwork Tue Dec 22 16:43:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 2352 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Tue, 22 Dec 2009 16:45:09 +0000 Received: from bombadil.infradead.org [18.85.46.34] by gaivota.chehab.org with IMAP (fetchmail-6.3.11) for (single-drop); Tue, 22 Dec 2009 14:48:06 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NN7rA-0004Qc-UH; Tue, 22 Dec 2009 16:45:09 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754118AbZLVQoA (ORCPT + 1 other); Tue, 22 Dec 2009 11:44:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753726AbZLVQn7 (ORCPT ); Tue, 22 Dec 2009 11:43:59 -0500 Received: from smtp.nokia.com ([192.100.105.134]:39902 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754104AbZLVQnl (ORCPT ); Tue, 22 Dec 2009 11:43:41 -0500 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nBMGhT8T009151; Tue, 22 Dec 2009 10:43:38 -0600 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 22 Dec 2009 18:43:14 +0200 Received: from mgw-sa01.ext.nokia.com ([147.243.1.47]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 22 Dec 2009 18:43:13 +0200 Received: from maxwell.research.nokia.com (maxwell.research.nokia.com [172.21.50.162]) by mgw-sa01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nBMGhCdD006499; Tue, 22 Dec 2009 18:43:12 +0200 Received: from lanttu (lanttu.localdomain [192.168.239.4]) by maxwell.research.nokia.com (Postfix) with ESMTPS id 4E1DE700C3; Tue, 22 Dec 2009 18:43:12 +0200 (EET) Received: from sakke by lanttu with local (Exim 4.69) (envelope-from ) id 1NN7pH-0002Sq-W0; Tue, 22 Dec 2009 18:43:11 +0200 From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, iivanov@mm-sol.com, hverkuil@xs4all.nl, gururaj.nagendra@intel.com Subject: [RFC v2 2/7] V4L: Events: Add new ioctls for events Date: Tue, 22 Dec 2009 18:43:06 +0200 Message-Id: <1261500191-9441-2-git-send-email-sakari.ailus@maxwell.research.nokia.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1261500191-9441-1-git-send-email-sakari.ailus@maxwell.research.nokia.com> References: <4B30F713.8070004@maxwell.research.nokia.com> <1261500191-9441-1-git-send-email-sakari.ailus@maxwell.research.nokia.com> X-OriginalArrivalTime: 22 Dec 2009 16:43:13.0602 (UTC) FILETIME=[DA7B4220:01CA8325] X-Nokia-AV: Clean Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds a set of new ioctls to the V4L2 API. The ioctls conform to V4L2 Events RFC version 2.3: Signed-off-by: Sakari Ailus --- drivers/media/video/v4l2-compat-ioctl32.c | 3 +++ drivers/media/video/v4l2-ioctl.c | 3 +++ include/linux/videodev2.h | 24 ++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/v4l2-compat-ioctl32.c b/drivers/media/video/v4l2-compat-ioctl32.c index 997975d..cba704c 100644 --- a/drivers/media/video/v4l2-compat-ioctl32.c +++ b/drivers/media/video/v4l2-compat-ioctl32.c @@ -1077,6 +1077,9 @@ long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg) case VIDIOC_DBG_G_REGISTER: case VIDIOC_DBG_G_CHIP_IDENT: case VIDIOC_S_HW_FREQ_SEEK: + case VIDIOC_DQEVENT: + case VIDIOC_SUBSCRIBE_EVENT: + case VIDIOC_UNSUBSCRIBE_EVENT: ret = do_video_ioctl(file, cmd, arg); break; diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 30cc334..bfc4696 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c @@ -283,6 +283,9 @@ static const char *v4l2_ioctls[] = { [_IOC_NR(VIDIOC_DBG_G_CHIP_IDENT)] = "VIDIOC_DBG_G_CHIP_IDENT", [_IOC_NR(VIDIOC_S_HW_FREQ_SEEK)] = "VIDIOC_S_HW_FREQ_SEEK", + [_IOC_NR(VIDIOC_DQEVENT)] = "VIDIOC_DQEVENT", + [_IOC_NR(VIDIOC_SUBSCRIBE_EVENT)] = "VIDIOC_SUBSCRIBE_EVENT", + [_IOC_NR(VIDIOC_UNSUBSCRIBE_EVENT)] = "VIDIOC_UNSUBSCRIBE_EVENT", #endif }; #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 54af357..9ae9a1c 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -1536,6 +1536,27 @@ struct v4l2_streamparm { }; /* + * E V E N T S + */ + +struct v4l2_event { + __u32 count; + __u32 type; + __u32 sequence; + struct timespec timestamp; + __u32 reserved[9]; + __u8 data[64]; +}; + +struct v4l2_event_subscription { + __u32 type; + __u32 reserved[7]; +}; + +#define V4L2_EVENT_ALL 0 +#define V4L2_EVENT_PRIVATE_START 0x08000000 + +/* * A D V A N C E D D E B U G G I N G * * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS! @@ -1651,6 +1672,9 @@ struct v4l2_dbg_chip_ident { #endif #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) +#define VIDIOC_DQEVENT _IOR('V', 83, struct v4l2_event) +#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 84, struct v4l2_event_subscription) +#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 85, struct v4l2_event_subscription) /* Reminder: when adding new ioctls please add support for them to drivers/media/video/v4l2-compat-ioctl32.c as well! */