From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 601B6C433DF for ; Tue, 26 May 2020 09:18:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 303242073B for ; Tue, 26 May 2020 09:18:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sB8gUcAu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 303242073B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=iki.fi Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aqtve4yooEdkMiQyBqL+0L0l5L626/CYlxiC7gA87vQ=; b=sB8gUcAu87QZcM emT7hK4UbvO/THttsci14XS2R7E0h/+H7sEpwLhB96cECiiS4JNaH68pA1Y6QAjJ3OEXAaoW8tDv3 jOIJbwmdKstsA5TaAh535TMrOJzoj9lfF9j6hkagm6JMTuNzFhOLkwwpLkPXzqPpK+Tn8Av3mwjWA EOa2OaELSOvteyfCfGj472aBogyvEjWtX6u5jgY8XpBGw1UIFmxZ2+KPId0Vdu9c6K/V6MdFb7qrl TejQ0IlcE9KoUJN9SW418vh5ES6vxH6a82G00EOEqFK8V6Vfrt1iWjFtGdDpKc0s4my++ixrsO50+ kWWT+TwrgmOsBwsVgsZA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdVin-0006ge-Ru; Tue, 26 May 2020 09:18:05 +0000 Received: from hillosipuli.retiisi.org.uk ([2a01:4f9:c010:4572::81:2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdVil-0006gJ-0W for linux-arm-kernel@lists.infradead.org; Tue, 26 May 2020 09:18:04 +0000 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id A14B4634C87; Tue, 26 May 2020 12:17:16 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1jdVi0-0002Rz-M8; Tue, 26 May 2020 12:17:16 +0300 Date: Tue, 26 May 2020 12:17:16 +0300 From: Sakari Ailus To: Andrey Konovalov Subject: Re: [PATCH v3 08/10] media: i2c: imx290: Add support to enumerate all frame sizes Message-ID: <20200526091716.GJ8214@valkosipuli.retiisi.org.uk> References: <20200524192505.20682-1-andrey.konovalov@linaro.org> <20200524192505.20682-9-andrey.konovalov@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200524192505.20682-9-andrey.konovalov@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200526_021803_230089_D42186EA X-CRM114-Status: GOOD ( 14.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, c.barrett@framos.com, linux-kernel@vger.kernel.org, a.brela@framos.com, peter.griffin@linaro.org, manivannan.sadhasivam@linaro.org, mchehab@kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Andrey, On Sun, May 24, 2020 at 10:25:03PM +0300, Andrey Konovalov wrote: > From: Manivannan Sadhasivam > > Add support to enumerate all frame sizes supported by IMX290. This is > required for using with userspace tools such as libcamera. > > Signed-off-by: Manivannan Sadhasivam > Signed-off-by: Andrey Konovalov > --- > drivers/media/i2c/imx290.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c > index 6e70ff22bc5f..88850f3b1427 100644 > --- a/drivers/media/i2c/imx290.c > +++ b/drivers/media/i2c/imx290.c > @@ -471,6 +471,25 @@ static int imx290_enum_mbus_code(struct v4l2_subdev *sd, > return 0; > } > > +static int imx290_enum_frame_size(struct v4l2_subdev *subdev, > + struct v4l2_subdev_pad_config *cfg, > + struct v4l2_subdev_frame_size_enum *fse) > +{ > + if ((fse->code != imx290_formats[0].code) && > + (fse->code != imx290_formats[1].code)) > + return -EINVAL; Please skip the modes that do not have the code specified by the user. They should not be enumerated here. > + > + if (fse->index >= ARRAY_SIZE(imx290_modes)) > + return -EINVAL; > + > + fse->min_width = imx290_modes[fse->index].width; > + fse->max_width = imx290_modes[fse->index].width; > + fse->min_height = imx290_modes[fse->index].height; > + fse->max_height = imx290_modes[fse->index].height; > + > + return 0; > +} > + > static int imx290_get_fmt(struct v4l2_subdev *sd, > struct v4l2_subdev_pad_config *cfg, > struct v4l2_subdev_format *fmt) > @@ -850,6 +869,7 @@ static const struct v4l2_subdev_video_ops imx290_video_ops = { > static const struct v4l2_subdev_pad_ops imx290_pad_ops = { > .init_cfg = imx290_entity_init_cfg, > .enum_mbus_code = imx290_enum_mbus_code, > + .enum_frame_size = imx290_enum_frame_size, > .get_fmt = imx290_get_fmt, > .set_fmt = imx290_set_fmt, > }; -- Regards, Sakari Ailus _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel