From nobody Thu Apr 9 15:44:51 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0FF2B288C81; Sat, 7 Mar 2026 00:58:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772845084; cv=none; b=I/FEzUkr/cuIBBvtHvFJafGrv/fqoLunWBf+CJKjCvzUwbEfwnNkMqAE/Mv7QNge5+7X0yGLipSTDpJnTnhteXk6pe6kcbZ60EaEHQb434CuNknEGDgVcbmVjgdEtIGo93/hzOrt7Ya6vf1DsD3GacDgV+GmL8GavAIynbRMBVY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772845084; c=relaxed/simple; bh=RSOssoQDt3tH+xZ9YIlkIHtRUEzMtQAhukhAWru5pcA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TR5ZzImuc/l77wtcyCwSeSJMtBEnqguCKuEzY8JHZ15HIgNqofxcIXQa80Ccn5WK7GW7lwZcV2gY+xXAtBpxncx2WMXYT6dg2O1Ykmu0bSLajxpcT9gRyd2X52p8QjFbRwzl1mEA+M7Lrrlo5xXOvIB7bT93M4whjmiZ2mQPQ4Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gmstopi/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gmstopi/" Received: by smtp.kernel.org (Postfix) with ESMTPS id A52B4C2BC9E; Sat, 7 Mar 2026 00:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772845083; bh=RSOssoQDt3tH+xZ9YIlkIHtRUEzMtQAhukhAWru5pcA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Gmstopi/TAVZivmWXLsh4zUBxRjq/ougk/82ara6vB9m/pyYpt1hVynD5g/cC657L /VdXk8fI7TecKXviZLR+Xz07ni8DwKD3Jhdz6lI5o+wP6PJhQ+q4aQ2NkDdlwjWf7t BYRrznq3ir0eg5s9CbL9oqWxQZnsFEi2oARJlyYioqxMTcGmam+resS3Er8tyzy2yl uM6ZgpmVM3ZltQe5xPX1D3ldyCuAlN3wZGeZ76dpIHe4XT/9BWWo7ilhjfjNBqTymd k6LuJj0lypb/7vkJlurRRo/WKYmSjOKoSbeS7uhCSy5yRFzR+MbrGJLXfcJKAvCQzo pyApuzH+CcBxQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AA51FC9EC6; Sat, 7 Mar 2026 00:58:03 +0000 (UTC) From: Rudraksha Gupta via B4 Relay Date: Fri, 06 Mar 2026 16:58:02 -0800 Subject: [PATCH 1/3] dt-bindings: leds: rt8515: Support single-GPIO flash ICs with unlock gate Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260306-expressatt_camera_flash-v1-1-b1996f7cdfdd@gmail.com> References: <20260306-expressatt_camera_flash-v1-0-b1996f7cdfdd@gmail.com> In-Reply-To: <20260306-expressatt_camera_flash-v1-0-b1996f7cdfdd@gmail.com> To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bjorn Andersson , Konrad Dybcio Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Rudraksha Gupta X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772845083; l=2686; i=guptarud@gmail.com; s=20240916; h=from:subject:message-id; bh=XkKexDy/wzuB27iB2DnLFEzKOovyf++JmlP+fQT4Q6o=; b=he6Q2vN99zHB/nJKmrP5qVDhXsKuAugWXRoYsVze3J2hDLS/1EGDegxeETpbLfSdCc+i4D8XY PVNa65EVPyMCnkBk9e5dqxgRft8bIKI1MvtPOQ5pHGJcJtxpHI7rYic X-Developer-Key: i=guptarud@gmail.com; a=ed25519; pk=ETrudRugWAtOpr0OhRiheQ1lXM4Kk4KGFnBySlKDi2I= X-Endpoint-Received: by B4 Relay for guptarud@gmail.com/20240916 with auth_id=211 X-Original-From: Rudraksha Gupta Reply-To: guptarud@gmail.com From: Rudraksha Gupta Some flash ICs use the same one-wire pulse-count protocol as the RT8515 but have only a single GPIO line for both flash and torch modes, plus an optional unlock gate (e.g. a PMIC MPP) that must be driven high before the chip responds to the enable GPIO. Make ent-gpios optional and add an unlock-gpios property to support these variants. Add a oneOf constraint requiring exactly one of ent-gpios or unlock-gpios. Add a binding example showing the single-GPIO configuration. Signed-off-by: Rudraksha Gupta --- .../devicetree/bindings/leds/richtek,rt8515.yaml | 36 ++++++++++++++++++= +++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml b/D= ocumentation/devicetree/bindings/leds/richtek,rt8515.yaml index 0356371a6b01..820cf8c55090 100644 --- a/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +++ b/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml @@ -15,6 +15,10 @@ description: | current for each mode is defined in hardware using two resistors RFS and RTS. =20 + This driver also supports single-GPIO flash ICs that use the same + one-wire pulse-count protocol on one line for both flash and torch. + For these, only enf-gpios is required. + properties: compatible: const: richtek,rt8515 @@ -26,6 +30,14 @@ properties: ent-gpios: maxItems: 1 description: A connection to the 'ENT' (enable torch) pin. + Optional for single-GPIO flash ICs where enf-gpios is used for + both flash and torch modes. + + unlock-gpios: + maxItems: 1 + description: Optional GPIO to unlock the flash LED circuit. Some + boards use a PMIC MPP pin that must be driven high before the + flash IC will respond to the enable GPIOs. =20 richtek,rfs-ohms: minimum: 7680 @@ -81,10 +93,15 @@ properties: =20 required: - compatible - - ent-gpios - enf-gpios - led =20 +oneOf: + - required: + - ent-gpios + - required: + - unlock-gpios + additionalProperties: false =20 examples: @@ -108,4 +125,21 @@ examples: }; }; =20 + - | + /* Single-GPIO flash IC with unlock gate */ + #include + #include + + led-controller { + compatible =3D "richtek,rt8515"; + enf-gpios =3D <&tlmm 3 GPIO_ACTIVE_HIGH>; + unlock-gpios =3D <&pm8921_mpps 4 GPIO_ACTIVE_HIGH>; + + led { + function =3D LED_FUNCTION_FLASH; + color =3D ; + flash-max-timeout-us =3D <250000>; + }; + }; + ... --=20 2.53.0 From nobody Thu Apr 9 15:44:51 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 100482D12F5; Sat, 7 Mar 2026 00:58:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772845084; cv=none; b=bSFmrQcpkc+SEHr4YvyyxqGyAUyB9DkmfkPpF+EqKC21QE11diAKzZRuh13mW1xKdXreaY9QauKev/HTMh8MiT3DQhbgozYSfwSI68mrysO8jHD8+QLF8cCWVp92PykoFTxt6yHbdC9ijLtgUVO5K96Xv7xhh2h0CWjwVymCcug= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772845084; c=relaxed/simple; bh=or+7upfxppeC6I+hTgBjStuGZkwTFy3gMr85nNaSj9M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T4AglhihGrFr1wOiIEtiCxYAaIVQ/WfNHMuPSRZkILyoirYmkTJvJwXpipJsKEwVNiYr1kHaMU5GgU+bwi8v9uBwPWckNNf8Y0R71tsXzSWG8GBfX5V4cK6IDhJZbl/EAI2dpYrQ9NIjwEugGhRK0euq0UmRs3V7q43f4Hkl8SQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nO+W/4/e; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nO+W/4/e" Received: by smtp.kernel.org (Postfix) with ESMTPS id AEEE9C2BC86; Sat, 7 Mar 2026 00:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772845083; bh=or+7upfxppeC6I+hTgBjStuGZkwTFy3gMr85nNaSj9M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=nO+W/4/eHGqWDRQDTU8k+wrQ7St8Omv0QfEi/Cr4yJnNgcAWRE22voqrixJgFz+Tt wUKjI+xjJejUECWRz7TqMqNgyEa4pE9pAUG6juHqzbNxT66Imnkl6OA1r89AoSNHmN R+XJCJDysN+iY80TjH7iaOic3NVdD2dA3OEHTG04TrnkqB/pF13Ak/4KFXS6hOs0lR Q4ipD9zjqOyP0RqycVRCmiYjN/IZN6YVrjWFR3D1C+FXHriepbi4QLNySAlRhxCll9 C7kehseo5Fdi7Goks9V7XWZC+/7E//tlx9w3qoVn5ZXnv/vqDn2e6qdQP1NYEt2Fwb KaIybhJKS7YJg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0163FC9EC8; Sat, 7 Mar 2026 00:58:03 +0000 (UTC) From: Rudraksha Gupta via B4 Relay Date: Fri, 06 Mar 2026 16:58:03 -0800 Subject: [PATCH 2/3] leds: flash: rt8515: Support single-GPIO flash ICs with unlock gate Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260306-expressatt_camera_flash-v1-2-b1996f7cdfdd@gmail.com> References: <20260306-expressatt_camera_flash-v1-0-b1996f7cdfdd@gmail.com> In-Reply-To: <20260306-expressatt_camera_flash-v1-0-b1996f7cdfdd@gmail.com> To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bjorn Andersson , Konrad Dybcio Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Rudraksha Gupta X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772845083; l=3781; i=guptarud@gmail.com; s=20240916; h=from:subject:message-id; bh=eBn8zK2zm3rDt5Cq7ivsaMjK/w9HVVqK9pNgZvC1x40=; b=UGnv+rPdrIkDsaPCfH0UYYPewggp5aHqP1G8iGvesY+NLY+lLUq1qPqga3ovVhzNgVzx5sl0w SGvmYjjv2mDCarGK2PGGbQNJeXJUO0bubloizi0gW2DiVMpf0Oq6bHu X-Developer-Key: i=guptarud@gmail.com; a=ed25519; pk=ETrudRugWAtOpr0OhRiheQ1lXM4Kk4KGFnBySlKDi2I= X-Endpoint-Received: by B4 Relay for guptarud@gmail.com/20240916 with auth_id=211 X-Original-From: Rudraksha Gupta Reply-To: guptarud@gmail.com From: Rudraksha Gupta Extend the RT8515 driver to support flash ICs that use only a single GPIO for both flash and torch modes (no separate ENT pin), with an optional unlock GPIO that gates the flash circuit. Signed-off-by: Rudraksha Gupta --- drivers/leds/flash/leds-rt8515.c | 38 ++++++++++++++++++++++++++++++++----= -- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/drivers/leds/flash/leds-rt8515.c b/drivers/leds/flash/leds-rt8= 515.c index f6b439674c03..3164bf91e4c9 100644 --- a/drivers/leds/flash/leds-rt8515.c +++ b/drivers/leds/flash/leds-rt8515.c @@ -52,6 +52,7 @@ struct rt8515 { struct regulator *reg; struct gpio_desc *enable_torch; struct gpio_desc *enable_flash; + struct gpio_desc *unlock_gpio; struct timer_list powerdown_timer; u32 max_timeout; /* Flash max timeout */ int flash_max_intensity; @@ -66,7 +67,10 @@ static struct rt8515 *to_rt8515(struct led_classdev_flas= h *fled) static void rt8515_gpio_led_off(struct rt8515 *rt) { gpiod_set_value(rt->enable_flash, 0); - gpiod_set_value(rt->enable_torch, 0); + if (rt->enable_torch) + gpiod_set_value(rt->enable_torch, 0); + if (rt->unlock_gpio) + gpiod_set_value_cansleep(rt->unlock_gpio, 0); } =20 static void rt8515_gpio_brightness_commit(struct gpio_desc *gpiod, @@ -99,11 +103,19 @@ static int rt8515_led_brightness_set(struct led_classd= ev *led, /* Off */ rt8515_gpio_led_off(rt); } else if (brightness < RT8515_TORCH_MAX) { - /* Step it up to movie mode brightness using the flash pin */ - rt8515_gpio_brightness_commit(rt->enable_torch, brightness); + /* Unlock the flash circuit if needed */ + if (rt->unlock_gpio) + gpiod_set_value_cansleep(rt->unlock_gpio, 1); + /* Step it up to movie mode brightness */ + rt8515_gpio_brightness_commit(rt->enable_torch ? + rt->enable_torch : rt->enable_flash, brightness); } else { + /* Unlock the flash circuit if needed */ + if (rt->unlock_gpio) + gpiod_set_value_cansleep(rt->unlock_gpio, 1); /* Max torch brightness requested */ - gpiod_set_value(rt->enable_torch, 1); + gpiod_set_value(rt->enable_torch ? rt->enable_torch : + rt->enable_flash, 1); } =20 mutex_unlock(&rt->lock); @@ -121,6 +133,9 @@ static int rt8515_led_flash_strobe_set(struct led_class= dev_flash *fled, mutex_lock(&rt->lock); =20 if (state) { + /* Unlock the flash circuit if needed */ + if (rt->unlock_gpio) + gpiod_set_value_cansleep(rt->unlock_gpio, 1); /* Enable LED flash mode and set brightness */ rt8515_gpio_brightness_commit(rt->enable_flash, brightness); /* Set timeout */ @@ -298,12 +313,23 @@ static int rt8515_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(rt->enable_flash), "cannot get ENF (enable flash) GPIO\n"); =20 - /* ENT - Enable Torch line */ - rt->enable_torch =3D devm_gpiod_get(dev, "ent", GPIOD_OUT_LOW); + /* ENT - Enable Torch line (optional for single-GPIO flash ICs) */ + rt->enable_torch =3D devm_gpiod_get_optional(dev, "ent", GPIOD_OUT_LOW); if (IS_ERR(rt->enable_torch)) return dev_err_probe(dev, PTR_ERR(rt->enable_torch), "cannot get ENT (enable torch) GPIO\n"); =20 + /* Optional unlock GPIO (e.g. PMIC MPP to gate flash circuit) */ + rt->unlock_gpio =3D devm_gpiod_get_optional(dev, "unlock", GPIOD_OUT_LOW); + if (IS_ERR(rt->unlock_gpio)) + return dev_err_probe(dev, PTR_ERR(rt->unlock_gpio), + "cannot get unlock GPIO\n"); + + /* Exactly one of ENT or unlock must be provided */ + if (!rt->enable_torch =3D=3D !rt->unlock_gpio) + return dev_err_probe(dev, -EINVAL, + "exactly one of ent-gpios or unlock-gpios is required\n"); + child =3D device_get_next_child_node(dev, NULL); if (!child) { dev_err(dev, --=20 2.53.0 From nobody Thu Apr 9 15:44:51 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0FFA3293B5F; Sat, 7 Mar 2026 00:58:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772845084; cv=none; b=choi1jGHRpitdX3Qufabn/CU5m4V6YHjijGvfoHUCGt6zV4iuscQrbwdMARu1F+kB/exbbfGxpsEvqs13KFD855AF24Yxz2EyTMG/Di7I7ezOTtDEQFUemVGzgzEEFyGScAFmqp07JZfbs/iUEw+5qk2LKQcDewcheeknrw9Bdc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772845084; c=relaxed/simple; bh=ND57kbsJYsDJH/Ykaz8RaKMHxJbv09SilGF1X9TaUM0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cfCKoH5MVwtM6bO31oAgiaUw1zpXqGeDvhrmjZ0n3Wd94AlFdUBB02NLQWwSst/tdsnq+M++ij76bxrndmua/oHBWih4oVmfGOESH0am2DiGWZfn2JTWrKkqtJ4qVGZXJKECXQySV4U5loQ5+jP485S1e77WYQak7t2BIjMie/8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hnaPiWkb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hnaPiWkb" Received: by smtp.kernel.org (Postfix) with ESMTPS id C0FD3C2BCB5; Sat, 7 Mar 2026 00:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772845083; bh=ND57kbsJYsDJH/Ykaz8RaKMHxJbv09SilGF1X9TaUM0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=hnaPiWkbaWUD48wCZ5LaIFZENdxVWmFtPxM1sQZZCk+zVkqF6O7cI0J/VggTotznm LnN5UD3htS+lt6RO0VN+yZ1wuvwUxZehZMm6pfZFgA8IOEV/CCPONOEeCyweiRsK44 EL7b8/XHKoN9rHKmb8SYJV8BFhoNYnskzUv+Q3pQ9xTOImP9VjKdok0ioR6p87hW57 uXVy34NU3Ab8O2+U6r1n3i+yoRZmPgwAlpTprnnKBdwriPIrfZpb+jsXW6jZ75ZnQj 2K4oNfZhwUgQznPUkeWKAzND4F6EGZnrQQOUnnnAvpkPY9TvUKI77HMeh78b0MSmAj OqCdTttQyI1NQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B260DFC9EC9; Sat, 7 Mar 2026 00:58:03 +0000 (UTC) From: Rudraksha Gupta via B4 Relay Date: Fri, 06 Mar 2026 16:58:04 -0800 Subject: [PATCH 3/3] ARM: dts: qcom: msm8960: expressatt: Add camera flash Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260306-expressatt_camera_flash-v1-3-b1996f7cdfdd@gmail.com> References: <20260306-expressatt_camera_flash-v1-0-b1996f7cdfdd@gmail.com> In-Reply-To: <20260306-expressatt_camera_flash-v1-0-b1996f7cdfdd@gmail.com> To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bjorn Andersson , Konrad Dybcio Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Rudraksha Gupta X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772845083; l=2268; i=guptarud@gmail.com; s=20240916; h=from:subject:message-id; bh=m8KzHTR6SVXyCK/3SUO/rHRnAapxb/9fTcFjEI6HQ28=; b=Bqqb8k0+8JBKt2d4AiB+WtjmC335yhw4VSqawv2OtkoBfOe49d0X3+SbLdDy6RT+WEDI764qj /yXwDX//3jTC4cjAao5RbQcnoR2PNxkYTjkIHJQF/ErNwysEaJgUWxf X-Developer-Key: i=guptarud@gmail.com; a=ed25519; pk=ETrudRugWAtOpr0OhRiheQ1lXM4Kk4KGFnBySlKDi2I= X-Endpoint-Received: by B4 Relay for guptarud@gmail.com/20240916 with auth_id=211 X-Original-From: Rudraksha Gupta Reply-To: guptarud@gmail.com From: Rudraksha Gupta Add camera flash support for the Samsung Galaxy Express (expressatt). The flash IC uses a one-wire pulse-count protocol on GPIO 3, gated by PMIC MPP 4 which must be driven high to unlock the flash circuit. Downstream references: Link: https://github.com/LineageOS/android_kernel_samsung_d2/blob/stable/cm= -12.0-YNG4N/drivers/leds/Makefile#L51 Link: https://github.com/LineageOS/android_kernel_samsung_d2/blob/stable/cm= -12.0-YNG4N/arch/arm/mach-msm/board-apexq-camera.c#L591 Signed-off-by: Rudraksha Gupta Reviewed-by: David Heidelberg --- .../dts/qcom/qcom-msm8960-samsung-expressatt.dts | 31 ++++++++++++++++++= ++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts b/a= rch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts index c4b98af6955d..96460775a4ec 100644 --- a/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +++ b/arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include +#include #include =20 #include "qcom-msm8960.dtsi" @@ -61,6 +62,20 @@ touchkey_enable: touchkey-enable { regulator-boot-on; }; =20 + camera_flash: led-controller { + compatible =3D "richtek,rt8515"; + enf-gpios =3D <&tlmm 3 GPIO_ACTIVE_HIGH>; + unlock-gpios =3D <&pm8921_mpps 4 GPIO_ACTIVE_HIGH>; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&cam_flash_en>; + + led { + function =3D LED_FUNCTION_FLASH; + color =3D ; + flash-max-timeout-us =3D <250000>; + }; + }; + i2c-gpio-touchkey { compatible =3D "i2c-gpio"; #address-cells =3D <1>; @@ -247,6 +262,13 @@ touchkey_irq_pin: touchkey-irq-state { drive-strength =3D <2>; bias-disable; }; + + cam_flash_en: cam-flash-en-state { + pins =3D "gpio3"; + function =3D "gpio"; + drive-strength =3D <16>; + bias-pull-down; + }; }; =20 &pm8921 { @@ -572,3 +594,12 @@ magnetometer@2e { /* TODO: Figure out Mount Matrix */ }; }; + +&pm8921_mpps { + flash_led_unlock: flash-led-unlock-state { + pins =3D "mpp4"; + function =3D "digital"; + output-low; + power-source =3D ; + }; +}; --=20 2.53.0