From patchwork Sat Jun 1 11:53:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Hackley X-Patchwork-Id: 800953 Received: from mail-4319.protonmail.ch (mail-4319.protonmail.ch [185.70.43.19]) (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 440DA14F9DD; Sat, 1 Jun 2024 11:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717242850; cv=none; b=CsbZCwVOBgASTcNsYJ+3BTgg7jXysMGnFj6ORIQ7yB6/82R87pXOm/Qitb8IcCD/ndtNiuM+d0mFB6I7qs+0JNvDuHBWmtydfkQixAMpsQDwo+a9lY0yRwSYOWhAInE6Lw8GgrTgKzz8RkDsP2dv54LsA6ZrnPVFh27wLbbQ72o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717242850; c=relaxed/simple; bh=rTGNR1gjpqxgwEbWGFTcY+0ou57HsU3yOk3rGq/T+XQ=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=T+CWzkuPdsU2p/OQ/7Pt1VTN2/nCmlnskzBGEwOM2ajQs5bl2pyhXJ+9jk957fvv+iT37yZVJnNcL4HvuOieIyXvCrtB+5Q8EXg/Wx3BOzcL16usF8j7Tc0PhhHsdMPYpmxUd0/E01xNBAtx2nuxp6071OSPRERRQYOJs79hIz0= 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=DUcjn+J5; arc=none smtp.client-ip=185.70.43.19 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="DUcjn+J5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1717242841; x=1717502041; bh=ZQZES2BbNvBUeOffC7dAFTAqf4ZRcVbqy7kUlYlzRxU=; 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=DUcjn+J5bQOBpjzJPFGbK93HK4b50ocPdOIVe+MusH+LuPmCJCgaigQ5FBeZWIpdA F7zzQY57BSZ/+vSQfzJEvFij47CP5AtE7q/WGyeqIvMhTrnRl2moOxgtddnymFgb4c Ckud5tH8LTR970qlCotng7fgS1xOmdRGKb8Ka2WEBkQ/f7aBeIDfCWdVPD4jVyOEPc jBrb0N/sthOuiKduH8lAW9G21Op0mxBHnDFA407j5JrQZH6a5QNWyhZStE3wgOoNUf cgSIP5ua6apXFTjaRLMdtGpaunqCrC/v1aspx3lPxQxBk/IZ/CMASVys161GAEwrHi pBdAeK+1N8y1A== Date: Sat, 01 Jun 2024 11:53:57 +0000 To: linux-kernel@vger.kernel.org From: Raymond Hackley Cc: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Siddharth Manthan , Stephan Gerhold , Nikita Travkin , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Joe Mason Subject: [PATCH 1/3] arm64: dts: qcom: msm8916-samsung-gprimeltecan: Add NFC Message-ID: <20240601115321.25314-2-raymondhackley@protonmail.com> In-Reply-To: <20240601115321.25314-1-raymondhackley@protonmail.com> References: <20240601115321.25314-1-raymondhackley@protonmail.com> Feedback-ID: 49437091:user:proton X-Pm-Message-ID: fcf6c71ce66daa31f8cf29645cd200c4b361e6b1 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Joe Mason The Samsung Galaxy Grand Prime CAN has a Samsung S3FWRN5 NFC chip that works quite well with the s3fwrn5 driver in the Linux NFC subsystem. The clock setup for the NFC chip is a bit special (although this seems to be a common approach used for Qualcomm devices with NFC): The NFC chip has an output GPIO that is asserted whenever the clock is needed to function properly. On the A3/A5 this is wired up to PM8916 GPIO2, which is then configured with a special function (NFC_CLK_REQ or BB_CLK2_REQ). Enabling the rpmcc RPM_SMD_BB_CLK2_PIN clock will then instruct PM8916 to automatically enable the clock whenever the NFC chip requests it. The advantage is that the clock is only enabled when needed and we don't need to manage it ourselves from the NFC driver. Signed-off-by: Joe Mason [Stephan: Put NFC pinctrl into common dtsi to share it with other variants] Signed-off-by: Stephan Gerhold [Raymond: Use interrupts-extended. Keep &blsp_i2c6 enabled by default] Signed-off-by: Raymond Hackley --- .../qcom/msm8916-samsung-fortuna-common.dtsi | 38 +++++++++++++++++++ .../dts/qcom/msm8916-samsung-gprimeltecan.dts | 17 +++++++++ 2 files changed, 55 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi index 4f05cae68b37..4cc83b64e256 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi @@ -6,6 +6,7 @@ #include #include #include +#include / { aliases { @@ -227,6 +228,10 @@ touchscreen: touchscreen@20 { }; }; +&blsp_i2c6 { + status = "okay"; +}; + &blsp_uart2 { status = "okay"; }; @@ -346,6 +351,29 @@ muic_int_default: muic-int-default-state { bias-disable; }; + nfc_default: nfc-default-state { + irq-pins { + pins = "gpio21"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + + nfc-pins { + pins = "gpio20", "gpio49"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + }; + + nfc_i2c_default: nfc-i2c-default-state { + pins = "gpio0", "gpio1"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + sdc2_cd_default: sdc2-cd-default-state { pins = "gpio38"; function = "gpio"; @@ -367,3 +395,13 @@ tsp_int_default: tsp-int-default-state { bias-disable; }; }; + +&pm8916_gpios { + nfc_clk_req: nfc-clk-req-state { + pins = "gpio2"; + function = "func1"; + power-source = ; + bias-disable; + input-enable; + }; +}; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts index 4dc74e8bf1d8..7ac86fd3c703 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts @@ -29,6 +29,23 @@ &bosch_magn { status = "okay"; }; +&blsp_i2c6 { + nfc@27 { + compatible = "samsung,s3fwrn5-i2c"; + reg = <0x27>; + + interrupts-extended = <&tlmm 21 IRQ_TYPE_EDGE_RISING>; + + en-gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>; + wake-gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>; + + clocks = <&rpmcc RPM_SMD_BB_CLK2_PIN>; + + pinctrl-0 = <&nfc_default>, <&nfc_clk_req>; + pinctrl-names = "default"; + }; +}; + &mpss_mem { /* Firmware for gprimeltecan needs more space */ reg = <0x0 0x86800000 0x0 0x5400000>; From patchwork Sat Jun 1 11:54:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Hackley X-Patchwork-Id: 801123 Received: from mail-4325.protonmail.ch (mail-4325.protonmail.ch [185.70.43.25]) (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 5F05478C87; Sat, 1 Jun 2024 11:54:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.25 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717242862; cv=none; b=q9DyXbeJSX6QkgRokUTLJndf2CYllh2C+ovnI3oLOnnYv6HPJFUpaS3bcEPKxtTndm2Yd5+qALIRky5SWJ5TiiJRylJ0CRsJfchSFZdK07Io36hQ9Yyg8OfPvMDbZz6AnrWHQzlMe3gbB/3uRl2sTFTaWnLHDLqsPeL8IunyaKk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717242862; c=relaxed/simple; bh=GZgagAbl3pI1q8QmFYrh1lpNjcc3oI0x3ybJngReqGg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KgT9ktljJGtI50akIA6rpoPBvHhV3JIhW4DxOoCfgL7W7T/QEgNFAB/56t9hVa0NXNtIFwpzdZfCFeBGQsBW1bUGC4F07URjPT6pmsoM49LSif34M+KsKRL9xX/kZ7GQL9KXt5rOPPB25fbWkeXkYClW7m27sQpgV8tcXobOtl0= 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=zIXdZFJe; arc=none smtp.client-ip=185.70.43.25 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="zIXdZFJe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1717242858; x=1717502058; bh=MtCTYw7Gn7E83PCVOAeCzKtlwojtmSJTwf2afS8Gjcw=; 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=zIXdZFJe53VPTiNzK3P19RTQ/ncQBPXTbShyWHwFH3nbpd+eTskY+rOAvjfsKEXVT zRJa6AG81/WP5s+ondyQ4COKU/GF1iXpP4KbP2vM720NlqpxeOXit2IZQ/rn2kulBA R4SEDcBb5WPENkkNM+PQXOXt8meD1sEVsccfLjulTNff4gO77KdC98/E9NEVxPoFiH Icy7oqdwzoh6RtmAj5QK/sy/hJpUfleZODpSVo28X6UgXa/4tqH3rNGwoRLWc7PPw7 tdtTjYjmyiL2IBdZGKysEv0jz8m81i08ItPELOTpzr7VuvcUqRWjKWI19SH+F/6V+o WjNwPhM56PgEg== Date: Sat, 01 Jun 2024 11:54:14 +0000 To: linux-kernel@vger.kernel.org From: Raymond Hackley Cc: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Siddharth Manthan , Stephan Gerhold , Nikita Travkin , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: [PATCH 2/3] arm64: dts: qcom: msm8916-samsung-fortuna/rossa: Add S3FWRN5 NFC Message-ID: <20240601115321.25314-3-raymondhackley@protonmail.com> In-Reply-To: <20240601115321.25314-1-raymondhackley@protonmail.com> References: <20240601115321.25314-1-raymondhackley@protonmail.com> Feedback-ID: 49437091:user:proton X-Pm-Message-ID: 12b5a1fb871df2e67b66828b7f877b4dc019f383 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some variants of Samsung Galaxy Core Prime LTE / Grand Prime LTE have a Samsung S3FWRN5 NFC chip that works quite well with the s3fwrn5 driver in the Linux NFC subsystem. The clock setup for the NFC chip is a bit special (although this seems to be a common approach used for Qualcomm devices with NFC): The NFC chip has an output GPIO that is asserted whenever the clock is needed to function properly. On the A3/A5 this is wired up to PM8916 GPIO2, which is then configured with a special function (NFC_CLK_REQ or BB_CLK2_REQ). Enabling the rpmcc RPM_SMD_BB_CLK2_PIN clock will then instruct PM8916 to automatically enable the clock whenever the NFC chip requests it. The advantage is that the clock is only enabled when needed and we don't need to manage it ourselves from the NFC driver. Signed-off-by: Raymond Hackley --- .../qcom/msm8916-samsung-fortuna-common.dtsi | 29 +++++++++++++++++++ .../dts/qcom/msm8916-samsung-gprimeltecan.dts | 4 +++ .../qcom/msm8916-samsung-rossa-common.dtsi | 4 +++ 3 files changed, 37 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi index 4cc83b64e256..b5b7beab2209 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi @@ -79,6 +79,35 @@ haptic { max-microvolt = <3300000>; }; + i2c_nfc: i2c-nfc { + compatible = "i2c-gpio"; + sda-gpios = <&tlmm 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&tlmm 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + + pinctrl-0 = <&nfc_i2c_default>; + pinctrl-names = "default"; + + #address-cells = <1>; + #size-cells = <0>; + + s3fwrn5_nfc: nfc@27 { + compatible = "samsung,s3fwrn5-i2c"; + reg = <0x27>; + + interrupts-extended = <&tlmm 21 IRQ_TYPE_EDGE_RISING>; + + en-gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>; + wake-gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>; + + clocks = <&rpmcc RPM_SMD_BB_CLK2_PIN>; + + pinctrl-0 = <&nfc_default>, <&nfc_clk_req>; + pinctrl-names = "default"; + + status = "disabled"; + }; + }; + reg_motor_vdd: regulator-motor-vdd { compatible = "regulator-fixed"; regulator-name = "motor_vdd"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts index 7ac86fd3c703..589dd006a746 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts @@ -46,6 +46,10 @@ nfc@27 { }; }; +&i2c_nfc { + /* nfc@27 is on &blsp_i2c6 */ +}; + &mpss_mem { /* Firmware for gprimeltecan needs more space */ reg = <0x0 0x86800000 0x0 0x5400000>; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi index 13a848d97b9d..e7f265e3c2ab 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi @@ -33,6 +33,10 @@ &clk_pwm_backlight { status = "disabled"; }; +&s3fwrn5_nfc { + status = "okay"; +}; + &st_accel { compatible = "st,lis2hh12"; mount-matrix = "1", "0", "0", From patchwork Sat Jun 1 11:54:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Hackley X-Patchwork-Id: 800952 Received: from mail-43166.protonmail.ch (mail-43166.protonmail.ch [185.70.43.166]) (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 DE87674418; Sat, 1 Jun 2024 11:54:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.166 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717242879; cv=none; b=Qyi/GkHo1+uPDyqeXaVe0aZgqJ0Atc4K2C26LQY2FWYOdNxSXGKeFWmVQac3KcRqq6OmgG4gPqtu89EZJvI0R2YfqjV4vUMc8pWDvVVJmGygeomtTLbnZu+iEYhp8uKpRlKfRIf3/fhLDKplwPpS60lX1CDPRdbsO+yxPV6D53s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717242879; c=relaxed/simple; bh=2Kcxwb2F9CVt435hR4lFrcovKuZoNWLP/iWamePe9uw=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qwNeXx4AQPA++rcIuDIcZxPx/5gZb9KFHtNfUZ0X/zLsxFgr67B2/mIdkuA1wQg6DImV0hRuJ2FSkFcwZiidF62Rs+n+k9I2qqp4ybz15DV6k/BPSL+Qx0fxlqc988FzV1PsDgRj7oV5Xkaz5gDCgjpnExa3RN/TgKwFZQp4KXo= 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=h42B65Ct; arc=none smtp.client-ip=185.70.43.166 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="h42B65Ct" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1717242875; x=1717502075; bh=AZP4En4IzH8eijQiKVXJZFEEvxHYp9iC45HR+AG84b8=; 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=h42B65Ct4GWnaU7nGC+gQrjnQd8H6gKGlMQVQ8xFWeRy8X+6m/xruVYdJSyd5KJUF /nD3SUJAnnIg8mVbPMZbOzm3Ah3kO+upg2FSZSiyUtMC1S/Wu7Gknn3PCEbvR7Vdbq w920QQ+cz2vy/9ahaYa90nAZGDxAl8nFNA6wuUphDpzpPd3bvsOPNuiTmtOn+0Dhal VCMgdSXowHK84hHNct7NAbmW7caNB1NbGD78xen7RpS3PmKwXj2ukWcjSfY/MlL1ea 0zZzEf0j5OM/5B4oUi3jSWv/QrC0OqcGhx8j1G9Z1JewyBK9tNpMRhk5a+76ehpZWx OaAMrkr++fVrA== Date: Sat, 01 Jun 2024 11:54:32 +0000 To: linux-kernel@vger.kernel.org From: Raymond Hackley Cc: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Siddharth Manthan , Stephan Gerhold , Nikita Travkin , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Jakob Hauser Subject: [PATCH 3/3] arm64: dts: qcom: msm8916-samsung-fortuna/rossa: Add PMIC and charger Message-ID: <20240601115321.25314-4-raymondhackley@protonmail.com> In-Reply-To: <20240601115321.25314-1-raymondhackley@protonmail.com> References: <20240601115321.25314-1-raymondhackley@protonmail.com> Feedback-ID: 49437091:user:proton X-Pm-Message-ID: 1ff21548d92eca535490bc8b4cfbabd5bea5f223 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The phones listed below have Richtek RT5033 PMIC and charger. Add them to the device trees. - Samsung Galaxy Core Prime LTE - Samsung Galaxy Grand Prime Cc: Jakob Hauser Signed-off-by: Raymond Hackley --- .../dts/qcom/msm8216-samsung-fortuna3g.dts | 6 +++ .../qcom/msm8916-samsung-fortuna-common.dtsi | 47 +++++++++++++++++++ .../dts/qcom/msm8916-samsung-gprimeltecan.dts | 41 ++++++++++++++++ .../qcom/msm8916-samsung-grandprimelte.dts | 6 +++ .../boot/dts/qcom/msm8916-samsung-rossa.dts | 6 +++ 5 files changed, 106 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts b/arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts index e7f6df229f9a..fba68bf8bf79 100644 --- a/arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts +++ b/arch/arm64/boot/dts/qcom/msm8216-samsung-fortuna3g.dts @@ -10,6 +10,12 @@ / { chassis-type = "handset"; }; +&battery { + charge-term-current-microamp = <200000>; + constant-charge-current-max-microamp = <1000000>; + constant-charge-voltage-max-microvolt = <4350000>; +}; + &st_accel { status = "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi index b5b7beab2209..81b3e0760154 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi @@ -27,6 +27,12 @@ tz-apps@85a00000 { }; }; + battery: battery { + compatible = "simple-battery"; + precharge-current-microamp = <450000>; + precharge-upper-limit-microvolt = <3500000>; + }; + clk_pwm_backlight: backlight { compatible = "pwm-backlight"; pwms = <&clk_pwm 0 100000>; @@ -234,6 +240,8 @@ fuel-gauge@35 { pinctrl-0 = <&fg_alert_default>; pinctrl-names = "default"; + + power-supplies = <&charger>; }; }; @@ -259,6 +267,38 @@ touchscreen: touchscreen@20 { &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 { @@ -403,6 +443,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-gprimeltecan.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts index 589dd006a746..677e4e286ac0 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gprimeltecan.dts @@ -21,6 +21,12 @@ tz-apps@85500000 { }; }; +&battery { + charge-term-current-microamp = <200000>; + constant-charge-current-max-microamp = <1000000>; + constant-charge-voltage-max-microvolt = <4350000>; +}; + &bosch_accel { status = "okay"; }; @@ -30,6 +36,9 @@ &bosch_magn { }; &blsp_i2c6 { + /* pmic@34 is on i2c_nfc instead */ + /delete-node/ pmic@34; + nfc@27 { compatible = "samsung,s3fwrn5-i2c"; reg = <0x27>; @@ -48,6 +57,38 @@ nfc@27 { &i2c_nfc { /* nfc@27 is on &blsp_i2c6 */ + + 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>; + }; + }; }; &mpss_mem { diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandprimelte.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandprimelte.dts index cffad734c4df..582bfcb09684 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandprimelte.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandprimelte.dts @@ -10,6 +10,12 @@ / { chassis-type = "handset"; }; +&battery { + charge-term-current-microamp = <200000>; + constant-charge-current-max-microamp = <1000000>; + constant-charge-voltage-max-microvolt = <4350000>; +}; + &bosch_accel { status = "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa.dts index ebaa13c6b016..1981bb71f6a9 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa.dts @@ -10,6 +10,12 @@ / { chassis-type = "handset"; }; +&battery { + charge-term-current-microamp = <150000>; + constant-charge-current-max-microamp = <700000>; + constant-charge-voltage-max-microvolt = <4400000>; +}; + &mpss_mem { /* Firmware for rossa needs more space */ reg = <0x0 0x86800000 0x0 0x5800000>;