From patchwork Fri May 14 10:43:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 439000 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-23.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9601C433B4 for ; Fri, 14 May 2021 10:50:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7EB8461460 for ; Fri, 14 May 2021 10:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231129AbhENKvV (ORCPT ); Fri, 14 May 2021 06:51:21 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.22]:11029 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231391AbhENKvU (ORCPT ); Fri, 14 May 2021 06:51:20 -0400 X-Greylist: delayed 362 seconds by postgrey-1.27 at vger.kernel.org; Fri, 14 May 2021 06:51:19 EDT ARC-Seal: i=1; a=rsa-sha256; t=1620989043; cv=none; d=strato.com; s=strato-dkim-0002; b=YZVzSPq8R4i4vFhj2RfblJryE1o9GzqXIIZX16Bvw8ezR8Ci7O6aeHNtNOT5TlT6c7 0dnSDGm/2V+br4ypMGH96P0Y0fjsGtbJdsCSLnElqlkPj6qgnJlvBK/LMcC43hmrcW5N LyCpBnC3aLbf4IdANdZLzZ6RHCGiz2P1wS3Nn0speSkqHlIQ4i0AtZ7tsfMwDW2irhxW hcqTArT0E8mtnA9EPr9gOsRFUlAy/+DW/Am3HSX1DgT+Nt8SZp7Yz7qNELY0oCEvMpS2 /MOCiJwJaQ+JNCx7vDuKC4xo/TG+gzogk2mBB+NaEXBDJ66fKP0FF+t/Qh+ED/fhUDEr kP5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1620989043; s=strato-dkim-0002; d=strato.com; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=dDRkH6tZiQw//M0zZQKuvlWcP5ZN2kmFHH6Pj9vqSVs=; b=j2F4LubwwSvVC5u4I/UPe/9afKNXJlnrwrsExJEcBz0MaJ9bh2yObPu8gpPagSTOh9 uk24TUZA2rGz8p6bzw78p3zaorpuGX/pH9MuokMf37dH6iDnH3s/Vhod+4QwMkazCrrb IGhC7bjARmkSJ5UhuL+U2Mb4yjhcICO3FNH8gPWHaWw3Zs4TNpxDtzpg1JpF1y3qVCoF 8yC4f2mxmM1hxTQCfB08gCowzwol0ZoU2zRnm+isfh1Jw4q4iA3qog5m3NVdBAtIw8k+ u9IUv6Rhq34bdv1lzWgEupBHUwOezDrGgTDiMmn6cHZIbVVRZ7lN5j+3VeXMNKlRjybM OfVA== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1620989043; s=strato-dkim-0002; d=gerhold.net; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=dDRkH6tZiQw//M0zZQKuvlWcP5ZN2kmFHH6Pj9vqSVs=; b=Fjcy4rNPgh+KcnhPmzEQ6cFcQFEksdovZ4/sW4mek4V18XEqvhlaunEkAa5BknQUzX TYbT4PUHH38Trg4QClFFEMAcaOcSx2Pt7/eDMUJ04BZ/wbUJG2cLz+HonjKLXze+qpvF DZDuROmcGwiQObZopKhLhus28vyNbfr7X5525kGADU48V6GlJcU4RrJonILjMFrZIYfh xdTKCBJCTQwYMWfDAytbkwdTuMx449B90/MgrgA58m9BF2lwHkYxmHXK+2V17ERhTdX+ DibSeRLnwdKLo7E+O+hdXXxSglPa799fwuBSA6akraLe0yed8OVr1uHptg9EqpChncQi t4Mg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB5m6OWA==" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.25.7 SBL|AUTH) with ESMTPSA id j06c13x4EAi3Fyk (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 14 May 2021 12:44:03 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson , Andy Gross Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 1/5] arm64: dts: qcom: msm8916: Add device tree for Huawei Ascend G7 Date: Fri, 14 May 2021 12:43:24 +0200 Message-Id: <20210514104328.18756-1-stephan@gerhold.net> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The Huawei Ascend G7 is a smartphone from Huawei based on MSM8916. It's fairly similar to the other MSM8916 devices, the only notable exception are the "cd-gpios" for detecting if a SD card was inserted: It looks like Huawei forgot to re-route this to gpio38, so the correct GPIO seems to be gpio56 on this device. Note: The original firmware from Huawei can only boot 32-bit kernels. To boot arm64 kernels it is necessary to flash 64-bit TZ/HYP firmware with EDL, e.g. taken from the DragonBoard 410c. This works because Huawei forgot to set up (firmware) secure boot for some reason. Also note that Huawei no longer provides bootloader unlock codes. This can be bypassed by patching the bootloader from a custom HYP firmware, making it think the bootloader is unlocked. I use a modified version of qhypstub [1], that patches a single instruction in the Huawei bootloader. The device tree contains initial support for the Huawei Ascend G7 with: - UART (untested, probably available via some test points) - eMMC/SD card - Buttons - Notification LED (combination of 3 GPIO LEDs) - Vibrator - WiFi/Bluetooth (WCNSS) - USB [1]: https://github.com/msm8916-mainline/qhypstub Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/Makefile | 1 + .../arm64/boot/dts/qcom/msm8916-huawei-g7.dts | 279 ++++++++++++++++++ 2 files changed, 280 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile index 456502aeee49..c894de19654e 100644 --- a/arch/arm64/boot/dts/qcom/Makefile +++ b/arch/arm64/boot/dts/qcom/Makefile @@ -7,6 +7,7 @@ dtb-$(CONFIG_ARCH_QCOM) += ipq6018-cp01-c1.dtb dtb-$(CONFIG_ARCH_QCOM) += ipq8074-hk01.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-alcatel-idol347.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-asus-z00l.dtb +dtb-$(CONFIG_ARCH_QCOM) += msm8916-huawei-g7.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-longcheer-l8150.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-longcheer-l8910.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-mtp.dtb diff --git a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts new file mode 100644 index 000000000000..d67aa7dd4a21 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts @@ -0,0 +1,279 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright (C) 2021 Stephan Gerhold + +/dts-v1/; + +#include "msm8916-pm8916.dtsi" +#include +#include +#include + +/* + * Note: The original firmware from Huawei can only boot 32-bit kernels. + * To boot arm64 kernels it is necessary to flash 64-bit TZ/HYP firmware + * with EDL, e.g. taken from the DragonBoard 410c. This works because Huawei + * forgot to set up (firmware) secure boot for some reason. + * + * Also note that Huawei no longer provides bootloader unlock codes. + * This can be bypassed by patching the bootloader from a custom HYP firmware, + * making it think the bootloader is unlocked. + * + * See: https://wiki.postmarketos.org/wiki/Huawei_Ascend_G7_(huawei-g7) + */ + +/ { + model = "Huawei Ascend G7"; + compatible = "huawei,g7", "qcom,msm8916"; + + aliases { + serial0 = &blsp1_uart2; + }; + + chosen { + stdout-path = "serial0"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&gpio_keys_default>; + + label = "GPIO Buttons"; + + volume-up { + label = "Volume Up"; + gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&gpio_leds_default>; + + led-0 { + gpios = <&msmgpio 8 GPIO_ACTIVE_HIGH>; + color = ; + default-state = "off"; + function = LED_FUNCTION_INDICATOR; + }; + + led-1 { + gpios = <&msmgpio 9 GPIO_ACTIVE_HIGH>; + color = ; + default-state = "off"; + function = LED_FUNCTION_INDICATOR; + }; + + led-2 { + gpios = <&msmgpio 10 GPIO_ACTIVE_HIGH>; + color = ; + default-state = "off"; + function = LED_FUNCTION_INDICATOR; + }; + }; + + usb_id: usb-id { + compatible = "linux,extcon-usb-gpio"; + id-gpio = <&msmgpio 117 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&usb_id_default>; + }; +}; + +&blsp1_uart2 { + status = "okay"; +}; + +&pm8916_resin { + status = "okay"; + linux,code = ; +}; + +&pm8916_vib { + status = "okay"; +}; + +&pronto { + status = "okay"; +}; + +&sdhc_1 { + status = "okay"; + + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>; + pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>; +}; + +&sdhc_2 { + status = "okay"; + + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdhc2_cd_default>; + pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdhc2_cd_default>; + + /* + * The Huawei device tree sets cd-gpios = <&msmgpio 38 GPIO_ACTIVE_HIGH>. + * However, gpio38 does not change its state when inserting/removing the + * SD card, it's just low all the time. The Huawei kernel seems to use + * polling for SD card detection instead. + * + * However, looking closer at the GPIO debug output it turns out that + * gpio56 switches its state when inserting/removing the SD card. + * It behaves just like gpio38 normally does. Usually GPIO56 is used as + * "UIM2_PRESENT", i.e. to check if a second SIM card is inserted. + * Maybe Huawei decided to replace the second SIM card slot with the + * SD card slot and forgot to re-route to gpio38. + */ + cd-gpios = <&msmgpio 56 GPIO_ACTIVE_LOW>; +}; + +&usb { + status = "okay"; + extcon = <&usb_id>, <&usb_id>; +}; + +&usb_hs_phy { + extcon = <&usb_id>; +}; + +&smd_rpm_regulators { + vdd_l1_l2_l3-supply = <&pm8916_s3>; + vdd_l4_l5_l6-supply = <&pm8916_s4>; + vdd_l7-supply = <&pm8916_s4>; + + s3 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1300000>; + }; + + s4 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <2100000>; + }; + + l1 { + regulator-min-microvolt = <1225000>; + regulator-max-microvolt = <1225000>; + }; + + l2 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + }; + + l4 { + regulator-min-microvolt = <2050000>; + regulator-max-microvolt = <2050000>; + }; + + l5 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + l6 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + l7 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + l8 { + regulator-min-microvolt = <2950000>; + regulator-max-microvolt = <2950000>; + }; + + l9 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + l10 { + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <2800000>; + }; + + l11 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <2950000>; + regulator-allow-set-load; + regulator-system-load = <200000>; + }; + + l12 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <2950000>; + }; + + l13 { + regulator-min-microvolt = <3075000>; + regulator-max-microvolt = <3075000>; + }; + + l14 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + }; + + l15 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + }; + + l16 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + }; + + l17 { + regulator-min-microvolt = <2850000>; + regulator-max-microvolt = <2850000>; + }; + + l18 { + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <2700000>; + }; +}; + +&msmgpio { + gpio_keys_default: gpio-keys-default { + pins = "gpio107"; + function = "gpio"; + + drive-strength = <2>; + bias-pull-up; + }; + + gpio_leds_default: gpio-leds-default { + pins = "gpio8", "gpio9", "gpio10"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + + sdhc2_cd_default: sdhc2-cd-default { + pins = "gpio56"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + + usb_id_default: usb-id-default { + pins = "gpio117"; + function = "gpio"; + + drive-strength = <8>; + bias-pull-up; + }; +}; From patchwork Fri May 14 10:43:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 439518 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47F49C43461 for ; Fri, 14 May 2021 10:47:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E565613F2 for ; Fri, 14 May 2021 10:47:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231600AbhENKsP (ORCPT ); Fri, 14 May 2021 06:48:15 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.50]:10184 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232050AbhENKsO (ORCPT ); Fri, 14 May 2021 06:48:14 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1620989044; cv=none; d=strato.com; s=strato-dkim-0002; b=IsMmOO+CnuSck2fLgyQqlRaJlpzJzaBiGrMdeZRvF30GBKd0Kyf9pFAcuzq3rDK2aP Gku6esbktEyd7J0ocdaTSeOZ5jtXd+tWRBPgNT1Rt4a0TdSSos9tAKmyg1FPdfcVzwc9 hNCQ2y6yKPc5ajb0cOvZ+1mHkMpjaFaAJBG2SZ9Nz5kwAx0vupZMloG8tzCZQbLQ/ut8 VfItwxe7kVQOroUhu7l2Bz+NUzjjrLC8jXEOYpx8b9pc+rYpi8/tE+qVlFjuUtm+DYVC rPTzUWWyguUoN9VpvWQVPO5DheFjID3VMS1aBQdP14tZ1SfVJl4LJ4wbbRHfoF+fgcim 8QkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1620989044; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=pOMxRVCSZeL7WA4kcc0Aa8Hx9q+zfPbiWCDXBlUaSss=; b=cZMSGnRuzOh8FJ4Buze3SH6EoHEniFzJ5ODHXWI2x4X7q2kbNPYrjgXTsK8gq0/bDN 2Rn0NrL/lesBIzjRe8ar6jrSmcs5305o3vKa/FNSNOuOyqw25nvVvybdz/ZtbQE1sf0h 41lnOAsbd5vAXBqR49A2h1B4FvrBgAacAQqaDHb40I+nmdPiMhn6fy6ku/3omc3YGxWl 7KP/KZCIYI2h9O7x92a5q+J32mzKa6GjFUgYYn//dROpzDbMFzplF0vrDsdvFKUvrqlC +VsicNLfBVGePTi66f+ttQi03cF+BsjfK5VNYzsdauLJ8YdTeM0wDbVrpg4J8WmooVap 6TyA== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1620989044; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=pOMxRVCSZeL7WA4kcc0Aa8Hx9q+zfPbiWCDXBlUaSss=; b=RucXJ4kmsKnI5AsSM3FweyelRnctk/xBRP43rWdx7vnZvz+dTjxJ5tudz2lfLcB5Kh +sGXw+vPFf/+M+P6jJ4ZEiSPm/DxcTBQRKOc2ou8IJlKUA1QWrFtzhy8aUDDWhqoUvGK FGb63bcvopwl1ktAEH3sWYW+hDND6NQ1F9KU6jkE/rBKO1Z4L4Yq2Jn4qcGib3dh1LHy FlsIn7iKX91c8xLEkEE3CteDf+LLBBiMjEyJAf/58Gs6iij/ykd9aNnXXf2a4yaMjqac puUCjwVSdAKDuAIRjQiuvSjoykEDm6b/lCuS5ZD7CgE8eau5euSnwRYL4qlwUR34yWaM RNGw== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB5m6OWA==" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.25.7 SBL|AUTH) with ESMTPSA id j06c13x4EAi3Fyl (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 14 May 2021 12:44:03 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson , Andy Gross Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 2/5] arm64: dts: qcom: msm8916-huawei-g7: Add touchscreen Date: Fri, 14 May 2021 12:43:25 +0200 Message-Id: <20210514104328.18756-2-stephan@gerhold.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514104328.18756-1-stephan@gerhold.net> References: <20210514104328.18756-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The Huawei Ascend G7 has a Synaptics "C199HW-006" touchscreen, supplied by pm8916_l17 and pm8916_l16. Add it to the device tree and reduce the maximum allowed voltage for pm8916_l16 to 1.8V since we really should not use more for an I/O supply. Signed-off-by: Stephan Gerhold --- .../arm64/boot/dts/qcom/msm8916-huawei-g7.dts | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts index d67aa7dd4a21..f928179f9ded 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts @@ -6,6 +6,7 @@ #include "msm8916-pm8916.dtsi" #include #include +#include #include /* @@ -84,6 +85,38 @@ usb_id: usb-id { }; }; +&blsp_i2c5 { + status = "okay"; + + rmi4@70 { + compatible = "syna,rmi4-i2c"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + + interrupt-parent = <&msmgpio>; + interrupts = <13 IRQ_TYPE_EDGE_FALLING>; + + vdd-supply = <&pm8916_l17>; + vio-supply = <&pm8916_l16>; + + pinctrl-names = "default"; + pinctrl-0 = <&ts_irq_default>; + + syna,startup-delay-ms = <100>; + + rmi4-f01@1 { + reg = <0x1>; + syna,nosleep-mode = <1>; /* Allow sleeping */ + }; + + rmi4-f11@11 { + reg = <0x11>; + syna,sensor-type = <1>; /* Touchscreen */ + }; + }; +}; + &blsp1_uart2 { status = "okay"; }; @@ -230,7 +263,7 @@ l15 { l16 { regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; + regulator-max-microvolt = <1800000>; }; l17 { @@ -269,6 +302,14 @@ sdhc2_cd_default: sdhc2-cd-default { bias-disable; }; + ts_irq_default: ts-irq-default { + pins = "gpio13"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + usb_id_default: usb-id-default { pins = "gpio117"; function = "gpio"; From patchwork Fri May 14 10:43:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 439002 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA1BCC433B4 for ; Fri, 14 May 2021 10:44:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 882636145B for ; Fri, 14 May 2021 10:44:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230526AbhENKpV (ORCPT ); Fri, 14 May 2021 06:45:21 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.52]:10337 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230023AbhENKpT (ORCPT ); Fri, 14 May 2021 06:45:19 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1620989044; cv=none; d=strato.com; s=strato-dkim-0002; b=H5LsvLVNrc1CX1muc8g5CPtUrD30XAPOoVmASFhLVMbWF6ZwBrNtN+VnBAXiE1wAYz 66BDbo3YAME3tif7tgRvG1mdIhm+LglVgYEbGlafQJcG+9pnhqXESg+I2us7VUb/e9w4 ZGT1vWGr85r4KmAnqvaaXcCRSeR+MHGtiBmywv+Bb0fohIyW06vm16c+cvZ7YEIlF3b/ VHzeqXiLIgOh+htnCGFzPIDrYHMTyuVl4lWJCYrLaC3IH8GeGNI2hQIQfquU32Ao4LHt J+tBUjGcUcaW5ZIFLvBfUYmCxEobJis7bvfN3ODkXuoHInIUOGNv4pk0oRN8DUZgNkTk 1iPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1620989044; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=npGo6RY7cHwUEm6OFef7gBC2N2Rik3ZzNRUu4isJVzw=; b=ovBP+3WAltp1imUt84fN0nTp/8Z0C26If/H3fGWCKzy3w9CWX1IbRP/+ImzU6qvPCg 1TdS6BbRmi5aJGui/N2cloL7CP//AMPkr9SY54tJcZk6PiVHZpvYdRQUlPgRk/DaM4ff 0/C6sGT5dQmvMKBTa9z/50H2j+pCGphA17oHGo+V7Ip1lB9QAWpax4nZamMU41cHyrZS KiFq8i5/lrDkYzbVmeCDHvGR1fCXGUnq3NLFZUWAcvFL8ZQczhJGLn//ZBHcBTBriQV9 o/GJrG9vhIJ+qQHw//BKIdXWZ8o4JMizHjCMIkS9vZjwdsAQZzntuXm9Hfgyu8ZkXMR/ BIDg== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1620989044; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=npGo6RY7cHwUEm6OFef7gBC2N2Rik3ZzNRUu4isJVzw=; b=geBCmI37pjERL6cPPrVb4VCZCJA4G31LGebGcWEYNwVwDFUi1q9aE4XtxJPHWaZonI afo+eNTLTsAF6w6QLwV9lTa8m4MB5NdsVotjl34TkS1j31bV7qmREawlfH9qqpCDuwlw LTMkaAVxwRFxyy3oQ+gED11z9O9YKykLLC7R44OBfxUgRnWq3vLLGrEiSInJ2/XpzaUW G9LeTdYQXEdFofycFwlxDQ3FidSKxBElokCgxKkljt5tHbcGdBob//xU7liUR9udHC1z O/bF6/WSdhk+nP6DwCIPuMhAsPcUwoYFvbfvZd6I178T0V5VrOT5cRmyaQoxu2V7xp+z nV/g== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB5m6OWA==" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.25.7 SBL|AUTH) with ESMTPSA id j06c13x4EAi4Fym (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 14 May 2021 12:44:04 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson , Andy Gross Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 3/5] arm64: dts: qcom: msm8916-huawei-g7: Add sensors Date: Fri, 14 May 2021 12:43:26 +0200 Message-Id: <20210514104328.18756-3-stephan@gerhold.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514104328.18756-1-stephan@gerhold.net> References: <20210514104328.18756-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The Huawei Ascend G7 has 3 sensors, all supported by existing kernel drivers: 1. Kionix KX023-1025 accelerometer (kxcjk-1023) 2. Asahi Kasei AK09911 magnetometer (ak8975) 3. Avago APDS9930 proximity/light sensor (tsl2772) Add them to the huawei-g7 device tree. Signed-off-by: Stephan Gerhold --- .../arm64/boot/dts/qcom/msm8916-huawei-g7.dts | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts index f928179f9ded..3b558dc9e90f 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts @@ -85,6 +85,58 @@ usb_id: usb-id { }; }; +&blsp_i2c2 { + status = "okay"; + + magnetometer@c { + compatible = "asahi-kasei,ak09911"; + reg = <0x0c>; + + vdd-supply = <&pm8916_l17>; + vid-supply = <&pm8916_l6>; + + reset-gpios = <&msmgpio 36 GPIO_ACTIVE_LOW>; + + pinctrl-names = "default"; + pinctrl-0 = <&mag_reset_default>; + }; + + accelerometer@1e { + compatible = "kionix,kx023-1025"; + reg = <0x1e>; + + interrupt-parent = <&msmgpio>; + interrupts = <115 IRQ_TYPE_EDGE_RISING>; + + vdd-supply = <&pm8916_l17>; + vddio-supply = <&pm8916_l6>; + + pinctrl-names = "default"; + pinctrl-0 = <&accel_irq_default>; + + mount-matrix = "-1", "0", "0", + "0", "1", "0", + "0", "0", "1"; + }; + + proximity@39 { + compatible = "avago,apds9930"; + reg = <0x39>; + + interrupt-parent = <&msmgpio>; + interrupts = <113 IRQ_TYPE_EDGE_FALLING>; + + vdd-supply = <&pm8916_l17>; + vddio-supply = <&pm8916_l6>; + + led-max-microamp = <100000>; + amstaos,proximity-diodes = <1>; + + pinctrl-names = "default"; + pinctrl-0 = <&prox_irq_default>; + }; +}; + &blsp_i2c5 { status = "okay"; @@ -278,6 +330,14 @@ l18 { }; &msmgpio { + accel_irq_default: accel-irq-default { + pins = "gpio115"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + gpio_keys_default: gpio-keys-default { pins = "gpio107"; function = "gpio"; @@ -294,6 +354,22 @@ gpio_leds_default: gpio-leds-default { bias-disable; }; + mag_reset_default: mag-reset-default { + pins = "gpio36"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + + prox_irq_default: prox-irq-default { + pins = "gpio113"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + sdhc2_cd_default: sdhc2-cd-default { pins = "gpio56"; function = "gpio"; From patchwork Fri May 14 10:43:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 439517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 948CEC433ED for ; Fri, 14 May 2021 10:50:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CD4C6143D for ; Fri, 14 May 2021 10:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229516AbhENKvU (ORCPT ); Fri, 14 May 2021 06:51:20 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.170]:19118 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231129AbhENKvT (ORCPT ); Fri, 14 May 2021 06:51:19 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1620989044; cv=none; d=strato.com; s=strato-dkim-0002; b=gjQ2/L5ziGQ1O0H4xYQGGoRY55UDXqWHZgaTvEDSEBo95mkN8MgFC/Zinba5sn30Pl h+MJcbk6jdK6/YMyQBwZ+6lM0YpJljLl57KLYJ2DFdQKH2pcfqxihFeJyzgD7el5OUwr jFIcRWQ3Y6e2yOwdFiJC8rzgBnbPTwwzLa6ajX2SeVvoLe3iJx/XDt5MRpX3PVRDsDEN xl48+/huMzh1NMLOPn3I0RwUUPJ0Io2oFA40swtBPHWU/VqH/fOzWB/AqoCEPsxiMN0v Tz0jt9UGzzlMpp0xf32+C8SDHCOWB+V8wi2/dMPZSXvN5r+3Hf/51J/wn/ju7oT0dXri z3gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1620989044; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=99IYwNg54dmBzr49xTRAglezUv8789iToQiSeRNiiQI=; b=kEWQnfkBFGmCle6lOCxD5ttIQcXdVb9D4zkaCkzd05oPNrUKqqFjuTprTr1fJkWIhR OLfEAZ1efH+rtJ5vB7RrLVS6aM0/VvqIjX97VA18Ymxieuy+NWswhoQ9qqOqIpXizNTi VdHtDSqUx9/MT5x8O28JgyQWchhbmeys6m2mhhYbodK43E6lMiReYZCKwsRnqMrXqv0x 7PUVXGp9zh011xQebINMRNc0Zm12xwwc4IWaFlPuGYdvX3NW8iGKh8PsxWPBptEHxwcA oU3q9di8pukyE/8owH4hAoBYhxzy66DTYW8q8ZSsh3j9P5SedO/fwqHpMPPAy2qOPXsm djLg== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1620989044; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=99IYwNg54dmBzr49xTRAglezUv8789iToQiSeRNiiQI=; b=XAgDp5CKJALlxz5DSqk5OO2CLbY7xhmUgazOmKk22dvJLizDMDiShHXfOpItzW1/mE n46yPcH00CdBLpk/SczcGkIEYtSBqLJ+qGZix6SN5lgXFd/V7PDoxZVSie6pLU9igD/w xCu+6ZAFaGzmUSZx+qF5BlZ9F1Of0eh2NqVa1n+d2/yGQdFj/hwkPXxnKBKhGe9FCw4C 2bFh1XDEuE74xgZVddOx+IjLm/ykJM1cuc+YGL21tQO+XV9V5NydbCK0uqTlKkXXDcbT +4gpsyKMLvJoTuBjJHJAR+8sKh6zMKJLispG9OmLb2iy1doTA7793UTC4GQ4PJWodAGh yFFg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB5m6OWA==" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.25.7 SBL|AUTH) with ESMTPSA id j06c13x4EAi4Fyn (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 14 May 2021 12:44:04 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson , Andy Gross Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 4/5] arm64: dts: qcom: msm8916-huawei-g7: Add display regulator Date: Fri, 14 May 2021 12:43:27 +0200 Message-Id: <20210514104328.18756-4-stephan@gerhold.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514104328.18756-1-stephan@gerhold.net> References: <20210514104328.18756-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The display on the Huawei Ascend G7 is supplied by a TI TPS65132 regulator. The panel needs a driver in mainline first, but the TPS65132 is already supported in mainline by the tps65132 driver. Signed-off-by: Stephan Gerhold --- .../arm64/boot/dts/qcom/msm8916-huawei-g7.dts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts index 3b558dc9e90f..5ad4e921b110 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts @@ -135,6 +135,30 @@ proximity@39 { pinctrl-names = "default"; pinctrl-0 = <&prox_irq_default>; }; + + regulator@3e { + compatible = "ti,tps65132"; + reg = <0x3e>; + + pinctrl-names = "default"; + pinctrl-0 = <®_lcd_en_default>; + + reg_lcd_pos: outp { + regulator-name = "outp"; + regulator-min-microvolt = <5400000>; + regulator-max-microvolt = <5400000>; + enable-gpios = <&msmgpio 97 GPIO_ACTIVE_HIGH>; + regulator-active-discharge = <1>; + }; + + reg_lcd_neg: outn { + regulator-name = "outn"; + regulator-min-microvolt = <5400000>; + regulator-max-microvolt = <5400000>; + enable-gpios = <&msmgpio 32 GPIO_ACTIVE_HIGH>; + regulator-active-discharge = <1>; + }; + }; }; &blsp_i2c5 { @@ -370,6 +394,14 @@ prox_irq_default: prox-irq-default { bias-disable; }; + reg_lcd_en_default: reg-lcd-en-default { + pins = "gpio32", "gpio97"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + sdhc2_cd_default: sdhc2-cd-default { pins = "gpio56"; function = "gpio"; From patchwork Fri May 14 10:43:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 439001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F15DFC433B4 for ; Fri, 14 May 2021 10:50:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C91EA61457 for ; Fri, 14 May 2021 10:50:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231124AbhENKvR (ORCPT ); Fri, 14 May 2021 06:51:17 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.168]:23411 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbhENKvR (ORCPT ); Fri, 14 May 2021 06:51:17 -0400 X-Greylist: delayed 358 seconds by postgrey-1.27 at vger.kernel.org; Fri, 14 May 2021 06:51:16 EDT ARC-Seal: i=1; a=rsa-sha256; t=1620989045; cv=none; d=strato.com; s=strato-dkim-0002; b=pmq7QYHzo+prEMJrMP2cDyBfw41rlani3SzajT0L8ncBkD9Yw6ZtDV7zrYwmSnVCtg HTz6Q48+GynS8gcCOUZ5sWuFgvqchkrHuHxOyOAEjVAn/qDoCjgsHE+AaH0F1Uv6eY+a Hytj7vWJiGKEUEE4DwInz1Oqgih4l6RT0qS7tZ/t2OwzDYOznUN7ALEBFuk/F4mXTArB SNGm2NEORL2rRk8ikqL+PhXxSVSPlQMagQilG5PSgomfR60i2K6e7VaK9FY7Sfz6Lt3G iphiMeGHQarsDY+/K4V4N+bhtSQofGG/KGB9ENaDMRdvY4GYveIQ9k/eNlvgJZcQrGnY +ksg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1620989045; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=onZ1ndtHrNRFqAtDjGioRxEfQXLifJXbNhb184j8N9g=; b=VajhScdtRyhKsBH+lcw6FglMqIysujkiluQYtWQUJFrRQDOL8A1RyHwrIJHVRNm4Pz moMw0y4fkSXby+Rwu3hBtsSwFO3zZvK8cCJ3bJ8EMW7fnwL0GgJr4eFvYXrEAutHqD9i DXqt+MPVzzwX6rbOb06XG+lf6rihO75BFquDDolMZQcw+8r2ufxg8GuXTPNAqE/+co+a 8hiLctbPCuoxUp9n5Hh5MU+6wIBXLa6tzHoKXw6qI9/F+5x+GHwDKoOZJj7g2Qzuqzif k+zekgwXcO9ceszHjQ0yxnIqBYHyk+lAEfCHJPYOkSFjk4O0kPx6AEhSdncmHrgWdP5m 4gDg== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1620989045; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=onZ1ndtHrNRFqAtDjGioRxEfQXLifJXbNhb184j8N9g=; b=AECLsnTsmsdgQelCoRn/ViLk9exFytmnpVLLEPz1lGdLdx47TNKmi7Ajjrc+KZGnWE C7B/K3DCZoVBHumhiYIXP8YjOAlbDf4Wny4sBxNJ+uPSTyWLXus6Vf5wj1BDcYqNQptE JjwrxGX9vscbBqhOxM5/mCX2X0+W31rYuaKVFmm/3oWdxgIfayqgXi30P0BwmY2cVcgx wiZCBjapX5n0a7exGaxoUBKYh9UH2gsmC1yOxcbcEJiZuCaEUtG84IajIli0rl8XU/xh UZVI8vY1x6ms9Bl/kcjjmqMXkVS974z8Xfc91cHoue8BFt6TtaZkoemtnw2AmVjJ3Zy6 Sh9Q== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB5m6OWA==" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.25.7 SBL|AUTH) with ESMTPSA id j06c13x4EAi4Fyo (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 14 May 2021 12:44:04 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson , Andy Gross Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 5/5] arm64: dts: qcom: msm8916-huawei-g7: Add NFC Date: Fri, 14 May 2021 12:43:28 +0200 Message-Id: <20210514104328.18756-5-stephan@gerhold.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514104328.18756-1-stephan@gerhold.net> References: <20210514104328.18756-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The Huawei Ascend G7 supports NFC using the NXP PN547, which is supported by the nxp-nci-i2c driver in mainline. It seems to detect NFC tags using "nfctool" just fine, although it seems like there are not really any useful applications making use of the Linux NFC subsystem. :( Signed-off-by: Stephan Gerhold --- .../arm64/boot/dts/qcom/msm8916-huawei-g7.dts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts index 5ad4e921b110..e0075b574190 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts @@ -193,6 +193,24 @@ rmi4-f11@11 { }; }; +&blsp_i2c6 { + status = "okay"; + + nfc@28 { + compatible = "nxp,pn547", "nxp,nxp-nci-i2c"; + reg = <0x28>; + + interrupt-parent = <&msmgpio>; + interrupts = <21 IRQ_TYPE_EDGE_RISING>; + + enable-gpios = <&msmgpio 20 GPIO_ACTIVE_HIGH>; + firmware-gpios = <&msmgpio 2 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&nfc_default>; + }; +}; + &blsp1_uart2 { status = "okay"; }; @@ -378,6 +396,14 @@ gpio_leds_default: gpio-leds-default { bias-disable; }; + nfc_default: nfc-default { + pins = "gpio2", "gpio20", "gpio21"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + mag_reset_default: mag-reset-default { pins = "gpio36"; function = "gpio";