From patchwork Thu Apr 4 12:17:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Hackley X-Patchwork-Id: 13617660 Received: from mail-4324.protonmail.ch (mail-4324.protonmail.ch [185.70.43.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6777712BEA4; Thu, 4 Apr 2024 12:18:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.24 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712233087; cv=none; b=bA3RfERFMOIYX2S/ggbaTRPup0Y5VrFytbNLWoTSGQzwcpVEz7+CFfHmsFbYCxHD/tlZMkV3drqhSg9KekqwXTE2LLa5TWrrkAdnWRMonvPEASnJcz8fZuVGFKNjU86akvqC2FiVbu0d3qqz/GuLISHmsj2tpo2ZOEHMRnt6FfQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712233087; c=relaxed/simple; bh=GVxSMuaMMwDtSmPLzrzidTFjSfDHe8yr66fS7IQWKuY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jGIXJnfyXt/YDN59MdRDCoYNSbgP4XHmVHWUuhBWvS3YfqOaLh5zTBTQpaAe/Fr5RuZeiRUSeBVyN56AuzJWx2wfxtqY38TLRaVsc1F1CCs+cKMc18A5aRpvZZrKSUvNFC6H3nVfLYKX3rlEi8gqjrBkRvhYnyHLGU/MoZ5lpiw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com; spf=pass smtp.mailfrom=protonmail.com; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b=tYHl59K8; arc=none smtp.client-ip=185.70.43.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="tYHl59K8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1712233083; x=1712492283; bh=SseXJJNHa/F6U0kOq29Q+JI+GmFAZYvDtNaSxxH9FJ0=; 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:BIMI-Selector; b=tYHl59K8FpvqoZ6F0UJJ1w7NHzL439qWNSxc/q78GtQtnU0/TWNQpDMbI/KgrTgfc SGt6jqT5cp5hX4vnUtLAMoVNo/kxmTecDaN6ysxvY0XVsObq1tts6+Y/0VwuPbfq3+ UlJG4YUuzqsAugGLipyyDyDWuYKGYtYSZQWmgJCFMNDaDXdBRX+doZnLgxXnUQ4hHg xFLSA4/3YYdFsUdLzF6pMaIZCPdnwdwZ1Yi5x/gHnIiyeT/81OGzhPtpCz3zG3pcrK i2clQiUVnVIZOU1BfuSYLzst3/+hi7tYSeofzjdLWWTVSsE04xODK9h+MOO5ZsYI71 4ioPWxz2bmDvQ== Date: Thu, 04 Apr 2024 12:17:57 +0000 To: linux-kernel@vger.kernel.org From: Raymond Hackley Cc: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephan Gerhold , Nikita Travkin , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Siddharth Manthan Subject: [PATCH v3 2/2] arm64: dts: qcom: msm8916-samsung-fortuna: Add PWM backlight Message-ID: <20240404121703.17086-3-raymondhackley@protonmail.com> In-Reply-To: <20240404121703.17086-1-raymondhackley@protonmail.com> References: <20240404121703.17086-1-raymondhackley@protonmail.com> Feedback-ID: 49437091:user:proton Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Siddharth Manthan Most of the Galaxy Grand Prime use backlight drivers controlled with PWM signal. To simplify the description, add the backlight with the necessary clk-pwm to the common dtsi. Signed-off-by: Siddharth Manthan [Stephan: Move to fortuna-common and disable on rossa-common] Signed-off-by: Stephan Gerhold [Raymond: Add the commit message] Signed-off-by: Raymond Hackley --- .../qcom/msm8916-samsung-fortuna-common.dtsi | 36 +++++++++++++++++++ .../qcom/msm8916-samsung-rossa-common.dtsi | 9 +++++ 2 files changed, 45 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi index 6c66a24ef1af..5e933fb8b363 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-fortuna-common.dtsi @@ -26,6 +26,30 @@ tz-apps@85a00000 { }; }; + clk_pwm_backlight: backlight { + compatible = "pwm-backlight"; + pwms = <&clk_pwm 0 100000>; + + enable-gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>; + + brightness-levels = <0 255>; + num-interpolated-steps = <255>; + default-brightness-level = <128>; + + pinctrl-0 = <&backlight_en_default>; + pinctrl-names = "default"; + }; + + clk_pwm: pwm { + compatible = "clk-pwm"; + #pwm-cells = <2>; + + clocks = <&gcc GCC_GP2_CLK>; + + pinctrl-0 = <&backlight_pwm_default>; + pinctrl-names = "default"; + }; + gpio-keys { compatible = "gpio-keys"; @@ -199,6 +223,18 @@ &wcnss_mem { }; &tlmm { + backlight_en_default: backlight-en-default-state { + pins = "gpio98"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + backlight_pwm_default: backlight-pwm-default-state { + pins = "gpio50"; + function = "gcc_gp2_clk_a"; + }; + fg_alert_default: fg-alert-default-state { pins = "gpio121"; function = "gpio"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi index 4048b72efcdc..b438fa81886c 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-rossa-common.dtsi @@ -17,3 +17,12 @@ muic: extcon@14 { pinctrl-names = "default"; }; }; + +/* On rossa backlight is controlled with MIPI DCS commands */ +&clk_pwm { + status = "disabled"; +}; + +&clk_pwm_backlight { + status = "disabled"; +};