From patchwork Tue Oct 9 06:47:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Bobrowicz X-Patchwork-Id: 10632015 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 1114E112B for ; Tue, 9 Oct 2018 06:48:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03BAB28827 for ; Tue, 9 Oct 2018 06:48:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECA172891C; Tue, 9 Oct 2018 06:48:27 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 8734C28827 for ; Tue, 9 Oct 2018 06:48:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725947AbeJIODv (ORCPT ); Tue, 9 Oct 2018 10:03:51 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39317 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbeJIODv (ORCPT ); Tue, 9 Oct 2018 10:03:51 -0400 Received: by mail-pl1-f194.google.com with SMTP id w14-v6so319918plp.6 for ; Mon, 08 Oct 2018 23:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elite-embedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LaVzmS2KYAFhhbZorwVeub9CQoT9j1KBTo27cQVYiSA=; b=M0oaekJIKhrg1DwFI62sgw/X+W95k+GG+rWG7AJH+jjnDiBbgL0+e+/sDjXasO0iO4 U0G+kY9wDRNK7Rbo/sYQF8sLz8LGGeDgLttH4l3c1J55f10KvO34jVVLuoQ/+6aCtRQj BgWaHJ9Dan2QaT8+iVwsxcoHus0y2LDSBU7JJGv/DmZckoBJ7neNBj+nQYnaIB4Qo3gI tpMuZXTiaXqHvwdV+sTFMn2yv/YdOtF22BallP4Mb7ZTr+E7f/NzbKHSx6Q6YxRMuDLB wI5ZWnZP1q1PkQaxGxtkEH8PijquqPdNPK+GUPE8I3sv2eZDMH7JrOAE4NoauK6N66A0 sWXA== 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; bh=LaVzmS2KYAFhhbZorwVeub9CQoT9j1KBTo27cQVYiSA=; b=JYTUp4YRWYFQTWMGMeP0oC7o8hJULej9r5s8jOQP1vNGzcymmWaax8tZwgvL2gXX/h 4hsz+0zURwDQEx4ieUqKUlnpcmmJCt21CfPkG1qanVPyhC/3of8GCuQe1fyo7yEVleU0 rcZe1bBmpU9Tm3rHfljg+af60wDlqJuwd/tnOYiHvxQz6+HLtRvAXmAxjur9NIZYKkZ+ WrxLKLXJIhnorb9fxLr61saapd50PqbFO0pGvmzHtU91FmTM1R7aFPT7qZ/PbFSBmzvv PZlE1c/xXpYBfgH5jp2jCnANwuAMZx/hURcuR3cLsEo5QpF8ogGEcAYd7cwpXZN0FFmQ HqAQ== X-Gm-Message-State: ABuFfohRIsFpT19//XHXpdbaz+MZcEhj3VAIBLMs/ShGSPUdrMlhSx3R 3YRXCfct+3M5SjMHYolM5Nrwtq6qm4Sm X-Google-Smtp-Source: ACcGV63kUqFCLpY5ZiklBdynmUrXZYKY6zcMFbD2YoBgp5xJ+SkmKvlZVRc30qxmD6gPfOORt+tq9w== X-Received: by 2002:a17:902:b109:: with SMTP id q9-v6mr27255525plr.83.1539067706103; Mon, 08 Oct 2018 23:48:26 -0700 (PDT) Received: from ubuntu.localdomain (97-113-94-157.tukw.qwest.net. [97.113.94.157]) by smtp.gmail.com with ESMTPSA id h77-v6sm38960457pfh.13.2018.10.08.23.48.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Oct 2018 23:48:25 -0700 (PDT) From: Sam Bobrowicz To: linux-media@vger.kernel.org Cc: Sam Bobrowicz Subject: [PATCH 1/4] media: ov5640: fix resolution update Date: Mon, 8 Oct 2018 23:47:59 -0700 Message-Id: <1539067682-60604-2-git-send-email-sam@elite-embedded.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539067682-60604-1-git-send-email-sam@elite-embedded.com> References: <1539067682-60604-1-git-send-email-sam@elite-embedded.com> 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 set_fmt was not properly triggering a mode change when a new mode was set that happened to have the same format as the previous mode (for example, when only changing the frame dimensions). Fix this. Signed-off-by: Sam Bobrowicz --- drivers/media/i2c/ov5640.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index eaefdb5..5031aab 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -2045,12 +2045,12 @@ static int ov5640_set_fmt(struct v4l2_subdev *sd, goto out; } - if (new_mode != sensor->current_mode) { + + if (new_mode != sensor->current_mode || + mbus_fmt->code != sensor->fmt.code) { + sensor->fmt = *mbus_fmt; sensor->current_mode = new_mode; sensor->pending_mode_change = true; - } - if (mbus_fmt->code != sensor->fmt.code) { - sensor->fmt = *mbus_fmt; sensor->pending_fmt_change = true; } out: From patchwork Tue Oct 9 06:48:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Bobrowicz X-Patchwork-Id: 10632017 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 46339112B for ; Tue, 9 Oct 2018 06:48:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39291286F2 for ; Tue, 9 Oct 2018 06:48:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DF902891A; Tue, 9 Oct 2018 06:48:29 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 C77A028827 for ; Tue, 9 Oct 2018 06:48:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726057AbeJIODw (ORCPT ); Tue, 9 Oct 2018 10:03:52 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39763 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbeJIODw (ORCPT ); Tue, 9 Oct 2018 10:03:52 -0400 Received: by mail-pf1-f196.google.com with SMTP id c25-v6so332177pfe.6 for ; Mon, 08 Oct 2018 23:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elite-embedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=C/q1xvuLIeoTeO/bxOems62KELrzsbrMEMN2SRmv6/k=; b=E8vOYLlTNiBoglk0uaIYDjdCxbieW8fFIlRcp8Mx30iEmd6fuL3kDY/4HWg8JZDnY+ GBun8eZWT8lMF6OTMLAmLEr2wq79h9ep9n0iabT12VHCy3W/F8kaZXWSCQMC/N47v2iu qqyq0vUV/8a7BSOHSMRYk8GwU93gKzrQwzlu72RUfugJMugvI5Yf7cH53+HqQ/APBZY0 0NDmaiGyTMIXyyVn+Q0rPzQNtepZf3FRETILOPhbHsH7K9S/pe6GLzSc5P54OLABuLDq wY7dWh+ioSfmm4Zd7fYIlV1sb5XUJl8iWBTNWg3P3jMeMkoF1hxzDu+2ew4JU6SLf+iV qCNw== 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; bh=C/q1xvuLIeoTeO/bxOems62KELrzsbrMEMN2SRmv6/k=; b=ochy8eDCe7j4xiawNd0LChogROyrFHOiN6DizQQI4wFgSIBbvec2qV8fo/W0ySSD9x BhgHxBSxf+UsbcqHbrrYwkO1LpXwAZ1VG9nbDAGJMu/ICfOj1KoEVI2X56Lajh96lwxq HEEpj+3/cZA+hQDNTqaNa+ZYazb8tM7QspzGKop4GWqpUrF5zOa3r/Ih9jmHmwzPMWAF OPKoPJtvCMtzZlXWdALYhRoTkaso6AE4RaAHC/q3Jj54UkZwtXnIJtaDxrpN6ZfiI8Qn 3h5bqSl5m6oj4T63doQHpOLUjBopdoa0cuM3UHwXmgSBn7yEnqttXaZL2Qv5RoIeoeCG 01Ww== X-Gm-Message-State: ABuFfogOSQWB0wTv+9ZV1C2drD9xlh32C9Sy9LjZShLBfFa6Srwjbe5g 0WJJyiyXsPCHKKmo2daBW+WggG4h4lLI X-Google-Smtp-Source: ACcGV62wWkM/Dgx0/xmfsBg5wbKmqd8ORza6nGdODItvyy9gGwHjlIW5/ENYtRAMHcunc0aSB6ikwA== X-Received: by 2002:a62:ccd4:: with SMTP id j81-v6mr29300171pfk.76.1539067707178; Mon, 08 Oct 2018 23:48:27 -0700 (PDT) Received: from ubuntu.localdomain (97-113-94-157.tukw.qwest.net. [97.113.94.157]) by smtp.gmail.com with ESMTPSA id h77-v6sm38960457pfh.13.2018.10.08.23.48.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Oct 2018 23:48:26 -0700 (PDT) From: Sam Bobrowicz To: linux-media@vger.kernel.org Cc: Sam Bobrowicz Subject: [PATCH 2/4] media: ov5640: fix get_light_freq on auto Date: Mon, 8 Oct 2018 23:48:00 -0700 Message-Id: <1539067682-60604-3-git-send-email-sam@elite-embedded.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539067682-60604-1-git-send-email-sam@elite-embedded.com> References: <1539067682-60604-1-git-send-email-sam@elite-embedded.com> 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 Light frequency was not properly returned when in auto mode and the detected frequency was 60Hz. Fix this. Signed-off-by: Sam Bobrowicz Acked-by: Jacopo Mondi --- drivers/media/i2c/ov5640.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index 5031aab..f183222 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -1295,6 +1295,7 @@ static int ov5640_get_light_freq(struct ov5640_dev *sensor) light_freq = 50; } else { /* 60Hz */ + light_freq = 60; } } From patchwork Tue Oct 9 06:48:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Bobrowicz X-Patchwork-Id: 10632019 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 1A266112B for ; Tue, 9 Oct 2018 06:48:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BB90286F2 for ; Tue, 9 Oct 2018 06:48:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 002032891A; Tue, 9 Oct 2018 06:48:29 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 9E0A6286F2 for ; Tue, 9 Oct 2018 06:48:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726160AbeJIODx (ORCPT ); Tue, 9 Oct 2018 10:03:53 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:39320 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbeJIODx (ORCPT ); Tue, 9 Oct 2018 10:03:53 -0400 Received: by mail-pl1-f196.google.com with SMTP id w14-v6so319958plp.6 for ; Mon, 08 Oct 2018 23:48:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elite-embedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sCDJnRsfbVEeNvCMszpbP9M4AA9wOWcgIDxNKrFLowU=; b=TwFnH5GCO3A4kNr0wVNuqCs3pJkWy2Kit9CRtYEJ2UKREkk5F2rZKBriIOYU133P4v 3OMKqIsYcwsQF/84twSkvvB4fM2ddy6hIPhwrdRYuT41FJZl82dx28V3hWuqGvJsiBwl afaBaF7GBBMWoAq3w7V3Ms+igYwOdu8WT0LFyBYbF0u7RZbleecX87rIudBzJCMYkKK0 zi0N9uESgHrHV9AFOHQKOr4BNZbthgNSSIt5LCFOv+tP+aVZsTvYRHUZm98hxvsRqDWZ MLhnW10Ak9hIghdZwXq5dlwTzKEPRm6TKggCat2tgpIVSuP+6K7GGBxXmXfcypOip5xe empQ== 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; bh=sCDJnRsfbVEeNvCMszpbP9M4AA9wOWcgIDxNKrFLowU=; b=Rn7pnhzwHdgshnbjZacKzntUjAOggLcB5u0uSB3LGOTixMO2o9f217hfDfXdNgvgHc 7FoflGHIC3KujHjjNY8JCvzbII+8Qo1iz7R4h/WYWwirvDMIrPC3X9yYH0EaN4/Fjx4W qX/DDHbRNR7pwqz7Szj+TWCARze99GdPsvt0VUEgL0LQSa8D30BDGq+4UWRnY/EBkafU v0vwOx8J97UHKXBBe+iwsRGjQUVtz1KaMpIanz8SgOz3QXnFe/xcQ5Y+UJQEUzt4CLRS L4w4gDoXPDcM7e8VorKmNrMuLktXer0uDxK4wZCDsvdPRv/MGV8+6tRVowKF/TQ4Hhku EQzg== X-Gm-Message-State: ABuFfoiiP1PEiw3zTihtBeIQ3sE3wSI64l9bctMpt+QgB1e68f4Yi48D vG4TQ7n0pSl8iFx8imivIglneEf4QOWl X-Google-Smtp-Source: ACcGV616JvEkRQGRt7orE4nWNFQoYsxv+k0BZsPyU7BBue3XlAZpO/suBUsZpx92F1ZhL1x2Zk/8kg== X-Received: by 2002:a17:902:ceb:: with SMTP id 98-v6mr16757929plt.331.1539067708179; Mon, 08 Oct 2018 23:48:28 -0700 (PDT) Received: from ubuntu.localdomain (97-113-94-157.tukw.qwest.net. [97.113.94.157]) by smtp.gmail.com with ESMTPSA id h77-v6sm38960457pfh.13.2018.10.08.23.48.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Oct 2018 23:48:27 -0700 (PDT) From: Sam Bobrowicz To: linux-media@vger.kernel.org Cc: Sam Bobrowicz Subject: [PATCH 3/4] media: ov5640: Don't access ctrl regs when off Date: Mon, 8 Oct 2018 23:48:01 -0700 Message-Id: <1539067682-60604-4-git-send-email-sam@elite-embedded.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539067682-60604-1-git-send-email-sam@elite-embedded.com> References: <1539067682-60604-1-git-send-email-sam@elite-embedded.com> 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 a check to g_volatile_ctrl to prevent trying to read registers when the sensor is not powered. Signed-off-by: Sam Bobrowicz Acked-by: Jacopo Mondi --- drivers/media/i2c/ov5640.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index f183222..a50d884 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -2336,6 +2336,13 @@ static int ov5640_g_volatile_ctrl(struct v4l2_ctrl *ctrl) /* v4l2_ctrl_lock() locks our own mutex */ + /* + * If the sensor is not powered up by the host driver, do + * not try to access it to update the volatile controls. + */ + if (sensor->power_count == 0) + return 0; + switch (ctrl->id) { case V4L2_CID_AUTOGAIN: val = ov5640_get_gain(sensor); From patchwork Tue Oct 9 06:48:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Bobrowicz X-Patchwork-Id: 10632021 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 20711112B for ; Tue, 9 Oct 2018 06:48:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10E1D286F2 for ; Tue, 9 Oct 2018 06:48:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 056DC2891A; Tue, 9 Oct 2018 06:48:31 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 9D73C286F2 for ; Tue, 9 Oct 2018 06:48:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726418AbeJIODy (ORCPT ); Tue, 9 Oct 2018 10:03:54 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42541 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbeJIODy (ORCPT ); Tue, 9 Oct 2018 10:03:54 -0400 Received: by mail-pl1-f195.google.com with SMTP id c8-v6so315327plo.9 for ; Mon, 08 Oct 2018 23:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elite-embedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=J9BgPUO0UvmG0f6J1ELz66Vi3MklvXWYkm8JXlvRZ/o=; b=ITCMu6oG0ohnWubPRt7+AQdVb64FbgwZMmL49PAeKno513lJB4eTbatfU+rK4q/aao x5I1fiorWiB8cl6VhB5gXEfNg9XhP4saiy4uAC0VHeAJbw7w7Rn8yGk+52MTlj7sryf0 T0rXUXd0GhQOJGqGP37yM0YHNUBtUxDhjpTqBaPDv6IMtwLKWdHL2JKh/ttvtw/Cwy0M jvfaBI00zNazB3dND8jpVGSlFw5DdzaFPTvE3DHOKxlRKTbiMZ16CahWaFuNgEEoyqx/ 0qgyyItkdqIB4dpLURf+lfT7w9uN7AyXEXbjL+CnUYfKzde4+9J8RPp6pIbreF/4f+Eh KxbQ== 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; bh=J9BgPUO0UvmG0f6J1ELz66Vi3MklvXWYkm8JXlvRZ/o=; b=t9cg/E+WvxMY/9pEdh1wOhSzzVKhlpRulzNJXtz3V3UMVgH72e5E1O/yMnVFU0VcHm vz77aMiLLiuzV2lGOCHx5wI/dP5peSMR4AHwe341wSyu20OrkLCTqHUiMZOd462sN7al 4EbhrwmxsNkE7pRdUebh3in4MSCEmpenB1ryCKk6OgB3un2BmMObxEWs88LzLbGOTg++ 1pwH79w1uNgPiIqnOUeRt+wnegrCYtHBCKgKqavE3P1H8Z3P8Sj7dl9KxcxqX6lmNsZy JJJKpimWsUD7FeHZEmgvt2ki/Z4ftEgrKJ6hxymZvBvF/o/HTziiN43vpHGV82dXvyoH Zrsg== X-Gm-Message-State: ABuFfoiS3cmKAFYO+JoysewJ8M4sBlXQakb/lOS3LAxaW4COVRVx47UU G7KqduN9HAHXCJBQuK7SlnSrejePXDLr X-Google-Smtp-Source: ACcGV61HwOtXxMNh7oHK2VqEaSMxyZfOQ8wgQFhQs66649dCZWkow77D5DplyDbh82G5EC+5rI8SPQ== X-Received: by 2002:a17:902:4181:: with SMTP id f1-v6mr26610489pld.248.1539067709176; Mon, 08 Oct 2018 23:48:29 -0700 (PDT) Received: from ubuntu.localdomain (97-113-94-157.tukw.qwest.net. [97.113.94.157]) by smtp.gmail.com with ESMTPSA id h77-v6sm38960457pfh.13.2018.10.08.23.48.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Oct 2018 23:48:28 -0700 (PDT) From: Sam Bobrowicz To: linux-media@vger.kernel.org Cc: Sam Bobrowicz Subject: [PATCH 4/4] media: ov5640: Add additional media bus formats Date: Mon, 8 Oct 2018 23:48:02 -0700 Message-Id: <1539067682-60604-5-git-send-email-sam@elite-embedded.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539067682-60604-1-git-send-email-sam@elite-embedded.com> References: <1539067682-60604-1-git-send-email-sam@elite-embedded.com> 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 for 1X16 yuv media bus formats (v4l2_mbus_framefmt). These formats are equivalent to the 2X8 formats that are already supported, both of which accurately describe the data present on the CSI2 interface. This change will increase compatibility with CSI2 RX drivers that only advertise support for the 1X16 formats. Signed-off-by: Sam Bobrowicz --- drivers/media/i2c/ov5640.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index a50d884..ca9de56 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -125,6 +125,8 @@ static const struct ov5640_pixfmt ov5640_formats[] = { { MEDIA_BUS_FMT_JPEG_1X8, V4L2_COLORSPACE_JPEG, }, { MEDIA_BUS_FMT_UYVY8_2X8, V4L2_COLORSPACE_SRGB, }, { MEDIA_BUS_FMT_YUYV8_2X8, V4L2_COLORSPACE_SRGB, }, + { MEDIA_BUS_FMT_UYVY8_1X16, V4L2_COLORSPACE_SRGB, }, + { MEDIA_BUS_FMT_YUYV8_1X16, V4L2_COLORSPACE_SRGB, }, { MEDIA_BUS_FMT_RGB565_2X8_LE, V4L2_COLORSPACE_SRGB, }, { MEDIA_BUS_FMT_RGB565_2X8_BE, V4L2_COLORSPACE_SRGB, }, }; @@ -2069,10 +2071,12 @@ static int ov5640_set_framefmt(struct ov5640_dev *sensor, switch (format->code) { case MEDIA_BUS_FMT_UYVY8_2X8: + case MEDIA_BUS_FMT_UYVY8_1X16: /* YUV422, UYVY */ val = 0x3f; break; case MEDIA_BUS_FMT_YUYV8_2X8: + case MEDIA_BUS_FMT_YUYV8_1X16: /* YUV422, YUYV */ val = 0x30; break;