Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13315700rwl; Wed, 4 Jan 2023 06:35:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXuhk/qdjAsZFQhcywglTEvflBC0VG35Tgeoq21l5tUX6Ze6BWnnR570Ah1UUYZYhlhfM/A6 X-Received: by 2002:a17:902:a510:b0:192:48d1:f06c with SMTP id s16-20020a170902a51000b0019248d1f06cmr44618945plq.35.1672842929943; Wed, 04 Jan 2023 06:35:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672842929; cv=none; d=google.com; s=arc-20160816; b=XjM1x6JuyLyZCWDR7K4h5bLKXiJbEhHE5l4cMuOxcOjGK3AuQiADXY3yMc61HiIjQd d34MXLPlG3h8bo5nfNmzANYR4m5imZeqMBWKVB5nYFidjvT9ie7rzIT+1t7OK/HM8IsF 6N6r0w9oiYYJHExOrnH2l7Afap+UEr9hUJ3HE1B+SMJUQ4Ssya3F56jRrHeqsy6A/2q8 8zKa+Q25VTd22Ud8QqiGAQaJXpRHF+xeBGy9xvdfynci6jsiIQ/O2eKyXVEFzx1zlfPl us+LnxLojjYWLedQE8T7G1V1Wbcr6EzinxYcsn7sVqGUXHnxm6Fexuu9VfKfMR66nBKM 4pHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=avpPF0KFA0KkSa1/Sfl63nUI1uchYXXjpLRpQW8D1oE=; b=sOzpUVIQSC9QOyKlne1pfJ7WhMTmN1MOU1rBlpOTtaCijjDF4fHoEzWbUpbeR9BldW TfMN7qJR4Oymcz+fR2zHA6jAyLYvyGbQjQco+MhLPN7gpQbHUmwi9zexN/K/c6mahPgC QlkBMBB4GWhZex7J8Amc13YEbtfhHxJ95515qRCzxVv8Lq7TJrfTETzt+qunT4GHpdQ/ +qWAzZk3nRvvDi7zHntPq0mcLN4TzNuoeHIgvJHf3ZIvtxAGuuEaMrd8rXr8Y5dEMEd7 ed81WeB69w5adQ9ElpbvS8tpf8l3MKnbOUOApX5Tkf4Q6H6HdwDhpxg47gWz6AxIeyK/ wyeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=RaOsVC2Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a635c04000000b0043cad841eb1si35634445pgb.827.2023.01.04.06.35.22; Wed, 04 Jan 2023 06:35:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=RaOsVC2Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229743AbjADOMh (ORCPT + 58 others); Wed, 4 Jan 2023 09:12:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239742AbjADOMJ (ORCPT ); Wed, 4 Jan 2023 09:12:09 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92E0D1EEEF; Wed, 4 Jan 2023 06:12:05 -0800 (PST) Received: from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 855D76F0; Wed, 4 Jan 2023 15:12:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1672841522; bh=msUYvAx7nht3qkWr7r2R/VeKP9ruGiKSIVIO/mml9Fw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RaOsVC2Yn3RRXAMOBkNE7Zh3BYIS+mpWQJtUUN+Hypq2K164Zzw0pMuXN+v6qQFlB AsvlWWd/UZCT0ExN/PKbTKyQWSRadFxAH/CJhg8spJz64MoHYr2KH1F2ySEa0QLMeJ lUkrFVLRyMphz2bDgKmWCe4k5f3AMqTJ4ACWj+Xk= Date: Wed, 4 Jan 2023 15:11:59 +0100 From: Jacopo Mondi To: Robert Mader Cc: linux-kernel@vger.kernel.org, nicholas@rothemail.net, javierm@redhat.com, Sakari Ailus , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: Re: [PATCH v2] media: i2c: imx258: Parse and register properties Message-ID: <20230104141159.e2klapbpenslxqbx@uno.localdomain> References: <20230104122337.123055-1-robert.mader@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230104122337.123055-1-robert.mader@collabora.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robert On Wed, Jan 04, 2023 at 01:23:37PM +0100, Robert Mader wrote: > Analogous to e.g. the imx219. This enables propagating > V4L2_CID_CAMERA_ORIENTATION and V4L2_CID_CAMERA_SENSOR_ROTATION > values. > The motivation is to allow libcamera detect these values from the > device tree and propagate them further to e.g. Pipewire. > > While at it, reserve space for 3 additional controls even if > v4l2_ctrl_new_fwnode_properties() can only register 2 of > them, to fix the existing implementation which reserve space for 8 > controls but actually registers 9. > > Changes in v2: > - Reserve 11 instead of 10 controls > - Change order of variable declaration > - Slightly extend description This part should go below, after ---, as it shouldn't be part of the commit message The patch looks good Reviewed-by: Jacopo Mondi > > Signed-off-by: Robert Mader > --- > drivers/media/i2c/imx258.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c > index eab5fc1ee2f7..3b560865b657 100644 > --- a/drivers/media/i2c/imx258.c > +++ b/drivers/media/i2c/imx258.c > @@ -9,6 +9,7 @@ > #include > #include > #include > +#include > #include > > #define IMX258_REG_VALUE_08BIT 1 > @@ -1148,6 +1149,7 @@ static const struct v4l2_subdev_internal_ops imx258_internal_ops = { > static int imx258_init_controls(struct imx258 *imx258) > { > struct i2c_client *client = v4l2_get_subdevdata(&imx258->sd); > + struct v4l2_fwnode_device_properties props; > struct v4l2_ctrl_handler *ctrl_hdlr; > s64 vblank_def; > s64 vblank_min; > @@ -1156,7 +1158,7 @@ static int imx258_init_controls(struct imx258 *imx258) > int ret; > > ctrl_hdlr = &imx258->ctrl_handler; > - ret = v4l2_ctrl_handler_init(ctrl_hdlr, 8); > + ret = v4l2_ctrl_handler_init(ctrl_hdlr, 11); > if (ret) > return ret; > > @@ -1232,6 +1234,15 @@ static int imx258_init_controls(struct imx258 *imx258) > goto error; > } > > + ret = v4l2_fwnode_device_parse(&client->dev, &props); > + if (ret) > + goto error; > + > + ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx258_ctrl_ops, > + &props); > + if (ret) > + goto error; > + > imx258->sd.ctrl_handler = ctrl_hdlr; > > return 0; > -- > 2.39.0 >