Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp671641rdh; Thu, 26 Oct 2023 12:18:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrDXlptjLqmL7by5QUOeo0gjmLaO/zabP+eE5D8Vc1cS/iEEAPPzteZHHOaLmRHFht/zC7 X-Received: by 2002:a05:6830:2b07:b0:6b9:4155:7dbd with SMTP id l7-20020a0568302b0700b006b941557dbdmr543959otv.0.1698347897126; Thu, 26 Oct 2023 12:18:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698347897; cv=pass; d=google.com; s=arc-20160816; b=zF8jviMsK6kwlLX6+HxzCu9ALv4EOyGT7tzJEDvM66393fL2KTovgYCW6EapC9OYuc KSdHXG70RU5SpR0BOzigCExMGVewmziQjQZb6zXHen8sy5+nRUYE5j1vBEEV0BMXJ2yQ 5vKOhbYjcwP8ZvhoJPQMYn2Sjm5GzqpEsnV/SNhWuQPXvvF1fPDYuq7m1JUXZ8fim4dZ 9GkmuzeJd8RDzV4qucpB6evpSMDmPJFnAKgyr6wUde2lca/DRDySSMShBdc8vrYDzTXn bYWm8Jouz75KUsHRRuyRb9mR51LML9iAKkDzqtdYxNNzwCeKqUkrmraAxwbgm7zQPcxC CHpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=3RRTbCKgym2ZKAfKmnEa/WEdD9osQqu4/PX3qrE8WD8=; fh=A5FqVuv0yDJzrgKhHtnldW+q9F3KasnmqpZ64q8R9qA=; b=JQnwqjVRUFS2agdJUWyHwOcp49uUgytdgYC+a7D+aSPzgaQNRs/oL73j5gSeEnUWxh EFlhdHsiQ8P9ss2JmwgV1q3vymuvu++ya/rZ/R9ASM4G3kTkAWkPuusGa4Zwxydhux8h H2G9nu+cDY4Hqtdp0745Ahx+8Ew6VOKq4vu00fRivuK7IevszbIo9hWdgSo4CyIP3c5i epilE/ABIRr8evXygE7oEU6O1QGdfHiPhoTP/s9l6f0VlmrpE8ZvKmW7HH7Z58er9OS6 3bdurdiRYD5PW6TWAnyoiIJs0QGBSaQYuXf3fT3MpFLXuUXQwQRzBRUCejk/1fLasfUF X2xg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=ReOeW7Tn; dkim=neutral (no key) header.i=@gerhold.net; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q129-20020a0de787000000b0059eae2bc317si15486890ywe.217.2023.10.26.12.18.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 12:18:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=ReOeW7Tn; dkim=neutral (no key) header.i=@gerhold.net; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7F281822D1FC; Thu, 26 Oct 2023 12:18:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229815AbjJZTSE (ORCPT + 99 others); Thu, 26 Oct 2023 15:18:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjJZTSC (ORCPT ); Thu, 26 Oct 2023 15:18:02 -0400 Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35A62AC; Thu, 26 Oct 2023 12:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698347875; cv=none; d=strato.com; s=strato-dkim-0002; b=MAyPAt6Fw8HBzoOrR3mTRFlSYcoTN/biTPt+LZ49ZNHY1AevjLZ+hOrFs7PIg/jxQq 0Xe/AzW0EHyXJTZmudh3qqg8F/X45IPRCLd7RAZwyMkA2OrBhAl4YVQEmnXJ33WEs665 uuHj9lMABoMFQyNldDPiiGLhnF62GfyeqDOOwYSo3fcd/JH3R4PJH71MTVMh1muP/y1u btbtWjx4exsW6jZKjA64XdA6qpU1H8bPfVff5Gse3YjnkWQUpobbqQwwMUB1CnQoeR5E whU7prFkAg9pXm+HkJJKtxSp7ROtk2rqcBhw+dmqHZB7z1YJESzsjaS5oXQl1erQb9vc A7kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1698347875; s=strato-dkim-0002; d=strato.com; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=3RRTbCKgym2ZKAfKmnEa/WEdD9osQqu4/PX3qrE8WD8=; b=eGUXKIxOK0rVVM85nLOb5L47o7IIcIhFFDTQgfuEPsGRA0dK3vKlhablGlWJ3Tm4HG eylRbPc5L+kZhAwE2W1IZKHgvXvKyvsdZL3zx4QNM/UxAg7XQ+MmfZUv3L66W4Pk2+yk 7Lhmgga4K2Xdu0CfNXDFXg5iD14HOG9hAbbxjllOG9yyMfWRWEoiGkyX82eovfOwJLBC t6eBIvme1fQf8F/yF/IyoetcjwetJ9lg3Y0rS3mAd6SVcNXhpBl4wOozdpG1fVW+LzKR ump9pi4BP9djoYpBxdiNk+wWzdqkhEsRyopASw9sSfo870m4tC8lt29ot0vTi32VUO4K YFlA== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1698347875; s=strato-dkim-0002; d=gerhold.net; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=3RRTbCKgym2ZKAfKmnEa/WEdD9osQqu4/PX3qrE8WD8=; b=ReOeW7TnoeZqegJf5JfRuaRAn8UyaJKgkKvyku4ilimr1OcwczHexvCssg1vLmCldS R4NKuv5Kg2EefE+NAO7EA6LhfOLjHeegbmTq93tv7u7q4TswYgFJZ61d78E071SFjsZz RBdMdXDhj2pLFMR+GVFdB9pjMCT4LREbvQN9jXKpkTmkSosS3fw46OswbN+T8OCyUfc2 Mx8nxrxGwiTxorjDxCuE+q3dzc+ZtnnC3+YuP0TYgCFtS56OyWrsjJC6dzCIx2bJgLre vYOT4EuArJ8rXpCF44CymJSCLpUjYNscaOdNDssNp63Xp1D6BT4Ze9Q7GSJEO9jSnKug uU1g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1698347875; s=strato-dkim-0003; d=gerhold.net; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=3RRTbCKgym2ZKAfKmnEa/WEdD9osQqu4/PX3qrE8WD8=; b=xsqt+VygVZfAOk6OK0oxcjaIseydbe43WzIKNFEaNonstiAHum+ybBY99SCsTc5rn9 f4UJimc1W89HIbMBFUAQ== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQ/OcYgojyw4j34+u261EJF5OxJD4peA95vh" Received: from gerhold.net by smtp.strato.de (RZmta 49.9.1 DYNA|AUTH) with ESMTPSA id Lbb8e2z9QJHs4iy (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 26 Oct 2023 21:17:54 +0200 (CEST) Date: Thu, 26 Oct 2023 21:17:48 +0200 From: Stephan Gerhold To: Konrad Dybcio Cc: Nikita Travkin , Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Stephen Boyd , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: Re: [PATCH v2 2/3] arm64: dts: qcom: pm8916: Add BMS and charger Message-ID: References: <20231023-pm8916-dtsi-bms-lbc-v2-0-343e3dbf423e@trvn.ru> <20231023-pm8916-dtsi-bms-lbc-v2-2-343e3dbf423e@trvn.ru> <3dff444b-c439-4c40-9d21-1e390f449840@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 26 Oct 2023 12:18:15 -0700 (PDT) On Thu, Oct 26, 2023 at 08:54:00PM +0200, Konrad Dybcio wrote: > On 10/24/23 11:29, Nikita Travkin wrote: > > Konrad Dybcio писал(а) 24.10.2023 13:34: > > > On 10/23/23 08:20, Nikita Travkin wrote: > > > > 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", > > > So, both the charger and the USBIN driver use the same irq? :/ > > > > > > > AFAIU the usbin extcon driver pretty much just tracks the state > > of the IRQ to report extcon. It happens to assume the same part > > of the pmic though, yes, which also means there will be no user > > that would enable both charger and vbus extcon, since charger > > driver provides this functionality as well. > So, should USBIN be removed from PM8916 dt since it's essentially > a part of the charger block? > The "USB_IN" pad of the PM8916 seems to be connected on pretty much all devices, even if they are using external chargers and the charging functionality of PM8916 is completely disabled. For those devices, the &pm8916_usbin device provides a convenient way to detect the USB state, even without a working charger driver. While we could modify the PM8916 charger driver and DT node to have some special mode where charging and battery monitoring is completely disabled and only the USBIN extcon is provided, I'm not sure if that would provide a significant advantage compared to just keeping the simple &pm8916_usbin node with the existing driver. Thanks, Stephan