From patchwork Wed Sep 28 11:06:30 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: 611871 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 EB352C6FA92 for ; Wed, 28 Sep 2022 11:09:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229847AbiI1LI7 (ORCPT ); Wed, 28 Sep 2022 07:08:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234133AbiI1LIU (ORCPT ); Wed, 28 Sep 2022 07:08:20 -0400 Received: from mail-0201.mail-europe.com (mail-0201.mail-europe.com [51.77.79.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AA3DE4DAF; Wed, 28 Sep 2022 04:06:42 -0700 (PDT) Date: Wed, 28 Sep 2022 11:06:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1664363199; x=1664622399; bh=/92kCfS+GRH3XqMQ3bWJNxBIL7UNiMfLCQcS7CPJ5ng=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=ug4dh8P+fEjbf1yUvdjS9tWhjxFKVKrS76WgGRIokdqHsA4kiDrsjOwP4DpuiLqUq EBb9Kfb9ysKvOj1vOxj7bIvhhbdqzW46kqZBfgVIL2Ap27AZAg8QC+MCumSOvWQy0q Us3+filJfEDHXn0yCayQsZfCH/sAODM4ZZEx7+qT5KdhR+NKyEsySpvx3eB9T9C5pn tRdzD0HobwsegevS1f3KNNLfGHWJ6ns2LhArNphNwCaK/A4yFzESG7y6toHEbAtKNt nDWYIuwfsLcVpNoVaiDEtapcdGSVUGDxY17Y2D5/E7JxsPQAEtH03jpV4Lj6knOCJO g9VERuMpr9rrQ== To: devicetree@vger.kernel.org From: "Lin, Meng-Bo" Subject: [PATCH 3/3] arm64: dts: qcom: msm8916-samsung-j5-common: Add Hall sensor Message-ID: <20220928110529.96373-1-linmengbo0689@protonmail.com> In-Reply-To: <20220928110049.96047-1-linmengbo0689@protonmail.com> References: <20220928110049.96047-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 24e77c61ca9b..6d4e53295c30 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 ea2e165c2aa4..2c498d3b2c83 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi @@ -3,6 +3,7 @@ #include "msm8916-pm8916.dtsi" #include +#include / { aliases { @@ -21,6 +22,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"; @@ -193,6 +211,14 @@ l18 { }; &msmgpio { + gpio_hall_sensor_default: gpio-hall-sensor-default { + pins = "gpio52"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + gpio_keys_default: gpio-keys-default { pins = "gpio107", "gpio109"; function = "gpio";