From patchwork Mon Nov 7 09:15:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Billy Tsai X-Patchwork-Id: 13034304 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 7649AC433FE for ; Mon, 7 Nov 2022 12:29:27 +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:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=rydTmy4wm1qA6+542Itq4m0TMM9DbKRiBiMPwsW1S3g=; b=oWsbjpbHLl92/j UfADte/D0TCrREZAoJ1YRuEpS2mXRKgulVtdipAyoZQ1rqI3tnbZKBS5/oEJ47abXQP4V0KjDMyH7 LU4DVat+3UyKn2rE3MTmQhZydmBEJvEZUNjySbW8pwlZ8dTQ+OA9sV/SWtOfMoGhFkB63bMz8C5pm QTDLtCV2R1TUwu95NahOWaet2vMP5jbB3Oj2r9cHjyOSAfxgP54SIzMUKC9zLkzFm/7oaRlSIn7zD i2LzJ3NiieQ3zYzmFtgDRzDzzL+tXS60+8PaYsZJm/2g2pDSYx2D/b/WigJVF0wOIacSDNF/pJY8t JAeLqZuc+0l3rKgNk1Hw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1os1Eb-00ESo0-DW; Mon, 07 Nov 2022 12:28:13 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1os1EW-00ESmB-LP for linux-arm-kernel@bombadil.infradead.org; Mon, 07 Nov 2022 12:28:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:In-Reply-To:References; bh=xowJH2WBdr3VQKrjfNeSPsv+Fx5T0qRYck2Ox+SsO4w=; b=RZGOOPrexlVt/GnqP+t3jDxHra eseHi2fWEsz4/D1Ur1HGAXfw23RTVjx9bCnS6euIwtNYHaU7wdWqSKN64zoDfQC5e98Ke0YnMykUC 7ih1kvFk1QD/11zh8vKb//il2b0Eplw2eTkOQe1//oYfROi3NmdahBBT9L3I+BgprvrweTnsosTn3 7OXACN0sqtcsi7/+sqPliRWJTrv96UAS1uKSwpHBY3h2cpCUJ8O/WuqnWu1xWTe/g0+/b8Xc9amwY De7If3UUK5OdpDnhEmGtFIOwdPI+vBWuK7OKN2GGBfvYwNEHhVSAVvuPjoSbiknQv3F7dXkQThWQz tt+kDtwQ==; Received: from twspam01.aspeedtech.com ([211.20.114.71]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1orzM8-009iiQ-PT for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 10:27:56 +0000 Received: from twspam01.aspeedtech.com (localhost [127.0.0.2] (may be forged)) by twspam01.aspeedtech.com with ESMTP id 2A78pD9G095429 for ; Mon, 7 Nov 2022 16:51:13 +0800 (GMT-8) (envelope-from billy_tsai@aspeedtech.com) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 2A78nWxo095132; Mon, 7 Nov 2022 16:49:32 +0800 (GMT-8) (envelope-from billy_tsai@aspeedtech.com) Received: from BillyTsai-pc.aspeed.com (192.168.2.149) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 7 Nov 2022 17:13:02 +0800 From: Billy Tsai To: , , , , , , , , , , , , Subject: [v2 1/2] iio: adc: aspeed: Remove the trim valid dts property. Date: Mon, 7 Nov 2022 17:15:05 +0800 Message-ID: <20221107091506.28630-1-billy_tsai@aspeedtech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [192.168.2.149] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 2A78nWxo095132 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221107_102753_754914_1752A92F X-CRM114-Status: GOOD ( 14.32 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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)) { From patchwork Mon Nov 7 09:15:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Billy Tsai X-Patchwork-Id: 13034305 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 43438C433FE for ; Mon, 7 Nov 2022 12:29:36 +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:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YSWIlFyoQmYkKZs30zwU9gQboM60KrgL7J4/Z0TNioA=; b=tK2f47Cxvv/PmD IHzmM5UJjYN3eZrHJ6fg1Qu3YKUclsliuF810r9CouTUoBZY+XbvmR2NrHn07kFobVWbG4xfv3hEk d+epFGrSKQpELgFq3Mc4+x5+SH/ny4b1d0Litjc8gdeJPC3SwHmIaLiAw1SfdZxfixJDJtnk5QDet yO7/52r13tzmilJStB0FjNWUrSvozQ5ESaAWHRZUzW+rsJAdhCLROV2FIdGGLis5aoggOsO0FaZUC s8y8k8KO9629GE5wTEmtPXZzd0yY1hNx8nzXbZTdzQv9Z9TOT/cdiMFGMG7iP3K+0dp0ggH987YcC EYEuqZnjX6wrZGqNrXRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1os1Eo-00ESsd-2r; Mon, 07 Nov 2022 12:28:26 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1os1Ed-00ESoy-Rz for linux-arm-kernel@bombadil.infradead.org; Mon, 07 Nov 2022 12:28:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description; bh=FrElOn1aRK/hqqzg2IDMzniyAN6unObri5GIy+1utlA=; b=EI5FR7WpJYBASPsTEsIB3jlgl6 hFEzWA/WxC43Zi81g7SOVN3m//UovQVb8qnjooToObpm0+3ZPny6aCtXW/FanykgKoKeBjhTAjkEX zJUljxemA+3BjJ+2taRr8Gs4PN2XXd5aaR3uPxqoghdrmUZSSUiPcnp3s/VPvFokMcO3OgdSyTqpm RS0dbw3g/aRE8n7XA5tY0lPTpBfhnC4FkwPYEFXbJZO5OkXkvAsfmx9CsO6P5BWu80M14Z13RSJq0 +jMqoSwzKLM3pb5mdxZscvvmD+acpJPk/Bnc3xAALgaAeNKCZH4QRGMM4u2Drry3blYyQmiIm8ZhG XHnXENSw==; Received: from twspam01.aspeedtech.com ([211.20.114.71]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1orzLz-009ii0-TN for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 10:27:46 +0000 Received: from twspam01.aspeedtech.com (localhost [127.0.0.2] (may be forged)) by twspam01.aspeedtech.com with ESMTP id 2A78pAfU095426 for ; Mon, 7 Nov 2022 16:51:10 +0800 (GMT-8) (envelope-from billy_tsai@aspeedtech.com) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 2A78nXVJ095133; Mon, 7 Nov 2022 16:49:33 +0800 (GMT-8) (envelope-from billy_tsai@aspeedtech.com) Received: from BillyTsai-pc.aspeed.com (192.168.2.149) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 7 Nov 2022 17:13:03 +0800 From: Billy Tsai To: , , , , , , , , , , , , Subject: [v2 2/2] dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid" Date: Mon, 7 Nov 2022 17:15:06 +0800 Message-ID: <20221107091506.28630-2-billy_tsai@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221107091506.28630-1-billy_tsai@aspeedtech.com> References: <20221107091506.28630-1-billy_tsai@aspeedtech.com> MIME-Version: 1.0 X-Originating-IP: [192.168.2.149] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 2A78nXVJ095133 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221107_102744_698047_9BC3455E X-CRM114-Status: UNSURE ( 9.55 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The valid of the trimming data will use the otp default value as a criterion. Fixes: 2bdb2f00a895 ("dt-bindings: iio: adc: Add ast2600-adc bindings") Signed-off-by: Billy Tsai --- .../devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml b/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml index b283c8ca2bbf..5c08d8b6e995 100644 --- a/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml +++ b/Documentation/devicetree/bindings/iio/adc/aspeed,ast2600-adc.yaml @@ -62,13 +62,6 @@ properties: description: Inform the driver that last channel will be used to sensor battery. - aspeed,trim-data-valid: - type: boolean - description: | - The ADC reference voltage can be calibrated to obtain the trimming - data which will be stored in otp. This property informs the driver that - the data store in the otp is valid. - required: - compatible - reg