From patchwork Mon Mar 24 19:33:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Frank_Sch=C3=A4fer?= X-Patchwork-Id: 3883591 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7E9209F2B6 for ; Mon, 24 Mar 2014 19:33:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8694D2022F for ; Mon, 24 Mar 2014 19:33:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9BEBA2020F for ; Mon, 24 Mar 2014 19:33:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754031AbaCXTdC (ORCPT ); Mon, 24 Mar 2014 15:33:02 -0400 Received: from mail-ee0-f45.google.com ([74.125.83.45]:43642 "EHLO mail-ee0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754024AbaCXTdA (ORCPT ); Mon, 24 Mar 2014 15:33:00 -0400 Received: by mail-ee0-f45.google.com with SMTP id d17so4795709eek.18 for ; Mon, 24 Mar 2014 12:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=i0qQD9wK+6bJbBLaB24CuUnBEpSApuTJq0Ejv59NRGE=; b=XL8JYYMwLdsk9n12QuzlMbzP7OTp2IFldqIhlXVospcJf/XcyxUiMR3lP3ZAxvLJ3m K2fDgZ021JeSPAN+vPMx+gkE7QcqNrzX9byitb3SMMq5iqGOoGFlHmiKXYxvnmI3mQ63 neZl1KPVEBbVFonEpoGxjzexzaJEUtUNsEhIOXr5nOHERJVR6aeBVUepqjTfsNauXIsp QbovSXcJV4Bw1/BBeOrpa6bv/992XMYPx6hjsNXwuxTaCnI1olKiHS7gfyGDtZ1AeF1V 21qP1zL27vezwr98rZVMVW96yGn1Rt8iX1BiQXZl6Nw0poPBDkFQHuIOniK68FK5vO+6 J0gw== X-Received: by 10.14.223.136 with SMTP id v8mr1136740eep.91.1395689579014; Mon, 24 Mar 2014 12:32:59 -0700 (PDT) Received: from Athlon64X2-5000.site (ip-109-91-213-89.unitymediagroup.de. [109.91.213.89]) by mx.google.com with ESMTPSA id m1sm35132640een.7.2014.03.24.12.32.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Mar 2014 12:32:58 -0700 (PDT) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: m.chehab@samsung.com Cc: linux-media@vger.kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= Subject: [PATCH 07/19] em28xx: move videobuf2 related data from struct em28xx to struct v4l2 Date: Mon, 24 Mar 2014 20:33:13 +0100 Message-Id: <1395689605-2705-8-git-send-email-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1395689605-2705-1-git-send-email-fschaefer.oss@googlemail.com> References: <1395689605-2705-1-git-send-email-fschaefer.oss@googlemail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Frank Schäfer --- drivers/media/usb/em28xx/em28xx-cards.c | 2 -- drivers/media/usb/em28xx/em28xx-video.c | 15 +++++++++------ drivers/media/usb/em28xx/em28xx.h | 12 ++++++------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index ff19833..a21cce1 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -2991,8 +2991,6 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, const char *chip_name = default_chip_name; dev->udev = udev; - mutex_init(&dev->vb_queue_lock); - mutex_init(&dev->vb_vbi_queue_lock); mutex_init(&dev->ctrl_urb_lock); spin_lock_init(&dev->slock); diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 7252eef..301acef 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -1049,9 +1049,10 @@ static int em28xx_vb2_setup(struct em28xx *dev) { int rc; struct vb2_queue *q; + struct em28xx_v4l2 *v4l2 = dev->v4l2; /* Setup Videobuf2 for Video capture */ - q = &dev->vb_vidq; + q = &v4l2->vb_vidq; q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; q->io_modes = VB2_READ | VB2_MMAP | VB2_USERPTR | VB2_DMABUF; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; @@ -1065,7 +1066,7 @@ static int em28xx_vb2_setup(struct em28xx *dev) return rc; /* Setup Videobuf2 for VBI capture */ - q = &dev->vb_vbiq; + q = &v4l2->vb_vbiq; q->type = V4L2_BUF_TYPE_VBI_CAPTURE; q->io_modes = VB2_READ | VB2_MMAP | VB2_USERPTR; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; @@ -2483,8 +2484,10 @@ static int em28xx_v4l2_init(struct em28xx *dev) ret = -ENODEV; goto unregister_dev; } - v4l2->vdev->queue = &dev->vb_vidq; - v4l2->vdev->queue->lock = &dev->vb_queue_lock; + mutex_init(&v4l2->vb_queue_lock); + mutex_init(&v4l2->vb_vbi_queue_lock); + v4l2->vdev->queue = &v4l2->vb_vidq; + v4l2->vdev->queue->lock = &v4l2->vb_queue_lock; /* disable inapplicable ioctls */ if (dev->board.is_webcam) { @@ -2519,8 +2522,8 @@ static int em28xx_v4l2_init(struct em28xx *dev) v4l2->vbi_dev = em28xx_vdev_init(dev, &em28xx_video_template, "vbi"); - v4l2->vbi_dev->queue = &dev->vb_vbiq; - v4l2->vbi_dev->queue->lock = &dev->vb_vbi_queue_lock; + v4l2->vbi_dev->queue = &v4l2->vb_vbiq; + v4l2->vbi_dev->queue->lock = &v4l2->vb_vbi_queue_lock; /* disable inapplicable ioctls */ v4l2_disable_ioctl(v4l2->vdev, VIDIOC_S_PARM); diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index 88d0589..b02e8b1 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h @@ -508,6 +508,12 @@ struct em28xx_v4l2 { struct video_device *vdev; struct video_device *vbi_dev; struct video_device *radio_dev; + + /* Videobuf2 */ + struct vb2_queue vb_vidq; + struct vb2_queue vb_vbiq; + struct mutex vb_queue_lock; + struct mutex vb_vbi_queue_lock; }; struct em28xx_audio { @@ -649,12 +655,6 @@ struct em28xx { struct mutex lock; struct mutex ctrl_urb_lock; /* protects urb_buf */ - /* Videobuf2 */ - struct vb2_queue vb_vidq; - struct vb2_queue vb_vbiq; - struct mutex vb_queue_lock; - struct mutex vb_vbi_queue_lock; - /* resources in use */ unsigned int resources;