From patchwork Thu Jan 5 12:32:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Travkin X-Patchwork-Id: 639357 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 C6E83C53210 for ; Thu, 5 Jan 2023 12:51:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233383AbjAEMvc (ORCPT ); Thu, 5 Jan 2023 07:51:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233342AbjAEMv2 (ORCPT ); Thu, 5 Jan 2023 07:51:28 -0500 Received: from box.trvn.ru (box.trvn.ru [194.87.146.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56F0E4BD68; Thu, 5 Jan 2023 04:51:26 -0800 (PST) Received: from authenticated-user (box.trvn.ru [194.87.146.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by box.trvn.ru (Postfix) with ESMTPSA id 6873E420D1; Thu, 5 Jan 2023 17:33:57 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=trvn.ru; s=mail; t=1672922038; bh=Q9PyOYwHzV6hYDK9dXXB+GuVnQwRSCoeQeyi78nz73I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O6qIpXLl4UvqKGU1e3SF8yjsLQYthoP8q8EapvOKZSM7nkD1VV+GG6iMn2PPXeMkP bTRwHohiJ/XM27qqxd3Axfak4HF9oWRzg27uCoqd1QrIEUDYi1Q/RBv77QlroS/40w 2Gt6NjuKBLYk7oKXV5lmkdATKd81sIWWO4vMYnthjg7LvXiNMaWTq/L+1E1D9/8J3c yfZWxBTuE0hEZtPzlFQG/7IV7pyH75115Ndydc+yo9BTw/sAqC76UHpEca2WyZO9NR 7fmAbYFMR2ZtVwT/5grR2YqS2YfX0MsUZ+44Ah129iO5j8LMxF/IPa5kg0Wj3rXiDF kYWBHR5uQojVw== From: Nikita Travkin To: Andy Gross , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Konrad Dybcio , Siddharth Manthan , Jasper Korten , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Nikita Travkin Subject: [PATCH 4/8] arm64: dts: qcom: msm8916-samsung-gt510: Add Vibrator Date: Thu, 5 Jan 2023 17:32:36 +0500 Message-Id: <20230105123240.1089375-5-nikita@trvn.ru> In-Reply-To: <20230105123240.1089375-1-nikita@trvn.ru> References: <20230105123240.1089375-1-nikita@trvn.ru> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org gt510 uses a PWM controllable vibrator, that uses a general purpose clock output for it's control. Set up the pwm, supply and the vibrator. Signed-off-by: Nikita Travkin --- .../boot/dts/qcom/msm8916-samsung-gt510.dts | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts index e9916199e5a3..44d527b3f1f6 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts @@ -8,4 +8,51 @@ / { model = "Samsung Galaxy Tab A 9.7 (2015)"; compatible = "samsung,gt510", "qcom,msm8916"; chassis-type = "tablet"; + + clk_pwm: pwm { + compatible = "clk-pwm"; + #pwm-cells = <2>; + + clocks = <&gcc GCC_GP2_CLK>; + + pinctrl-0 = <&motor_pwm_default>; + pinctrl-names = "default"; + }; + + 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-0 = <&motor_en_default>; + pinctrl-names = "default"; + }; + + vibrator { + compatible = "pwm-vibrator"; + + pwms = <&clk_pwm 0 100000>; + pwm-names = "enable"; + + vcc-supply = <®_motor_vdd>; + }; +}; + +&msmgpio { + motor_en_default: motor-en-default-state { + pins = "gpio76"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; + + motor_pwm_default: motor-pwm-default-state { + pins = "gpio50"; + function = "gcc_gp2_clk_a"; + }; };