From patchwork Sat Dec 29 17:07:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10744967 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 86FBA13AD for ; Sat, 29 Dec 2018 17:07:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7950B28A63 for ; Sat, 29 Dec 2018 17:07:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DB7828AE3; Sat, 29 Dec 2018 17:07:59 +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 0599128AB2 for ; Sat, 29 Dec 2018 17:07:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727539AbeL2RHz (ORCPT ); Sat, 29 Dec 2018 12:07:55 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:45909 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727532AbeL2RHz (ORCPT ); Sat, 29 Dec 2018 12:07:55 -0500 Received: by mail-pl1-f195.google.com with SMTP id a14so11206459plm.12 for ; Sat, 29 Dec 2018 09:07:54 -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; bh=LixWnpehVNoPfXFEQn+kJGTokJpiPMy5ZsylAeis1hI=; b=B+E3uVZs58nG+5kyCz7RORkMWjdQwgZfjtCjnKeCfkryysZ6ChwNLZAD1Cy9LtZ2zo 6IM3gx9bqMgOYq/RF5qEbA4jHSZt1A/MzYBzb8H60y8kvKJSeRhb0qnNhxgJVoHTwszb ggcTw2/jxEr1wueCvGXm95p1WrF2tKJjOKn9Q980LM/LpXH6iwsmZWE1bYXWUOiKrud7 KlbOhbKylhtT1ewxtaFVpHAplwsw6iU7GsLdFh8ZNhfjpCxgvBwsst2IDCzRi3gDLEdk 2+smbXXnUMRb5hpdVn2uw8KWEqD9gWPbPQRC0zGScgzHrRAN25fB5ZO+kPVX2wPChNvt o0cg== 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=LixWnpehVNoPfXFEQn+kJGTokJpiPMy5ZsylAeis1hI=; b=gfhqN3FXQt1Nu4lDHY2TbGfdcfm/ECcwTYUPYGJKRlz7GQeGqxy+a8vWcPdl9bAFM6 MQy2+Gq/hYOeEtBOmDSmVxYX6MDDRF1gZMBT2Kf5IshseNvAHjohAOZI8Zc4OwSmVgo3 CILwrgbNTTMpXaRTEDPq0juW+7pZlapCJaj50vOVoax/a1yDOctOaKnQN4uxpdPmhU8i ndmRBmEU//za7aqSZrKhHM/G+iQxwO8ObVm04okijPRWD0z9Cjy5//0dCCGGou5vc+8n /JYOsYc8bT7ghf2yxRBSuWD+spec8XYNGheCeyFiCpnbpiLBNqmvLq6fhMWluPLHU0DD etEQ== X-Gm-Message-State: AJcUukcUHnflnE5VusqXMe89tBcRU9TDFrKnHMGeKwZfcW59OCyjVmDG A/BguTE7XdaEjEZ6lLbh2fzLLez88cI= X-Google-Smtp-Source: ALg8bN7qHj+7l5GjJY5S8ChzZKSHp9hiEDlJTzYvX7fyyD1psUJUORo9iAZUUJiikTERmHI/Az73kg== X-Received: by 2002:a17:902:ac8f:: with SMTP id h15mr30779048plr.245.1546103273700; Sat, 29 Dec 2018 09:07:53 -0800 (PST) Received: from localhost.localdomain ([240f:34:212d:1:d91e:35b2:75a8:1394]) by smtp.gmail.com with ESMTPSA id h134sm86856276pfe.27.2018.12.29.09.07.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 29 Dec 2018 09:07:53 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Enrico Scholz , Michael Grzeschik , Marco Felsch , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 1/4] media: mt9m111: fix setting pixclk polarity Date: Sun, 30 Dec 2018 02:07:35 +0900 Message-Id: <1546103258-29025-2-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546103258-29025-1-git-send-email-akinobu.mita@gmail.com> References: <1546103258-29025-1-git-send-email-akinobu.mita@gmail.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 Since commit 98480d65c48c ("media: mt9m111: allow to setup pixclk polarity"), the MT9M111_OUTFMT_INV_PIX_CLOCK bit in the output format control 2 register has to be changed depending on the pclk-sample property setting. Without this change, the MT9M111_OUTFMT_INV_PIX_CLOCK bit is unchanged. Fixes: 98480d65c48c ("media: mt9m111: allow to setup pixclk polarity") Cc: Enrico Scholz Cc: Michael Grzeschik Cc: Marco Felsch Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/mt9m111.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c index d639b9b..f0e47fd 100644 --- a/drivers/media/i2c/mt9m111.c +++ b/drivers/media/i2c/mt9m111.c @@ -542,6 +542,7 @@ static int mt9m111_set_pixfmt(struct mt9m111 *mt9m111, { struct i2c_client *client = v4l2_get_subdevdata(&mt9m111->subdev); u16 data_outfmt2, mask_outfmt2 = MT9M111_OUTFMT_PROCESSED_BAYER | + MT9M111_OUTFMT_INV_PIX_CLOCK | MT9M111_OUTFMT_BYPASS_IFP | MT9M111_OUTFMT_RGB | MT9M111_OUTFMT_RGB565 | MT9M111_OUTFMT_RGB555 | MT9M111_OUTFMT_RGB444x | MT9M111_OUTFMT_RGBx444 | From patchwork Sat Dec 29 17:07:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10744965 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 D610C14E2 for ; Sat, 29 Dec 2018 17:07:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5C6328A63 for ; Sat, 29 Dec 2018 17:07:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B957E28AF2; Sat, 29 Dec 2018 17:07:58 +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 26FBE28AE3 for ; Sat, 29 Dec 2018 17:07:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727542AbeL2RH5 (ORCPT ); Sat, 29 Dec 2018 12:07:57 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40785 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727530AbeL2RH4 (ORCPT ); Sat, 29 Dec 2018 12:07:56 -0500 Received: by mail-pg1-f196.google.com with SMTP id z10so11241489pgp.7 for ; Sat, 29 Dec 2018 09:07:56 -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; bh=hCfbsDT3WB7JJDTASC61Hh4ta8XGF8ois0pAxvjQ2dY=; b=cj5ppDz1eCQnSBLfFSQrreFPKzFOb86wUl9lZp/hu4p5g845X8t7AviwGiKkKQVtYj NIKIbY5pIrp1Boc6S0DsyTJdlPpMXbBbYSahjqFBJWw3oB1yMbw1w1vw9TaCnsNDTjvT Ukwxxh6TQEoWgXojY4XF2Qy+v4SggS4cdpDu47hOaLN7h1H60Q0kkoVJ76+FO5vpZF59 r6QNZkMwq8hsUCAc1Vp+Q2frPhOEgP+TeJy7SzsE9RSvC70jqHEtGwZScQRZq4ApE/mm R0OvJhuT1yuyOeb8XVl2PMv32KzMc/8EPuJKithac3FcriPutVerPQhHybDPCQ0f/A1G 9kLw== 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=hCfbsDT3WB7JJDTASC61Hh4ta8XGF8ois0pAxvjQ2dY=; b=mOuAc1HX7VvaWw3eMI56YCTHhUCKLV/FOt6OxNE5WxFQEe9N94WRf5H0wWAovE3Cfe RSODmqddWfzpCn3qymo8AmBDxXXgqAMR0pn471ABosE+lUqHB4vO9eMUvMHIATPQz8u8 AduVpKG6IYRYlpXLg3+0+hLKY1XUzWNLbwpawxm94zK++8sclwP35Ip2I8WKz1k9B++Q pKMQQOHY8nwl2Lf6+/QBpD/44YyUBdoSeLK68Z770cfOtjIMlFKPYM2gSCdBWbcNa3SN c/ueqGgQqgTs4ErY7Dun/R36JyNxVW2SI4+XQ4K4a9HRIywRP+oGfNWWHKAL6OJ4Lzca YUqQ== X-Gm-Message-State: AA+aEWbN6AhdUUn0iqJ52NP1sWhUsyeRhZZWYA98n6TOxfXIc6uT0q5F z2JVbL931YivTZLOaccs9ktopTSLXEY= X-Google-Smtp-Source: AFSGD/VsYdi6dJzYc1dl0eRxpJR7+IrP3CjjWbhBEuss+JDU9g2T4ApIVwPA5z7iSp5qANrRC9Jpkg== X-Received: by 2002:a62:1542:: with SMTP id 63mr32607572pfv.230.1546103275682; Sat, 29 Dec 2018 09:07:55 -0800 (PST) Received: from localhost.localdomain ([240f:34:212d:1:d91e:35b2:75a8:1394]) by smtp.gmail.com with ESMTPSA id h134sm86856276pfe.27.2018.12.29.09.07.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 29 Dec 2018 09:07:55 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 2/4] media: mt9m111: make VIDIOC_SUBDEV_G_FMT ioctl work with V4L2_SUBDEV_FORMAT_TRY Date: Sun, 30 Dec 2018 02:07:36 +0900 Message-Id: <1546103258-29025-3-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546103258-29025-1-git-send-email-akinobu.mita@gmail.com> References: <1546103258-29025-1-git-send-email-akinobu.mita@gmail.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 The VIDIOC_SUBDEV_G_FMT ioctl for this driver doesn't recognize V4L2_SUBDEV_FORMAT_TRY and always works as if V4L2_SUBDEV_FORMAT_ACTIVE is specified. Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/mt9m111.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c index f0e47fd..acb4dee 100644 --- a/drivers/media/i2c/mt9m111.c +++ b/drivers/media/i2c/mt9m111.c @@ -528,6 +528,16 @@ static int mt9m111_get_fmt(struct v4l2_subdev *sd, if (format->pad) return -EINVAL; + if (format->which == V4L2_SUBDEV_FORMAT_TRY) { +#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API + mf = v4l2_subdev_get_try_format(sd, cfg, 0); + format->format = *mf; + return 0; +#else + return -ENOTTY; +#endif + } + mf->width = mt9m111->width; mf->height = mt9m111->height; mf->code = mt9m111->fmt->code; @@ -1090,6 +1100,26 @@ static int mt9m111_s_stream(struct v4l2_subdev *sd, int enable) return 0; } +static int mt9m111_init_cfg(struct v4l2_subdev *sd, + struct v4l2_subdev_pad_config *cfg) +{ +#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API + struct mt9m111 *mt9m111 = container_of(sd, struct mt9m111, subdev); + struct v4l2_mbus_framefmt *format = + v4l2_subdev_get_try_format(sd, cfg, 0); + + format->width = mt9m111->width; + format->height = mt9m111->height; + format->code = mt9m111->fmt->code; + format->colorspace = mt9m111->fmt->colorspace; + format->field = V4L2_FIELD_NONE; + format->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; + format->quantization = V4L2_QUANTIZATION_DEFAULT; + format->xfer_func = V4L2_XFER_FUNC_DEFAULT; +#endif + return 0; +} + static int mt9m111_g_mbus_config(struct v4l2_subdev *sd, struct v4l2_mbus_config *cfg) { @@ -1115,6 +1145,7 @@ static const struct v4l2_subdev_video_ops mt9m111_subdev_video_ops = { }; static const struct v4l2_subdev_pad_ops mt9m111_subdev_pad_ops = { + .init_cfg = mt9m111_init_cfg, .enum_mbus_code = mt9m111_enum_mbus_code, .get_selection = mt9m111_get_selection, .set_selection = mt9m111_set_selection, From patchwork Sat Dec 29 17:07:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10744969 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 E9A5D13AD for ; Sat, 29 Dec 2018 17:08:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC7B928A63 for ; Sat, 29 Dec 2018 17:08:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0FE728AE3; Sat, 29 Dec 2018 17:08:00 +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 82D8428A63 for ; Sat, 29 Dec 2018 17:08:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727545AbeL2RH7 (ORCPT ); Sat, 29 Dec 2018 12:07:59 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:44950 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727530AbeL2RH6 (ORCPT ); Sat, 29 Dec 2018 12:07:58 -0500 Received: by mail-pg1-f196.google.com with SMTP id t13so11233006pgr.11 for ; Sat, 29 Dec 2018 09:07:58 -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; bh=jNsxWjc3RCpR0fM6DE6EOaHiHD9ZdrtINc39zi3t07M=; b=qtjOOwKcGtUTa4+2uSPQdZGYLhhInsVCDsN7WPXxky0QCO+zxlivyq0mK3QblqRvDF UTYZfsDk9/nEfFkDtBDL+2X9QPTlH2/HHciQ6zHCv9hwe16wrpqwEaHND//pBrQRK4JF jnS2Fte1PTAnw+4nRpGHsuw5ADFjAzCpRx3tXgggJsjqunBktsnbPI4FAnvLPup26zMK VBQzPvo4BQP7mg+bpYvl85vKVk94Lqn5t6oIA1BAOAQzBJQubzvRmAWspa96nKD9wE1k jzcAg1DeH3EtcsMb5kHv+b1MrMHWgDgfBERJ0YpIGhWRxkAh20au6AwwbVDctKN8rG3R YgpA== 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=jNsxWjc3RCpR0fM6DE6EOaHiHD9ZdrtINc39zi3t07M=; b=jLCao511afWywZaxLBt4F0q4ZezI5bDPqUTRg/MpakiVcvoSGFNAv2LZ2YI8tOLG3M 1eakzXKK5u2QP9CPdg10Jqs3dWJ6P4qke5UBfmtRfZKL7mwRkJ0LbZUVGgo39772Fe20 F0Dxw4kwG5gNo8SIHp/oUagYyBJQ7ZL/3Pys6xe7wemw+FgjIvR/sxufrfbqNxcIbh0y ATWwM8AtbW/xokzOmJMwygMiGwhqXBmsCpkuHVCaLjv1OCyp98it3HjxDhldmg48aT0k K0hR52dHk2CHssOKtQepAK0AOOKxK8xHNawE/GcZHTsSLw/vMWUwrwzyRKt0e7qpwN3L TuDQ== X-Gm-Message-State: AJcUukche6xCQD2TUv0EDTjMtZVcv1gYeOLr0CXaekKJRXal6bQ9J61w BaL8i9tEIi+uWeOz14ojbW8I+Xq1My8= X-Google-Smtp-Source: ALg8bN5tYM1oKAUbZxtNV/JcEX519UFqt6DxIwrhWM2NIOBb3mLcI9yDjKzCAxsCapBvMm8FhJvExw== X-Received: by 2002:a65:484c:: with SMTP id i12mr2177034pgs.309.1546103277840; Sat, 29 Dec 2018 09:07:57 -0800 (PST) Received: from localhost.localdomain ([240f:34:212d:1:d91e:35b2:75a8:1394]) by smtp.gmail.com with ESMTPSA id h134sm86856276pfe.27.2018.12.29.09.07.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 29 Dec 2018 09:07:57 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 3/4] media: mt9m111: set all mbus format field when G_FMT and S_FMT ioctls Date: Sun, 30 Dec 2018 02:07:37 +0900 Message-Id: <1546103258-29025-4-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546103258-29025-1-git-send-email-akinobu.mita@gmail.com> References: <1546103258-29025-1-git-send-email-akinobu.mita@gmail.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 This driver doesn't set all members of mbus format field when the VIDIOC_SUBDEV_{S,G}_FMT ioctls are called. This is detected by v4l2-compliance. Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/mt9m111.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c index acb4dee..465e920 100644 --- a/drivers/media/i2c/mt9m111.c +++ b/drivers/media/i2c/mt9m111.c @@ -543,6 +543,9 @@ static int mt9m111_get_fmt(struct v4l2_subdev *sd, mf->code = mt9m111->fmt->code; mf->colorspace = mt9m111->fmt->colorspace; mf->field = V4L2_FIELD_NONE; + mf->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; + mf->quantization = V4L2_QUANTIZATION_DEFAULT; + mf->xfer_func = V4L2_XFER_FUNC_DEFAULT; return 0; } @@ -671,6 +674,10 @@ static int mt9m111_set_fmt(struct v4l2_subdev *sd, mf->code = fmt->code; mf->colorspace = fmt->colorspace; + mf->field = V4L2_FIELD_NONE; + mf->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; + mf->quantization = V4L2_QUANTIZATION_DEFAULT; + mf->xfer_func = V4L2_XFER_FUNC_DEFAULT; if (format->which == V4L2_SUBDEV_FORMAT_TRY) { cfg->try_fmt = *mf; From patchwork Sat Dec 29 17:07:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10744971 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 6360413B5 for ; Sat, 29 Dec 2018 17:08:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 565B328A63 for ; Sat, 29 Dec 2018 17:08:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AF5428AE3; Sat, 29 Dec 2018 17:08:02 +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 F1D5628A63 for ; Sat, 29 Dec 2018 17:08:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727550AbeL2RIB (ORCPT ); Sat, 29 Dec 2018 12:08:01 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39102 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727530AbeL2RIA (ORCPT ); Sat, 29 Dec 2018 12:08:00 -0500 Received: by mail-pf1-f196.google.com with SMTP id r136so11701612pfc.6 for ; Sat, 29 Dec 2018 09:08:00 -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; bh=GsYYj9hvF53lNra8umQJWkpQxGtDlYUa8ZF1UB6gZzQ=; b=NFmOUOCoVajrbEBXFTLSyPw30Jz5slqdqojeN234zCUqsootlA1lk255ZO2WZh+cj/ GdDGWF7KZWMnNvOiwHTc2BG+l2vGLAwlEMlOAAYfnMniUF22Q/XHpaoG1YJkSPtEYauC cfziXD1Py8Zj1N0rU7wj2gowQDvxOaskeuPrD9nN2CjktawkyM7LGUXfF1DkkAAS9Oru J+vrtMRr0O6UdERBR3KxBydlUvcMOrbbr9DgV2v5HLf2R8nRjiYNNKu12yI6S883eWC0 sR2v4NTibFdk+S+5p8HN6n9YzAsPOVjfTKCLZAQkqdT2ZsmGZW70boU9hQn5yHSPq8+E N/bw== 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=GsYYj9hvF53lNra8umQJWkpQxGtDlYUa8ZF1UB6gZzQ=; b=QNum2vDXA8BqJNSX7YsBUtVFUEBOOBWebVP/ADYYa1Yrniu3DmffGKi2aN13jujk6Q s9lL76tP4XROPyeK/ExMaCH5xq8JkftIW/HKlCotH8xwCblSbTcFGxUJkTg6ZdpYS5GQ b7HAb9tjVuUZjhrcJEP3/1WZOIj76jEXHUUXtpiYsexUE2hqMsaXaae+OU0qu4E/KHwF HU+zinYuKgxHvObHmD06MSchFWWkGPQR2RNSPgh8gNRjiLH7SdWeWPR3kRwhibJ250uH IiEki9tLGaoQshHfshjtdPqb01+iGMWG7dl36p3Xql6JUeIGrXvWgJpTo2t8nmg+OwFB dkTw== X-Gm-Message-State: AJcUukeZKbTVBOZrJIeywf60ZdZrvgloVbLcH1Wl3m4xZv5eerTZSM85 sS0Kuj9lqj+DUQPEN49p91ugVdYsdaA= X-Google-Smtp-Source: ALg8bN6P5x3VsDHGyyhV8hGa6U0kTcRt8yeDR3Vy2HKWAYoyEpN+mSCazTICeWsg6s24tIFGm2+gRg== X-Received: by 2002:a63:7154:: with SMTP id b20mr2167994pgn.342.1546103279978; Sat, 29 Dec 2018 09:07:59 -0800 (PST) Received: from localhost.localdomain ([240f:34:212d:1:d91e:35b2:75a8:1394]) by smtp.gmail.com with ESMTPSA id h134sm86856276pfe.27.2018.12.29.09.07.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 29 Dec 2018 09:07:59 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 4/4] media: mt9m111: set initial frame size other than 0x0 Date: Sun, 30 Dec 2018 02:07:38 +0900 Message-Id: <1546103258-29025-5-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546103258-29025-1-git-send-email-akinobu.mita@gmail.com> References: <1546103258-29025-1-git-send-email-akinobu.mita@gmail.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 This driver sets initial frame width and height to 0x0, which is invalid. So set it to selection rectangle bounds instead. This is detected by v4l2-compliance detected. Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/mt9m111.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c index 465e920..638236f 100644 --- a/drivers/media/i2c/mt9m111.c +++ b/drivers/media/i2c/mt9m111.c @@ -1312,6 +1312,8 @@ static int mt9m111_probe(struct i2c_client *client, mt9m111->rect.top = MT9M111_MIN_DARK_ROWS; mt9m111->rect.width = MT9M111_MAX_WIDTH; mt9m111->rect.height = MT9M111_MAX_HEIGHT; + mt9m111->width = mt9m111->rect.width; + mt9m111->height = mt9m111->rect.height; mt9m111->fmt = &mt9m111_colour_fmts[0]; mt9m111->lastpage = -1; mutex_init(&mt9m111->power_lock);