From patchwork Thu Feb 15 12:26:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Hackley X-Patchwork-Id: 201440 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp362347dyb; Thu, 15 Feb 2024 04:30:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUePWJ2NuG43LcQONbdymj9Hzc3oOj7ygv3ezkKOQaks2hL+yCDvKCn7rPrZEh23LhRaWrEk2E7c2+SZR1Gd0R/Vqb+IA== X-Google-Smtp-Source: AGHT+IGRNa58xK9OSKT9LdYLLCq8AntZ5XadrMp6wzdNeBln5lQBM92mfUIF+Eu2JrL+7cCGb9Bo X-Received: by 2002:a17:902:b7c6:b0:1d9:5b8b:f70 with SMTP id v6-20020a170902b7c600b001d95b8b0f70mr1544841plz.29.1708000251968; Thu, 15 Feb 2024 04:30:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708000251; cv=pass; d=google.com; s=arc-20160816; b=cE2OqNULIeGsZj6oHkA63B3sTMsfa8EBs/9qH792HivAtUy77IEkam1ozDTpiyjS0y w1hiSPsZDdpnURNmOCMkzu+xRwP5GnSSEm+kYTbW8TXrKiSaOssSIDmS3sWSaaBE40jA /xRXuYtkd291aSQjyrvLBfMpgMYUc6OMMkhloTTE9wSZheoY/olhTWqMGEZ+HXdwF/GS oDIQ0+Q6QdU4AkIWfpqSqo02af0lCa6sR9nyK5Y0TrWGL3XuwWeOvYZBe6pyRaghYXOU b4B3oruiAc3jvH+gBjbOtHtI9dDpCf3dwGuRZwCjqJywm2xSHj4xgUyysC2w3Yc5MWx1 ImNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=srmpZi2uOdq8TLrq51itEDqW3WFFrCeLXnGkywx2Dp0=; fh=xjD1ZNeWaD0l9nhkGyteqiIpcX/YUyOYWGy5WDW0xvk=; b=spFZgHyT2bmUjeR+X8yqMgRzww1kKGufSYbERIj0MwdIWMdq3PRLCozWSIZwYH2JqZ hEcLXdoe3KBG30VqO8LdWRZ3EJPcgeobPSrspNlVHJIq7B/S70QVrxjalzcNa2adqZGK ku2HwF1JGc5+fJTxuN1de98ZJ1tz6f9LAf+3iZdylyrdoNu9KJrgZoaUc7t0eCV5ridB duItAc/ffZkTLJt1MUkiPAVk5syJWNy8sVezLPlMeUlsPo+HRKTCHnzZn1c+hv8+I6P7 gbSpuo/D7wUWNNPMO7RZbXKL+Tt76jRFxlfXhPAzjHi0UBVyiuT1D1nSbaXST5teeQQB uGGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=C4nHm6os; arc=pass (i=1 spf=pass spfdomain=protonmail.com dkim=pass dkdomain=protonmail.com dmarc=pass fromdomain=protonmail.com); spf=pass (google.com: domain of linux-kernel+bounces-66889-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66889-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q7-20020a170902a3c700b001db98ccc15csi198985plb.608.2024.02.15.04.30.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 04:30:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66889-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=C4nHm6os; arc=pass (i=1 spf=pass spfdomain=protonmail.com dkim=pass dkdomain=protonmail.com dmarc=pass fromdomain=protonmail.com); spf=pass (google.com: domain of linux-kernel+bounces-66889-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66889-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9B59D2849EE for ; Thu, 15 Feb 2024 12:29:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D7BB812C808; Thu, 15 Feb 2024 12:29:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="C4nHm6os" Received: from mail-40140.protonmail.ch (mail-40140.protonmail.ch [185.70.40.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE23312C7E9 for ; Thu, 15 Feb 2024 12:29:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708000147; cv=none; b=i0hVNDab09HtggyzxQUl2EQ7txnOwHNRthlCTskjg8g3VDuLAxJeYpfRueZcu+hJs45GMJkneAx7YFMjMdx8+rqMW3+XISva152ET32O3mEfDXs0jHfPMwZ3F7oFSMCWqJ9NHnDbGRN2wdqOYy4LnFdwqFDEdsNlgws473Pc5eg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708000147; c=relaxed/simple; bh=gK6wUKZ7BRK2yS46gb+SKBvXjc9KtbVUd1KCbiSSQ04=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dIga9PDjbXjY/us6rRnTvKJMqPeq+b9nu6mrn809RwapQm0KANU2PWq1IMcVFj/yfZHPYcJvkHljLw8rX8I/9WH307xwF/7TctvqI2taQ2xRXnT3t/uZebLCWauzWnYJFcDBCd4H6EjjwtuOo6Nc2bupY9ESGJnE0rdEhLhJfz4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com; spf=pass smtp.mailfrom=protonmail.com; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b=C4nHm6os; arc=none smtp.client-ip=185.70.40.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1708000142; x=1708259342; bh=srmpZi2uOdq8TLrq51itEDqW3WFFrCeLXnGkywx2Dp0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=C4nHm6oskzC/uZkH3+TWaCj16kAD/GtFhaSVyb4dbDGLoJu4OId/CpeaoM+KUFe3L +3Xs2EnUflVhYY0h2mzJlskZ1djsGJ7BjoOl3nv+bdYWLQ0oXqVoYQNyIqevFlJYwm 4bjaLwgKZVaiZh4Riuet+rrk/4QxeLa8nHfeuAIDAlkERPTL3vQpeqppfSUXIlVpuy mACqaoJur9pQ5KKZJFshBQnXpKw2RhLUbq/wGWEOk4g7nH4c1ssMN3CNXon9vkLNUZ tAJuwh9PIAcOHBWpOWvHJgOrTQF9lYXMdJMPa0EB3zcrZ8veQbObHLnfGIQLphqWuF 4dawUywCnREFg== Date: Thu, 15 Feb 2024 12:26:36 +0000 To: linux-kernel@vger.kernel.org From: Raymond Hackley Cc: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jakob Hauser , Stephan Gerhold , Nikita Travkin , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: [PATCH v2 2/2] arm64: dts: qcom: msm8916/39-samsung-a2015: Add PMIC and charger Message-ID: <20240215122612.3833-3-raymondhackley@protonmail.com> In-Reply-To: <20240215122612.3833-1-raymondhackley@protonmail.com> References: <20240215122612.3833-1-raymondhackley@protonmail.com> Feedback-ID: 49437091:user:proton Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790967963994480449 X-GMAIL-MSGID: 1790968072322311853 The phones listed below have Richtek RT5033 PMIC and charger. Add them to the device trees. - Samsung Galaxy A3/A5/A7 2015 - Samsung Galaxy E5/E7 - Samsung Galaxy Grand Max Signed-off-by: Raymond Hackley --- .../qcom/msm8916-samsung-a2015-common.dtsi | 53 +++++++++++++++++- .../boot/dts/qcom/msm8916-samsung-a3u-eur.dts | 6 ++ .../boot/dts/qcom/msm8916-samsung-a5u-eur.dts | 6 ++ .../boot/dts/qcom/msm8916-samsung-e5.dts | 6 ++ .../boot/dts/qcom/msm8916-samsung-e7.dts | 7 +++ .../dts/qcom/msm8916-samsung-grandmax.dts | 6 ++ .../boot/dts/qcom/msm8939-samsung-a7.dts | 56 ++++++++++++++++++- 7 files changed, 138 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi index 4bbbee80b5e4..e6355e5e2177 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi @@ -28,6 +28,12 @@ tz-apps@85500000 { }; }; + battery: battery { + compatible = "simple-battery"; + precharge-current-microamp = <450000>; + precharge-upper-limit-microvolt = <3500000>; + }; + clk_pwm: pwm { compatible = "clk-pwm"; #pwm-cells = <2>; @@ -245,7 +251,7 @@ magnetometer@12 { &blsp_i2c4 { status = "okay"; - battery@35 { + fuel-gauge@35 { compatible = "richtek,rt5033-battery"; reg = <0x35>; interrupt-parent = <&tlmm>; @@ -253,6 +259,44 @@ battery@35 { pinctrl-names = "default"; pinctrl-0 = <&fg_alert_default>; + + power-supplies = <&charger>; + }; +}; + +&blsp_i2c6 { + status = "okay"; + + pmic@34 { + compatible = "richtek,rt5033"; + reg = <0x34>; + + interrupts-extended = <&tlmm 62 IRQ_TYPE_EDGE_FALLING>; + + pinctrl-0 = <&pmic_int_default>; + pinctrl-names = "default"; + + regulators { + rt5033_reg_safe_ldo: SAFE_LDO { + regulator-min-microvolt = <4900000>; + regulator-max-microvolt = <4900000>; + regulator-always-on; + }; + + /* + * Needed for camera, but not used yet. + * Define empty nodes to allow disabling the unused + * regulators. + */ + LDO {}; + BUCK {}; + }; + + charger: charger { + compatible = "richtek,rt5033-charger"; + monitored-battery = <&battery>; + richtek,usb-connector = <&usb_con>; + }; }; }; @@ -476,6 +520,13 @@ nfc_i2c_default: nfc-i2c-default-state { bias-disable; }; + pmic_int_default: pmic-int-default-state { + pins = "gpio62"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + sdc2_cd_default: sdc2-cd-default-state { pins = "gpio38"; function = "gpio"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts index 3b934f5eba47..906d31f1ea21 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts @@ -55,6 +55,12 @@ &accelerometer { "0", "0", "1"; }; +&battery { + charge-term-current-microamp = <150000>; + constant-charge-current-max-microamp = <1000000>; + constant-charge-voltage-max-microvolt = <4350000>; +}; + &blsp_i2c5 { status = "okay"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts index 391befa22bb4..fe39be7a742b 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts @@ -29,6 +29,12 @@ &accelerometer { "0", "0", "1"; }; +&battery { + charge-term-current-microamp = <200000>; + constant-charge-current-max-microamp = <1500000>; + constant-charge-voltage-max-microvolt = <4350000>; +}; + &blsp_i2c5 { status = "okay"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-e5.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-e5.dts index fad2535255f7..800cb1038da0 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-e5.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-e5.dts @@ -23,6 +23,12 @@ / { chassis-type = "handset"; }; +&battery { + charge-term-current-microamp = <200000>; + constant-charge-current-max-microamp = <1500000>; + constant-charge-voltage-max-microvolt = <4350000>; +}; + &blsp_i2c5 { status = "okay"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-e7.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-e7.dts index b412b61ca258..ec1debd2e245 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-e7.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-e7.dts @@ -23,6 +23,13 @@ / { chassis-type = "handset"; }; +&battery { + charge-term-current-microamp = <200000>; + constant-charge-current-max-microamp = <1500000>; + constant-charge-voltage-max-microvolt = <4350000>; +}; + + &pm8916_l17 { regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3000000>; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts index 5882b3a593b8..135df1739dbd 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts @@ -41,6 +41,12 @@ led-keyled { }; }; +&battery { + charge-term-current-microamp = <150000>; + constant-charge-current-max-microamp = <1000000>; + constant-charge-voltage-max-microvolt = <4400000>; +}; + ®_motor_vdd { gpio = <&tlmm 72 GPIO_ACTIVE_HIGH>; }; diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts index 0c599e71a464..91acdb160227 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts @@ -33,6 +33,15 @@ tz-apps@85500000 { }; }; + battery: battery { + compatible = "simple-battery"; + charge-term-current-microamp = <150000>; + constant-charge-current-max-microamp = <1500000>; + constant-charge-voltage-max-microvolt = <4300000>; + precharge-current-microamp = <450000>; + precharge-upper-limit-microvolt = <3500000>; + }; + gpio-hall-sensor { compatible = "gpio-keys"; @@ -82,7 +91,7 @@ i2c-fg { #address-cells = <1>; #size-cells = <0>; - battery@35 { + fuel-gauge@35 { compatible = "richtek,rt5033-battery"; reg = <0x35>; @@ -91,6 +100,8 @@ battery@35 { pinctrl-0 = <&fg_alert_default>; pinctrl-names = "default"; + + power-supplies = <&charger>; }; }; @@ -325,6 +336,42 @@ touchscreen@24 { }; }; +&blsp_i2c6 { + status = "okay"; + + pmic@34 { + compatible = "richtek,rt5033"; + reg = <0x34>; + + interrupts-extended = <&tlmm 62 IRQ_TYPE_EDGE_FALLING>; + + pinctrl-0 = <&pmic_int_default>; + pinctrl-names = "default"; + + regulators { + rt5033_reg_safe_ldo: SAFE_LDO { + regulator-min-microvolt = <4900000>; + regulator-max-microvolt = <4900000>; + regulator-always-on; + }; + + /* + * Needed for camera, but not used yet. + * Define empty nodes to allow disabling the unused + * regulators. + */ + LDO {}; + BUCK {}; + }; + + charger: charger { + compatible = "richtek,rt5033-charger"; + monitored-battery = <&battery>; + richtek,usb-connector = <&usb_con>; + }; + }; +}; + &blsp_uart2 { status = "okay"; }; @@ -510,6 +557,13 @@ nfc_i2c_default: nfc-i2c-default-state { bias-disable; }; + pmic_int_default: pmic-int-default-state { + pins = "gpio62"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + reg_tsp_en_default: reg-tsp-en-default-state { pins = "gpio73"; function = "gpio";