From patchwork Tue Jan 15 14:05:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10764561 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 BEE536C5 for ; Tue, 15 Jan 2019 14:05:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFAD12C57A for ; Tue, 15 Jan 2019 14:05:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A11CF2C5AB; Tue, 15 Jan 2019 14:05: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 3D6D02C5A7 for ; Tue, 15 Jan 2019 14:05:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730299AbfAOOF6 (ORCPT ); Tue, 15 Jan 2019 09:05:58 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:34138 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727060AbfAOOF6 (ORCPT ); Tue, 15 Jan 2019 09:05:58 -0500 Received: by mail-pl1-f193.google.com with SMTP id w4so1354889plz.1 for ; Tue, 15 Jan 2019 06:05: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=Hlnm9D8OUwcR3uZqYdz7phjSb/NYSvzfP6TAHCc46Ks=; b=kTMTJ80Lz2nr78589pVnVy2Vl275T0hpiOEofTkNM+i2xwtVeu0J1KyFt2IuFIWt/H iJi/8UmcrSrp1RGeqm5SP/KN22nkkBPQoSvhUV4arGuq5kZq5SxYw/VSJszTE7wTVp1v RFkofkgV1Q1H5FhPVaAW/2tt5QSNVLDt4NTvBdvhEK1rVOI7YySZ8HMCLjuemdhvbzjR WAUcOjVp/u+aiMNo73TrmKwHCyddRy76Xeg/Wt9UZArqz/2fRy1h/ZQ9cXdnuPkdmsvC rKf6sBHJCzew8QxbYAaeRQe2wndKTRRrEOr/g1OXlXhuUUwR2Zes4r0I8r3DIl0UN7B0 j0LA== 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=Hlnm9D8OUwcR3uZqYdz7phjSb/NYSvzfP6TAHCc46Ks=; b=i2dZME6ZXQs4R0eDtWHOgZkXesT7Co8HlxAK0mfc6jG668gKLOr6X+oa18wVqbIDOq B4o/ckcZ6hOZKsmJLzCdIwwR+7SFospFyEmUOh3f8A3HOd0xRJJP5PKTSXrjGqoUWV8W v9trFDCdh2xvz+JjoqbjhdBvGLQL3J9A/cPuROvi7pT7eIQwc5FWIPZZPp5HrCGJtnV7 tvWDoCVmDFyR+04Na7pJK5bltZpkOxAs64zPKU3lmJAP/Xa4fgtcE2PUlmdnFA//Of0Q 27dnFVHCvrGpDVkpaOLjbnqUhMBtyYZ2GMXIvkgUlj0lZKd+Cs0aKuhu02tTKq4FqYcm 7u7w== X-Gm-Message-State: AJcUukfPn9KXqTcewpccl3tLHcvvIjANtXW8OIWjhUS0iB4b7VqWpwYQ 9pVgw1EdwuG/S+n6moOPEk0yqUVb X-Google-Smtp-Source: ALg8bN7iepZwWACewAv0VOnzMKJLixmPiJFZlthVzpmFf+mMmkG++9VF1zgkMwwPSiIiCkrMQQ+D3Q== X-Received: by 2002:a17:902:6a4:: with SMTP id 33mr4204922plh.99.1547561157312; Tue, 15 Jan 2019 06:05:57 -0800 (PST) Received: from localhost.localdomain ([240f:34:212d:1:5894:91d7:f206:dece]) by smtp.gmail.com with ESMTPSA id c72sm5394125pfb.107.2019.01.15.06.05.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Jan 2019 06:05:56 -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 v3 1/3] media: mt9m111: make VIDIOC_SUBDEV_G_FMT ioctl work with V4L2_SUBDEV_FORMAT_TRY Date: Tue, 15 Jan 2019 23:05:39 +0900 Message-Id: <1547561141-13504-2-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547561141-13504-1-git-send-email-akinobu.mita@gmail.com> References: <1547561141-13504-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 --- * v3 - Set initial try format with default configuration instead of current one. drivers/media/i2c/mt9m111.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c index d639b9b..63a5253 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,25 @@ 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 v4l2_mbus_framefmt *format = + v4l2_subdev_get_try_format(sd, cfg, 0); + + format->width = MT9M111_MAX_WIDTH; + format->height = MT9M111_MAX_HEIGHT; + format->code = mt9m111_colour_fmts[0].code; + format->colorspace = mt9m111_colour_fmts[0].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 +1143,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 Tue Jan 15 14:05:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10764563 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 8DE031390 for ; Tue, 15 Jan 2019 14:06:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CD1C2C11D for ; Tue, 15 Jan 2019 14:06:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 713DB2C5A4; Tue, 15 Jan 2019 14:06:01 +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 1C4EA2C5A7 for ; Tue, 15 Jan 2019 14:06:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730301AbfAOOGA (ORCPT ); Tue, 15 Jan 2019 09:06:00 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:46031 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727060AbfAOOGA (ORCPT ); Tue, 15 Jan 2019 09:06:00 -0500 Received: by mail-pl1-f193.google.com with SMTP id a14so1326358plm.12 for ; Tue, 15 Jan 2019 06:06: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=IzcF86yc78ULv0eXIurT6kXm2dhNFldic57uuQGeChI=; b=bteNh1FEktTDscZpycTLdCdSCBL2ETQbL1TLHHjBvVKJSwN4q4/WdeVHiuetXCiSq2 fOur7QHcuotvHo89Q0iT1A8PTghU6RFDark59oqfxRlNRl79R5+h2Pxzh8JUOguXMTDB 7YlDW+DDUqMwjZIIp3TDR6IaX8tbksbbNL9wjB6QtFyUqP/6PqWvAHPeNRAmWi3l96Gt wsCSUB/ycAyoXGDRVE3p4pM0SJ+uoVqHGcATW9OpK4kizSccGtWUVH7blX92UzXfhuPy Imhk/xCZQMNRkH0sYn5tLlfALIYW61ZsKfYc/25P5+/KCXWV7ZLIznzZ0L/q1vZ/vu2x Z7Uw== 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=IzcF86yc78ULv0eXIurT6kXm2dhNFldic57uuQGeChI=; b=Zp7aFMMp90EieabeRuEm5NA8VeEHhnxM1P4OZio7++VqLKqZm4t8US2YVg1a+PMH+1 4suWZp4MsKTnSxy8Cqi+FNq33ASpzr6yIH+I0YMFEKfRRJWKPR/2LcgV/LXRB1eFeIfE dyi7OSgtw+1ZT5meQ0ENbDUdZxi0JF1eeqa/Xyjv5/CEhsA15MYs2vRYo0bJYF8wUT1L ibGDIgbK1vKjMbOan2icRJMB8tbwV5J3E5nftZwVx7vO16nvBhFTbLWBQGRr8R0Ua6ia CwKk5lp/Aj/OhTK19yu4psqaxY52sYChGG44un8vxF0hmm91YuDwWmPHPm81wmLorvGY FlGQ== X-Gm-Message-State: AJcUukcM4tUTEQ/kXLBtcdEK3U4aO1mrGZ2YqwbFkzFFY7FxxEfMFCXY 7N97hXDiGdkjOebt6guhTkDWEUPT X-Google-Smtp-Source: ALg8bN4LphkEuY/NQu6cyHwUZTyXLKBhnGsk/J1gD2LbnEO1ns0FvWqelalhTCF+/fO78WwUrM6bxw== X-Received: by 2002:a17:902:7d90:: with SMTP id a16mr4136787plm.249.1547561159620; Tue, 15 Jan 2019 06:05:59 -0800 (PST) Received: from localhost.localdomain ([240f:34:212d:1:5894:91d7:f206:dece]) by smtp.gmail.com with ESMTPSA id c72sm5394125pfb.107.2019.01.15.06.05.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Jan 2019 06:05:59 -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 v3 2/3] media: mt9m111: set all mbus format field when G_FMT and S_FMT ioctls Date: Tue, 15 Jan 2019 23:05:40 +0900 Message-Id: <1547561141-13504-3-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547561141-13504-1-git-send-email-akinobu.mita@gmail.com> References: <1547561141-13504-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 v2 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 63a5253..9c92eca 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 Tue Jan 15 14:05:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10764565 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 06F1F6C5 for ; Tue, 15 Jan 2019 14:06:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECF9B2C44C for ; Tue, 15 Jan 2019 14:06:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E098D2C5A4; Tue, 15 Jan 2019 14:06:03 +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 810372C44C for ; Tue, 15 Jan 2019 14:06:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730303AbfAOOGD (ORCPT ); Tue, 15 Jan 2019 09:06:03 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:35308 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727060AbfAOOGC (ORCPT ); Tue, 15 Jan 2019 09:06:02 -0500 Received: by mail-pl1-f194.google.com with SMTP id p8so1352144plo.2 for ; Tue, 15 Jan 2019 06:06:02 -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=V7KJzpokzs/SHc5BLW8fZKNX5ErQEMzpNlRmc6KIPCU=; b=d+JYwnQS8x4yppUMuScio0WhcGdPIfy7BZztOfxpwaY9q8ye/8kLs6unhEAlCC6Var f9DCCWDS+yEr4COwOyavbuwkgbPmh3gqObAFwMAFo5aG1K+LFHNGRDHR12+y34ngOuG1 jkEr0Wh3MGC1sEvvmGxB1ss/VZDEplJOaEASyl37HliBQf7yC+VpXuzpjTZQZ3LhPKTn xvGok4FOohjzgVHtoc31y924FgePY+z1DOkHEoJTQ6Lh7z/eS+hjoyDs1erS/eHxznbM ya14a+TpQup0YyNSAEh/qaudgqhT3YCcLLgNwVV2A89oArIF8NSTKr00dJ6fwIUjxTpR QZFA== 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=V7KJzpokzs/SHc5BLW8fZKNX5ErQEMzpNlRmc6KIPCU=; b=LccU/Mb0Ve2o/tW3djgO1WFwp8lJ3G7jR7vaMza5lnKdpxIsy3xtZAvgkZOPAzt8QI 4Gmz3qprRqdjM3c9nKfenAI5mL/RPOoGVUTZqrgKlf7yOms6eG1KcyCJEqX2ojPQ4nWj Hv70kj06IzdTQKvsxNPgHkXbuNOAPYG2GIm7mumQFpeXA1imfrDQE2CJuvlNfVm8ZK0I yGEg5x3w6RcNHK1TnFnZnygN34VWRiWJeIdEDpG0tpHBKl5Q+8fKx4/oMRRTiYYhHV/r g5ei3U8GpywULPQRr/u/G2vF23V7to+5xqGoJY2Sb1sUOWWobsaUusHgpWIAQIR37Rsv BzQw== X-Gm-Message-State: AJcUukdaSr352UpKkjKOwR/AvVpEE4QaAcpO60uEYZwDUTp2rFSa0xUe 76lSFgyqK/B9hNxB4dmQUUXKSSoD X-Google-Smtp-Source: ALg8bN75+hj0hEYfQNrd/ob+r8F/zfM3LA520/VIoLTIKk2K/jrN05ryh4FlgajewDR0oEqZB9RpNg== X-Received: by 2002:a17:902:4523:: with SMTP id m32mr4266777pld.53.1547561161818; Tue, 15 Jan 2019 06:06:01 -0800 (PST) Received: from localhost.localdomain ([240f:34:212d:1:5894:91d7:f206:dece]) by smtp.gmail.com with ESMTPSA id c72sm5394125pfb.107.2019.01.15.06.05.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Jan 2019 06:06:01 -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 v3 3/3] media: mt9m111: set initial frame size other than 0x0 Date: Tue, 15 Jan 2019 23:05:41 +0900 Message-Id: <1547561141-13504-4-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547561141-13504-1-git-send-email-akinobu.mita@gmail.com> References: <1547561141-13504-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 v2 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 9c92eca..5168bb5 100644 --- a/drivers/media/i2c/mt9m111.c +++ b/drivers/media/i2c/mt9m111.c @@ -1310,6 +1310,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);