From patchwork Mon Oct 31 11:32:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Billy Tsai X-Patchwork-Id: 13217 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2260224wru; Mon, 31 Oct 2022 04:41:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4UnD6oS5t1b39/Uhf9hXm++aNIs4cVaWiStr1DGaHDI8Fqdb0GzSz1w/mew3yNX9gyfcUC X-Received: by 2002:a05:6402:517c:b0:461:e7e7:c0b9 with SMTP id d28-20020a056402517c00b00461e7e7c0b9mr12685072ede.73.1667216504008; Mon, 31 Oct 2022 04:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667216504; cv=none; d=google.com; s=arc-20160816; b=gwfBeptBMgfO0ZJph3G1Z1+uM7wD60GOYwnEDP4VlTir/ReN6kuWP1opvcPzccBnUF HPPeOOvBKixk4KfDZ8EkkxtAHEaUzcwhGzM1zwvPi0rSBatl5prkp37HO9VLK3NEXUwM w5NiKHAnwfPl0jPUA3j3wLALlIvSsb6KP7iNdvZVhKF+GRBybdmYIDqALEfzhD0cw15z lctHJkwDvfQI2ltDs8Wvqbu/ukBPngTU4XN++2IskhH4S3tpN2QE6W7RTcp2eu9JHMY+ YpTGplriS3W+RGZ3S8aXEuMGvLL7HGcKEPEPXstV1cIZK5SNAwW6l1HVSjei8yP6NlBe axew== 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=WhkvwDY8l+K2R8SVWQEMlCb5Ppu2j2EDEEjR8vUOliI=; b=r/KSQxlE7qr7wfm5xjnAkxWem9z0qgggQ+XRw0gjxZDrK4IlzdXVUMdEuV3piJcHlp UiUDLbKowEC5GdiNRM80q3HWgy7Yk2hAGzbdHSYqtxX5huVtCO2ugs8XREZtHqV0o7wY D88cZvKzeWZGsWDpQPImMu13Hm6b0E9gS860Hd9sFUPtCNgYT1glm4UlUFc7Wumx+MmP 2ich3qzZ4chHRM4RUZ44//Zy7+UfTIAGG6vPsrqkMe7VsHq5clwsX8VCxYjXF+27J31/ r9bdMGdkD5bJP5ndU2WoKrZGDUKarM/yi1OTQaS9BAUKTARqS2xQYH6rsh9rtIAAwurL cXEQ== 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 m14-20020a056402430e00b0046335076fdfsi466665edc.341.2022.10.31.04.41.17; Mon, 31 Oct 2022 04:41:43 -0700 (PDT) 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 S230266AbiJaLch (ORCPT + 99 others); Mon, 31 Oct 2022 07:32:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbiJaLcf (ORCPT ); Mon, 31 Oct 2022 07:32:35 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE205DFBE; Mon, 31 Oct 2022 04:32:34 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 29VB7WjM080106; Mon, 31 Oct 2022 19:07: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, 31 Oct 2022 19:30:39 +0800 From: Billy Tsai To: , , , , , , , , , , , , Subject: [PATCH 1/2] iio: adc: aspeed: Remove the trim valid dts property. Date: Mon, 31 Oct 2022 19:32:07 +0800 Message-ID: <20221031113208.19194-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 29VB7WjM080106 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?1748203213104513607?= The dts property "aspeed,trim-data-valid" is used to determin whether to read the OTP register. If the image with the aspeed,trim-data-vali install to the chip without valid trimming data the adc controller will become confused. This patch use the default otp value 0 as a criterion for determining whether trimming data is valid instead of the dts property. The chip with actually trimming value is 0 should be filter out. 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 ffae64f39221..0f065f0bb8e7 100644 --- a/drivers/iio/adc/aspeed_adc.c +++ b/drivers/iio/adc/aspeed_adc.c @@ -201,6 +201,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", @@ -562,12 +564,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 Oct 31 11:32:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Billy Tsai X-Patchwork-Id: 13216 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2258304wru; Mon, 31 Oct 2022 04:37:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6aZLsbjv8ch6djdY8aU37luptRD2D1Ct1c0nk295n1ao0C+5JmkQKIq3LxIT4jAm0FPlrK X-Received: by 2002:a05:6402:344:b0:461:7d4:9c9 with SMTP id r4-20020a056402034400b0046107d409c9mr13437849edw.141.1667216230308; Mon, 31 Oct 2022 04:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667216230; cv=none; d=google.com; s=arc-20160816; b=VlvLKowNrnyJW3mOTUKiKkBDsRqYExXn99FWWxkkxWvnym8wGPoEweVv5RNyaIodtk 6HMVG9Rvk0NCNglj66Xy+heNAnENESXyDuYEqVHOK24Lm7IX6spEbeA0abs9xjHTgdoF RCBcGKxWl5bULp3QIel50hXyzYf/XqBgXVS8iByJpXM8wME+tSVuX5WcIZAZfZ8Q5+6x becC0z4rtLu/qJRS8b1DvsGr5y6uv4FbhtKEaWcUEb7wAx82rB3NjppOLgtlQJVTXdBp zqjLZZ3v5MdYOSTbN3nUQkkh5TE9RJNuGy4JP8Va0bQAEB8ngflJXDFgkOHs4Cn5/692 QJWA== 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=aSAsMZiILky2ovKyJNJ8tX6OoSL8PjaLrx1E/pr/KkA=; b=zUkf6OGkHo9BfaPUXZylNNOKBlqi6boUgTwUVnusEnfRaA/nuvAMYz7TtqsS+QbQ3N 711w1UdobR+4CG792H9iItcEGu11rHajqi26/k2mXJ5FoVqoJ5j/XnHutC8ClgeTOxT7 JlJQvwk8X38NO7qc/nGpyLk6NJujdyGwpe6XNlud/pzM1LDsxa9SidkxKpnX9Pc+UB2b TV8pDDdN4VrukOxwnyiwgkqNqAmvKb35j9QHrncwL81X1zaGaD5gjYKf2ItbbUlRD3M7 WYaUSpD8l5tVpLl3c4RsUIbxkSXL1fgBZs37k+ibGkeINNKYKiBEgM4cd3y4qYqejhlN rRGQ== 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 r10-20020a05640251ca00b0045cd68a2bc5si8636230edd.17.2022.10.31.04.36.45; Mon, 31 Oct 2022 04:37:10 -0700 (PDT) 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 S230249AbiJaLcH (ORCPT + 99 others); Mon, 31 Oct 2022 07:32:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbiJaLcF (ORCPT ); Mon, 31 Oct 2022 07:32:05 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABEB8DFBE; Mon, 31 Oct 2022 04:32:03 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 29VB7WZi080107; Mon, 31 Oct 2022 19:07: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, 31 Oct 2022 19:30:39 +0800 From: Billy Tsai To: , , , , , , , , , , , , Subject: [PATCH 2/2] dt-bindings: iio: adc: Remove the property "aspeed,trim-data-valid" Date: Mon, 31 Oct 2022 19:32:08 +0800 Message-ID: <20221031113208.19194-2-billy_tsai@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221031113208.19194-1-billy_tsai@aspeedtech.com> References: <20221031113208.19194-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 29VB7WZi080107 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?1748202925555024070?= X-GMAIL-MSGID: =?utf-8?q?1748202925555024070?= The valid of the trimming data will use the otp default value as a criterion. 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