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 3A8DEC433FE for ; Sun, 9 Oct 2022 12:43:33 +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=0a5GzXlINoJr5iHwckp2XHvOlTsqhxKhZF8KkdhAOc0=; b=d7AeMmmNKZkkMn uSGYGIVSSyLZdYrwzTsfOeWgJ+8NqFgegx9ROE6UpUdj284Q99Jc1mdP0PTCv1V5e9aewOWWEaJZa mM/Sei3rHyWexAPDRj9vEBXUqqx7vQIbROpsVAyIBg9oLRvMzfwv9Z4h/Xt6cnrQN49Tl1h+51sYY 3AWOO+XMWvIZqy2nDAg2NtIOsbWpkE7qL9awtlKZctCrTaHiPxjHVOBvD6yPyULvEqZ6qSbR0QKJS LGPBYsgz266bnlno7QRHOwcAixIV1SADfq303gdPBr4wxvAQHo9dJh4+R7tKkwxrfzdID57zl1wEl MOV86J1/ktqKQnUJ1q1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ohVde-00FaKh-Mt; Sun, 09 Oct 2022 12:42:38 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ohVda-00FaJO-SU for linux-arm-kernel@lists.infradead.org; Sun, 09 Oct 2022 12:42:36 +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 ams.source.kernel.org (Postfix) with ESMTPS id 55083B80D19; Sun, 9 Oct 2022 12:42:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFAB2C433C1; Sun, 9 Oct 2022 12:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665319352; bh=f+mosKCYImVjf5AY2/cBN3jgVGzwj8LSrp7eU/MOFg4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=N7LKrwOdUGnlYeoUU0LVlhBi005V35WwkiVkWZ8iiLSsbA56VeiIhSPLaQl2WGzuW w89wOBey4yI/Nv6EqXwU36cMc7apcX5Uf9B2TGRzEXGMyLMXtpxWzigThXXwk8ymWG 0PyPUfA3HHJeAO7z5YHpAh7D2t8YlmwkCGdQbFsXI6AaoDZtBQCJa0YnwPbbRnkcb0 8AQpkbOB56CbaVDO8fhtNWXbyALhLkGTIwSBvWJxFaGAD9fJDI0PnyJm42+tQfLVSL yjEXuVd5XJV7H8igsKVNx6/+x7At2UcLA81rzCG5xix/uqbrnkgwMA/i7BDOPJ/HDa KOucznWY74CHg== Date: Sun, 9 Oct 2022 13:42:52 +0100 From: Jonathan Cameron To: Olivier Moysan Cc: Alexandre Torgue , Andy Shevchenko , Fabrice Gasnier , Lars-Peter Clausen , Maxime Coquelin , , Paul Cercueil , Sebastian Andrzej Siewior , Wan Jiabing , Yannick Brosseau , , , , Subject: Re: [PATCH v3 1/8] iio: adc: stm32-adc: fix channel sampling time init Message-ID: <20221009134252.2b636e0a@jic23-huawei> In-Reply-To: <20221005161424.4537-2-olivier.moysan@foss.st.com> References: <20221005161424.4537-1-olivier.moysan@foss.st.com> <20221005161424.4537-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-20221009_054235_239290_034AAF91 X-CRM114-Status: GOOD ( 21.57 ) 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, 5 Oct 2022 18:14:17 +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. Hi Olivier. Andy commented on this in v2... Line lengths in patch description are rather random and no where near the typical 72-75 chars. Should look more like: 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. Fine to have multiple paragraphs, but within each one, don't wrap too early. > > Fixes: 796e5d0b1e9b ("iio: adc: stm32-adc: use generic binding for sample-time") > Signed-off-by: Olivier Moysan > --- > 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