From patchwork Tue Aug 22 14:07:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raymond Hackley X-Patchwork-Id: 13361020 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 7ADBCEE49A3 for ; Tue, 22 Aug 2023 14:44:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236847AbjHVOo4 (ORCPT ); Tue, 22 Aug 2023 10:44:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235898AbjHVOo4 (ORCPT ); Tue, 22 Aug 2023 10:44:56 -0400 Received: from mail-4321.protonmail.ch (mail-4321.protonmail.ch [185.70.43.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B176126 for ; Tue, 22 Aug 2023 07:44:54 -0700 (PDT) Date: Tue, 22 Aug 2023 14:07:12 +0000 Authentication-Results: mail-4321.protonmail.ch; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="NkKE019C" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1692713242; x=1692972442; bh=JEDTfL56eXEIhpOtCWICTMLAmzOWWYiVCdprm1DzGsU=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=NkKE019CJSwybWgcTWCsiIbtG2U/0fsiND61i/rYNC7EUAJ2morhKQYvqKwrAUaOX QVIA/i+ghWY1oUR3E+DjN+Uz0qFvQRdU6PclG4ubNmnmJUaHUQgVv694jJvZRp+UjT js2QvYNXCxfH8ug4DfnRBWYI2MUJm430RugCWWTBmN8rSLYge+yHK/J9Bl6sQYHS3O YOtfheNzXox7Ttzp5dXE7//W1xEGV3w8+GNHT9HyOo0z8vE1EcRVMv7HqDsK+zoIzM t/g+Vd3SiUfY/B50KH0UhFSljNNiO+IQpg4TRM5EucNiex18kSSQqXmUhk5CXb30HV 38x83dOfurWEA== To: linux-kernel@vger.kernel.org From: Raymond Hackley Cc: Andy Gross , 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 Subject: [PATCH] arm64: dts: qcom: msm8916/39-samsung-a2015: Add flash LED Message-ID: <20230822140407.3316-1-raymondhackley@protonmail.com> Feedback-ID: 49437091:user:proton MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The phones listed below have Richteck RT5033 LED, which has GPIO pin configurations similar to SGM3140 Flash LED driver. Add it to the device trees. - Samsung Galaxy A3/A5/A7 2015 - Samsung Galaxy E5/E7 - Samsung Galaxy Grand Max Signed-off-by: Raymond Hackley --- .../qcom/msm8916-samsung-a2015-common.dtsi | 23 +++++++++++++++++++ .../boot/dts/qcom/msm8939-samsung-a7.dts | 23 +++++++++++++++++++ 2 files changed, 46 insertions(+) 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 019bf73178fa..48990716cafd 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi @@ -4,6 +4,7 @@ #include #include #include +#include #include / { @@ -36,6 +37,21 @@ clk_pwm: pwm { status = "disabled"; }; + flash-led-controller { + compatible = "richtek,rt5033-led"; + enable-gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>; + flash-gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>; + + pinctrl-0 = <&camera_flash_default>; + pinctrl-names = "default"; + + flash_led: led { + function = LED_FUNCTION_FLASH; + color = ; + flash-max-timeout-us = <544000>; + }; + }; + gpio-keys { compatible = "gpio-keys"; @@ -293,6 +309,13 @@ accel_int_default: accel-int-default-state { bias-disable; }; + camera_flash_default: camera-flash-default-state { + pins = "gpio34", "gpio36"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + fg_alert_default: fg-alert-default-state { pins = "gpio121"; function = "gpio"; diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts index ba652909d162..8d00a2328ca8 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts @@ -7,6 +7,7 @@ #include #include #include +#include / { model = "Samsung Galaxy A7 (2015)"; @@ -31,6 +32,21 @@ tz-apps@85500000 { }; }; + flash-led-controller { + compatible = "richtek,rt5033-led"; + enable-gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>; + flash-gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>; + + pinctrl-0 = <&camera_flash_default>; + pinctrl-names = "default"; + + flash_led: led { + function = LED_FUNCTION_FLASH; + color = ; + flash-max-timeout-us = <544000>; + }; + }; + gpio-hall-sensor { compatible = "gpio-keys"; @@ -360,6 +376,13 @@ accel_int_default: accel-int-default-state { bias-disable; }; + camera_flash_default: camera-flash-default-state { + pins = "gpio34", "gpio36"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + fg_alert_default: fg-alert-default-state { pins = "gpio121"; function = "gpio";