From patchwork Mon Nov 14 02:50:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Billy Tsai X-Patchwork-Id: 19529 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1932155wru; Sun, 13 Nov 2022 18:57:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf7I7nPJoA/h+8PQSk0+qeMdHYkDK8o3pz+5wYNoJRotfKND6H1Xl0JW2rcgFZ7OtTR3w2oa X-Received: by 2002:a05:6402:321f:b0:461:bd12:52ce with SMTP id g31-20020a056402321f00b00461bd1252cemr9718107eda.197.1668394666314; Sun, 13 Nov 2022 18:57:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668394666; cv=none; d=google.com; s=arc-20160816; b=kz+4POwrKPIdQXsVRmyk5rprguawtrRKUgAGVMM1bmkIfHqRIFTnimi5VmJC5mfNTv b1Bx/3kcwfsBKmGqoHEp6WRbpVZHdM31sdBx2QH0hzo1xopLG5blMSMgpfbEVIuc5d4O ouRqDYTDA76FZ/ANoxcgbxzQR3g7VDZ/Xwia0YmfZdMq2rAmEhkkkjKR62SZLJzndtk0 akaipsM3X39zaCfsk+gfT9/5/35tIB8gi6ppfN1T8iV0PMNTut2ezsUpzQaqGF8Hv7Fo B9CiWkfKsKug7UTO6jlTkfXTWXleUpjVfW9NHzfwK5NnQFYtjkF7UkphGpP2icFCox8e SbYQ== 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 :message-id:date:subject:to:from; bh=xowJH2WBdr3VQKrjfNeSPsv+Fx5T0qRYck2Ox+SsO4w=; b=NWrcpCgvMNghZqk3wPzHHEp+qYy+blOUq6Cr5m4n+2Klh47Pg2Wjh9WlIHWwKrK71G 7GSAPk/tZDvBIeqbrc5FbE+84wVDsY6WlpoY7eUcV5WomPwrHhuDURuXx/gtf7lLr7DO iIlW0qeIyVnmouuiMe6JJqK/oZ+LlluTTpB7dafYXEvFBjvk/OGLpPl7Y2PldgwPolxx bQGMHewV9QF5sHZdtFpCFfA1a21UL6MneB5RaELBPU2XS1o9GCDXhY994iELGFqEithT DwpIAoIuIkaKDI6YRTv002tRiRnca1y9VwLBharAYObdUWXbuTVlT9bKQJitNAOfOs2R 7mdQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g10-20020a056402090a00b00461b2c3c4acsi7157204edz.515.2022.11.13.18.57.22; Sun, 13 Nov 2022 18:57:46 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235443AbiKNCw0 (ORCPT + 99 others); Sun, 13 Nov 2022 21:52:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233930AbiKNCwW (ORCPT ); Sun, 13 Nov 2022 21:52:22 -0500 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FA611409B; Sun, 13 Nov 2022 18:52:21 -0800 (PST) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 2AE2R8om061169; Mon, 14 Nov 2022 10:27:08 +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, 14 Nov 2022 10:51:01 +0800 From: Billy Tsai To: , , , , , , , , , , , , Subject: [v3 1/2] iio: adc: aspeed: Remove the trim valid dts property. Date: Mon, 14 Nov 2022 10:50:56 +0800 Message-ID: <20221114025057.10843-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 2AE2R8om061169 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749438605584916715?= X-GMAIL-MSGID: =?utf-8?q?1749438605584916715?= 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 14 02:50:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Billy Tsai X-Patchwork-Id: 19530 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1932302wru; Sun, 13 Nov 2022 18:58:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf7vyT+maSYPq9LLyasDjyV3ORGCPUaF9Db8cq9ZEpd9v1+z1ZFqbdB/ObFj0EtBmPeWCFs0 X-Received: by 2002:a17:906:27d5:b0:78d:34a:f466 with SMTP id k21-20020a17090627d500b0078d034af466mr8999917ejc.162.1668394713572; Sun, 13 Nov 2022 18:58:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668394713; cv=none; d=google.com; s=arc-20160816; b=q8aZ2OhTkZpOj4fkjBI5S1SSrikkKVTQbvv5mYnt26RLfFS5pFgQrMmE47S/Se9TS2 5/Gxnkl5MzkluYsNCYnPc6oWwiRxH+qfndwr7itgywqamgNHG7Dk7gjVGLlKi7PlrcTK bBXx72w0Nam8SObkmpzbFevNgq0/NAqKz5x6skdf6LJSIBAmy0kBMyfjrt6VsQlyj+Vm 2nqNx8TBX1t8RTLDXsy1UgYfoqJlIiuR5Ma8pu3DFGn2JEQaC8q5OUt5TkqMTNXZmCz5 BK1rg6EQPFD8vN8UGXmdJKDVDroUVafbyY8Si0kd4bUkoiWNqLnuDz4ZugG8BYKhYP6Z JCFg== 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:date:subject:cc:to:from; bh=fCKIbY/OLuzzftdt0SNhRto4BfPKCwNP51ExkiAY9A8=; b=jkR4ryLIZcJuAcbEFO10Xg+9kDHvWkUiPDH3coq1JI1CapMlrbg0nsgroOWe4jPQ4g VZVSTkS7/3o2hPVCe8kL85FxTGaLOJeUBAQNEaCiG9T3Huh+gaLHY/ly3w/P4lJCzE0S aZAAAN93ayOebQu4uDtZ1yJCQ0klQeBpGjfb0TBsLxCiuAAyVKj2ghEaWuMHv+gZHXfl NyBwxYQh8yxK+uP6U9mg2LUDpjwfXObLYb6lSAp6tozFIk+oxuHjNpwXorPRJHRVrS25 wGwq1o8OAhnHCUntXP0y1UfH/HarzstQPcWYQTf41Rxu+8pHv3W43q29kR2UzSa4mOPX pvuA== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rn17-20020a170906d93100b007ae377adb6asi6722703ejb.628.2022.11.13.18.58.10; Sun, 13 Nov 2022 18:58:33 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235733AbiKNCwX (ORCPT + 99 others); Sun, 13 Nov 2022 21:52:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235443AbiKNCwW (ORCPT ); Sun, 13 Nov 2022 21:52:22 -0500 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CC6714090; Sun, 13 Nov 2022 18:52:21 -0800 (PST) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 2AE2R8on061169; Mon, 14 Nov 2022 10:27:09 +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, 14 Nov 2022 10:51:01 +0800 From: Billy Tsai To: , , , , , , , , , , , , CC: Rob Herring Subject: [v3 2/2] dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid" Date: Mon, 14 Nov 2022 10:50:57 +0800 Message-ID: <20221114025057.10843-2-billy_tsai@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221114025057.10843-1-billy_tsai@aspeedtech.com> References: <20221114025057.10843-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 2AE2R8on061169 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749438654940092784?= X-GMAIL-MSGID: =?utf-8?q?1749438654940092784?= If the property is set on a device without valid trimming data in the OTP the ADC will not function correctly. Therefore, this patch drops the use of this property to avoid this scenario. Fixes: 2bdb2f00a895 ("dt-bindings: iio: adc: Add ast2600-adc bindings") Signed-off-by: Billy Tsai Acked-by: Rob Herring --- .../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