From patchwork Fri Dec 14 16:40:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 10731429 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF72514E5 for ; Fri, 14 Dec 2018 16:40:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D8912D794 for ; Fri, 14 Dec 2018 16:40:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51A8C2D7FF; Fri, 14 Dec 2018 16:40:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 000152D77A for ; Fri, 14 Dec 2018 16:40:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729982AbeLNQkm (ORCPT ); Fri, 14 Dec 2018 11:40:42 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38970 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729619AbeLNQkm (ORCPT ); Fri, 14 Dec 2018 11:40:42 -0500 Received: by mail-wr1-f65.google.com with SMTP id t27so6050701wra.6 for ; Fri, 14 Dec 2018 08:40:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oYcA9EHF8OFyGzhe2E5tic7eN4P0pkwHdAnCokxENPA=; b=EetMesHUAVKjIAccLAxAunVjFJ+n0oWKHRxHYdDt0/iZbt2N6G8OLBSGxZtMxKy6ac yAswuA5Y6OH3kwiGqnJy2So218h68XqzjAOJgc4jHmra82iEcnAKcCuVg+jTHGbWF6Vd lUMlBSh3ZLdZeGbRQ11hteK3KN4PBPv1criIlroqwu++3uZ7S6AES+wLQyu85JS0kyD6 o+Qofz5/+hOhlg7BlI99t/DuM2X953sHfx+pIXbCPnvTqgbIcEc7Pv1kB7HchaW3V7wP nW86BD5D+Wcx6WD5xlbHHQdMD7CgYzPE1u9jZ9Uy9jGJtB4TwQFSHp03a7bC0ogsqjUC islA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oYcA9EHF8OFyGzhe2E5tic7eN4P0pkwHdAnCokxENPA=; b=mn0Bm4eqqN0N6ELc8R1VudhYoXl+eOrFrtffrZmSWeANnlY2JLwC4TB5aHRGUL7u9T FG02+CiE+zPgVGYuJyMVQNiPzjizV0yudIIA9Dq4yYFA3CPRJTULuR9bToVTnK3jwxIF 5tPf6A5H7Ax9aVj+3csKkCaWJNVBS+ewkfQgSiAMujlLN+stQ6Tb7Lq+n6kTlzt88kpk ZZAlIhp9nwospOW1C9iCvxOCr2Oylz9qjNR/KpZdKNmvq5pcK0/DZ5XDY3s4l4oc5WL4 JlbNW/aYrZxpbnsjx++nMf4hmRM76rvoTTEV7cssMJv1ayvTKxwozy0JpX7+ZjBml/ma qTcQ== X-Gm-Message-State: AA+aEWZdR0GnCKyO116VXED3GhjJNCUMIYAF28hsq1Lez1fIcYXJdE7C 5qptuuvQqQL/EqrzI8J7Vpx4Xh8z X-Google-Smtp-Source: AFSGD/VQI2xNSGdtqNBA7nN627REP4/VEbsVoInPu6IXvBlB5d7L1fDRK+1P1x2dXlSQHcbOxLrXkQ== X-Received: by 2002:adf:fc09:: with SMTP id i9mr3055476wrr.299.1544805640310; Fri, 14 Dec 2018 08:40:40 -0800 (PST) Received: from ped.lan (ip5f5abcae.dynamic.kabel-deutschland.de. [95.90.188.174]) by smtp.googlemail.com with ESMTPSA id c13sm7680392wrb.38.2018.12.14.08.40.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 08:40:39 -0800 (PST) From: Philipp Zabel To: linux-media@vger.kernel.org Cc: Hans Verkuil , Philipp Zabel Subject: [PATCH 1/8] media: gspca: ov534: replace msleep(10) with usleep_range Date: Fri, 14 Dec 2018 17:40:24 +0100 Message-Id: <20181214164031.16757-2-philipp.zabel@gmail.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214164031.16757-1-philipp.zabel@gmail.com> References: <20181214164031.16757-1-philipp.zabel@gmail.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-Virus-Scanned: ClamAV using ClamSMTP For short waits, usleep_range should be used instead of msleep, see Documentation/timers/timers-howto.txt. Signed-off-by: Philipp Zabel --- drivers/media/usb/gspca/ov534.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/gspca/ov534.c b/drivers/media/usb/gspca/ov534.c index d06dc0755b9a..44f06a58bb67 100644 --- a/drivers/media/usb/gspca/ov534.c +++ b/drivers/media/usb/gspca/ov534.c @@ -679,7 +679,7 @@ static int sccb_check_status(struct gspca_dev *gspca_dev) int i; for (i = 0; i < 5; i++) { - msleep(10); + usleep_range(10000, 20000); data = ov534_reg_read(gspca_dev, OV534_REG_STATUS); switch (data) { @@ -1277,7 +1277,7 @@ static int sd_init(struct gspca_dev *gspca_dev) /* reset sensor */ sccb_reg_write(gspca_dev, 0x12, 0x80); - msleep(10); + usleep_range(10000, 20000); /* probe the sensor */ sccb_reg_read(gspca_dev, 0x0a); From patchwork Fri Dec 14 16:40:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 10731431 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E61014E5 for ; Fri, 14 Dec 2018 16:40:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E16CA2D845 for ; Fri, 14 Dec 2018 16:40:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5E6F2D85A; Fri, 14 Dec 2018 16:40:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86E7D2D845 for ; Fri, 14 Dec 2018 16:40:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730090AbeLNQkp (ORCPT ); Fri, 14 Dec 2018 11:40:45 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42970 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729619AbeLNQko (ORCPT ); Fri, 14 Dec 2018 11:40:44 -0500 Received: by mail-wr1-f66.google.com with SMTP id q18so6043286wrx.9 for ; Fri, 14 Dec 2018 08:40:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JIPWtui+JS8yVaI5mPX+bGhjb5g1JesbJdchtjV2uns=; b=sOcbuqqSlt0dQfhv2KX9lOvbD1FWpHTtGtc9OMfsyugy4yC+7JEbC3/fkHYfR/UpSV hLa2MbzDyYG+F65HH1O2x8XknNlJtjSeOWCDTnQL74cIahDvWhyeX21Pk8lN7yNCvqEO iYBNOx0ZAoWHu0hsMI1BWn6TZS0yVyCBJyvciJmHT3I5fJ54+2bFFI8sPfmj42bzI2aL gGZSomM/ynyD8pxRX6weXjwYB/7QHQpcqS4s2tVdvNqpnNefPqN5p4/1pgNjYaRLFE17 n6R4kSLMQgWTObWzHyYvurMWsepDg77tTWISGfSVUhZvICQtxdQy8d0qlap0yUn+ycPM uUHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JIPWtui+JS8yVaI5mPX+bGhjb5g1JesbJdchtjV2uns=; b=E+EZzhAPUkBRVMuayB7/uT9xGBazT/68C3la1iB9dP1xFMLWV220gZ15i64ScJNOOv SpgWRS5fEbgbrWpKwBlS+qfgAWKQ2P4jf6G3yMDyrmoUFauyHqhIV+hUypHmEfQWutwk xfmMUKXnYsHZ07JM+uW4iu5NZByWlbJHfEEcsZAchFH0iZPMNL4O8F/kUYHTPw6oF1Zu Qr/y9Y6JpG2RG6vRRO+tuf0+H5AtqT3bl/fetTuJXRVr7imbUf8YtqnYtnK0V3OOepm0 Pqclq8wI/KqKyYs5S2+tIvXgbubFgA7HEOteAxBrlZnTxEjc5cpvCcSoxT0/kditggf3 qDaA== X-Gm-Message-State: AA+aEWbN/AWGzmyjhG3kAGm8FTsKKTBCLBslfy6v5I2yYq5As9rSfn0d OrLx6lYnE/vUm85Wk/GNK7RWRqpp X-Google-Smtp-Source: AFSGD/VaYbxjJpyxIwEXfJDZ23rRdte2EndHqJcVwT0xTHFTUQfTqU5JLoINJa+CCaGoHF6p0P373g== X-Received: by 2002:a5d:480d:: with SMTP id l13mr3408296wrq.175.1544805642205; Fri, 14 Dec 2018 08:40:42 -0800 (PST) Received: from ped.lan (ip5f5abcae.dynamic.kabel-deutschland.de. [95.90.188.174]) by smtp.googlemail.com with ESMTPSA id c13sm7680392wrb.38.2018.12.14.08.40.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 08:40:41 -0800 (PST) From: Philipp Zabel To: linux-media@vger.kernel.org Cc: Hans Verkuil , Philipp Zabel Subject: [PATCH 2/8] media: gspca: support multiple pixel formats in ENUM_FRAMEINTERVALS Date: Fri, 14 Dec 2018 17:40:25 +0100 Message-Id: <20181214164031.16757-3-philipp.zabel@gmail.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214164031.16757-1-philipp.zabel@gmail.com> References: <20181214164031.16757-1-philipp.zabel@gmail.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-Virus-Scanned: ClamAV using ClamSMTP If a driver supports multiple pixel formats with the same frame size, ENUM_FRAMEINTERVALS will currently only work for the first pixel format. Fix this by adding pixelformat support to wxh_to_mode(). Signed-off-by: Philipp Zabel --- drivers/media/usb/gspca/gspca.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c index 3137f5d89d80..13361cfa6903 100644 --- a/drivers/media/usb/gspca/gspca.c +++ b/drivers/media/usb/gspca/gspca.c @@ -912,13 +912,14 @@ static void gspca_set_default_mode(struct gspca_dev *gspca_dev) } static int wxh_to_mode(struct gspca_dev *gspca_dev, - int width, int height) + int width, int height, u32 pixelformat) { int i; for (i = 0; i < gspca_dev->cam.nmodes; i++) { if (width == gspca_dev->cam.cam_mode[i].width - && height == gspca_dev->cam.cam_mode[i].height) + && height == gspca_dev->cam.cam_mode[i].height + && pixelformat == gspca_dev->cam.cam_mode[i].pixelformat) return i; } return -EINVAL; @@ -1152,7 +1153,8 @@ static int vidioc_enum_frameintervals(struct file *filp, void *priv, int mode; __u32 i; - mode = wxh_to_mode(gspca_dev, fival->width, fival->height); + mode = wxh_to_mode(gspca_dev, fival->width, fival->height, + fival->pixel_format); if (mode < 0) return -EINVAL; From patchwork Fri Dec 14 16:40:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 10731433 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD39B112C for ; Fri, 14 Dec 2018 16:40:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B3D42D855 for ; Fri, 14 Dec 2018 16:40:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FC442D863; Fri, 14 Dec 2018 16:40:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E27482D794 for ; Fri, 14 Dec 2018 16:40:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730198AbeLNQkq (ORCPT ); Fri, 14 Dec 2018 11:40:46 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:34967 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729923AbeLNQkp (ORCPT ); Fri, 14 Dec 2018 11:40:45 -0500 Received: by mail-wm1-f66.google.com with SMTP id c126so6411871wmh.0 for ; Fri, 14 Dec 2018 08:40:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cM2oDmuzvLvmEn6yyFJ6F8PgqNDtdcssA+pnNdwFjXg=; b=lotR3Idk7LOnEF8wuuA2LnUPk53szQdTZAGj7jdtpZXNrBHN0jmyXKrFr9LwHQ7gIY PYitFZAgIwXECJ2qH9TwbhKOmgT2N4YsHnH5rLkqhqnIt4EIJp6TIKKhx1JYIoLV+XJ2 Fm+XHu5BMt+ikBMySwMbPI0mFVk5JQJETKxfRijViTxOk7RtlXYHG3HnFHmacZeJLJCx 8c4Rk1aSxAHvsnJdf7AzxudKTtO/ZBCEDSLmUW/gkXZTpZQEXdsn/XrnaTzzXynbE/eI Fd7k8exaMe50Ph5Lx+j3OmDcjgGKGx1JKSn24q2vi2AqZpz3mG1MMqt5kavQo/g0rmx1 HFoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cM2oDmuzvLvmEn6yyFJ6F8PgqNDtdcssA+pnNdwFjXg=; b=X5SRgMfh5PprZrg0KxUor9run9n0+RovoKM8YVBnK4z63Je4Tan0RCzrPOHzhm0K5A nP1vbw3YoK83aZLBtHRL6RlAWTbWi6VvfoTA/fvERXNvIdE/lpUqmwu55B3ompEFn0zh Vx8NCXGDKJU3z5JiU56h5A6i8GGxDCUVGLoH7Oqy4IMEx0e72Oo5EYhWwWxlNT/T+C4c N5J+TzQDhFATKgrZ2S7mLj60AMFRnqvxUyXOLXY02HpbQml0/cKk2mfJPDUFvCf98I5/ PpXhhqiMTqm5LnKiHyCU1iLqKIdAEoan22OsOAiUY2l7xPOgXOPk+lumjBdYzJPOJtEI 3Nuw== X-Gm-Message-State: AA+aEWYW+A2FFjHRfujzbR4AchDvhW9y2sk8ZLFlzgfmYNW39OrrmMvN 4zETKlWP6osD+OHuIedy06Gwbkca X-Google-Smtp-Source: AFSGD/V45rwN2MKwTBZsBgHnQJFjGiJVmNzYhC9ug+2XcWFKICkym4n6tdN70TjQ6zhrH+j+8xS3Wg== X-Received: by 2002:a1c:b70b:: with SMTP id h11mr4006736wmf.72.1544805643442; Fri, 14 Dec 2018 08:40:43 -0800 (PST) Received: from ped.lan (ip5f5abcae.dynamic.kabel-deutschland.de. [95.90.188.174]) by smtp.googlemail.com with ESMTPSA id c13sm7680392wrb.38.2018.12.14.08.40.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 08:40:42 -0800 (PST) From: Philipp Zabel To: linux-media@vger.kernel.org Cc: Hans Verkuil , Philipp Zabel Subject: [PATCH 3/8] media: gspca: support multiple pixel formats in TRY_FMT Date: Fri, 14 Dec 2018 17:40:26 +0100 Message-Id: <20181214164031.16757-4-philipp.zabel@gmail.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214164031.16757-1-philipp.zabel@gmail.com> References: <20181214164031.16757-1-philipp.zabel@gmail.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-Virus-Scanned: ClamAV using ClamSMTP If a driver supports multiple pixel formats with the same frame size, TRY_FMT will currently always return the first pixel format. Fix this by adding pixelformat support to wxh_to_nearest_mode(). Signed-off-by: Philipp Zabel --- drivers/media/usb/gspca/gspca.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c index 13361cfa6903..ac70b36d67b7 100644 --- a/drivers/media/usb/gspca/gspca.c +++ b/drivers/media/usb/gspca/gspca.c @@ -926,10 +926,16 @@ static int wxh_to_mode(struct gspca_dev *gspca_dev, } static int wxh_to_nearest_mode(struct gspca_dev *gspca_dev, - int width, int height) + int width, int height, u32 pixelformat) { int i; + for (i = gspca_dev->cam.nmodes; --i > 0; ) { + if (width >= gspca_dev->cam.cam_mode[i].width + && height >= gspca_dev->cam.cam_mode[i].height + && pixelformat == gspca_dev->cam.cam_mode[i].pixelformat) + return i; + } for (i = gspca_dev->cam.nmodes; --i > 0; ) { if (width >= gspca_dev->cam.cam_mode[i].width && height >= gspca_dev->cam.cam_mode[i].height) @@ -1059,7 +1065,7 @@ static int try_fmt_vid_cap(struct gspca_dev *gspca_dev, fmt->fmt.pix.pixelformat, w, h); /* search the nearest mode for width and height */ - mode = wxh_to_nearest_mode(gspca_dev, w, h); + mode = wxh_to_nearest_mode(gspca_dev, w, h, fmt->fmt.pix.pixelformat); /* OK if right palette */ if (gspca_dev->cam.cam_mode[mode].pixelformat From patchwork Fri Dec 14 16:40:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 10731435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 573F7112C for ; Fri, 14 Dec 2018 16:40:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C92762D7E8 for ; Fri, 14 Dec 2018 16:40:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C70E42D802; Fri, 14 Dec 2018 16:40:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B1B82D81C for ; Fri, 14 Dec 2018 16:40:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730200AbeLNQkr (ORCPT ); Fri, 14 Dec 2018 11:40:47 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:50675 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729619AbeLNQkr (ORCPT ); Fri, 14 Dec 2018 11:40:47 -0500 Received: by mail-wm1-f65.google.com with SMTP id n190so6315133wmd.0 for ; Fri, 14 Dec 2018 08:40:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lQVSNSAnQ5BA6yU8XgWw7eEzETxjR2LJ00O6uFVQmNg=; b=PypQdqBIJ/o1wWI6LRLsNAqVkUlmVDrukWw9U9J91W92JXSVLRWpudgMGncAvEZLva ayC4gEtdmi23CGHyumvxwJGzloY6Fl/OIBPdVZCrGUEuj2eiU32J7B7oOAbSSTVeqQUg aUYimdBH2PVbCyD7dsC5wPFX2Tl7VZgG9y90CBJTX5bzlW94z+BpLKENX1vJD0WGmiK6 hwPAn6snILtisTo5oMIg1zhOQ+RAuHse/CCNqwoHEAZFBbKZgKMwCP9gLCcVlp/gtrBk d6LFW7pazudK8AY5qKBDQXjguqSqtYvOzCqT96EGS21nPBle4Cr1qtvJYV8LrwdRILwf pPZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lQVSNSAnQ5BA6yU8XgWw7eEzETxjR2LJ00O6uFVQmNg=; b=bSzaT8OR+sGD3HR63xK7HCTk/y12vc9zK+cEUtkxuK1/cieGzHsmqmLWV0bpS7kjBi 2MnKU+GW6oWTwO+zuat0GELASreWzCHyabHEzy8kBcMAd2EhNmoZ18JIg0hKMqXhOrsj I/TGTg2GJHCYmoDOAFJekM3Gn/TEhvRQbm0xFD5CcwSzSuWqUimHVTaIC5fPCDCjVPFr XOy/5b4bpI7x7R3M4UqUBKmIhxE5xNnHLHtiB81b/jTxdVoYCfcmGHQbS5XIBUEgACo4 47Ryf2fENZvjcvI/xW/6ym1zlVzX66AJsx6uC0zSfZfSVtfXNH/pu3B/c+f0IYQtF86i pYlA== X-Gm-Message-State: AA+aEWZurLbpNr8Cvf2PSqY0lmVxvaVryCgUN2vmjzCCqls6flHiIcaL zS16kKb1CY1qaPSXE9+f+qztlUf/ X-Google-Smtp-Source: AFSGD/VEvteqpRHinbu+j0vV+uePOrI1bYxc1pSWKvtL6OpGnesxgpbX+iGqUEjewt0d4VCj/c8yzg== X-Received: by 2002:a1c:68d7:: with SMTP id d206mr3685799wmc.43.1544805644899; Fri, 14 Dec 2018 08:40:44 -0800 (PST) Received: from ped.lan (ip5f5abcae.dynamic.kabel-deutschland.de. [95.90.188.174]) by smtp.googlemail.com with ESMTPSA id c13sm7680392wrb.38.2018.12.14.08.40.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 08:40:43 -0800 (PST) From: Philipp Zabel To: linux-media@vger.kernel.org Cc: Hans Verkuil , Philipp Zabel Subject: [PATCH 4/8] media: gspca: ov543-ov772x: move video format specific registers into bridge_start Date: Fri, 14 Dec 2018 17:40:27 +0100 Message-Id: <20181214164031.16757-5-philipp.zabel@gmail.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214164031.16757-1-philipp.zabel@gmail.com> References: <20181214164031.16757-1-philipp.zabel@gmail.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-Virus-Scanned: ClamAV using ClamSMTP In preparation for adding SGBRG8 as a second video format besides YUYV, move video format specific register settings from the bridge_init array into the bridge_start arrays. Signed-off-by: Philipp Zabel --- drivers/media/usb/gspca/ov534.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/media/usb/gspca/ov534.c b/drivers/media/usb/gspca/ov534.c index 44f06a58bb67..077c49a74709 100644 --- a/drivers/media/usb/gspca/ov534.c +++ b/drivers/media/usb/gspca/ov534.c @@ -411,9 +411,7 @@ static const u8 sensor_start_qvga_767x[][2] = { }; static const u8 bridge_init_772x[][2] = { - { 0xc2, 0x0c }, { 0x88, 0xf8 }, - { 0xc3, 0x69 }, { 0x89, 0xff }, { 0x76, 0x03 }, { 0x92, 0x01 }, @@ -439,7 +437,6 @@ static const u8 bridge_init_772x[][2] = { { 0x1f, 0x81 }, { 0x34, 0x05 }, { 0xe3, 0x04 }, - { 0x88, 0x00 }, { 0x89, 0x00 }, { 0x76, 0x00 }, { 0xe7, 0x2e }, @@ -460,13 +457,7 @@ static const u8 bridge_init_772x[][2] = { { 0x1d, 0x08 }, /* turn on UVC header */ { 0x1d, 0x0e }, /* .. */ - { 0x8d, 0x1c }, - { 0x8e, 0x80 }, { 0xe5, 0x04 }, - - { 0xc0, 0x50 }, - { 0xc1, 0x3c }, - { 0xc2, 0x0c }, }; static const u8 sensor_init_772x[][2] = { { 0x12, 0x80 }, @@ -562,6 +553,7 @@ static const u8 sensor_init_772x[][2] = { { 0x0c, 0xd0 } }; static const u8 bridge_start_vga_772x[][2] = { + {0x88, 0x00}, {0x1c, 0x00}, {0x1d, 0x40}, {0x1d, 0x02}, @@ -569,8 +561,12 @@ static const u8 bridge_start_vga_772x[][2] = { {0x1d, 0x02}, {0x1d, 0x58}, {0x1d, 0x00}, + {0x8d, 0x1c}, + {0x8e, 0x80}, {0xc0, 0x50}, {0xc1, 0x3c}, + {0xc2, 0x0c}, + {0xc3, 0x69}, }; static const u8 sensor_start_vga_772x[][2] = { {0x12, 0x00}, @@ -583,6 +579,7 @@ static const u8 sensor_start_vga_772x[][2] = { {0x65, 0x20}, }; static const u8 bridge_start_qvga_772x[][2] = { + {0x88, 0x00}, {0x1c, 0x00}, {0x1d, 0x40}, {0x1d, 0x02}, @@ -590,8 +587,12 @@ static const u8 bridge_start_qvga_772x[][2] = { {0x1d, 0x01}, {0x1d, 0x4b}, {0x1d, 0x00}, + {0x8d, 0x1c}, + {0x8e, 0x80}, {0xc0, 0x28}, {0xc1, 0x1e}, + {0xc2, 0x0c}, + {0xc3, 0x69}, }; static const u8 sensor_start_qvga_772x[][2] = { {0x12, 0x40}, From patchwork Fri Dec 14 16:40:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 10731437 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1DF5F1580 for ; Fri, 14 Dec 2018 16:40:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 907272D810 for ; Fri, 14 Dec 2018 16:40:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8533C2D862; Fri, 14 Dec 2018 16:40:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEE4C2D810 for ; Fri, 14 Dec 2018 16:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730221AbeLNQkt (ORCPT ); Fri, 14 Dec 2018 11:40:49 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:33656 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729923AbeLNQks (ORCPT ); Fri, 14 Dec 2018 11:40:48 -0500 Received: by mail-wm1-f68.google.com with SMTP id r24so16633088wmh.0 for ; Fri, 14 Dec 2018 08:40:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iLohm9ftKuz8UtcP4m2Wxmj/Qv7F8u2X9gOinGzMN4c=; b=rcQM1lAWXbGJHZ/nQWg0A80cWYJcnsqV0fPEZbAwX2E9rBbkKLOiIX9MZROQCM40xd d+vzpBLuRz8099RPejHYFfARKhsr9T2c9mwkS2fX5sGFuPcbuYv73gG0xdFdeIrteEbl r6jh+9QOt2nm6O66vvjyH9AKXSmq2aES3lk7aSgcgU68QuFDEUeuSr2FgeZc2fVVwRCP +gRqnPCObLkI6bHCQ8zL5Z0p1zDMmLQCbz5leoyNdKprFXgY3SuDr+tEaqqKXL6z1vh7 +u2quU5tcNnbOcVtSWZW63Kp57ZA1tdwDm+vJXndthqDV63YcdbPFpFcT/t5O3p8Y/EV Csww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iLohm9ftKuz8UtcP4m2Wxmj/Qv7F8u2X9gOinGzMN4c=; b=Am+AZ7Kcx1qy7q+NV0Xrf/HCYTsJ+rMkVjG6fSJopM1iY7LdzNmEQ6KqC2jdnlHUdy faV+MJJwCLw7hem0Ya8inNjWQ88XHPJLRcfe+e9ymOSGzE+lvNb8VwVz9sx2JFK73l8O 4G8nvpscXWkST/Y8IKlc7Ke/ICVZNjlDqVTLR7ZoFEeGZs9zGZYL3c8MUq/YsDFvJxlS S0lnGgOZkqgaoobw/6ZHNHNLz16sHYFucLE2MrfRHnGyYYkPrXmwJyDNnP1AKCmdyuk+ GRPRDyKf7dkC7yWK5SvYb16TbzuMWB5P0x/ihl+k7cYpMGeFsIuwmmmY8O0CjQzK3imj Cz/Q== X-Gm-Message-State: AA+aEWZVrH0Q1A+J2nIycQPRNEUCELfF31/+VjdHwSa6eaf6QMcnGMiY PzFh6tLeYE0XBWCbR5CvCLSod21r X-Google-Smtp-Source: AFSGD/WMyXQ/H8cgvZwI/Gt+degFmJ3e/7lfim56aT3Y50UJaKBYewjqdd3AD3m0p/7RKYcWggSofA== X-Received: by 2002:a1c:1112:: with SMTP id 18mr4140395wmr.30.1544805646156; Fri, 14 Dec 2018 08:40:46 -0800 (PST) Received: from ped.lan (ip5f5abcae.dynamic.kabel-deutschland.de. [95.90.188.174]) by smtp.googlemail.com with ESMTPSA id c13sm7680392wrb.38.2018.12.14.08.40.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 08:40:45 -0800 (PST) From: Philipp Zabel To: linux-media@vger.kernel.org Cc: Hans Verkuil , Philipp Zabel Subject: [PATCH 5/8] media: gspca: ov534-ov772x: add SGBRG8 bayer mode support Date: Fri, 14 Dec 2018 17:40:28 +0100 Message-Id: <20181214164031.16757-6-philipp.zabel@gmail.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214164031.16757-1-philipp.zabel@gmail.com> References: <20181214164031.16757-1-philipp.zabel@gmail.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-Virus-Scanned: ClamAV using ClamSMTP Add support to pass through the sensor's native SGBRG8 bayer pattern, allowing to cut the required USB bandwidth in half. Signed-off-by: Philipp Zabel --- drivers/media/usb/gspca/ov534.c | 115 +++++++++++++++++++++++++++----- 1 file changed, 98 insertions(+), 17 deletions(-) diff --git a/drivers/media/usb/gspca/ov534.c b/drivers/media/usb/gspca/ov534.c index 077c49a74709..5b73f7f58ae6 100644 --- a/drivers/media/usb/gspca/ov534.c +++ b/drivers/media/usb/gspca/ov534.c @@ -103,6 +103,16 @@ static const struct v4l2_pix_format ov772x_mode[] = { .sizeimage = 640 * 480 * 2, .colorspace = V4L2_COLORSPACE_SRGB, .priv = 0}, + {320, 240, V4L2_PIX_FMT_SGRBG8, V4L2_FIELD_NONE, + .bytesperline = 320, + .sizeimage = 320 * 240, + .colorspace = V4L2_COLORSPACE_SRGB, + .priv = 1}, + {640, 480, V4L2_PIX_FMT_SGRBG8, V4L2_FIELD_NONE, + .bytesperline = 640, + .sizeimage = 640 * 480, + .colorspace = V4L2_COLORSPACE_SRGB, + .priv = 0}, }; static const struct v4l2_pix_format ov767x_mode[] = { {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, @@ -127,6 +137,14 @@ static const struct framerates ov772x_framerates[] = { .rates = vga_rates, .nrates = ARRAY_SIZE(vga_rates), }, + { /* 320x240 SGBRG8 */ + .rates = qvga_rates, + .nrates = ARRAY_SIZE(qvga_rates), + }, + { /* 640x480 SGBRG8 */ + .rates = vga_rates, + .nrates = ARRAY_SIZE(vga_rates), + }, }; struct reg_array { @@ -552,7 +570,7 @@ static const u8 sensor_init_772x[][2] = { { 0x8e, 0x00 }, /* De-noise threshold */ { 0x0c, 0xd0 } }; -static const u8 bridge_start_vga_772x[][2] = { +static const u8 bridge_start_vga_yuyv_772x[][2] = { {0x88, 0x00}, {0x1c, 0x00}, {0x1d, 0x40}, @@ -568,7 +586,7 @@ static const u8 bridge_start_vga_772x[][2] = { {0xc2, 0x0c}, {0xc3, 0x69}, }; -static const u8 sensor_start_vga_772x[][2] = { +static const u8 sensor_start_vga_yuyv_772x[][2] = { {0x12, 0x00}, {0x17, 0x26}, {0x18, 0xa0}, @@ -577,8 +595,9 @@ static const u8 sensor_start_vga_772x[][2] = { {0x29, 0xa0}, {0x2c, 0xf0}, {0x65, 0x20}, + {0x67, 0x00}, }; -static const u8 bridge_start_qvga_772x[][2] = { +static const u8 bridge_start_qvga_yuyv_772x[][2] = { {0x88, 0x00}, {0x1c, 0x00}, {0x1d, 0x40}, @@ -594,7 +613,7 @@ static const u8 bridge_start_qvga_772x[][2] = { {0xc2, 0x0c}, {0xc3, 0x69}, }; -static const u8 sensor_start_qvga_772x[][2] = { +static const u8 sensor_start_qvga_yuyv_772x[][2] = { {0x12, 0x40}, {0x17, 0x3f}, {0x18, 0x50}, @@ -603,6 +622,61 @@ static const u8 sensor_start_qvga_772x[][2] = { {0x29, 0x50}, {0x2c, 0x78}, {0x65, 0x2f}, + {0x67, 0x00}, +}; +static const u8 bridge_start_vga_gbrg_772x[][2] = { + {0x88, 0x08}, + {0x1c, 0x00}, + {0x1d, 0x00}, + {0x1d, 0x02}, + {0x1d, 0x00}, + {0x1d, 0x01}, + {0x1d, 0x2c}, + {0x1d, 0x00}, + {0x8d, 0x00}, + {0x8e, 0x00}, + {0xc0, 0x50}, + {0xc1, 0x3c}, + {0xc2, 0x01}, + {0xc3, 0x01}, +}; +static const u8 sensor_start_vga_gbrg_772x[][2] = { + {0x12, 0x01}, + {0x17, 0x26}, + {0x18, 0xa0}, + {0x19, 0x07}, + {0x1a, 0xf0}, + {0x29, 0xa0}, + {0x2c, 0xf0}, + {0x65, 0x20}, + {0x67, 0x02}, +}; +static const u8 bridge_start_qvga_gbrg_772x[][2] = { + {0x88, 0x08}, + {0x1c, 0x00}, + {0x1d, 0x00}, + {0x1d, 0x02}, + {0x1d, 0x00}, + {0x1d, 0x00}, + {0x1d, 0x4b}, + {0x1d, 0x00}, + {0x8d, 0x00}, + {0x8e, 0x00}, + {0xc0, 0x28}, + {0xc1, 0x1e}, + {0xc2, 0x01}, + {0xc3, 0x01}, +}; +static const u8 sensor_start_qvga_gbrg_772x[][2] = { + {0x12, 0x41}, + {0x17, 0x3f}, + {0x18, 0x50}, + {0x19, 0x03}, + {0x1a, 0x78}, + {0x29, 0x50}, + {0x2c, 0x78}, + {0x65, 0x2f}, + {0x67, 0x02}, }; static void ov534_reg_write(struct gspca_dev *gspca_dev, u16 reg, u8 val) @@ -1316,25 +1390,33 @@ static int sd_start(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; int mode; - static const struct reg_array bridge_start[NSENSORS][2] = { + static const struct reg_array bridge_start[NSENSORS][4] = { [SENSOR_OV767x] = {{bridge_start_qvga_767x, ARRAY_SIZE(bridge_start_qvga_767x)}, {bridge_start_vga_767x, ARRAY_SIZE(bridge_start_vga_767x)}}, - [SENSOR_OV772x] = {{bridge_start_qvga_772x, - ARRAY_SIZE(bridge_start_qvga_772x)}, - {bridge_start_vga_772x, - ARRAY_SIZE(bridge_start_vga_772x)}}, + [SENSOR_OV772x] = {{bridge_start_qvga_yuyv_772x, + ARRAY_SIZE(bridge_start_qvga_yuyv_772x)}, + {bridge_start_vga_yuyv_772x, + ARRAY_SIZE(bridge_start_vga_yuyv_772x)}, + {bridge_start_qvga_gbrg_772x, + ARRAY_SIZE(bridge_start_qvga_gbrg_772x)}, + {bridge_start_vga_gbrg_772x, + ARRAY_SIZE(bridge_start_vga_gbrg_772x)} }, }; - static const struct reg_array sensor_start[NSENSORS][2] = { + static const struct reg_array sensor_start[NSENSORS][4] = { [SENSOR_OV767x] = {{sensor_start_qvga_767x, ARRAY_SIZE(sensor_start_qvga_767x)}, {sensor_start_vga_767x, ARRAY_SIZE(sensor_start_vga_767x)}}, - [SENSOR_OV772x] = {{sensor_start_qvga_772x, - ARRAY_SIZE(sensor_start_qvga_772x)}, - {sensor_start_vga_772x, - ARRAY_SIZE(sensor_start_vga_772x)}}, + [SENSOR_OV772x] = {{sensor_start_qvga_yuyv_772x, + ARRAY_SIZE(sensor_start_qvga_yuyv_772x)}, + {sensor_start_vga_yuyv_772x, + ARRAY_SIZE(sensor_start_vga_yuyv_772x)}, + {sensor_start_qvga_gbrg_772x, + ARRAY_SIZE(sensor_start_qvga_gbrg_772x)}, + {sensor_start_vga_gbrg_772x, + ARRAY_SIZE(sensor_start_vga_gbrg_772x)} }, }; /* (from ms-win trace) */ @@ -1440,10 +1522,9 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, /* If this packet is marked as EOF, end the frame */ } else if (data[1] & UVC_STREAM_EOF) { sd->last_pts = 0; - if (gspca_dev->pixfmt.pixelformat == V4L2_PIX_FMT_YUYV + if (gspca_dev->pixfmt.pixelformat != V4L2_PIX_FMT_JPEG && gspca_dev->image_len + len - 12 != - gspca_dev->pixfmt.width * - gspca_dev->pixfmt.height * 2) { + gspca_dev->pixfmt.sizeimage) { gspca_dbg(gspca_dev, D_PACK, "wrong sized frame\n"); goto discard; } From patchwork Fri Dec 14 16:40:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 10731439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16DC414E5 for ; Fri, 14 Dec 2018 16:40:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88FCE2D810 for ; Fri, 14 Dec 2018 16:40:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 879DE2D863; Fri, 14 Dec 2018 16:40:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F2552D810 for ; Fri, 14 Dec 2018 16:40:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730252AbeLNQku (ORCPT ); Fri, 14 Dec 2018 11:40:50 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54556 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729619AbeLNQku (ORCPT ); Fri, 14 Dec 2018 11:40:50 -0500 Received: by mail-wm1-f67.google.com with SMTP id a62so6282586wmh.4 for ; Fri, 14 Dec 2018 08:40:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x3debq00P5WewIt9MnNKItc/RT+GqN8aHZOxBKL/8LI=; b=YajAzYuENeK2+C+6ETwHMdsQDI90B4vSyOjPzdMrB1aUKwUySRwH/vz8dKQ8oTOIqo ZSoRuthsQ8oAIiJEQ+Z7fG0PzmSRjGDdt6uUogDGuTTiWGP6xlqlkdl8p6jylqPJjQIs j77P8nWx8vIeZRLoMwajH9hi/5/IZP/QwQGChhHimcOC3x0YyoCBBMHIBY0AtdrfYTAd H1bVHXEI5unjaAyOU19koMGR+G5V6xgZTOUjBjFRdgqQc1M0Su+LSEdnR2bWML7kXogX UuHk28VOktD2vX0ujP6gSHAbY6Y7HV6wqMT+nF+DGxnMkksaNJjIDq0LGJWGJbtlaLpU Y2WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x3debq00P5WewIt9MnNKItc/RT+GqN8aHZOxBKL/8LI=; b=YZE+DibGVRi0IDWHMMyfXc2J/Wr0iDBpVUs4Hh7ye6+Ka8xR6nEMueWyB04Ni/HV8X jDQSRwpmCQofJ5B4YPXVdZzS7RwZJKA6TPcnE5SAmOx3Ka03GcEY+tJj3Xo1ZOVSj5+D Q8x0gqFKn4Hnb+gmYQR5cCvLbfN3t1w5oxXGH3Bd7bCw+8w/Mx2jo01e5ly2m/aOget0 m5l+YzritrYTXlBGarJx6rREe55th/oQJU5cJVaMPjczdGGKqdGy2MVNMP+ffPoBW2Fs OaSI60LGBDr2+tzNiBT/EuP0YaVA6v+yL5VHFLX+YM97vlEzyy53Uaq9lW5Mwn/cqnwH SSVA== X-Gm-Message-State: AA+aEWZhLQfhYcAae4ClMGgb/lmwNk78roZR3xI3W4szE8YH6IDqSLdW kqa7Hd356Ze8q0EZqX2fX6e8fi+W X-Google-Smtp-Source: AFSGD/Uo0NyPKgFZMeLHLWNDPuGyGGUr4HBqd/q1/uC9ySw1pnqWdM/KYSPw4O+lHofmNbif2t8K8w== X-Received: by 2002:a1c:da0c:: with SMTP id r12mr3771255wmg.54.1544805647789; Fri, 14 Dec 2018 08:40:47 -0800 (PST) Received: from ped.lan (ip5f5abcae.dynamic.kabel-deutschland.de. [95.90.188.174]) by smtp.googlemail.com with ESMTPSA id c13sm7680392wrb.38.2018.12.14.08.40.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 08:40:46 -0800 (PST) From: Philipp Zabel To: linux-media@vger.kernel.org Cc: Hans Verkuil , Philipp Zabel Subject: [PATCH 6/8] media: gspca: ov534-ov722x: remove mode specific video data registers from bridge_init Date: Fri, 14 Dec 2018 17:40:29 +0100 Message-Id: <20181214164031.16757-7-philipp.zabel@gmail.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214164031.16757-1-philipp.zabel@gmail.com> References: <20181214164031.16757-1-philipp.zabel@gmail.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-Virus-Scanned: ClamAV using ClamSMTP The video format, payload size, and frame size setup is video format and frame size specific. Those registers are overwritten during bridge_start anyway. Signed-off-by: Philipp Zabel --- drivers/media/usb/gspca/ov534.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/media/usb/gspca/ov534.c b/drivers/media/usb/gspca/ov534.c index 5b73f7f58ae6..bc9d2eb5db30 100644 --- a/drivers/media/usb/gspca/ov534.c +++ b/drivers/media/usb/gspca/ov534.c @@ -462,15 +462,6 @@ static const u8 bridge_init_772x[][2] = { { 0x25, 0x42 }, { 0x21, 0xf0 }, - { 0x1c, 0x00 }, - { 0x1d, 0x40 }, - { 0x1d, 0x02 }, /* payload size 0x0200 * 4 = 2048 bytes */ - { 0x1d, 0x00 }, /* payload size */ - - { 0x1d, 0x02 }, /* frame size 0x025800 * 4 = 614400 */ - { 0x1d, 0x58 }, /* frame size */ - { 0x1d, 0x00 }, /* frame size */ - { 0x1c, 0x0a }, { 0x1d, 0x08 }, /* turn on UVC header */ { 0x1d, 0x0e }, /* .. */ From patchwork Fri Dec 14 16:40:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 10731443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2FAFA14E5 for ; Fri, 14 Dec 2018 16:40:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1E272D855 for ; Fri, 14 Dec 2018 16:40:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A075A2D85A; Fri, 14 Dec 2018 16:40:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 561322D859 for ; Fri, 14 Dec 2018 16:40:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730269AbeLNQkw (ORCPT ); Fri, 14 Dec 2018 11:40:52 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:50681 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729923AbeLNQkv (ORCPT ); Fri, 14 Dec 2018 11:40:51 -0500 Received: by mail-wm1-f65.google.com with SMTP id n190so6315334wmd.0 for ; Fri, 14 Dec 2018 08:40:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=edGN2e55Mash8D1PpsoVee7XbO7aYKpVlUUQ7NbLuos=; b=TEpvX+f0zr9o6eWTxF9g4LALbdI6L75UKIXQYAjlNB5ePfD4va+I+HEZ9PyS70Dl/x iqrGNC/2e+j15B1AjmqPCWhsSAn82hdzpmpJzrgpttO6OxKNAboWIEDT/X9j/aGAK0wr YXevwVcz+NZaYTEDwsX5yFTACbSHeGVTCfqJz8q9frxVcShSX21oNHVSFWIL/iqHsldg ekMKoPpVdOGSKCLm4cnL1UJU6PVIQEhJ0/1d40LFpaRTDZxhrN6JsnCAY5VPVZzP2KhA /iMlXgeXWPRbz1B9xZaQqHQdTAPtM1snOozIYRo+WD3KPRz38e8I/IyqehjBwJiI8nxm z6Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=edGN2e55Mash8D1PpsoVee7XbO7aYKpVlUUQ7NbLuos=; b=pXQCk9rC/tZdil7V3R3v0WpE/5PoBVhmtbNkmyGNFS83CoXCh0ViiJjdIIjTl7YP9M f8CCjq3xv85KL62FOuXKdxKCJhsSWJqRVk4bF4rro0Zu934vCkWJSJpBzVXM5OpQVeGB u98qsmjAeggaUaEOQo4/LKjVaSUIMHbZoAjzJhlkZInzg9tovPlWaodjpGPSCAJUyVjl xy1la/aEgJcVu3b+ZmCW3+qmZ0vARgcjcfO0JQMB+MIh4t8QbyI4ZBdzpLlq4VK08Zuh TXoMvocrdIOPAW5XpBy5WpVYTAJqSAZyGLdXyIbLTPRF32fJHIQlERN/WR8XboHuUlnz Do/Q== X-Gm-Message-State: AA+aEWa0YlXPf1Z4F1xyKlGKlEgsolj3VYP8O0heuOxTV20cQ1slwP7c tTwCN2N7GrHrSjtKwSibEDMcQExa X-Google-Smtp-Source: AFSGD/WXrxaSmPkyt1CCwcZhdQLlQi5RsTnl8fo/xRtC769/g79zZnNLbbyd+nQV+WlnAZBRh+AKjg== X-Received: by 2002:a7b:cd85:: with SMTP id y5mr2232025wmj.129.1544805649034; Fri, 14 Dec 2018 08:40:49 -0800 (PST) Received: from ped.lan (ip5f5abcae.dynamic.kabel-deutschland.de. [95.90.188.174]) by smtp.googlemail.com with ESMTPSA id c13sm7680392wrb.38.2018.12.14.08.40.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 08:40:48 -0800 (PST) From: Philipp Zabel To: linux-media@vger.kernel.org Cc: Hans Verkuil , Philipp Zabel Subject: [PATCH 7/8] media: gspca: ov534-ov722x: remove camera clock setup from bridge_init Date: Fri, 14 Dec 2018 17:40:30 +0100 Message-Id: <20181214164031.16757-8-philipp.zabel@gmail.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214164031.16757-1-philipp.zabel@gmail.com> References: <20181214164031.16757-1-philipp.zabel@gmail.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-Virus-Scanned: ClamAV using ClamSMTP This register is later overwritten by set_frame_rate anyway. Signed-off-by: Philipp Zabel --- drivers/media/usb/gspca/ov534.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/usb/gspca/ov534.c b/drivers/media/usb/gspca/ov534.c index bc9d2eb5db30..23deeedd3279 100644 --- a/drivers/media/usb/gspca/ov534.c +++ b/drivers/media/usb/gspca/ov534.c @@ -465,8 +465,6 @@ static const u8 bridge_init_772x[][2] = { { 0x1c, 0x0a }, { 0x1d, 0x08 }, /* turn on UVC header */ { 0x1d, 0x0e }, /* .. */ - - { 0xe5, 0x04 }, }; static const u8 sensor_init_772x[][2] = { { 0x12, 0x80 }, From patchwork Fri Dec 14 16:40:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 10731441 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B7B214E5 for ; Fri, 14 Dec 2018 16:40:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD52E2D859 for ; Fri, 14 Dec 2018 16:40:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1D482D861; Fri, 14 Dec 2018 16:40:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51BDA2D859 for ; Fri, 14 Dec 2018 16:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730073AbeLNQkx (ORCPT ); Fri, 14 Dec 2018 11:40:53 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:38156 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730263AbeLNQkx (ORCPT ); Fri, 14 Dec 2018 11:40:53 -0500 Received: by mail-wm1-f67.google.com with SMTP id m22so6435332wml.3 for ; Fri, 14 Dec 2018 08:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kzhQWoew42A1nYV5l020Z5/UB55GqT3SXwsSzqRKNR8=; b=T+UWouVeddM1syzeZs+j3efcPCjbAVd1/FQyHjUEmMWybPm5OQZLENvLPfNREi73bo SXIWPnGynxNdUrmgNLYn5NgWUt0Ooesmk0NkOLIY6NVF3hIJAObsVSR1laC7RHakPHD3 kP6c9Wi9YYyKjXTZddSckaE4jBn5eYkWSYovzvntWATy32JZxE0ijnHgGADAphWM4ZJG Sp8SBjcJIfaNzUSI0t7ExhKB16lqQw6Q7magTy192hSK7iv9yL3++0lUq38uGDEIn5Ym x9wSNG+NEDzBjPDFywqYcQem9v6BsddnigPDW7kBpcNPMonFM3RPGC4XLBx0u/HNwkD/ TmtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kzhQWoew42A1nYV5l020Z5/UB55GqT3SXwsSzqRKNR8=; b=F1QnIrIsHSbsVDI7mn0kw4FDLBw4mtI1yVV2guEInugdjPbWvhaYlcqoI3+DyX+IGY tRp8A6sVdb6K4p1iO+VJSDhRbAk1tA5E1xmkNkPU5O9LKsdQyJXXxM3QIWxh3gdM7OkP XAyLiKhb14lCoaDly9apCNOnnPCc283xXOQN0QZIlLZwzQHyYJFmjgewcAOJgvYo6Z2t SKlplnN3jESw4zGBbx99bSau5UPCmrb7fC6EzAJYQiV2BEb3gwRqiUk91sPZM8ak8hY4 K71nvZJ0JMeaC25/s8dk0dsEqGCchgZajnU8TzyW9GdzrxeLt3mPI9KUD0DKqfNFFbK+ ndng== X-Gm-Message-State: AA+aEWZYL3RE65rsPCvp5WKnn5LaPD2LsN4enNYZxiANRG8I4qR8dags 9EAK3CALIfg8OYLnazCJpqHddkfW X-Google-Smtp-Source: AFSGD/WTljKW5tdKXHiATxeLtAoc43LYQs6Ww0NPK3+OM+cXe3sVhUwq223JRXu7CxS84aIMJYeurA== X-Received: by 2002:a1c:1d2:: with SMTP id 201mr4160229wmb.69.1544805650762; Fri, 14 Dec 2018 08:40:50 -0800 (PST) Received: from ped.lan (ip5f5abcae.dynamic.kabel-deutschland.de. [95.90.188.174]) by smtp.googlemail.com with ESMTPSA id c13sm7680392wrb.38.2018.12.14.08.40.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Dec 2018 08:40:49 -0800 (PST) From: Philipp Zabel To: linux-media@vger.kernel.org Cc: Hans Verkuil , Philipp Zabel Subject: [PATCH 8/8] media: gspca: ov534-ov772x: remove unnecessary COM3 initialization Date: Fri, 14 Dec 2018 17:40:31 +0100 Message-Id: <20181214164031.16757-9-philipp.zabel@gmail.com> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214164031.16757-1-philipp.zabel@gmail.com> References: <20181214164031.16757-1-philipp.zabel@gmail.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-Virus-Scanned: ClamAV using ClamSMTP The COM3 register at address 0x0c already defaults to 0x10, the two bits COM3[7:6] are set according to V4L2 controls by sethvflip later. There is no need to set it multiple times during bridge initialization. Signed-off-by: Philipp Zabel --- drivers/media/usb/gspca/ov534.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/media/usb/gspca/ov534.c b/drivers/media/usb/gspca/ov534.c index 23deeedd3279..02c90ad96b76 100644 --- a/drivers/media/usb/gspca/ov534.c +++ b/drivers/media/usb/gspca/ov534.c @@ -543,13 +543,10 @@ static const u8 sensor_init_772x[][2] = { { 0x8c, 0xe8 }, { 0x8d, 0x20 }, - { 0x0c, 0x90 }, - { 0x2b, 0x00 }, { 0x22, 0x7f }, { 0x23, 0x03 }, { 0x11, 0x01 }, - { 0x0c, 0xd0 }, { 0x64, 0xff }, { 0x0d, 0x41 }, @@ -557,7 +554,6 @@ static const u8 sensor_init_772x[][2] = { { 0x0e, 0xcd }, { 0xac, 0xbf }, { 0x8e, 0x00 }, /* De-noise threshold */ - { 0x0c, 0xd0 } }; static const u8 bridge_start_vga_yuyv_772x[][2] = { {0x88, 0x00},