From patchwork Thu Jan 10 15:28:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10756057 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 A2F1291E for ; Thu, 10 Jan 2019 15:28:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9298128EF7 for ; Thu, 10 Jan 2019 15:28:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85BDC28F83; Thu, 10 Jan 2019 15:28: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 25F2C28EF7 for ; Thu, 10 Jan 2019 15:28:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729108AbfAJP2u (ORCPT ); Thu, 10 Jan 2019 10:28:50 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36576 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727793AbfAJP2u (ORCPT ); Thu, 10 Jan 2019 10:28:50 -0500 Received: by mail-pl1-f196.google.com with SMTP id g9so5338325plo.3 for ; Thu, 10 Jan 2019 07:28: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; bh=oRLQpJfC6sZ1ksdB3sjUANiu4JbRPckOpm5gxomixO4=; b=BBu73nkJdsbYAjVMr34t4tuAZg7ImzIHLrw5Tse8SyN/Fq3h+Idog35KhXLdgjZCvq c8Gd6B480iadXsPFOgfVtb/GT5CU3CUPAywGRqskShtwcrPlhUFAh94CuNnw+1t3zauV uViHIIkvtO2/WcSWNSohSJi5LWQbHrKSvHTIY0gxiiSEeF5rGYHK6iRV1mOg+SC+zW9v q7VjwgNZb0d1RCCzU3EryIYyF/w5lUhWjQVpJn0zVuFZQRrSZME4cN5vOlfarZ1e5RIw ikDk6bJdnZr6srdv5WSjHaXSq0Kszb+HE+I51k53KzzpZ/lmvTSa+DdfSNpTPRJPirbk reZg== 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=oRLQpJfC6sZ1ksdB3sjUANiu4JbRPckOpm5gxomixO4=; b=fBHkA2OemmRah4HWthmvzeDxeZ7XEmAjTdQpUN6MvsTYdkMi47nmIr3J3u8tO8bZtE fSxSBT5Mbb6dJACrZJpb5klgGO+R8aJeDx4KD0iD+kEmnl25O7zb/JP+8DOr6csauGSW 8PXgyIuvdb+lHl7AbJjtIvnhEZ4IeCYXd/1QguQ6uxhRUdls0gTumZIzGk7xWJL86Wcy rniFCOUJkauyPfW4gOc9zwTUOu/qBOtRLWkQa3yvXxgzhuQAcPDvX3GJhopIkKVyH9wR epUUKTETaT+oLrnjEFhbQehFXc++6Om2d5DbucSr23t3lXFKw3E15+4SwIde7oPjiRPL NnEQ== X-Gm-Message-State: AJcUukcs45f6ryTliRArwOou8vA531a6J/IXTBgDbfPbTgFq/8BnS60N melK+gwhyy0V5vOL3/Fb2IbmKI2X X-Google-Smtp-Source: ALg8bN6tjmRxrjbl5MElKMQea4wQR+eVkizgCWcTg09C1eW5JUw/tl7wlH3Z2rq7MOl/gMbsbRAelw== X-Received: by 2002:a17:902:2c03:: with SMTP id m3mr10252465plb.6.1547134129778; Thu, 10 Jan 2019 07:28:49 -0800 (PST) Received: from localhost.localdomain ([240f:34:212d:1:25a3:d6ca:ee6b:e202]) by smtp.gmail.com with ESMTPSA id y1sm105916116pfe.9.2019.01.10.07.28.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jan 2019 07:28:49 -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 v2 1/3] media: mt9m111: make VIDIOC_SUBDEV_G_FMT ioctl work with V4L2_SUBDEV_FORMAT_TRY Date: Fri, 11 Jan 2019 00:28:27 +0900 Message-Id: <1547134109-21449-2-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547134109-21449-1-git-send-email-akinobu.mita@gmail.com> References: <1547134109-21449-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: Enrico Scholz Cc: Michael Grzeschik Cc: Marco Felsch Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- * v2 - Use format->pad for the argument of v4l2_subdev_get_try_format(). 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 d639b9b..eb5bf71 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, format->pad); + format->format = *mf; + return 0; +#else + return -ENOTTY; +#endif + } + mf->width = mt9m111->width; mf->height = mt9m111->height; mf->code = mt9m111->fmt->code; @@ -1089,6 +1099,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) { @@ -1114,6 +1144,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 Thu Jan 10 15:28:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10756059 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 1910891E for ; Thu, 10 Jan 2019 15:28:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0597E28EF7 for ; Thu, 10 Jan 2019 15:28:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB9E928F83; Thu, 10 Jan 2019 15:28:53 +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 993C328EF7 for ; Thu, 10 Jan 2019 15:28:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729176AbfAJP2x (ORCPT ); Thu, 10 Jan 2019 10:28:53 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33368 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727793AbfAJP2w (ORCPT ); Thu, 10 Jan 2019 10:28:52 -0500 Received: by mail-pl1-f194.google.com with SMTP id z23so5351970plo.0 for ; Thu, 10 Jan 2019 07:28:52 -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=vbK0onps6QNpGFPH3w79wJbQWfWBHGk9EgEyiWWP5OI=; b=KGymEQW+iZWOMvUYRVwF2jaFkfxB4C2fOQP1iJQepWH+KJJZAmRMRL/qfqX1suog5C HsXz2b67pQ7Jilan7qsoxzA4HMU145ED0JsNbrF385cy2D1Pa4xeyc5HnFohZ4jg4uqJ pbBcITu9kED0fDZzer5N/FaR7AKm2XE5oeebV2ikk2zamuxlMWXdEZ7dio6m8Z4VIxE+ sQEozr8F9i8y6ZbZwaPGkhZGZme1I2xAlR/958tb/v+lYEzX0kQH5loPjxXYJadQpy5o NwZPl4WNd8ZZdrIT7AzNqbKFnpS+9NrIIIaC3bHvacCW603Se6su3lWCeTz3hAvuXenY 5o+Q== 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=vbK0onps6QNpGFPH3w79wJbQWfWBHGk9EgEyiWWP5OI=; b=lvDBCvi4ww4GR7IZh5XyUFhHcpIumzFGM4rIVX9wAlfTkX0+M2jPWtiAePu2cz0OmJ z93Rg52Ow28NF/BFOM/5qeUqifPg2GPJm2gxD9SVZPRTWlTWfmf1Oz/8xT6g67Y2ajW2 0G+hQEaUZHS4MXnHBiB8IRL/doYWU8evkK0PIkfWJvqLrgJlAsl/OtZ4wCygV6nUl20j q86GqVHKRBU5Nl9OAzU1LUgCCuhGHnz8UXqAZUQdr89Bcsg9LY+hKq5JtK0JfwQAIF6O X3O9qvVRWcUwIhDfPtBKC5QTwQTual3jAb/rJ2/1bP52bEIjkc0T4YOMg4wMoxyPmlWk gyZA== X-Gm-Message-State: AJcUukdFh9QW/g/HHN/mri7x8UdRo94OYLlqr3aarwjnn08xuvArOb6H 51xnikqdlQEwe/ucVdoBoDD6uwZK X-Google-Smtp-Source: ALg8bN6gu2Q43kveMNX2nihPt/YGT4B6PGyuRMjZNa9loXsFldteTeXdnsxnmP9680HE/R0hglwHiQ== X-Received: by 2002:a17:902:b68d:: with SMTP id c13mr10785967pls.102.1547134131931; Thu, 10 Jan 2019 07:28:51 -0800 (PST) Received: from localhost.localdomain ([240f:34:212d:1:25a3:d6ca:ee6b:e202]) by smtp.gmail.com with ESMTPSA id y1sm105916116pfe.9.2019.01.10.07.28.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jan 2019 07:28:51 -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 v2 2/3] media: mt9m111: set all mbus format field when G_FMT and S_FMT ioctls Date: Fri, 11 Jan 2019 00:28:28 +0900 Message-Id: <1547134109-21449-3-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547134109-21449-1-git-send-email-akinobu.mita@gmail.com> References: <1547134109-21449-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: Enrico Scholz Cc: Michael Grzeschik Cc: Marco Felsch Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- * No changes from v1 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 eb5bf71..e758b4d 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; } @@ -670,6 +673,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 Thu Jan 10 15:28:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10756061 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 F25DA1515 for ; Thu, 10 Jan 2019 15:28:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E15E128EF7 for ; Thu, 10 Jan 2019 15:28:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D561B28F83; Thu, 10 Jan 2019 15:28: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 858E928EF7 for ; Thu, 10 Jan 2019 15:28:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729657AbfAJP2z (ORCPT ); Thu, 10 Jan 2019 10:28:55 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:44610 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729188AbfAJP2y (ORCPT ); Thu, 10 Jan 2019 10:28:54 -0500 Received: by mail-pl1-f196.google.com with SMTP id e11so5328415plt.11 for ; Thu, 10 Jan 2019 07:28: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=BRjm403oirrjQoDG14oEXNOcD7lBBEEACEf3lxalZ68=; b=tev/FkFbcYCRUN8zRo93Vmwin/3OyjvHgXyzR2Ii9l2KQjYMd97FBo263TLJCiD86o M+rb3Fon+4ky2ri/TBR72WEjC4MGxewH03TxJOxDBjAvSX6Zedp/q6oCcrW5Uvonnp0B ndzB7wz/gWN/EDXHTcmotgJpOUwQ6aIL+JlfwkSLCiaPIKKtxrLKYYxvBx8P6lhzp8fV ok/HNMmguWtYxw19dyh5xH1cbbij3sdLxiIFoqc61U9s6XJkgfmqvNgGx28nG/XKF7Wx UUcawVIeFzfo8vkmeTf3ylN2EzYTcjDKy1uRPTpgk19gOFaSj0OAuoNIwAPliTCuspOp jnCQ== 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=BRjm403oirrjQoDG14oEXNOcD7lBBEEACEf3lxalZ68=; b=jsBQRdAuD2i4LOHm/+fCj1XtI6Mo77NyDgL/s6+aFDjAtw0iqtdqwnjW8mW18Q1JhT L0C33y3+0TOB5Zxfx5KDM2idAUrqOzRZkRQIjSji+XPhm4696k2bSoE2HlNt2nPSR9js oDjVA35APQSVQcMUhbZqTj1gxAVE7rUwmo7FzI+3T3/OXO/vQd6VeRnvCcE3KVqPB4cz 7j3txMnrkrLJdsW9IzsmokfkmQYtbm/Cf7ey1J/o1hIshpX6YVXU5xjn9H65D/meC1Su wZi7HvGDYyOZPzRIUNhBmcBE4fBup86cLaP2KtQaWakRGF6p5KPRfgsBfe6X69v/h/ts zo2g== X-Gm-Message-State: AJcUukdXdcE/G8AXC2W+c9exsTprEISA7Yv1xkd7pwYvkj5h/c2rFXfo y5I4661+0VWKcBmf4fsof9NLF0SS X-Google-Smtp-Source: ALg8bN6Sxrd7a3B58rMPIzOezBRfp/G0b9yjwHo15LcKm5g/ee+yNi0f94jGunhDdUZiXT9+MaVs5w== X-Received: by 2002:a17:902:ab92:: with SMTP id f18mr10366360plr.221.1547134134142; Thu, 10 Jan 2019 07:28:54 -0800 (PST) Received: from localhost.localdomain ([240f:34:212d:1:25a3:d6ca:ee6b:e202]) by smtp.gmail.com with ESMTPSA id y1sm105916116pfe.9.2019.01.10.07.28.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jan 2019 07:28: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 v2 3/3] media: mt9m111: set initial frame size other than 0x0 Date: Fri, 11 Jan 2019 00:28:29 +0900 Message-Id: <1547134109-21449-4-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547134109-21449-1-git-send-email-akinobu.mita@gmail.com> References: <1547134109-21449-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: Enrico Scholz Cc: Michael Grzeschik Cc: Marco Felsch Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- * No changes from v1 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 e758b4d..c442f80 100644 --- a/drivers/media/i2c/mt9m111.c +++ b/drivers/media/i2c/mt9m111.c @@ -1311,6 +1311,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);