Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2206480rwi; Sat, 15 Oct 2022 09:33:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM55QxUAGJnoT4c4Zz0lB7TIr7hycyn371TkA9Zbut/gb/NZfcsrHGLo5TByDn8O0VpFKnWy X-Received: by 2002:a17:903:489:b0:17c:b4b9:6606 with SMTP id jj9-20020a170903048900b0017cb4b96606mr3644036plb.30.1665851597456; Sat, 15 Oct 2022 09:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665851597; cv=none; d=google.com; s=arc-20160816; b=egtaSydHOj/hdIK0uL+9OHXesHnT35BEKZ0BpR625XitLzd4qYnsQqZD92MYvpHIky zXu8Fo7Cvq0ZqLGWVDaD9IE0Khv5EJzvYa4IF+EQ1wcZb/8Mlnko9d0tBLwr/9Z5WB28 3+KxKHq52PAhgEq46AOy/pixkYzz8icc4t6aO1fOpz3KVdvDigoAkLvO7RbGbiogFXzx oC1kW4tQ1HsvxlSGndQ6yKYcg4KSJZTa+Ac3IRZrcpLx77HBSeCoyQW5lVdVIQlYjCNP nVzudi0I5RmAYBgt5/jtb4r0ZqnEZvRKV+ZUBfu/aDsbEA3uSXE05qkTUwnbI+W72Bd1 sZZA== 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=fUTRBuwjit5z8YMYjFVUP7O9m6eIIdGB/fQfW1QNmRw=; b=EHnSKyzsPnstDnN7IMyYBuOKwbKvKMzScfBuxvpPxPeEoAXjZgIAym8qIIpGt1c9KJ rS69oCBeYT/1buhb9BFwO8vSxt06Uttv9VRChIwbHzf8r8QBOSueN1pZcNtz3tVMD9c5 O/dLCd9aF+FfPHu9qBcqWm7pX9ZybUIggFQsIHgU4ywDnASbj8DKLOENDHwG527rByAt 1fHORdKFi8y/FqHVolpizWQ0SfrDMlOnKxDUy9Avi6aOjKmTsh3U9r5xrkZqlJh3Ek+Z FEOmG1FPtg2UTeocEkElzdtbtEkusMwqBIICQNXkq8XsNYZiRvgZ0CTCAn9SEtJ1M0S6 oC+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gg82aqVO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p5-20020a1709026b8500b00176c12fef06si6218605plk.25.2022.10.15.09.33.04; Sat, 15 Oct 2022 09:33:17 -0700 (PDT) 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 header.i=@kernel.org header.s=k20201202 header.b=gg82aqVO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229792AbiJOP42 (ORCPT + 99 others); Sat, 15 Oct 2022 11:56:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbiJOP41 (ORCPT ); Sat, 15 Oct 2022 11:56:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B46850FAA; Sat, 15 Oct 2022 08:56:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 245A560D29; Sat, 15 Oct 2022 15:56:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BDBCC433D6; Sat, 15 Oct 2022 15:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665849385; bh=QGSTjg5RYI5bnHPXoE3XKdNotgMZOaQIAFpSpm3dcI8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gg82aqVOXCtuNJfFEX2Xn/i+g8Z3yiXXg9hlOSFeCFRv1sqhtP0kUMU5WxRlobdfg d68+7eDOVWjNm5+PDT564x9JpWbpPdFSSHsmTPl5oCN0+lP8S39ia6HY7aK2BJ0ipx tkwELDC2kB0DyCIh9njpFt01uWryuUdb/xU288n9gBSdMu+TLdHi9zpcvwcUC2Xi7P /uAI/NWfFaAxd4TJ6nJ0NHTsjZeSVJoO+wbJvBQAoSTQqFfqYXWaonztdx/yspiSOd Zjrc9u3faL6mIoEHHxkinWLz/8b1uemnJUzMWKmW+6Tv/swI4stctso0P3ObDn4x4P uNfvT+EWVm1Fw== Date: Sat, 15 Oct 2022 16:56:49 +0100 From: Jonathan Cameron To: Olivier Moysan Cc: Rob Herring , Alexandre Torgue , Andy Shevchenko , Fabrice Gasnier , Lars-Peter Clausen , Maxime Coquelin , , , , , Subject: Re: [PATCH v4 1/8] iio: adc: stm32-adc: fix channel sampling time init Message-ID: <20221015165649.7720a101@jic23-huawei> In-Reply-To: <20221012142205.13041-2-olivier.moysan@foss.st.com> References: <20221012142205.13041-1-olivier.moysan@foss.st.com> <20221012142205.13041-2-olivier.moysan@foss.st.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; 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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Wed, 12 Oct 2022 16:21:58 +0200 Olivier Moysan wrote: > Fix channel init for ADC generic channel bindings. > In generic channel initialization, stm32_adc_smpr_init() is called to > initialize channel sampling time. The "st,min-sample-time-ns" property > is an optional property. If it is not defined, stm32_adc_smpr_init() is > currently skipped. > However stm32_adc_smpr_init() must always be called, to force a minimum > sampling time for the internal channels, as the minimum sampling time is > known. Make stm32_adc_smpr_init() call unconditional. > > Fixes: 796e5d0b1e9b ("iio: adc: stm32-adc: use generic binding for sample-time") > Signed-off-by: Olivier Moysan So I'm crossing my fingers a little that this fix and the rest of the series can go through different paths - looks like it should be clean. Applied to the fixes-togreg branch of iio.git and marked for stable. Thanks, Jonathan > --- > drivers/iio/adc/stm32-adc.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c > index 6256977eb7f7..3cda529f081d 100644 > --- a/drivers/iio/adc/stm32-adc.c > +++ b/drivers/iio/adc/stm32-adc.c > @@ -2086,18 +2086,19 @@ static int stm32_adc_generic_chan_init(struct iio_dev *indio_dev, > stm32_adc_chan_init_one(indio_dev, &channels[scan_index], val, > vin[1], scan_index, differential); > > + val = 0; > ret = fwnode_property_read_u32(child, "st,min-sample-time-ns", &val); > /* st,min-sample-time-ns is optional */ > - if (!ret) { > - stm32_adc_smpr_init(adc, channels[scan_index].channel, val); > - if (differential) > - stm32_adc_smpr_init(adc, vin[1], val); > - } else if (ret != -EINVAL) { > + if (ret && ret != -EINVAL) { > dev_err(&indio_dev->dev, "Invalid st,min-sample-time-ns property %d\n", > ret); > goto err; > } > > + stm32_adc_smpr_init(adc, channels[scan_index].channel, val); > + if (differential) > + stm32_adc_smpr_init(adc, vin[1], val); > + > scan_index++; > } >