From patchwork Tue Mar 1 10:39:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Potin Lai X-Patchwork-Id: 547351 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBCFDC4332F for ; Tue, 1 Mar 2022 10:39:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234326AbiCAKkX (ORCPT ); Tue, 1 Mar 2022 05:40:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234297AbiCAKkW (ORCPT ); Tue, 1 Mar 2022 05:40:22 -0500 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2104.outbound.protection.outlook.com [40.107.215.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D48D593B8; Tue, 1 Mar 2022 02:39:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QmDh0I5a/LvuSDKm3Mt82aCR8WOwTOlCSse/cx8kSOkmbLrCHOqktcATX49pY6ocmZ1lb81tS0T8UScKiGxrfiQfQc32T7xE9mrOS7/yIQONxEq8cCVgTVHoAqgHP7yXh4w7mPkTndStVTKQ/2GtZt8NkUw/s6MljV4T1uJvkKvc9fkAwG8aEcrhyhFoVSX5XUY3JDoKPFvYYFpaklo1Vz01cVvJm04bYbVlKG7SroAZgFqilWCxHb/f3jkpXjW8Huj3/dBzTyHDdVUJQ/hl8wEnTwRvaOls5OeZSo4HNuIX07Lb1O3zpCJrdU4WHLNK7XZ7iIGf9yNjbbDTuL0qSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dy4h7GbVHqJlb6gex0kd9iCoN3mDmgwQF6Bkk5v4J4w=; b=FcjqDbNOX3tP+zoYX+W+c7JAbfL2wxGqmNfBEk43p324ktJxyV1itylSFOY5p1c2mbiFuoIqvIXp6omQozwYDwlIatE61VO8+Cya79JlIOebRpbDlErKV4NPbHooCIe+YBWZgE4ij/oMGJLzNLZn3kxwo4/Q8PpuR6DSOMbp5JRHCI6V+CME3f8sBXAOFLdcFCKh0lwhMcnnmhVGCdlRS415738TRfzHqmRA/M8GjuP0Z2t31cbEzePCwLDY3l3BVfE8ZjoemOHsrceGSchhXFJcVfGA3qhptf1FB+/0ZkkL/DKtUwHOHcD5Gv/Kkwde3cRnmuRqtC5NxVZakEq8Qw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=quantatw.com; dmarc=pass action=none header.from=quantatw.com; dkim=pass header.d=quantatw.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantacorp.onmicrosoft.com; s=selector2-quantacorp-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dy4h7GbVHqJlb6gex0kd9iCoN3mDmgwQF6Bkk5v4J4w=; b=Z3nV9FLrSHHqh/V496hSN1hWDBr5Nyx9AqQ6sDjs8gHTRotNmCNdXUdMjaabwjuwUQkSOqfDIfaDIJuNDxdVe96cX/V01iLSyVBwWwz/CyfCvM95ypyZCPpbnZDVBh0INEFFECGcz6zqxmeMhV0Q4xk8dfenzZYA4vndcdR899g= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=quantatw.com; Received: from HK0PR04MB3282.apcprd04.prod.outlook.com (2603:1096:203:89::17) by TYZPR04MB4925.apcprd04.prod.outlook.com (2603:1096:400:125::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.24; Tue, 1 Mar 2022 10:39:33 +0000 Received: from HK0PR04MB3282.apcprd04.prod.outlook.com ([fe80::b57e:962a:3820:eab]) by HK0PR04MB3282.apcprd04.prod.outlook.com ([fe80::b57e:962a:3820:eab%3]) with mapi id 15.20.5017.027; Tue, 1 Mar 2022 10:39:33 +0000 From: Potin Lai To: Jean Delvare , Guenter Roeck , Rob Herring , Krzysztof Kozlowski Cc: Patrick Williams , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Potin Lai Subject: [PATCH v4 2/2] dt-bindings: hwmon: Add sample averaging properties for ADM1275 Date: Tue, 1 Mar 2022 18:39:00 +0800 Message-Id: <20220301103900.12637-3-potin.lai@quantatw.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220301103900.12637-1-potin.lai@quantatw.com> References: <20220301103900.12637-1-potin.lai@quantatw.com> X-ClientProxiedBy: HK2PR02CA0129.apcprd02.prod.outlook.com (2603:1096:202:16::13) To HK0PR04MB3282.apcprd04.prod.outlook.com (2603:1096:203:89::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9ead7a7a-3115-413c-d7ca-08d9fb6fc5af X-MS-TrafficTypeDiagnostic: TYZPR04MB4925:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xQuqxT3mh9Lk6iSbUvaDSWfgUBMRa0nm/Q5aVvBWz7o9nZX2UIi/dX7PEmHlZD3zbtQz/DPZzfvJNrCY37/lpKEgfRoExflv1HjqLELjVepYuIL4j+pKMXsl3VKGHbeQ4GUCemPfhej7MoifJ2RNOjplpPxsm4qPViITMZdza+AF1vsLkTcPEdzYq2Roibp+6u5F+414A7UAPTgNyu2F+h3OxKCHZxb5Lwq2uNw3HdtkNYwnTPspubzWEkn3Asq2G2LUjMUQt2gI1pqY4VAV5INPra+p8gQPkDOvUT9XCCkj4HkqDwvBpTnlcw9zOcgrA48K/1DTFaDbryZFiWRUaOeigXF0dmTbX4QAxgIumtGThCYR/NFovhg99HlrTpRJTNQZw/oGAdC4F9GmhG9vQ0ZkNeMvr2bznluWVSvro66DbfWvb3qmWsVZTSYV5Qp+7F4cnXbLHNbcw6KhX5CMp64IBxz94dPQW9v49IAeQhvvHdhXGpXl1+SH6W/qlGDopQujH6Bq3KBLcEeK0vNxnnrVSMnMpbIZltHmbmndqLAQWHjpeTiz0Iub+fyfRqtPsS9HuYzdQJa8A1ie3pHcHayBuf1kE73wyzoHvp8kBSsYPPnGJXMmszOFwLlW98njuOfqU0sRVcH9bYMyRHcgHENC0zDzyMei+KR8JN/vt8Ayhqk/qUqvfN4chU5vVJWRQ8LfdkrbYmmiszZijAN2eg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HK0PR04MB3282.apcprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6486002)(6666004)(4326008)(8676002)(38350700002)(52116002)(36756003)(6512007)(508600001)(83380400001)(110136005)(54906003)(316002)(1076003)(8936002)(38100700002)(6506007)(44832011)(86362001)(2616005)(107886003)(5660300002)(2906002)(26005)(186003)(66476007)(66556008)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RejYNmZv24Hx1O+Lkk+KlNL0Jd7Adyjo2n8UE48GltWwsQzYtKJEjohGMNVDnkCKGBIMABkj0iR6yON3MLXihT7a0HTedQY/vExszO4XEzFv6rb3ypHFc8VtLvFn5PrL1bImXwgvg0zvvSHByZPL68FFXYX/8jVZqswemcVtrDhrMe/sXTcf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Cqr1yNUZZk7h/2/pq3SpXGukQPdY0URMnA0IsIun2G3q4WXWEBATYvEamCHFz4ICaprN9XUSmqjZz69Er2dPQkJow+kPejUGA1Xb/7Pz0OuSUYtDD0AWLPwajUEBDW6tKtzKYnud+LWdbfgHqrkAXELrMr2+6zyoEyNc56i0jR+nCIyMosDe7hSleYQfHCpszyguuTVv2UDY/g7FQvA7zjV+y03JadNKKPd0ogtAGE0hhQMVKP1Q2R1Xxs3dUGGobEyAiEcAOB8obWT8Y6l2f1Qbo0TOIlN2RS8vsSyuWhXU0G6aunpC4Ir/4NzVYsOzcMGP5zMQeqmWHUkxP+KmN1a2KsWlZ70QGrLjLwnCe9rEetQZRTwhnUuRK9xWCLJTArvfQ0xP/ItU= X-OriginatorOrg: quantatw.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ead7a7a-3115-413c-d7ca-08d9fb6fc5af X-MS-Exchange-CrossTenant-AuthSource: HK0PR04MB3282.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2022 10:39:32.8087 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 179b0327-07fc-4973-ac73-8de7313561b2 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pbyJqc8r3xHPKJwu4K9lbJJ9kT+4RQRxh+9jiiznCaphYvU4m5Av/FqddvTF3S068KwkZKkaEvKUHQEjnxcNoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR04MB4925 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add documentation of new properties for sample averaging in PMON_CONFIG register. New properties: - adi,volt-curr-sample-average - adi,power-sample-average - adi,power-sample-average-enable Signed-off-by: Potin Lai --- .../bindings/hwmon/adi,adm1275.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml b/Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml index 223393d7cafd..1b612dc06992 100644 --- a/Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml +++ b/Documentation/devicetree/bindings/hwmon/adi,adm1275.yaml @@ -37,6 +37,47 @@ properties: description: Shunt resistor value in micro-Ohm. + adi,volt-curr-sample-average: + description: | + Number of samples to be used to report voltage and current values. + If the configured value is not a power of 2, sample averaging number + will be configured with smaller and closest power of 2. + + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [1, 2, 4, 8, 16, 32, 64, 128] + default: 1 + + adi,power-sample-average: + description: | + Number of samples to be used to report power values. + If the configured value is not a power of 2, sample averaging number + will be configured with smaller and closest power of 2. + + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [1, 2, 4, 8, 16, 32, 64, 128] + default: 1 + + adi,power-sample-average-enable: + description: Enable sample averaging for power reading. + type: boolean + +dependencies: + adi,power-sample-average-enable: ['adi,power-sample-average'] + adi,power-sample-average: ['adi,power-sample-average-enable'] + +allOf: + - if: + properties: + compatible: + contains: + enum: + - adi,adm1075 + - adi,adm1275 + - adi,adm1276 + then: + properties: + adi,power-sample-average-enable: false + required: - compatible - reg @@ -53,5 +94,8 @@ examples: compatible = "adi,adm1272"; reg = <0x10>; shunt-resistor-micro-ohms = <500>; + adi,volt-curr-sample-average = <128>; + adi,power-sample-average = <128>; + adi,power-sample-average-enable; }; };