From nobody Mon Apr 6 16:47:46 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 124B83E2768; Wed, 18 Mar 2026 18:34:40 +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=1773858881; cv=none; b=B4Fq4MVEepNtN3UikJHwVwnkhplWitKIe/BfK78QTItqIYCv53jJ58HkLiIOTrcjTT8CyQsbIB053Jn3JTO5UJpMCJqj58uIUH9jVh76tixO+u10XQnXdzmYTX/nXq17YBDnnwxt7y/8p/LUAKF3dj2VJiFxPnugrbrTv9ZEcSs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773858881; c=relaxed/simple; bh=YaxvqjXUbTIlCH1GcpZj8fDciQKdM5QgRWnTBclQAxo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jqZ15xgupeNtaYIHpDIvCsQN42WRY2waqj1jyRKF/G/KoK4yYqXU4pjnYpi2MdkvjewGXt2DcFioQ2URT8fK/CB2icxexVjKkkY9RHtKjBkMT8mTeSeb8DKC+2BRFPfhBQ9awCc7rEsoov5DA7+6ShNPqzJN4sNuLCvpEYmdoXA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OiuYDGWz; 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="OiuYDGWz" Received: by smtp.kernel.org (Postfix) with ESMTPS id BEFDCC2BCB0; Wed, 18 Mar 2026 18:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773858880; bh=YaxvqjXUbTIlCH1GcpZj8fDciQKdM5QgRWnTBclQAxo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=OiuYDGWzsYHCOQp9q/RxlFn2b2djhbfMvK6/JPdNnbRbR4BpUeoDSfUbB0Zg7LqMS gH7wNMEkE+XZ44SSoPDBlVc5Kc8179BY+Ly2Nav6x1hdf3o9Au7W6REFO34fkgqsRG bC/z7ktXhWOGssnEBNdoOA/VxxyCRy5B9mdK2CZ4Li/xw9Qy6rzBfCdMBF+jr20tsf h+hdasaTBDy3KTMZpYfrrXLH0Y2YVAk/EgitAkIIiMZ/zHnsj2rm3cHJTrt2gpNUh6 kXtT2NeR61TYLF1Eloi46M4nxK9bPW204OU7vgqXvI/njG2T8x52IYihxVRfNqwfn8 KwHe8f2MoNApQ== 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 AD73B1077603; Wed, 18 Mar 2026 18:34:40 +0000 (UTC) From: Rudraksha Gupta via B4 Relay Date: Wed, 18 Mar 2026 11:34:39 -0700 Subject: [PATCH v2 1/3] dt-bindings: leds: rt8515: Support single-GPIO flash ICs with vin supply 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: <20260318-expressatt_camera_flash-v2-1-5c2b9a623dcb@gmail.com> References: <20260318-expressatt_camera_flash-v2-0-5c2b9a623dcb@gmail.com> In-Reply-To: <20260318-expressatt_camera_flash-v2-0-5c2b9a623dcb@gmail.com> To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, phone-devel@vger.kernel.org, Rudraksha Gupta X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773858880; l=2584; i=guptarud@gmail.com; s=20240916; h=from:subject:message-id; bh=yYBJe6glHiFbQLkK5n9J7m92+K8p9p43uhZGLgoNsMM=; b=Gp/YsGw4bT4jw0F3LRRkfz6ZLTUgtXtlwLgkWu5Vzo/7QPJj7on2BoFyAOCBR1Th+QRl0IRAd 5rWUm1ewBakCkrbYSyhoqFx+fSHyE6+ZQoSZKhRhAlrOcVjIJBLmJl1 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 enable line for both flash and torch modes, plus an optional input voltage supply (e.g. a GPIO-controlled fixed regulator) that gates power to the chip. Make ent-gpios optional and add a vin-supply property to support these variants. Add a oneOf constraint requiring exactly one of ent-gpios or vin-supply. Add a binding example showing the single-GPIO configuration with an input supply. Signed-off-by: Rudraksha Gupta Acked-by: Conor Dooley Reviewed-by: Linus Walleij --- .../devicetree/bindings/leds/richtek,rt8515.yaml | 34 ++++++++++++++++++= +++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml b/D= ocumentation/devicetree/bindings/leds/richtek,rt8515.yaml index 0356371a6b01..ab3c5139132c 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 + Some flash ICs use the same one-wire pulse-count protocol but have + only a single enable line for both flash and torch modes. For these + single-channel variants, only enf-gpios is needed. + properties: compatible: const: richtek,rt8515 @@ -26,6 +30,11 @@ properties: ent-gpios: maxItems: 1 description: A connection to the 'ENT' (enable torch) pin. + Not present on single-channel flash ICs that use only one enable + line for both flash and torch modes. + + vin-supply: + description: Optional input supply for the flash IC. =20 richtek,rfs-ohms: minimum: 7680 @@ -81,10 +90,15 @@ properties: =20 required: - compatible - - ent-gpios - enf-gpios - led =20 +oneOf: + - required: + - ent-gpios + - required: + - vin-supply + additionalProperties: false =20 examples: @@ -108,4 +122,22 @@ examples: }; }; =20 + - | + /* Single-channel flash IC with input supply */ + #include + #include + + led-controller { + compatible =3D "richtek,rt8515"; + enf-gpios =3D <&tlmm 3 GPIO_ACTIVE_HIGH>; + vin-supply =3D <&flash_reg>; + richtek,rfs-ohms =3D <16000>; + + led { + function =3D LED_FUNCTION_FLASH; + color =3D ; + flash-max-timeout-us =3D <250000>; + }; + }; + ... --=20 2.53.0 From nobody Mon Apr 6 16:47:46 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 1238D3E2741; Wed, 18 Mar 2026 18:34:41 +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=1773858881; cv=none; b=N7cwYQbIjIq5B6jJhpaOwyDycYZiAnTqoWbhboqjzsXAVRYYcNO9KZQRCHPv6jKacZ7FHuQ7sWvJdiGp5HMC8YjqDdFvmq2UqVJt8bMKnTWfQFgQBEEen+xdN9YC3FlGOTqCPoveAt3voXraVpJxVY69LV0oH3+GSGQNNbB8vt4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773858881; c=relaxed/simple; bh=E7tnsMC7ZepUXd/Uiotk8REsBsDrkzUH/mRdAkea3ww=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LsBE6zOAZTjsupkbHKYKWNZzlPkHIimdLqtHWNfJzZtanUKHClVWb8Tandj4DVyFLoRfYMnviYlVGaRTi2xf0QzIgiBzsCTBnBKlOn8/dXVRl8ZZH4peEnjY9T/soNrbeHLfBaLmbpKxAoQY9Ef5LEgpQc8P2GWV1eqPEIdPA5U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dxSAA0vB; 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="dxSAA0vB" Received: by smtp.kernel.org (Postfix) with ESMTPS id CC972C2BCAF; Wed, 18 Mar 2026 18:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773858880; bh=E7tnsMC7ZepUXd/Uiotk8REsBsDrkzUH/mRdAkea3ww=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=dxSAA0vBy9WSZvkuaf73yNSg+kI9lqJudHxJIYlfPbA3ds7c5hVKV7b9SH3whZ/y5 PSAn0R7mvPQbEhPn3uMZo4z0rPCnDflGjWRu/+xtwNYDuIH2VWiHpAY/Ko4BlVYiyD 7rX2lRySlisYmARvkjw5wSCMWvzEpNbvhx+TG5FZ3iXhFO8Ri9AYsvR/1BMsfi9ik3 yDt5l0SOxBOt1MqTjEsNk7kET3z7MFLqcEEIOeTauA2FDirybIH9aobnju+YTwdViC A3onfMCmqWF0pXu86UZaPzOec9grYBuQIJ6uAbLqFvurHnQ+AurOEeV0HxZzNIC6Y3 0dXYupyNTtabg== 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 BCB591077605; Wed, 18 Mar 2026 18:34:40 +0000 (UTC) From: Rudraksha Gupta via B4 Relay Date: Wed, 18 Mar 2026 11:34:40 -0700 Subject: [PATCH v2 2/3] leds: flash: rt8515: Support single-GPIO flash ICs with vin supply 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: <20260318-expressatt_camera_flash-v2-2-5c2b9a623dcb@gmail.com> References: <20260318-expressatt_camera_flash-v2-0-5c2b9a623dcb@gmail.com> In-Reply-To: <20260318-expressatt_camera_flash-v2-0-5c2b9a623dcb@gmail.com> To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, phone-devel@vger.kernel.org, Rudraksha Gupta X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773858880; l=5198; i=guptarud@gmail.com; s=20240916; h=from:subject:message-id; bh=PKRvCMK0VSbCQ3Z9MBD1bkA0UDBR/q3Gb0zyNbKdvRE=; b=MQbNxOMteq4Y3zoIYZ+ythyp8RsNJ2IshduHMf9mzkPG0sMd3jUjq/ybA754Z1jwsX1+ANo6j 7eJq3o73ZClBiAr+JxcRNpLmcMfmkMGXrMy7WnV41fbgygRSbwbhtP4 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 vin regulator that gates power to the flash IC. When vin-supply is provided, the driver enables the regulator before activating the LED and disables it when turning off. Make ent-gpios optional and validate at probe time that exactly one of ent-gpios or vin-supply is provided. When ent-gpios is absent, the driver uses enf-gpios for both flash and torch brightness control. Signed-off-by: Rudraksha Gupta --- drivers/leds/flash/leds-rt8515.c | 64 +++++++++++++++++++++++++++++++++++-= ---- 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/drivers/leds/flash/leds-rt8515.c b/drivers/leds/flash/leds-rt8= 515.c index f6b439674c03..69cfd5cba921 100644 --- a/drivers/leds/flash/leds-rt8515.c +++ b/drivers/leds/flash/leds-rt8515.c @@ -50,6 +50,7 @@ struct rt8515 { struct v4l2_flash *v4l2_flash; struct mutex lock; struct regulator *reg; + bool reg_enabled; struct gpio_desc *enable_torch; struct gpio_desc *enable_flash; struct timer_list powerdown_timer; @@ -66,7 +67,12 @@ 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->reg && rt->reg_enabled) { + regulator_disable(rt->reg); + rt->reg_enabled =3D false; + } } =20 static void rt8515_gpio_brightness_commit(struct gpio_desc *gpiod, @@ -92,6 +98,7 @@ static int rt8515_led_brightness_set(struct led_classdev = *led, { struct led_classdev_flash *fled =3D lcdev_to_flcdev(led); struct rt8515 *rt =3D to_rt8515(fled); + int ret =3D 0; =20 mutex_lock(&rt->lock); =20 @@ -99,16 +106,33 @@ 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); + /* Enable the vin regulator if needed */ + if (rt->reg && !rt->reg_enabled) { + ret =3D regulator_enable(rt->reg); + if (ret) + goto out; + rt->reg_enabled =3D true; + } + /* Step it up to movie mode brightness */ + rt8515_gpio_brightness_commit(rt->enable_torch ? + rt->enable_torch : rt->enable_flash, brightness); } else { + /* Enable the vin regulator if needed */ + if (rt->reg && !rt->reg_enabled) { + ret =3D regulator_enable(rt->reg); + if (ret) + goto out; + rt->reg_enabled =3D true; + } /* 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 +out: mutex_unlock(&rt->lock); =20 - return 0; + return ret; } =20 static int rt8515_led_flash_strobe_set(struct led_classdev_flash *fled, @@ -117,10 +141,18 @@ static int rt8515_led_flash_strobe_set(struct led_cla= ssdev_flash *fled, struct rt8515 *rt =3D to_rt8515(fled); struct led_flash_setting *timeout =3D &fled->timeout; int brightness =3D rt->flash_max_intensity; + int ret =3D 0; =20 mutex_lock(&rt->lock); =20 if (state) { + /* Enable the vin regulator if needed */ + if (rt->reg && !rt->reg_enabled) { + ret =3D regulator_enable(rt->reg); + if (ret) + goto out; + rt->reg_enabled =3D true; + } /* Enable LED flash mode and set brightness */ rt8515_gpio_brightness_commit(rt->enable_flash, brightness); /* Set timeout */ @@ -135,9 +167,10 @@ static int rt8515_led_flash_strobe_set(struct led_clas= sdev_flash *fled, fled->led_cdev.brightness =3D LED_OFF; /* After this the torch LED will be disabled */ =20 +out: mutex_unlock(&rt->lock); =20 - return 0; + return ret; } =20 static int rt8515_led_flash_strobe_get(struct led_classdev_flash *fled, @@ -298,12 +331,27 @@ 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 VIN supply (e.g. GPIO-controlled fixed regulator) */ + rt->reg =3D devm_regulator_get_optional(dev, "vin"); + if (IS_ERR(rt->reg)) { + if (PTR_ERR(rt->reg) =3D=3D -ENODEV) + rt->reg =3D NULL; + else + return dev_err_probe(dev, PTR_ERR(rt->reg), + "failed to get vin supply\n"); + } + + /* Exactly one of ENT or VIN must be provided */ + if (!rt->enable_torch =3D=3D !rt->reg) + return dev_err_probe(dev, -EINVAL, + "exactly one of ent-gpios or vin-supply is required\n"); + child =3D device_get_next_child_node(dev, NULL); if (!child) { dev_err(dev, --=20 2.53.0 From nobody Mon Apr 6 16:47:46 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 122F83E123D; Wed, 18 Mar 2026 18:34:41 +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=1773858881; cv=none; b=CqoTsQEw+4SkRt0gKg0T/YmwB2TaUueAprHJczZx+fT8MlsijufOaE6rLXXGagNk1Q/IbPK/yUNMqpXfl27rMP/UbaxHl4UNJsjhrocQ4eWeglDuGssd30zpQaVPv8TVfZupCmtWgNTM8xEgJKnYnhgTP1yWA//cGTmM9xbJxMI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773858881; c=relaxed/simple; bh=zFPpzhrUFYFmNF065283+r2lfoF7K9r9raXNq+AD6Kc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G6IOAjWKaoSCAnQi4TDOiiyXk99TPfNmWITG8WrMf5DlNtTSWpxI0SL7kF3c0wYJjxK+zinQwajODUCBrKqOJGHWUu2Bb+6K6/KvT2QQb/A694Pu2Cv/uneOiYh0cmBJKkM9cIFDBbB72ynnqywIVAX8R4vi6xRXZlOSn79GE7I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=h8NGOrV2; 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="h8NGOrV2" Received: by smtp.kernel.org (Postfix) with ESMTPS id D360FC2BCB5; Wed, 18 Mar 2026 18:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773858880; bh=zFPpzhrUFYFmNF065283+r2lfoF7K9r9raXNq+AD6Kc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=h8NGOrV2xGhyhP6YQwxfniQqgibl19W6Luyp8ewrMUWGIAExPEDG6a3BfMNPjGROz vZIrcAWxw3n5oHX+67NdQeTA3R6q57tQgYrxwk4/iGlQEtcB1fvs+ClfrhYEetigEc T1e2FAb5KSsZwiDeCeDj0wuqXkTTEvVgyQSrzTRX2iays61Qfn+yN5wZW2a4Lz19YM 1CSNLSf7i/FSZMHgnEDKfQJPOtjVMU+uWxG902FlvoZR0MMHhrRPoVXX0fK8/BRoQh v63hIQvqNE4wryASJR5BYXKCAtzDkGnpKIoqT4E5loc1UbFne5WiKM1f/KaXqLLo5n 3r4yB6iOhxqXQ== 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 CA4371077608; Wed, 18 Mar 2026 18:34:40 +0000 (UTC) From: Rudraksha Gupta via B4 Relay Date: Wed, 18 Mar 2026 11:34:41 -0700 Subject: [PATCH v2 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: <20260318-expressatt_camera_flash-v2-3-5c2b9a623dcb@gmail.com> References: <20260318-expressatt_camera_flash-v2-0-5c2b9a623dcb@gmail.com> In-Reply-To: <20260318-expressatt_camera_flash-v2-0-5c2b9a623dcb@gmail.com> To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, phone-devel@vger.kernel.org, Rudraksha Gupta , David Heidelberg X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773858880; l=2751; i=guptarud@gmail.com; s=20240916; h=from:subject:message-id; bh=azmf77v4SGAT8Qy3s0ldETd0CQ8M86C+x8906RvCaTA=; b=6W4N4Z/M2J271yx81scr++OgMBIh65qYQhPNRv+4WahF9Ol2dd2zT2Rh+tVyY8NVYrH9eEwKu eTB7LrYhv7tCxn7EGgbN2ffH8pUsHbcuncooOOUdPgfqgkwce8AyZ+Y 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, powered by a GPIO-controlled fixed regulator on PMIC MPP 4. The regulator is modeled as a regulator-fixed node and supplied to the flash IC via vin-supply. 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 Reviewed-by: David Heidelberg Signed-off-by: Rudraksha Gupta --- .../dts/qcom/qcom-msm8960-samsung-expressatt.dts | 43 ++++++++++++++++++= ++++ 1 file changed, 43 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..ad5169a60937 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,32 @@ touchkey_enable: touchkey-enable { regulator-boot-on; }; =20 + flash_gpio_reg: regulator-flash { + compatible =3D "regulator-fixed"; + regulator-name =3D "flash_led_en"; + regulator-min-microvolt =3D <3300000>; + regulator-max-microvolt =3D <3300000>; + gpio =3D <&pm8921_mpps 4 GPIO_ACTIVE_HIGH>; + enable-active-high; + pinctrl-0 =3D <&flash_led_unlock>; + pinctrl-names =3D "default"; + }; + + camera_flash: led-controller { + compatible =3D "richtek,rt8515"; + enf-gpios =3D <&tlmm 3 GPIO_ACTIVE_HIGH>; + vin-supply =3D <&flash_gpio_reg>; + richtek,rfs-ohms =3D <16000>; + pinctrl-0 =3D <&cam_flash_en>; + pinctrl-names =3D "default"; + + 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 +274,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 +606,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