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 08744C4332F for ; Mon, 14 Nov 2022 20:10:37 +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=FVInrjGPtbs1ob5iSuJ72dvYZWFYZ5IcrKkx4rMXg6M=; b=JQaSqoHHK9jV8h grQciElvAxu53JQD6AWYiibJ34w/91N/2hzEDQGhXPoB6op3XdkRNXcPBPw+iOslKXZOCGaNBOjjk gUca1IIsXQQmiwTRYPEoF1e5DNdABXwSm5TwVkIoTu4WZPmwsMPhvoB0Owgo31VIMc+5pjiaq+HdK qbyVl1MmjFVeu6G0ISs/fHQNAf6hTuO8gsNU6PduP4NI0EYsM7t+5C8Jbv0ERBS1/l076fqb7MOqU bLjkLpItWO4aOtgHyJw3rQSC4lmJc94gP+wlxW886V8mOHplXapFe+PE7HJT57RGlQetJ6URCKbUt TWL/wqCPfFFRcV+E3rxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oufls-004cYX-Tj; Mon, 14 Nov 2022 20:09:33 +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 1ouflp-004cXR-Vq for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2022 20:09:31 +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 89B4061440; Mon, 14 Nov 2022 20:09:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A22D7C433D6; Mon, 14 Nov 2022 20:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668456567; bh=CG12EQqGhqcddZAaKvzY1RjvyFLqLPjqbkdgD9qGLHA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qgc1Yfx34GODBMR1J+DE3O48+t5FVIF7aPoVwTCdw7qwAZcfvuiLxFClpFBw/7qQ2 0dOuh6wk0M445tCti6l8nlpPshPO5cJ5E+Bm0ltNcVAGLhF59SfjkkwGtnGZE/Q1r8 mIoTrBIoUfILyApIcP1Yd/TQj9cDl62ZnzfnQ+7TllYxjIs9ziTt3IlToeVX+TrhjC z2dVVvmrbBhYpD7WNWQF2KzLwC8G7VXTNn9dsM3VRnpRqRThB6skpwby8/ED7x+eTO wis9svFl+wKpK9wCn7e+GtMrr33i1CGfktSVoCYQOLJOTBUg0ozRdIVwitMqlq5xLp 0asyMBgGbpJEA== Date: Mon, 14 Nov 2022 20:21:43 +0000 From: Jonathan Cameron To: Billy Tsai Cc: , , , , , , , , , , Subject: Re: [v3 1/2] iio: adc: aspeed: Remove the trim valid dts property. Message-ID: <20221114202143.6156b436@jic23-huawei> In-Reply-To: <20221114025057.10843-1-billy_tsai@aspeedtech.com> References: <20221114025057.10843-1-billy_tsai@aspeedtech.com> X-Mailer: Claws Mail 4.1.1 (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-20221114_120930_110415_1A9142EE X-CRM114-Status: GOOD ( 23.13 ) 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 Mon, 14 Nov 2022 10:50:56 +0800 Billy Tsai wrote: > The dts property "aspeed,trim-data-valid" is currently used to determine > whether to read trimming data from the OTP register. If this is set on > a device without valid trimming data in the OTP the ADC will not function > correctly. This patch drops the use of this property and instead uses the > default (unprogrammed) OTP value of 0 to detect when a fallback value of > 0x8 should be used rather then the value read from the OTP. > > Fixes: d0a4c17b4073 ("iio: adc: aspeed: Get and set trimming data.") > Signed-off-by: Billy Tsai Series applied to the fixes-togreg branch of iio.git and marked for stable. Thanks, Jonathan > --- > drivers/iio/adc/aspeed_adc.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c > index 9341e0e0eb55..998e8bcc06e1 100644 > --- a/drivers/iio/adc/aspeed_adc.c > +++ b/drivers/iio/adc/aspeed_adc.c > @@ -202,6 +202,8 @@ static int aspeed_adc_set_trim_data(struct iio_dev *indio_dev) > ((scu_otp) & > (data->model_data->trim_locate->field)) >> > __ffs(data->model_data->trim_locate->field); > + if (!trimming_val) > + trimming_val = 0x8; > } > dev_dbg(data->dev, > "trimming val = %d, offset = %08x, fields = %08x\n", > @@ -563,12 +565,9 @@ static int aspeed_adc_probe(struct platform_device *pdev) > if (ret) > return ret; > > - if (of_find_property(data->dev->of_node, "aspeed,trim-data-valid", > - NULL)) { > - ret = aspeed_adc_set_trim_data(indio_dev); > - if (ret) > - return ret; > - } > + ret = aspeed_adc_set_trim_data(indio_dev); > + if (ret) > + return ret; > > if (of_find_property(data->dev->of_node, "aspeed,battery-sensing", > NULL)) { _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel