From patchwork Wed Sep 28 18:29:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lin, Meng-Bo" X-Patchwork-Id: 610172 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C02C6C04A95 for ; Wed, 28 Sep 2022 18:29:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232974AbiI1S3R (ORCPT ); Wed, 28 Sep 2022 14:29:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233290AbiI1S3P (ORCPT ); Wed, 28 Sep 2022 14:29:15 -0400 Received: from mail-4324.protonmail.ch (mail-4324.protonmail.ch [185.70.43.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 659F810651D for ; Wed, 28 Sep 2022 11:29:12 -0700 (PDT) Date: Wed, 28 Sep 2022 18:29:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1664389749; x=1664648949; bh=J6Q0VuvyIjV0kEqykmiUPF3+T4Y0AOtQNu0NAJk0z28=; 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; b=Z1re1hcf6xVNgettc/MzhcqUJaDjgd5rUpJfdtgNMyas4LXaYxH6yh6Uu3dFruOxz 3O+px1y6t9UybLwYiIsbLgRxbttn6ML/1XpPIM9hZ8aBRTZOVtEKeZvSYjxl58DFvd YuJRNcH9aDlOLl9Up4DiO40rQ7zxtfTdI8U7C2s/UgVzsOrEoW7DbrIcMyiK6N2qP6 aPaiNF2CxOhe41C+W0vwG/d+bOo3CYjRvQSzDua7j6BuCp3EsIiBeBqFqGcLvqOtib z+o8OsgnvdU+SMKluDNWhptt2iqYvJtCI41c0UIP/JUOtOnX57E2Zwfn8bxF2A1Oav Qv5CYldob1R3g== To: devicetree@vger.kernel.org From: "Lin, Meng-Bo" Cc: Stephan Gerhold , Nikita Travkin , Julian Ribbeck , Josef W Menad , Markuss Broks , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski Subject: [PATCH v4 2/4] arm64: dts: qcom: msm8916-samsung-j5-common: Add initial common device tree Message-ID: <20220928182722.186237-1-linmengbo0689@protonmail.com> In-Reply-To: <20220928182435.186116-1-linmengbo0689@protonmail.com> References: <20220928182435.186116-1-linmengbo0689@protonmail.com> Feedback-ID: 40467236:user:proton MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The smartphones below are using the MSM8916 SoC, which are released in 2015-2016: Samsung Galaxy J5 2015 (SM-J500*) Samsung Galaxy J5 2016 (SM-J510*) Samsung Galaxy J3 2016 - SM-J3109/SM-J320Y/SM-J320YZ - SM-J320N0/SM-J320ZN - SM-J320P/SM-J320R4/SM-J320V/SM-S320VL Add a common device tree for with initial support for: - GPIO keys - SDHCI (internal and external storage) - USB Device Mode - UART (on USB connector via the SM5703 MUIC) - WCNSS (WiFi/BT) - Regulators The three devices (some varints of J3, all other variants of J5 released in 2015 and J5X released in 2016) are very similar, with some differences in display and GPIO pins. The common parts are shared in msm8916-samsung-j5-common.dtsi to reduce duplication. Signed-off-by: Lin, Meng-Bo --- ...-j5.dts => msm8916-samsung-j5-common.dtsi} | 9 +- .../boot/dts/qcom/msm8916-samsung-j5.dts | 224 ++---------------- 2 files changed, 16 insertions(+), 217 deletions(-) copy arch/arm64/boot/dts/qcom/{msm8916-samsung-j5.dts => msm8916-samsung-j5-common.dtsi} (94%) rewrite arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts (93%) +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts @@ -?,? +1,15 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/dts-v1/; + +#include "msm8916-samsung-j5-common.dtsi" + +/ { + model = "Samsung Galaxy J5 (2015)"; + compatible = "samsung,j5", "qcom,msm8916"; + chassis-type = "handset"; +}; + +&usb_hs_phy { + qcom,init-seq = /bits/ 8 <0x1 0x19 0x2 0x0b>; +}; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi similarity index 94% copy from arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts copy to arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi index eabeed18cfaa..502b38d4a61e 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi @@ -1,15 +1,9 @@ // SPDX-License-Identifier: GPL-2.0-only -/dts-v1/; - #include "msm8916-pm8916.dtsi" #include / { - model = "Samsung Galaxy J5 (2015)"; - compatible = "samsung,j5", "qcom,msm8916"; - chassis-type = "handset"; - aliases { serial0 = &blsp1_uart2; }; @@ -92,7 +86,6 @@ &usb { &usb_hs_phy { extcon = <&pm8916_usbin>; - qcom,init-seq = /bits/ 8 <0x1 0x19 0x2 0x0b>; }; &smd_rpm_regulators { @@ -199,7 +192,7 @@ l18 { }; &msmgpio { - gpio_keys_default: gpio-keys-default { + gpio_keys_default: gpio-keys-default-state { pins = "gpio107", "gpio109"; function = "gpio"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts dissimilarity index 93% index eabeed18cfaa..0a32d33e9778 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts From patchwork Wed Sep 28 18:29:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lin, Meng-Bo" X-Patchwork-Id: 610171 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BD27C6FA82 for ; Wed, 28 Sep 2022 18:30:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234628AbiI1SaN (ORCPT ); Wed, 28 Sep 2022 14:30:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234198AbiI1S36 (ORCPT ); Wed, 28 Sep 2022 14:29:58 -0400 Received: from mail-4324.protonmail.ch (mail-4324.protonmail.ch [185.70.43.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EAFC13D28; Wed, 28 Sep 2022 11:29:50 -0700 (PDT) Date: Wed, 28 Sep 2022 18:29:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1664389788; x=1664648988; bh=IsWhgXDQSqlqcrpGge6hF7eCE/OeZB8nSGU7RUC7f8E=; 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; b=hNkLqObdw9jS/gMU9PYDzVT0gJAXmxzxkvy2BH8DPG49732asHi3MYSx9AHPgEamS OimyEWuS6b2XROehl63m8YoahWeApYPqBfN9Nnb0TdYYxSpcLw4yRiOwRMkTkXp+Vc xy/dUDWcuSpc9EAWenRxRnnGT7HKdycMwlSzjrGVNYhjQCP/eJJ4yCfj5WVfCPTi9/ +dfiJLDiaiq15kveNa7cJ+/f0QlLb8HrOU528Hf/p9Ns0/hls3YUBRNNPzwsJh6s2e Ht17EWsUUjQF8QyJpDoMdTaFkbXEzA9638ND0w2GVHyO1rMhtT7iF+fatKr5zVHtDD s7EUunOzbiYhg== To: devicetree@vger.kernel.org From: "Lin, Meng-Bo" Cc: Stephan Gerhold , Nikita Travkin , Julian Ribbeck , Josef W Menad , Markuss Broks , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski Subject: [PATCH v4 4/4] arm64: dts: qcom: msm8916-samsung-j5-common: Add Hall sensor Message-ID: <20220928182745.186429-1-linmengbo0689@protonmail.com> In-Reply-To: <20220928182435.186116-1-linmengbo0689@protonmail.com> References: <20220928182435.186116-1-linmengbo0689@protonmail.com> Feedback-ID: 40467236:user:proton MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Samsung Galaxy J5 2015 and 2016 have a Hall sensor on GPIO pin 52. Add GPIO Hall sensor for them. Signed-off-by: Lin, Meng-Bo --- .../boot/dts/qcom/msm8916-samsung-j3.dts | 4 +++ .../dts/qcom/msm8916-samsung-j5-common.dtsi | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j3.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-j3.dts index bf8672ebedcd..7fd357b7f728 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j3.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j3.dts @@ -19,3 +19,7 @@ tz-apps@85a00000 { }; }; }; + +&gpio_hall_sensor { + status = "disabled"; +}; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi index 502b38d4a61e..5755b360c6ed 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi @@ -2,6 +2,7 @@ #include "msm8916-pm8916.dtsi" #include +#include / { aliases { @@ -20,6 +21,23 @@ tz-apps@85500000 { }; }; + gpio_hall_sensor: gpio-hall-sensor { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&gpio_hall_sensor_default>; + + label = "GPIO Hall Effect Sensor"; + + event-hall-sensor { + label = "Hall Effect Sensor"; + gpios = <&msmgpio 52 GPIO_ACTIVE_LOW>; + linux,input-type = ; + linux,code = ; + linux,can-disable; + }; + }; + gpio-keys { compatible = "gpio-keys"; @@ -192,6 +210,14 @@ l18 { }; &msmgpio { + gpio_hall_sensor_default: gpio-hall-sensor-default-state { + pins = "gpio52"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + gpio_keys_default: gpio-keys-default-state { pins = "gpio107", "gpio109"; function = "gpio";