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: 16337 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1936571wru; Mon, 7 Nov 2022 01:22:39 -0800 (PST) X-Google-Smtp-Source: AMsMyM57EuF0kS7NgUgD598t2l6seT7KR999bwpbP6C58jF19v/OwbqRjMxWIS2oH1XYUZ4jFjj7 X-Received: by 2002:a05:6402:1842:b0:461:59b6:3f1b with SMTP id v2-20020a056402184200b0046159b63f1bmr49432832edy.308.1667812958938; Mon, 07 Nov 2022 01:22:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667812958; cv=none; d=google.com; s=arc-20160816; b=MdMKrDBCxhb2eY1KZvSxgKxFzeLb4AuPHt9rVtxIF8yBEuKIJrtNSn16iCrM4FW744 /HuenlI/9wt6v+7U5L61rdiUE9j4VI+HVHuS3u2aYTY3GlSIgWAKid6IKS9cteEAinM8 A3tBSx18lfyFBMFt+VWIQetfLrSTcRrhOvgzlvdrDgkrHMIN9MLjSB/RYNQl1SYd0gxC guGoBOLZGT1vfD4mfI+hmKqz/CM3JVxz650eK3JBpStqkPgL8KRBUdL0ecA/1jrRbNyj czwODAFX1kMd2DWosBFpOsto80lLW8U2v/cEZqUXtGyXDVENJpPX8Hm6FCZnsfrWzYkF WYKA== 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=HIn6UH9hkHVfi+slaIvfbIp/Hfm0XObdkadt0Rk5EbOLzBoSh0T8nEq1VSKjNwNUFF tSDw3V6pZSTDTS7+Fx/qOSaQylaByGRHdQyFgTtvD7zZUd8l3LQiBD2oI1ZMHbn9pfhe FkHZAsLE6q1IbmkZmWbdqQRgtidkZVLBlQOdP5xfZsoh8apYHbueH2OxL9yaEtDtlbvr mkVnkBydCVCNpDVTjojXW0QL+6ar7BGf+3S0ueubie5hX0+V4t4sLiyB4vYVi3kpvTfA 6NrM/Rtri31Lrg5PuB9njFhPt1eSwGhO5KWPJI3YTBeq3CTEZFz/h2MKkksEOKdfUbm1 s/EQ== 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 bb6-20020a1709070a0600b00781bbff1cc1si8380526ejc.455.2022.11.07.01.22.14; Mon, 07 Nov 2022 01:22:38 -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 S231705AbiKGJPs (ORCPT + 99 others); Mon, 7 Nov 2022 04:15:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231703AbiKGJPi (ORCPT ); Mon, 7 Nov 2022 04:15:38 -0500 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2154E15827; Mon, 7 Nov 2022 01:15:37 -0800 (PST) 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-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?1748203213104513607?= X-GMAIL-MSGID: =?utf-8?q?1748828641365772971?= 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: 16338 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1936861wru; Mon, 7 Nov 2022 01:23:19 -0800 (PST) X-Google-Smtp-Source: AMsMyM6goJbmenk1vE6WvuBs1dGSAc+EqSnKJd+YX2SuyOenDltAFGRZ9FCLZFrLArNWZqJgYfJX X-Received: by 2002:a05:6402:298d:b0:451:5fc5:d423 with SMTP id eq13-20020a056402298d00b004515fc5d423mr46803618edb.102.1667812999254; Mon, 07 Nov 2022 01:23:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667812999; cv=none; d=google.com; s=arc-20160816; b=g9jdlTAWBXTLdTJABQR01dts0ioH8nf/TzX3nNxXA2jsF4TgABzlyGgoXMYiFXIXOm +C3xhlE92kfLsRECl9wQVt/K5shJ7qXpQuxbTAzHT6yfrQ3gSUgcQCooLxNuh4g3Ryn4 SLX226+JGc/eU2S5tQ4EoHtTvoeLv/8RFPM7qv2smttdxhgzkkbcjhNjlajPuDa0Ux61 3h+K1pVCyNP3hYDbvRlm1AHJiKto4fmW5sHSUNjY08RrkZ67WdTuX7Bjde0Gq2mu8E7N T+SmOayMMdEFiGQjt0mKSI+sbLEH4KN6ZcoJ1gr9d9/Ix/tI7sJkW9XUcD20rvJ8EBnk 0f5A== 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:to:from; bh=FrElOn1aRK/hqqzg2IDMzniyAN6unObri5GIy+1utlA=; b=VxLqyVhwUcAR210wlMeQ0+DTJXa3LHODuIV6lPjf59PCHznwo47stzY0DgPs5euJ5+ C7jTyOMfvbLEShmIhM1Tdf5U5Yy+bGHTvzli8YSXatJ7uzz2h6XNs4a8ikR4B5qtW/NB BXZWFLOUFeW01VxW5NyqvmJiYdu68WNBHc9FECyiybZc5rhIEoF+QuvIFvbRY1Ozuum9 YTzFURQ5mNyNPdGkfKvDMgR10a1Hg6obMn1aKjwIYFeS2ByYsDxgQN1XYchwvMomV/1a G0SsvBDh+ezgdGGQCZ6PyMixLvxehl3l7ySXHQWTtt7aleVeca0FKO3J+IRN4uPvlJ4V tUtg== 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 ef10-20020a05640228ca00b0045d8bff7afesi8445254edb.376.2022.11.07.01.22.55; Mon, 07 Nov 2022 01:23:19 -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 S231727AbiKGJPp (ORCPT + 99 others); Mon, 7 Nov 2022 04:15:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231654AbiKGJPh (ORCPT ); Mon, 7 Nov 2022 04:15:37 -0500 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD52F5FAA; Mon, 7 Nov 2022 01:15:36 -0800 (PST) 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-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?1748828683653244832?= X-GMAIL-MSGID: =?utf-8?q?1748828683653244832?= 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