Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp388998rdb; Sat, 30 Sep 2023 08:17:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2CevfUkVCQAzbWtwSwcj6l7u1q4mSTFtm6X8GoxOWqpfLBdHB0nCsPNU5nhNjRphAuL0B X-Received: by 2002:a17:903:1247:b0:1c4:3cd5:4298 with SMTP id u7-20020a170903124700b001c43cd54298mr8528429plh.18.1696087021595; Sat, 30 Sep 2023 08:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696087021; cv=none; d=google.com; s=arc-20160816; b=CV0mzte+dp3qbfM/msplHPFKnZCjJ7YIsJvUvxwExrUEuMJe4BeNi6M1lISzhJZnuh TCED/eSqAaxUxcxkYpD1Ra23zIFj1/yfPMrSeDA72M7t8A9SbowePhcQaaJ1t5f7UiQn HBjk7cekNLGDBxhZaJVjRdSAQXsJWJeos2lR7aygP5knUSbnQ3uHYhMg9vJc3ZeFf2eA Hjcb6mHqWeTFmng10cZPWOmO8iueeUCIjG1k+oxWZapx7Ol6/cTbMCqMC7NEmiBziLed 3rCq8ba4QQ6qMdfEv8peW8QCbymhfc/x3dFVs6TpWe5xxmEyfPYTzA/TDwHdK8U4DJBQ edrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=wa63/5fAZknlS6B/yO1MXsCpRgLu/Toql5dYMlrddJA=; fh=e9lXfbAZmLMG/YSSxlbXRgGopMc52ojan+iACBc5a/Y=; b=UqRa3IEtagQnnlMNQd+nfm353KVkekHJLQd0ocS4NFawSZF6WhNcaX/s+wUbKS8AsV vfvhBwPvAr/OfD9mPiQy4hILv0dnkxZMwbV6uXqLA7NXehrs4NinZF+ngfmJRS5gJO/g IYYOWOkx65Iemk7aKVKhjN0SAPlkW/qCZPeivrq2xVV7Klz974DjUF6Ikpn8j6u2IGr+ QCW3oLMuxnFsL+ILA4+LHYdu1QboBo+arAjGNKfu2l3ivdvtoMrgZesKf53M2w9+ZCoL 8nkLZRBIujJEYWVJWo2jl3Hto3PTcGNFQl8SFgzjcMYynyFs0RnmEUz4uhKP+SapsyVS m2/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qrydavIh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id kp14-20020a170903280e00b001c3e8a6748asi15864104plb.644.2023.09.30.08.17.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 08:17:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qrydavIh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C69268028857; Sat, 30 Sep 2023 08:15:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234418AbjI3PPr (ORCPT + 99 others); Sat, 30 Sep 2023 11:15:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234403AbjI3PPq (ORCPT ); Sat, 30 Sep 2023 11:15:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9486E3; Sat, 30 Sep 2023 08:15:44 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 782CDC433C7; Sat, 30 Sep 2023 15:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696086944; bh=hRndYACHXPOhZ82VVELJZJz9qqQwJ4BMoQZVmLoxOE0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qrydavIhS8QQ9TlkbXK+yVpFh3YPFwrS3tuIMBB2w66IUjLewjHQV762t4nHG/K4L /x4Dy2M9r4EHegkKRYNWgMIa6VMyERVR5CFJwqnwdnVGGkszZuMavwYd2xUkqiE5A3 nS/F3DjG7Jn6s9x0AcI/OQ5dPFxRIn3wwgEWEyjJeffzjF7xnL4zXwLsHz/T9aVV8i ELtylheIik7oGvzEzsNlSPMTL84i15+Jkt8Wuc/nAc8E425UJmeBANCITbR78+KS4l eHQB1gibLBZ56QPxHx9r7A0U0/Hq+jfZA39Sq/eK2rRTCRp0hRf0+Hm+vc1FXlksiH LbFaPkLz1HfBQ== Date: Sat, 30 Sep 2023 16:15:43 +0100 From: Jonathan Cameron To: David Lechner Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-staging@lists.linux.dev, David Lechner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , Nuno =?UTF-8?B?U8Oh?= , Axel Haslam , Philip Molloy , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 18/27] staging: iio: resolver: ad2s1210: convert resolution to devicetree property Message-ID: <20230930161543.22c3833e@jic23-huawei> In-Reply-To: <20230929-ad2s1210-mainline-v3-18-fa4364281745@baylibre.com> References: <20230929-ad2s1210-mainline-v3-0-fa4364281745@baylibre.com> <20230929-ad2s1210-mainline-v3-18-fa4364281745@baylibre.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 30 Sep 2023 08:15:51 -0700 (PDT) On Fri, 29 Sep 2023 12:23:23 -0500 David Lechner wrote: > From: David Lechner > > From: David Lechner > > Selecting the resolution was implemented as the `bits` sysfs attribute. > However, the selection of the resolution depends on how the hardware > is wired and the specific application, so this is rather a job for > devicetree to describe. > > A new devicetree property `adi,resolution` to specify the resolution > required for each chip is added and the `bits` sysfs attribute is > removed. Description need updating to reflect property having a different name. Otherwise this LGTM > > Since the resolution is now supplied by a devicetree property, the > resolution-gpios are now optional and we can allow for the case where > the resolution pins on the AD2S1210 are hard-wired instead of requiring > them to be connected to gpios. > > Signed-off-by: David Lechner ... > > +static int ad2s1210_setup_properties(struct ad2s1210_state *st) > +{ > + struct device *dev = &st->sdev->dev; > + u32 val; > + int ret; > + > + ret = device_property_read_u32(dev, "assigned-resolution-bits", &val); Doesn't match patch description of what this is called. > + if (ret < 0) > + return dev_err_probe(dev, ret, > + "failed to read assigned-resolution-bits property\n"); > + > + if (val < 10 || val > 16) > + return dev_err_probe(dev, -EINVAL, > + "resolution out of range: %u\n", val); > + > + st->resolution = (val - 10) >> 1; > + > + return 0; > +} > +