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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D5DE0C4332F for ; Sat, 15 Oct 2022 15:57:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc: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=w4Ta2/Gg9TifBgIO6Xg8Vllz9P6sdEojta1M58wy9OE=; b=nltuDLjCvFY7Pc VO47m3yZr4YTJKPT/sm2EIo+yRNgpKAkTBUTdhATkGKXoF11x9B8siKU2/aM2m8HhRek9zM+6KpI4 BYWsyfzHiCZ+AwdFMV+PNLI0Xsv/baI/GzelSQa4Pu1V2tV4Qh7WnyfTj05zS6hccqS+UisOCXiwx xX4ipTD9I1Nu7epqVbE2C+t6qWOSzfx83evI7KKWT2NF4kBDAYEBllmqBHKD0/dpSgQ31q36+R+i+ QKRxfVWk2kXDGP4tisHGJMN+iXA3xAtp74CX3e7gyNVkDwXsxHhNNKgXbs1UZ7KCKqTxD2pzNMkMf xTLuMsGBPhs8iwc5VqRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ojjWY-00HBvT-P6; Sat, 15 Oct 2022 15:56:30 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ojjWV-00HBub-E2 for linux-arm-kernel@lists.infradead.org; Sat, 15 Oct 2022 15:56:28 +0000 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 200C260C5E; 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221015_085627_582922_5FF352F4 X-CRM114-Status: GOOD ( 21.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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++; > } > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel