From patchwork Tue Jul 19 14:52:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cy_huang X-Patchwork-Id: 591742 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 1E4BBCCA483 for ; Tue, 19 Jul 2022 14:53:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236144AbiGSOw7 (ORCPT ); Tue, 19 Jul 2022 10:52:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236160AbiGSOw6 (ORCPT ); Tue, 19 Jul 2022 10:52:58 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51A8E26F9; Tue, 19 Jul 2022 07:52:56 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id e16so13747385pfm.11; Tue, 19 Jul 2022 07:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WDks3qDrWxLLtCzjVaMIFrgSz1H5Uq4a3TXwwtZzFxU=; b=AG+9Yaj5qw/Xi+LCS4oUQ9A5e9J4iIrePBp8of2RrRy7ITPu+Ve8vax6O51mWInq0Q G2GTUqXSRPbxRLocCNY7CkztPhbXwypabt6jZlS/k2qnq8HffD1GfxRjU85gMYnvcWEh DlP5EEoyo0CDI2WyQFxy0JxlMahxPangj+0B4uIuXTUnSXDYfYlVGHa77+tT5LZQrAxl raXloDKJ9tWt/xtkfKs4c5ZraLQGf4yc5IXCsvaZM1q9O2tUs7vjFsNoQhuMnlqRCrFS 1QmJkqRQ3fgbMJaCft9kv9MLNRL98o+H/N7QAfVr53+CoCGK39HFyk6SUlqpdVDtk8c3 T/LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WDks3qDrWxLLtCzjVaMIFrgSz1H5Uq4a3TXwwtZzFxU=; b=ry3gYW6GLvufpzezZh9sjUbt/5GXo8N5m+NmI6kb0sBx6PptJe0IdGDKEz7n+JfgWd G4u7z1FKLepLR0GzsCjytpqs5wAskp3kmO94GmOFgEUjMtBmVqrHbePcJnbH0OjrHwy+ mZP/7Qou1OOJGrfs7QFn9FCC9uHLrFOMI24uSNfBODbdC+q4S5S7+RHMguf1cn1JNXhk 2BCjvd4HSeugQcyDZEOkUHV3vpLeD7WyrvkVMIYDtzk+VM6gkT6Js/D1KSIbgfJ+csbG rwfvCOvUiW81b07EFZTXYicdLhyPQOXG4Yv2jY5qz5jhK94f00CZbwytLacZ5PGBqsjo PTbA== X-Gm-Message-State: AJIora/4nMXcBZOAMvH/YLr7qiWoigKipmsPMfbRYZgwim2my3X38i3G 9gTkCObSGuNuYDS/CVNlVrY= X-Google-Smtp-Source: AGRyM1vNcGIoA6hGLVlUdWiIH54MjznBLLVh/Cl8mift+QIeF4n5WfR8dRiuM27knerLSTPfCcUTRg== X-Received: by 2002:a05:6a00:22d5:b0:52b:af2:9056 with SMTP id f21-20020a056a0022d500b0052b0af29056mr33504236pfj.80.1658242375719; Tue, 19 Jul 2022 07:52:55 -0700 (PDT) Received: from localhost.localdomain (1-171-6-142.dynamic-ip.hinet.net. [1.171.6.142]) by smtp.gmail.com with ESMTPSA id o18-20020a170903211200b001615f64aaabsm11630842ple.244.2022.07.19.07.52.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 07:52:55 -0700 (PDT) From: cy_huang To: jic23@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: lars@metafoo.de, cy_huang@richtek.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v8 1/3] dt-bindings: iio: adc: Add rtq6056 adc support Date: Tue, 19 Jul 2022 22:52:43 +0800 Message-Id: <1658242365-27797-2-git-send-email-u0084500@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1658242365-27797-1-git-send-email-u0084500@gmail.com> References: <1658242365-27797-1-git-send-email-u0084500@gmail.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: ChiYuan Huang Add the documentation for Richtek rtq6056. Signed-off-by: ChiYuan Huang Reviewed-by: Krzysztof Kozlowski --- Since v3 - change the node name to be generic 'adc' in binding example. Since v2 - Change the resistor property name to be generic 'shunt-resistor-micro-ohms'. --- .../bindings/iio/adc/richtek,rtq6056.yaml | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/richtek,rtq6056.yaml diff --git a/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056.yaml b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056.yaml new file mode 100644 index 00000000..88e0086 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/richtek,rtq6056.yaml @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/richtek,rtq6056.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RTQ6056 Bi-Directional Current and Power Monitor with 16-bit ADC + +maintainers: + - ChiYuan Huang + +description: | + The RTQ6056 is a high accuracy current-sense monitor with I2C and SMBus + interface, and the device provides full information for system by reading + out the loading current and power. + + The device monitors both of the drops across sense resistor and the BUS + voltage, converts into the current in amperes, and power in watts through + internal analog-to-digital converter ADC. The programmable calibration, + adjustable conversion time, and averaging function are also built in for + more design flexibility. + + Datasheet is available at + https://www.richtek.com/assets/product_file/RTQ6056/DSQ6056-00.pdf + +properties: + compatible: + const: richtek,rtq6056 + + reg: + maxItems: 1 + + "#io-channel-cells": + const: 1 + + shunt-resistor-micro-ohms: + description: Shunt IN+/IN- sensing node resistor + +required: + - compatible + - reg + - "#io-channel-cells" + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + adc@40 { + compatible = "richtek,rtq6056"; + reg = <0x40>; + #io-channel-cells = <1>; + }; + }; From patchwork Tue Jul 19 14:52:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cy_huang X-Patchwork-Id: 591741 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 A7ADACCA481 for ; Tue, 19 Jul 2022 14:54:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237934AbiGSOxb (ORCPT ); Tue, 19 Jul 2022 10:53:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237962AbiGSOxD (ORCPT ); Tue, 19 Jul 2022 10:53:03 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1C845F48; Tue, 19 Jul 2022 07:53:02 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id y9so13747986pff.12; Tue, 19 Jul 2022 07:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OZiBpFyW9MnDMSabeWCxAJ/auRfTTJrBnZ7dKBX77Q8=; b=aUUu+v7RPc8KpnCUPG+ReeGtPU9ePs/btyw3lVMyZSKsfVv/eDKICi7mJv3h7KRwsA XohNzdTLKPsvegeWmf1i2RN92JtVunk+d7EPRZRxzOD0eZI51kgQt6DaKanX7bfiuI1n oPpZfDZVefTyAx8rOLp39r3v1Y3354VYb1jnHWFzYXTtL3fbG3WKLPMcoyB/HbtJvYKr Pcuyq5UGU1/F1wezzomiH3V9oAQSo2exD/iXtJjB3Aa2BeSoLB1qcic9HiDbW+flMESz ao/rP3+Iv9EcWKgcBTOtTDaxc1xyUzQMBWApWdVHuuffoUtRnYdAUuZFHK1PyTX4k1+g mIyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OZiBpFyW9MnDMSabeWCxAJ/auRfTTJrBnZ7dKBX77Q8=; b=5hgRVmh741Hum2YRGc9bJYTvgt7ExbpYbQl/NgQjjtTA+BL5RO3bqoOAv1KOVqr5k2 ZlGJC3YBBAtmXZpAdIlKtsAzVnoeSCcCgPwQciVtM5q4CYOElQTNiqjqpcNVnOUWYDp3 pXcaZi676ztCSzocjC+D94WL4ayzk1SJd60mCMwTlRcHCzYUR5loAK1/QqYFKjvkyEs7 HaaCWF6KrEsOUjiDzYE7fMTffgHQZ7iKlZnetRye+27NDJf3iBuT5gAQTXpU9LYOv+e0 xwrog5kMhsJOCIlvnDDNqb6DENZQbAB9N6Oug53Bk4+6lKuTDAZ+PDe5W/h/+zkgEcac sS9g== X-Gm-Message-State: AJIora9WDyAYnxrUjxxbJmySPc/OGzk5L4frNzCnxL6Km7kNt1z/Td0d hOPfrJYKImzE6z/vS6zwyg4= X-Google-Smtp-Source: AGRyM1tt+Zcswq/JMIXpdHwqIDW/OQuVzWBUpDxwLrjc4pXrEWEVJ6/v2L0OdMEgZVU3ip9PHxFHXQ== X-Received: by 2002:a63:86c8:0:b0:415:366c:f287 with SMTP id x191-20020a6386c8000000b00415366cf287mr29184219pgd.309.1658242382406; Tue, 19 Jul 2022 07:53:02 -0700 (PDT) Received: from localhost.localdomain (1-171-6-142.dynamic-ip.hinet.net. [1.171.6.142]) by smtp.gmail.com with ESMTPSA id o18-20020a170903211200b001615f64aaabsm11630842ple.244.2022.07.19.07.52.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 07:53:01 -0700 (PDT) From: cy_huang To: jic23@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: lars@metafoo.de, cy_huang@richtek.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v8 3/3] Documentation: ABI: testing: rtq6056: Update ABI docs Date: Tue, 19 Jul 2022 22:52:45 +0800 Message-Id: <1658242365-27797-4-git-send-email-u0084500@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1658242365-27797-1-git-send-email-u0084500@gmail.com> References: <1658242365-27797-1-git-send-email-u0084500@gmail.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: ChiYuan Huang Add documentation for the usage of voltage channel integration time. Signed-off-by: ChiYuan Huang --- Since v8 - Update IIO ABI about sampling frequency for power/current/voltage channel. --- Documentation/ABI/testing/sysfs-bus-iio | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index d4ccc68..17855f7 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -2030,3 +2030,14 @@ Description: Available range for the forced calibration value, expressed as: - a range specified as "[min step max]" + +What: /sys/bus/iio/devices/iio:deviceX/in_voltageX_sampling_frequency +What: /sys/bus/iio/devices/iio:deviceX/in_powerY_sampling_frequency +What: /sys/bus/iio/devices/iio:deviceX/in_currentZ_sampling_frequency +KernelVersion: 5.20 +Contact: linux-iio@vger.kernel.org +Description: + Some devices have separate controls of sampling frequency for + individual channels. If multiple channels are enabled in a scan, + then the sampling_frequency of the scan may be computed from the + per channel sampling frequencies.