From patchwork Thu Oct 20 11:56:08 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: 618316 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 5D8BFC433FE for ; Thu, 20 Oct 2022 11:56:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbiJTL4Z (ORCPT ); Thu, 20 Oct 2022 07:56:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbiJTL4W (ORCPT ); Thu, 20 Oct 2022 07:56:22 -0400 Received: from mail-4324.protonmail.ch (mail-4324.protonmail.ch [185.70.43.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2E8F12E0E6; Thu, 20 Oct 2022 04:56:20 -0700 (PDT) Date: Thu, 20 Oct 2022 11:56:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1666266978; x=1666526178; bh=8+35NVO0c0UvUjwWAVqxXJYRfNgUQLbju4mSBPabbg8=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID; b=eun3vO++Su1XSxTdmdJs/WC6r519scdeMdkVcc58v2ILdhhqVZbRknNO+hRWBpHPW CHleG38sTeJzGTY2EJdGlDIiYHjRjjgr1mjzi9zt+eQ7HloGRS4ZhiErtTJW2e0PhC 3FO1JcCT5HePfUJArvGI3q3Tl3VKXaYEydJO5msK86lXXsfuLdHLZfyrAPlvaGz56w fSYzggmDNAe+To1M+b5x9Bn6uU2vnC0z9ngsNan0Rn0JweRcCtSR5jQeX56FNDpL1I H0FYfd1tgHVNnnxzXxVxuU+SedW9D+izfgeP5IACSs1hqqPAbUgBhIMw7CKZfNkG+i 3pb/BqKhJ3ceg== To: devicetree@vger.kernel.org From: "Lin, Meng-Bo" Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Nikita Travkin , Stephan Gerhold , "open list:ARM/QUALCOMM SUPPORT" , open list , ~postmarketos/upstreaming@lists.sr.ht Subject: [PATCH] arm64: dts: msm8916-samsung-a2015: Add vibrator Message-ID: <20221020115255.2026-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 From: Nikita Travkin Both a2015 devices use motor drivers controlled with PWM signal. A5 additionally has a fixed regulator that powers the driver and is controlled by enable signal. A3 routes that enable signal to the motor driver itself. To simplify the description, add the motor to the common dtsi and assume a regulator is used for both. Signed-off-by: Nikita Travkin [Rename the nodes to be reusable in msm8916-sansung-e2015] Signed-off-by: Lin, Meng-Bo --- .../qcom/msm8916-samsung-a2015-common.dtsi | 52 +++++++++++++++++++ .../boot/dts/qcom/msm8916-samsung-a3u-eur.dts | 8 +++ .../boot/dts/qcom/msm8916-samsung-a5u-eur.dts | 8 +++ .../qcom/msm8916-samsung-e2015-common.dtsi | 26 ++-------- 4 files changed, 73 insertions(+), 21 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 3255bd3fcb55..16935de738af 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi @@ -23,6 +23,17 @@ tz-apps@85500000 { }; }; + clk_pwm: pwm { + compatible = "clk-pwm"; + #pwm-cells = <2>; + + clocks = <&gcc GCC_GP2_CLK>; + + pinctrl-names = "default"; + pinctrl-0 = <&motor_pwm_default>; + status = "disabled"; + }; + gpio-keys { compatible = "gpio-keys"; @@ -61,6 +72,24 @@ event-hall-sensor { }; }; + /* + * NOTE: A5 connects GPIO 76 to a reglator powering the motor + * driver IC but A3 connects the same signal to an ENABLE pin of + * the driver. + */ + reg_motor_vdd: regulator-motor-vdd { + compatible = "regulator-fixed"; + regulator-name = "motor_vdd"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + + gpio = <&msmgpio 76 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-names = "default"; + pinctrl-0 = <&motor_en_default>; + }; + reg_vdd_tsp_a: regulator-vdd-tsp-a { compatible = "regulator-fixed"; regulator-name = "vdd_tsp_a"; @@ -153,6 +182,16 @@ nfc@27 { pinctrl-0 = <&nfc_default &nfc_clk_req>; }; }; + + vibrator: vibrator { + compatible = "pwm-vibrator"; + + pwms = <&clk_pwm 0 100000>; + pwm-names = "enable"; + + vcc-supply = <®_motor_vdd>; + status = "disabled"; + }; }; &blsp_i2c2 { @@ -397,6 +436,19 @@ mdss_sleep: mdss-sleep { }; }; + motor_en_default: motor-en-default { + pins = "gpio76"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + + motor_pwm_default: motor-pwm-default { + pins = "gpio50"; + function = "gcc_gp2_clk_a"; + }; + muic_i2c_default: muic-i2c-default { pins = "gpio105", "gpio106"; 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 6db5f78ca286..d495d5ae5cc3 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts @@ -81,6 +81,10 @@ touchscreen@20 { }; }; +&clk_pwm { + status = "okay"; +}; + &dsi0 { panel@0 { reg = <0>; @@ -104,6 +108,10 @@ &dsi0_out { remote-endpoint = <&panel_in>; }; +&vibrator { + status = "okay"; +}; + &msmgpio { panel_vdd3_default: panel-vdd3-default { pins = "gpio9"; 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 5fb8ecd0c9ca..c03504ab27b7 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts @@ -50,6 +50,10 @@ touchscreen@48 { }; }; +&clk_pwm { + status = "okay"; +}; + &pronto { iris { compatible = "qcom,wcn3660b"; @@ -61,6 +65,10 @@ &touchkey { vdd-supply = <®_touch_key>; }; +&vibrator { + status = "okay"; +}; + &msmgpio { tkey_en_default: tkey-en-default { pins = "gpio97"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi index 542010fdfb8a..edd24b597a15 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi @@ -26,19 +26,6 @@ muic: extcon@14 { }; }; - reg_motor_vdd: regulator-motor-vdd { - compatible = "regulator-fixed"; - regulator-name = "motor_vdd"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - - gpio = <&msmgpio 76 GPIO_ACTIVE_HIGH>; - enable-active-high; - - pinctrl-names = "default"; - pinctrl-0 = <&motor_en_default>; - }; - reg_touch_key: regulator-touch-key { compatible = "regulator-fixed"; regulator-name = "touch_key"; @@ -61,20 +48,17 @@ &blsp_i2c2 { /delete-node/ magnetometer@12; }; +®_motor_vdd { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; +}; + &touchkey { vcc-supply = <®_touch_key>; vdd-supply = <®_touch_key>; }; &msmgpio { - motor_en_default: motor-en-default { - pins = "gpio76"; - function = "gpio"; - - drive-strength = <2>; - bias-disable; - }; - tkey_en_default: tkey-en-default { pins = "gpio97"; function = "gpio";