Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4465199rwb; Mon, 8 Aug 2022 01:04:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR5VyR89KCD85mCWN8b/AW4hOpz/Zi0t59/DQUNXOzbQobO+od7h60Xgwi9C9hhLc+XsQmWF X-Received: by 2002:a05:6402:400e:b0:440:253e:961a with SMTP id d14-20020a056402400e00b00440253e961amr12213317eda.285.1659945885551; Mon, 08 Aug 2022 01:04:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659945885; cv=none; d=google.com; s=arc-20160816; b=MhHnV6PSIegrOa0JnH2MRNjYgV36Yd7ho0HoCSrV+r7ZaFTHDwejgaYV4L5Ij2BEX9 1KBpO2u+nnU/aF5hRBUlTgzIctKirlq4DeykFuQmgehP/oRA5UmOVcHpIL/HT+hSKKPG 9YqK70OwR9kBbX5yuI+nZDWA+MED4PhuMBoELn4qNg5Y/paRuNpCVOEpJosru3LqSGMO +ODsnD2w+rkDKU+0d5Ikl0l52NLHwyL5WYUA2FFZN/5Zhrym1NvxQ6XMwRfiE0k0A6Au H+ZP/Ep28LbZPu4f0UkStGdzBP1MaObDzcnSvwGD8lnqx7QYNpke/Ei85xXlqs+DcQsl ymUA== 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 :dkim-signature; bh=5U3mxEHoJ4j0IaPwuYR+EkUg8ARPqLGxlFWvfIK89d4=; b=sWYSH77YV/XNdaO7UCLbQqP4rB9IygRqDEogiZhkWbUwcrauEiB95olvdQAXB1oC4f afcxN7UdH8pGIDBnKZ4qUGOKqshF5mSw1jcxGQzOCLLlHo8offVEfboAwU2aZfT8FohP RTINfvKdHAuKQdnw2CPFCOibUNqDkOF3h+F4Ri/3sGZOtNMAx4hkASYHIMVv7RDeImfp Bxczd8qS4dS0cDmrl382nFLWOfpNS8k94LNgDsjFAL5LPyyaj/i1WrncUaQ/2fvw9CCl RA5MeI954UTZrUklMBNzZ5KuAnsZnlE1eADPbPNt9a03oweCH3AoX+0AkL+T0Yj4turM hJog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eS4uVBWF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht15-20020a170907608f00b0072f9c64493dsi10421690ejc.935.2022.08.08.01.04.20; Mon, 08 Aug 2022 01:04:45 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eS4uVBWF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236564AbiHHHfx (ORCPT + 99 others); Mon, 8 Aug 2022 03:35:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236393AbiHHHfl (ORCPT ); Mon, 8 Aug 2022 03:35:41 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0368C6399; Mon, 8 Aug 2022 00:35:40 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id q30so9824991wra.11; Mon, 08 Aug 2022 00:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=5U3mxEHoJ4j0IaPwuYR+EkUg8ARPqLGxlFWvfIK89d4=; b=eS4uVBWF/h2cfOJPjUFgee0cwP/FtrazBNExTcWrHtpBDdkHJuLQ3vHMFtHIe70h2n A373KF/RdDDLdL+0XsQAki9vOoPit1LG8pzXZLtIruK6LG13Ppp1KbmZy+mh0WpFIfp0 nF2w+ReA44wk6oE/Hq4sNE/MHKB95S/zKE8jg3OX8HlbUFzpWjmvOESpjm0zjyPEaCg+ NEisDVvWQ+sVV++G6DkAl2EX0QUAhLqxwtkVW0E5TgWM66MY85UbZ+9Ig6NvGEasiP2X 8GE6vDiF99kOgzU3oXO/OkIjIa6/v9m4Ll5Phgiok8JsLNVEMGYk+4n872iLarA1n2q2 86Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=5U3mxEHoJ4j0IaPwuYR+EkUg8ARPqLGxlFWvfIK89d4=; b=YQZ6KOMP5r0YvycFVa+H8BifkMhJazOQN2vaSwYa509FHNQybgDlr2G03kIRsooD9D EGiGBCfnWEJmiG9igm2sc5BjUqhExjh2POYMn3A1Z8xnxgFxin8kP777NnDuYuOQVad/ 6g0oPVDcymKUwU2vulTR1fnayMlrr3gtH1Q5jXQ68zjDp/yHfbsylaHxF3JN+Eskgqxu GB1Ii+RKtZ5K4VE0RSdrweur/zOnGebRfEoqjFuXAuI4AtAI3gFdlxI4xSrhA2L4UElU dOzHHvRNHQrCEOXjQmtMzkH/xVcoLi+AF3mV+I/Q97My+WcSpRgsgooRNr2CGZt5eriR NlWg== X-Gm-Message-State: ACgBeo04wxPEy738fJCi+BYblF7dweLNoM1iYk+mZsc4ajVbSv6vNLY7 3iFgI/CppuYU7xMa1r7AA8c= X-Received: by 2002:adf:f004:0:b0:21f:fdad:deb2 with SMTP id j4-20020adff004000000b0021ffdaddeb2mr10869569wro.279.1659944138532; Mon, 08 Aug 2022 00:35:38 -0700 (PDT) Received: from localhost.localdomain ([105.235.133.111]) by smtp.gmail.com with ESMTPSA id cc11-20020a5d5c0b000000b002205ffe88edsm8333364wrb.31.2022.08.08.00.35.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Aug 2022 00:35:38 -0700 (PDT) From: Yassine Oudjana X-Google-Original-From: Yassine Oudjana To: Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson Cc: Yassine Oudjana , Yassine Oudjana , Alejandro Tafalla , Konrad Dybcio , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, phone-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/8] dt-bindings: power: supply: Add DT schema for Qualcomm SMBCHG Date: Mon, 8 Aug 2022 08:34:52 +0100 Message-Id: <20220808073459.396278-2-y.oudjana@protonmail.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220808073459.396278-1-y.oudjana@protonmail.com> References: <20220808073459.396278-1-y.oudjana@protonmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Yassine Oudjana Add DT schema for the switch-mode battery charger found on Qualcomm PMICs such as PMI8994. Due to lack of documentation, some interrupt descriptions might be inaccurate. Signed-off-by: Yassine Oudjana --- .../bindings/power/supply/qcom,smbchg.yaml | 205 ++++++++++++++++++ MAINTAINERS | 8 + 2 files changed, 213 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/supply/qcom,smbchg.yaml diff --git a/Documentation/devicetree/bindings/power/supply/qcom,smbchg.yaml b/Documentation/devicetree/bindings/power/supply/qcom,smbchg.yaml new file mode 100644 index 000000000000..d825a9c10b3e --- /dev/null +++ b/Documentation/devicetree/bindings/power/supply/qcom,smbchg.yaml @@ -0,0 +1,205 @@ +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/supply/qcom,smbchg.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm PMIC Switch-Mode Battery Charger + +maintainers: + - Yassine Oudjana + - Alejandro Tafalla + +properties: + compatible: + enum: + - qcom,pmi8994-smbchg + - qcom,pmi8996-smbchg + + reg: + maxItems: 1 + + monitored-battery: + description: | + phandle of battery characteristics node. + The charger uses the following properties: + - charge-term-current-microamp + - constant-charge-current-max-microamp + - voltage-max-design-microvolt + The constant-charge-current-max-microamp and voltage-max-design-microvolt + properties must be set. + See Documentation/devicetree/bindings/power/supply/battery.yaml + + interrupts: + items: + - description: Charger error + - description: Charger inhibited + - description: Charger precharge safety timer timeout + - description: Charger charge safety timer timeout + - description: Charger pre to fast charging switch threshold reached + - description: Charger recharge threshold reached + - description: Charger taper threshold reached + - description: Charger charge termination threshold reached + - description: Battery hot + - description: Battery warm + - description: Battery cold + - description: Battery cool + - description: Battery overvoltage + - description: Battery low + - description: Battery missing + - description: Battery thermistor missing # unconfirmed + - description: USB input undervolt + - description: USB input overvolt + - description: USB input source detected + - description: OTG regulator failure + - description: OTG regulator overcurrent + - description: Automatic input current limiting done + - description: USB ID pin changed + - description: DC input undervolt + - description: DC input overvolt + - description: Power OK + - description: Temperature shutdown + - description: Watchdog timeout + - description: Flash failure + - description: OTST2 # unknown + - description: OTST3 # unknown + + interrupt-names: + items: + - const: chg-error + - const: chg-inhibit + - const: chg-prechg-sft + - const: chg-complete-chg-sft + - const: chg-p2f-thr + - const: chg-rechg-thr + - const: chg-taper-thr + - const: chg-tcc-thr + - const: batt-hot + - const: batt-warm + - const: batt-cold + - const: batt-cool + - const: batt-ov + - const: batt-low + - const: batt-missing + - const: batt-term-missing + - const: usbin-uv + - const: usbin-ov + - const: usbin-src-det + - const: otg-fail + - const: otg-oc + - const: aicl-done + - const: usbid-change + - const: dcin-uv + - const: dcin-ov + - const: power-ok + - const: temp-shutdown + - const: wdog-timeout + - const: flash-fail + - const: otst2 + - const: otst3 + + otg-vbus: + type: object + + description: + OTG regulator subnode. + +required: + - compatible + - reg + - monitored-battery + - interrupts + - interrupt-names + - otg-vbus + +additionalProperties: false + +examples: + - | + #include + + battery: battery { + compatible = "simple-battery"; + + charge-full-design-microamp-hours = <4070000>; + charge-term-current-microamp = <100000>; + voltage-min-design-microvolt = <3400000>; + voltage-max-design-microvolt = <4400000>; + }; + + pmic { + #address-cells = <1>; + #size-cells = <0>; + + charger@1000 { + compatible = "qcom,pmi8996-smbchg"; + reg = <0x1000>; + + interrupts = <0x2 0x10 0x0 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x10 0x1 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x10 0x2 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x10 0x3 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x10 0x4 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x10 0x5 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x10 0x6 IRQ_TYPE_EDGE_RISING>, + <0x2 0x10 0x7 IRQ_TYPE_EDGE_RISING>, + <0x2 0x12 0x0 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x12 0x1 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x12 0x2 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x12 0x3 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x12 0x4 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x12 0x5 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x12 0x6 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x12 0x7 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x13 0x0 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x13 0x1 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x13 0x2 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x13 0x3 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x13 0x4 IRQ_TYPE_EDGE_RISING>, + <0x2 0x13 0x5 IRQ_TYPE_EDGE_RISING>, + <0x2 0x13 0x6 IRQ_TYPE_EDGE_FALLING>, + <0x2 0x14 0x0 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x14 0x1 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x16 0x0 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x16 0x1 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x16 0x2 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x16 0x3 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x16 0x4 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x16 0x5 IRQ_TYPE_EDGE_BOTH>; + interrupt-names = "chg-error", + "chg-inhibit", + "chg-prechg-sft", + "chg-complete-chg-sft", + "chg-p2f-thr", + "chg-rechg-thr", + "chg-taper-thr", + "chg-tcc-thr", + "batt-hot", + "batt-warm", + "batt-cold", + "batt-cool", + "batt-ov", + "batt-low", + "batt-missing", + "batt-term-missing", + "usbin-uv", + "usbin-ov", + "usbin-src-det", + "otg-fail", + "otg-oc", + "aicl-done", + "usbid-change", + "dcin-uv", + "dcin-ov", + "power-ok", + "temp-shutdown", + "wdog-timeout", + "flash-fail", + "otst2", + "otst3"; + + monitored-battery = <&battery>; + + otg-vbus { }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 3796fd700727..7e9f5893c0eb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -16951,6 +16951,14 @@ F: Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst F: drivers/net/ethernet/qualcomm/rmnet/ F: include/linux/if_rmnet.h +QUALCOMM SMBCHG DRIVER +M: Yassine Oudjana +M: Alejandro Tafalla +L: linux-pm@vger.kernel.org +L: linux-arm-msm@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/power/supply/qcom,smbchg.yaml + QUALCOMM TSENS THERMAL DRIVER M: Amit Kucheria M: Thara Gopinath -- 2.37.1