From patchwork Mon Oct 23 06:20:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Travkin X-Patchwork-Id: 156675 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1105929vqx; Sun, 22 Oct 2023 23:21:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5lUipFyblh5xp0a1SxjmJXWXkw6a8m/idkAMFOzNpVnxUsa72vR5ULWAK8pyaubaRaa2V X-Received: by 2002:a05:6a21:35c8:b0:17a:e03f:5665 with SMTP id ba8-20020a056a2135c800b0017ae03f5665mr4970680pzc.31.1698042107821; Sun, 22 Oct 2023 23:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698042107; cv=none; d=google.com; s=arc-20160816; b=IMm/WCKrrn3zIXhLflY/prlieQVt3VHVAKdTM4LuFjsVjJU9WXM4Qo0LvofgBGPACD +mrnL8hdjhIh3RVsBGSvcbAlxNzQlF++BfveLt6r2PK2+HFGkYA8NZreNYniyy+PhXM5 o3tJoP+KR4I6lYMyLDolNR6YWg8N7pT+yJGnJAxwESUCT+F9cSRN6F/bKRZbB/82OHmx USwkVMmg0yXyOgALVUQkbbnx6mKugiBerzLLxlV5V4+kJRRgdj53bRK5jPbZitQHaZrk OzuQvx98bI9mYAvvrKRsgZw9Y72Hx7Qf3ohWhrD40ZJVGf2Mk6cuI6Qn/ejLs9958z30 YvEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=kIA95I2ewKTLuAAZPHe/l3g4GXWBWg5Jjaw2wiqkmHM=; fh=WJZ0ZrB0e7K7PtDZrv0aOFDugF3kN5vtBdwtzw6+lXE=; b=Y9KVxGXubdlW0TQMu4YEeW64BoW6fURG9WOhdAGJkZ6ITj6/Xrnu8E8tK2hF+S7fiP /JgKn4l7huZmyhy+MgbywaK+vGLgvnPrdTG6kQdmPYeYXuZcaPiKcQCsH0lHDi5F+XA8 iQ37CSQEKFM6XpU8UzysFSWoFkI2HkvmaDq5rOBOrN8JBrFTuTGRdWCIk0mQypAXuYbe XfDewkzyAh4UDh0bSkQCJXpqjr20uE2p+KyOH81k/Rmywk6a+Q3AHbynQdBeZxVeFDoh ee7XTtcBZTa+3dTQCAou2M6LXa1AXTKMM9GWPbusPoIiBR/8+MV3HfJPt/ooTwlnTzCa +eGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=N8kfWVYw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id d31-20020a631d5f000000b005b834096959si5860357pgm.851.2023.10.22.23.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 23:21:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=N8kfWVYw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id EBFCF8061152; Sun, 22 Oct 2023 23:21:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233490AbjJWGV1 (ORCPT + 26 others); Mon, 23 Oct 2023 02:21:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233352AbjJWGVY (ORCPT ); Mon, 23 Oct 2023 02:21:24 -0400 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 846D5D70; Sun, 22 Oct 2023 23:21:22 -0700 (PDT) Received: from authenticated-user (box.trvn.ru [194.87.146.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.trvn.ru (Postfix) with ESMTPSA id 48ADC4C0C8; Mon, 23 Oct 2023 11:21:09 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1698042069; bh=luFC7my9PJ6B7z1i59mt1ERZ1dlWg9/dkHvKsguCUSo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=N8kfWVYwZjQOXm4rGD8cA8cbc2f5ID92oAlwrty5fvsgH/SYZ2bV8IhnfPnUF4kyV gwhH4PmlMmvTeF+h7AvT1FOFuc3JD3JT3oj54F5esz6JxKA6yBeWClW7ZNzM14XTEm ffyHKlnWmhC6IGnuCyH/O6MOfytOevcjGIWijnqwzRpnexkVqp8ZoK2g/PLVK7g0NU 4b/xJ/svcGoLxDerDhCh8D67v9hiTk1RGVWuOvRPsKp22ZX3VRcRr1IV4KMLu7wae0 A6v6UQDmc0ttVIulu83e/YSsLYBaiJtEvk1ny+JYBpQxedb1GgaY8CZu3p93NcXmmK jvaVczMxnZmiw== From: Nikita Travkin Date: Mon, 23 Oct 2023 11:20:32 +0500 Subject: [PATCH v2 1/3] dt-bindings: mfd: qcom,spmi-pmic: Add pm8916 vm-bms and lbc MIME-Version: 1.0 Message-Id: <20231023-pm8916-dtsi-bms-lbc-v2-1-343e3dbf423e@trvn.ru> References: <20231023-pm8916-dtsi-bms-lbc-v2-0-343e3dbf423e@trvn.ru> In-Reply-To: <20231023-pm8916-dtsi-bms-lbc-v2-0-343e3dbf423e@trvn.ru> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Stephen Boyd Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Nikita Travkin X-Developer-Signature: v=1; a=openpgp-sha256; l=1246; i=nikita@trvn.ru; h=from:subject:message-id; bh=luFC7my9PJ6B7z1i59mt1ERZ1dlWg9/dkHvKsguCUSo=; b=owEBbQKS/ZANAwAIAUMc7O4oGb91AcsmYgBlNhDRw3kL1xMo/oFuqFrVGmBx/J1tcSHs8Vlrm O5FI2hw13SJAjMEAAEIAB0WIQTAhK9UUj+qg34uxUdDHOzuKBm/dQUCZTYQ0QAKCRBDHOzuKBm/ dTIRD/4m9cd91tQKb8ywplt7DOVB8WuPPqMB5SXFanHKRg6mQE9rcU4MiKF4Di68RkOqwvoU6eU pclYoN4+IEaZg4UW5UHumh1fl5CvCj6OvV9jwVl2XWoZ/FsizPpAmNWDMgylmAdzcRiNlGeQn5y rzndH7eloPc+NxP7dYAHiQ2pGS1cP8+xUnd5hgAH94vcOrxlYheYPXw6qzxPqEuhTIhnRdUSLAl f0sQg9oCVG4ZxZraplqeb/tZRKylaYh8YK5X+0f1wOvBKcMkuFB0L3tf/RbxZzTua6FNJO3eH4x OT9u+wavVvqWnXmUzpyO9n7FZpW9CJpwLI99Kpb8FqOcuX9cevuG2y8h2dq4ABqBQ/YbCQ+8KR8 zM53rpNlpQAW90jXDDZWSBJleQXbPxuaWn1riEeabZbA6g83PML+vQxXhaAE47ZUWOqWT2XUE19 UdSOKvcS1qzIOtRDii42YmLut4xb8PcFUOljer0ukxDOxqsN0J/OqFWD4eOicGtiAQpm9liNru5 uvfLxvcm+gybq2RtYzDIpCZoBJV2ljmUeUyfZjULZx1vlpVVkUWF2O2b9cnzeOOsayrgse0bhT9 GDwCKwiUMJimYwr87vxwDooyPEblCcRw73MmX4N92YJ5mvHNUjtnL3PeaxKjNR43cgCOcOUWB6k 7HJeSAfOVd+dn+A== X-Developer-Key: i=nikita@trvn.ru; a=openpgp; fpr=C084AF54523FAA837E2EC547431CECEE2819BF75 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sun, 22 Oct 2023 23:21:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780526201275557598 X-GMAIL-MSGID: 1780526201275557598 PM8916 (and probably some other similar pmics) have hardware blocks for battery monitoring and charging. Add patterns for respecive nodes so the devicetree for those blocks can be validated properly. Signed-off-by: Nikita Travkin --- Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml index 9fa568603930..49103e07032a 100644 --- a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml +++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml @@ -134,9 +134,15 @@ patternProperties: type: object $ref: /schemas/sound/qcom,pm8916-wcd-analog-codec.yaml# + "^battery@[0-9a-f]+$": + type: object + oneOf: + - $ref: /schemas/power/supply/qcom,pm8916-bms-vm.yaml# + "^charger@[0-9a-f]+$": type: object oneOf: + - $ref: /schemas/power/supply/qcom,pm8916-lbc.yaml# - $ref: /schemas/power/supply/qcom,pm8941-charger.yaml# - $ref: /schemas/power/supply/qcom,pm8941-coincell.yaml# - $ref: /schemas/power/supply/qcom,pmi8998-charger.yaml# From patchwork Mon Oct 23 06:20:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Travkin X-Patchwork-Id: 156677 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1106005vqx; Sun, 22 Oct 2023 23:21:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBWR+vX5J4GPxpMGocd75tPRLEB2YWe84u4JdI6gdYEiBFD73XCO+Rx3kwKl2jWU1YRLTG X-Received: by 2002:a17:90b:2786:b0:274:111c:c14d with SMTP id pw6-20020a17090b278600b00274111cc14dmr5331721pjb.13.1698042118579; Sun, 22 Oct 2023 23:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698042118; cv=none; d=google.com; s=arc-20160816; b=z7EBh+RqCgd/VdykES3x+MWQLU+OB/YV6yXPYQQ8d7TepymHWACmd8JCGH/LxDatkr RBBi/xj+1YDDitVMDDsXtBjrhkEhr6v/ShYysa0T6O+UVxkiBlFNUxZfqp1AxA9ya8k0 h3oOBzao6F9zCYFT7lzbG6aNjz+EoxYaiqOGym8yHcCY1tNC/Ae5huQLCXnELxXxKf/s zQ1r3JiGy1OlgtDjNKg6ubeMonRxSTqYTnEWxYIHtWNUGe7rN+LW91IZa/L2XNiG1+iE w3zSk8i1VFubKFvcPrWlgqXYDsDzbZNi4S1A8AWrD67pdfTYbmSi7jh+NREcAM0Eey88 yImw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=gKU2Hb5Ts8ACz6pXE/qz00/JtwGg1ALMTvmhW/lX6v4=; fh=WJZ0ZrB0e7K7PtDZrv0aOFDugF3kN5vtBdwtzw6+lXE=; b=OGGy57GCDdr3Hf144U+Csiv6wbyTjxB2CTBjJYJXQAjvEeJdk5ZgV/Sv4lePIBjgXD yeIOROsC9MSIJ31xU6zi5zrFFt2ybsfncEmKw3DKH0YHNrXK4NqUhGO0fsmSn8WQ6eg+ N6gFAU32BIYeNcoqbjgJCGAvQ/ZRMM+EBKoRlUwWGWSaNt8wsoIw81DBtQpnX+qW1jeD zqEJw887zhkHWX+vKeoOCovCk3BBpE0lP4D8QX0Do0gHmBpYeFNDsfBJYWkBFctjsx5e l8xRUTb4y1JEhefYks5V/dvx4+j1VeKGir4tD82efaj2I3t3kcVyY8QURuoMNLVID8S4 LFmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=ejXquwX3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id p9-20020a17090a868900b002774c98054csi6102100pjn.116.2023.10.22.23.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 23:21:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=ejXquwX3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4D4C88068228; Sun, 22 Oct 2023 23:21:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233504AbjJWGVn (ORCPT + 26 others); Mon, 23 Oct 2023 02:21:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233491AbjJWGVg (ORCPT ); Mon, 23 Oct 2023 02:21:36 -0400 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EA1D10D5; Sun, 22 Oct 2023 23:21:31 -0700 (PDT) Received: from authenticated-user (box.trvn.ru [194.87.146.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.trvn.ru (Postfix) with ESMTPSA id 0BBE44C0CE; Mon, 23 Oct 2023 11:21:11 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1698042071; bh=cGxQVt+NVbaQIsSjfqmJUKIMf/PR6FSgo/FLAfIdsik=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ejXquwX3PnnIL3dZ7rb01Fjajr9FkFcJAWX30feIVvRbMCbZ3rmgqCfQyl/IkBDoo GbeJgr7DIi8cARGXqSK6svS7dkF4TMu3CQEJs0c/q0IIcKiti2kWynIbBIZfvgRVvO tBOIcW/RRXbbx+9ODfvB6xgFSTukqiUiVOj2rh0ERPCJ8mn+4BHm0jiMX5ePw9UUOk 4QpzNk1zTtXMc/lhxbKmkY40nD9L3FrB2hOfSeKk0jObrsjUY1jmSk4A3QIGUw21Ax 9eml7e9Zd8YYREc+ks0ZRwXoNhf9zDEdIb62T8GPCuyAGJcJZGBoRUllgAeKUoF7jd WexgptyP2qxQA== From: Nikita Travkin Date: Mon, 23 Oct 2023 11:20:33 +0500 Subject: [PATCH v2 2/3] arm64: dts: qcom: pm8916: Add BMS and charger MIME-Version: 1.0 Message-Id: <20231023-pm8916-dtsi-bms-lbc-v2-2-343e3dbf423e@trvn.ru> References: <20231023-pm8916-dtsi-bms-lbc-v2-0-343e3dbf423e@trvn.ru> In-Reply-To: <20231023-pm8916-dtsi-bms-lbc-v2-0-343e3dbf423e@trvn.ru> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Stephen Boyd Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Nikita Travkin X-Developer-Signature: v=1; a=openpgp-sha256; l=2360; i=nikita@trvn.ru; h=from:subject:message-id; bh=cGxQVt+NVbaQIsSjfqmJUKIMf/PR6FSgo/FLAfIdsik=; b=owEBbQKS/ZANAwAIAUMc7O4oGb91AcsmYgBlNhDRHM6Gt64pGbufSe8l9M5t5S0bp3svifn+y QLkTSjDZFiJAjMEAAEIAB0WIQTAhK9UUj+qg34uxUdDHOzuKBm/dQUCZTYQ0QAKCRBDHOzuKBm/ dUxWEACdupMPoHhHcJ6VkcR5ikUEQLdMOqy04PTeJ1Jv3dwSUXnsHHA69p6wmYwCASI6zEtDEAx mQK6Ao5Q4r31Q8s9CZzZW8PzJC70O9V275q8jd5+IlR8x8iArR1ToZ59hOk6lfp9Wruaf38f3kW bOSuEh/NpiGWe7F4ULq001IchM4AbHCdhzfOuoIZGbZDFtwbAGSPGx6I7uIKlVRIDpNRWQO2Jzw bBV3lUc04oRkJqaLeLc6eoJpBGyl20dFI57OPOp0JK3qtloWtymm+e73OZA+ynhtnPQiI8+8pcV Ix14alS3x1tu/G1HH8oioUhNTxE+JGCZpDGckiZYm1OnMgqtso4DCUqDLFybPPZavG6881oSuez 74pHrFo4g6Q6zYoM1o3K/z20NO6bZOiAlbdyulDAjZrs6ISgWQ/OrtSWJDyIqpAosofDhlclNq3 V/8vdcZ7ZgHs7Sz6WGej3wpvYs9BsEywKcY7H6i1rxhffhhCBz2LMBQY8jazQe/VorJfrLB2+Cw kRRllP5wnizvQWdWhnRob4k2RcM2Doynf8qe+KCVNP3N3/L65BpuAI/NobdNiolPteO9dqU047a wFMQjpT1nJU9vRPFUt7lz0kLwvakcjwLMvzcGVoaTimuVreiwqYmwob6/7BxGORMqI5xEfxVH+W GaVDiepL/8mTaIQ== X-Developer-Key: i=nikita@trvn.ru; a=openpgp; fpr=C084AF54523FAA837E2EC547431CECEE2819BF75 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 22 Oct 2023 23:21:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780526212122594591 X-GMAIL-MSGID: 1780526212122594591 pm8916 contains some hardware blocks for battery powered devices: - VM-BMS: Battery voltage monitoring block. - LBC: Linear battery charger. Add them to the pmic dtsi so the devices that make use of those blocks can enable them. Signed-off-by: Nikita Travkin --- arch/arm64/boot/dts/qcom/pm8916.dtsi | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pm8916.dtsi b/arch/arm64/boot/dts/qcom/pm8916.dtsi index f4de86787743..4b2e8fb47d2d 100644 --- a/arch/arm64/boot/dts/qcom/pm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/pm8916.dtsi @@ -41,6 +41,35 @@ watchdog { }; }; + pm8916_charger: charger@1000 { + compatible = "qcom,pm8916-lbc"; + reg = <0x1000>, <0x1200>, <0x1300>, <0x1600>; + reg-names = "chgr", "bat_if", "usb", "misc"; + + interrupts = <0x0 0x10 0 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x10 6 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x13 0 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>, + <0x0 0x13 4 IRQ_TYPE_EDGE_BOTH>; + interrupt-names = "vbat_det", + "fast_chg", + "chg_fail", + "chg_done", + "bat_pres", + "temp_ok", + "coarse_det", + "usb_vbus", + "chg_gone", + "overtemp"; + + status = "disabled"; + }; + pm8916_usbin: usb-detect@1300 { compatible = "qcom,pm8941-misc"; reg = <0x1300>; @@ -91,6 +120,25 @@ channel@f { }; }; + pm8916_bms: battery@4000 { + compatible = "qcom,pm8916-bms-vm"; + reg = <0x4000>; + interrupts = <0x0 0x40 0 IRQ_TYPE_EDGE_RISING>, + <0x0 0x40 1 IRQ_TYPE_EDGE_RISING>, + <0x0 0x40 2 IRQ_TYPE_EDGE_RISING>, + <0x0 0x40 3 IRQ_TYPE_EDGE_RISING>, + <0x0 0x40 4 IRQ_TYPE_EDGE_RISING>, + <0x0 0x40 5 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "cv_leave", + "cv_enter", + "ocv_good", + "ocv_thr", + "fifo", + "state_chg"; + + status = "disabled"; + }; + rtc@6000 { compatible = "qcom,pm8941-rtc"; reg = <0x6000>, <0x6100>; From patchwork Mon Oct 23 06:20:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Travkin X-Patchwork-Id: 156676 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1105996vqx; Sun, 22 Oct 2023 23:21:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHsZHaj0n4GWTSx8CDI+yh5bkWlFzosscIYnpT3POl9FzGbzEVIM3SAY4UCSDnr0ccfArQ1 X-Received: by 2002:a05:6a20:7495:b0:13f:13cb:bc50 with SMTP id p21-20020a056a20749500b0013f13cbbc50mr11204306pzd.25.1698042117388; Sun, 22 Oct 2023 23:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698042117; cv=none; d=google.com; s=arc-20160816; b=UUqmawn6FDhZKYGviz2mu+JfhaFW9xYQqgDx4pb9i+2dg4OqndBdczfIvOc4iOnatI 6C1EVjAsOGCH4JcnKghpqwVJPGZrQJQru8vEJQp1P4cWssZKh4VHyUXcAZij5jcs7Tzd s7Bp9dDx3NI63ePiZ7MMyzpCioy1CekfEyLBuM2Xg6JkPFQACiT7Zzipjv/tti69rr22 lmPxgWnJ8XQAI1YgSKArlZE7o0zKAcFzJbkyokYa1Dq/choLcHT4U5tDeEfojF/gTO77 gdLtF8p+RpXLRBdUt3ji/D/4DlHgRu7e3UIe2/yEznXg5DJ4lRT4l+MIC6U14Yca+HC4 lvXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=GIAzoqTkcL484Z/DHRenS9rPIoBpnbPeM5WfCLtX/Xc=; fh=WJZ0ZrB0e7K7PtDZrv0aOFDugF3kN5vtBdwtzw6+lXE=; b=watfVUkc0SGsxbbg3jKI32oFX9WA/BbXvGD11NjRMMbm4+gcn6s9z6asRFtGh0kjqj w7Ggh0z575O9BwU86epaSkknsXzoJfL4m5uyV32e6c3BueeKa7gbUiI9EIeKOMg2wcja OTBPOvrXor2kCmNZzSIBDZjGZFYqFMCWzFqiyu+nPDbiSi8kRpl+ZyN8trw9hbqQPIWv 8m9OUzKZYL7FIxJmsgcGxQkn0xIQJRJhLPeL9ooaYw+0VQNvgWCUJdBINEEKKIb8rjSc 4YaE0M0h51J4VnJG0PGphYR7YRDMZ6vWO5IS0dXGB00tdU/nS1zxLo731QW9hndIIhSW Ttdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=yVgDjFsK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b1-20020a056a00114100b0068fac3509a9si6065341pfm.350.2023.10.22.23.21.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 23:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@trvn.ru header.s=mail header.b=yVgDjFsK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=trvn.ru Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 070B7808EDF2; Sun, 22 Oct 2023 23:21:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233514AbjJWGVk (ORCPT + 26 others); Mon, 23 Oct 2023 02:21:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233501AbjJWGVf (ORCPT ); Mon, 23 Oct 2023 02:21:35 -0400 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 869C710D9; Sun, 22 Oct 2023 23:21:31 -0700 (PDT) Received: from authenticated-user (box.trvn.ru [194.87.146.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.trvn.ru (Postfix) with ESMTPSA id B22CA4C0CF; Mon, 23 Oct 2023 11:21:11 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1698042072; bh=LE4M+4BoGWR3AG2eTo3yWZAS7TbtqWSMeFL22HkUE/g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=yVgDjFsKUTLlUFp86vRaEKR32Z/eqUeft91isQBTxF14E3oIun0SPgqoP3AoRoSkF 2H8/PoCMdmBaTQPr4V9kXOfKCEkt6JFr3t9phNJ2NZ3uLNJRSGkbsMcNIApMd3CMI7 xeJD0TujgfglPVuBFOnl6aGhxVfYIewtJ3b1HS1fED+2oi5qMJaiV/QEHQON9bzbud FBPdt+P521Ot4VNzWpjJFCax1ueUy2GaELvgaCBeEPN69GrOsRyIX7RLJnJsSr9bvE XEPpypY3D5aJb52YVd99oSRxwJzrvEh9j5ldaryCz+p8JWjqAh7uN1TgqXWWUZ4OlW kP72kaXnngYxA== From: Nikita Travkin Date: Mon, 23 Oct 2023 11:20:34 +0500 Subject: [PATCH v2 3/3] arm64: dts: qcom: msm8916-longcheer-l8150: Add battery and charger MIME-Version: 1.0 Message-Id: <20231023-pm8916-dtsi-bms-lbc-v2-3-343e3dbf423e@trvn.ru> References: <20231023-pm8916-dtsi-bms-lbc-v2-0-343e3dbf423e@trvn.ru> In-Reply-To: <20231023-pm8916-dtsi-bms-lbc-v2-0-343e3dbf423e@trvn.ru> To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Stephen Boyd Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Nikita Travkin X-Developer-Signature: v=1; a=openpgp-sha256; l=2452; i=nikita@trvn.ru; h=from:subject:message-id; bh=LE4M+4BoGWR3AG2eTo3yWZAS7TbtqWSMeFL22HkUE/g=; b=owEBbQKS/ZANAwAIAUMc7O4oGb91AcsmYgBlNhDRAVqwuDanZgTc9o1vFaHcsS/w8USKj22lF lB3GiI6pnGJAjMEAAEIAB0WIQTAhK9UUj+qg34uxUdDHOzuKBm/dQUCZTYQ0QAKCRBDHOzuKBm/ daPTEACFYCoq42J8LVnT9OP7NvNIFkkl1eb8y2BzwydJgrLaUkMH98E5S0bRiZCSD8roC4tExdT 5dGj5FcYAYQWy5t7O+3UJqPNGHR4ixDK2X/6S/klYj07JKprA+yogU/5odKyqlMVT85dH3397W1 fFtiSvnLteNmxHMOv12+RfSKxCuXwXN0/moXv9HYpiecM8b9HrweS4CSF8yXwKDafumvIwvKB6D G4Mv0xOc0QeSBlYuSozjs5sDmrLwqPzhH3cf+Hn68JgWQKgD0NQoz6PXs2nnFL6fBBNr0zeGERH rzMhg2Mxzu8oj+A8QtNxAeDlxVBZMLws0lxk5A5WvMpGjH4g69ljDvV9pmAgn9MWv7e6ruwrpBu CbVOYW5p84Zk0XxRFM4kIa5zU6GgqSx1NPN0YpMYGah4CKkqrByL3Lpw2WIIICwjl3K4d/BMsTJ EfQzc81BNgD86OZPR0PYKA/X/sRnPCjZp+/BQ5FyMXJpIUKWjy1Sc/jngKHMEebGjtCDo5Yqyri knLVlMn2voVAVL6BgqYkOctQkd22RRl91xwVUPXY7JWWkVYyZk/IPRDi9qHIIG+Xr8Tz1dcFgVU 3IDCuvkVO0V+1J3p3ml0RS2msY3h9FhVOejUmyCalKtY64vnGIXN9uEkQYznhpISOAw0Q2N/YfJ 0XSyXgj8hnlqeWQ== X-Developer-Key: i=nikita@trvn.ru; a=openpgp; fpr=C084AF54523FAA837E2EC547431CECEE2819BF75 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 22 Oct 2023 23:21:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780526211418549559 X-GMAIL-MSGID: 1780526211418549559 Longcheer L8150 doesn't have any dedicated fuel-gauge or charger, instead making use of the pmic hardware blocks for those purposes. Add pm8916 bms and charger, as well as the battery cell description that those blocks rely on. Signed-off-by: Nikita Travkin --- .../boot/dts/qcom/msm8916-longcheer-l8150.dts | 43 +++++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts index 47d1c5cb13f4..d35d34ef60d2 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts @@ -38,6 +38,25 @@ wcnss_mem: wcnss@8b600000 { }; }; + battery: battery { + compatible = "simple-battery"; + voltage-min-design-microvolt = <3400000>; + voltage-max-design-microvolt = <4350000>; + energy-full-design-microwatt-hours = <9500000>; + charge-full-design-microamp-hours = <2500000>; + + ocv-capacity-celsius = <25>; + ocv-capacity-table-0 = <4330000 100>, <4265000 95>, + <4208000 90>, <4153000 85>, <4100000 80>, <4049000 75>, + <4001000 70>, <3962000 65>, <3919000 60>, <3872000 55>, + <3839000 50>, <3817000 45>, <3798000 40>, <3783000 35>, + <3767000 30>, <3747000 25>, <3729000 20>, <3709000 16>, + <3688000 13>, <3681000 11>, <3680000 10>, <3679000 9>, + <3677000 8>, <3674000 7>, <3666000 6>, <3641000 5>, + <3597000 4>, <3537000 3>, <3457000 2>, <3336000 1>, + <3000000 0>; + }; + gpio-keys { compatible = "gpio-keys"; @@ -225,6 +244,22 @@ &blsp_uart2 { status = "okay"; }; +&pm8916_bms { + status = "okay"; + + monitored-battery = <&battery>; + power-supplies = <&pm8916_charger>; +}; + +&pm8916_charger { + status = "okay"; + + monitored-battery = <&battery>; + + qcom,fast-charge-safe-current = <900000>; + qcom,fast-charge-safe-voltage = <4300000>; +}; + &pm8916_resin { status = "okay"; linux,code = ; @@ -237,10 +272,6 @@ pm8916_l17: l17 { }; }; -&pm8916_usbin { - status = "okay"; -}; - &pm8916_vib { status = "okay"; }; @@ -257,11 +288,11 @@ &sdhc_2 { &usb { status = "okay"; dr_mode = "peripheral"; - extcon = <&pm8916_usbin>; + extcon = <&pm8916_charger>; }; &usb_hs_phy { - extcon = <&pm8916_usbin>; + extcon = <&pm8916_charger>; }; &venus {