* [PATCH v3 0/2] leds: rgb: lpg: Don't enable TRILED when configuring PWM
@ 2025-11-19 6:06 Fenglin Wu via B4 Relay
2025-11-19 6:06 ` [PATCH v3 1/2] dt-bindings: leds: qcom-lpg: Explain standalone PWM usage Fenglin Wu via B4 Relay
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Fenglin Wu via B4 Relay @ 2025-11-19 6:06 UTC (permalink / raw)
To: kernel, Lee Jones, Pavel Machek, Marijn Suijten, Bjorn Andersson,
linux-arm-msm, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Subbaraman Narayanamurthy, Pavel Machek, linux-leds, linux-kernel,
devicetree, Fenglin Wu
The LPG channel can be used for only outputting PWM signal without the
need to enable TRILED. Update the DT binding document to explain that
usage and remove the TRILED enabling register write in the driver for
that use case.
Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
---
Changes in v3:
- Add a DT binding change to clarify the standalone PWM usage according
to the suggestion from Bjorn.
- Link to v2: https://lore.kernel.org/r/20251118-lpg_triled_fix-v2-1-6d1e5831333f@oss.qualcomm.com
Changes in v2:
- Check "chan->in_use" flag in lpg_pwm_apply() is not correct, as it
indicates the channel is being used as a LED and this PWM API would
never get called. Instead, remove the code line which enables TRILED
in lpg_pwm_apply() and update the commit text to explain it clearly.
- Link to v1: https://lore.kernel.org/r/20251114-lpg_triled_fix-v1-1-9b239832c53c@oss.qualcomm.com
---
Fenglin Wu (2):
dt-bindings: leds: qcom-lpg: Explain standalone PWM usage
leds: rgb: leds-qcom-lpg: Don't enable TRILED when configuring PWM
Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 5 +++++
drivers/leds/rgb/leds-qcom-lpg.c | 4 +---
2 files changed, 6 insertions(+), 3 deletions(-)
---
base-commit: ea1c4c7e648d1ca91577071fc42fdc219521098c
change-id: 20251114-lpg_triled_fix-44491b49b340
Best regards,
--
Fenglin Wu <fenglin.wu@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3 1/2] dt-bindings: leds: qcom-lpg: Explain standalone PWM usage
2025-11-19 6:06 [PATCH v3 0/2] leds: rgb: lpg: Don't enable TRILED when configuring PWM Fenglin Wu via B4 Relay
@ 2025-11-19 6:06 ` Fenglin Wu via B4 Relay
2025-11-19 21:51 ` Bjorn Andersson
2025-11-20 16:13 ` Rob Herring
2025-11-19 6:06 ` [PATCH v3 2/2] leds: rgb: leds-qcom-lpg: Don't enable TRILED when configuring PWM Fenglin Wu via B4 Relay
2025-11-20 15:25 ` [PATCH v3 0/2] leds: rgb: lpg: " Lee Jones
2 siblings, 2 replies; 7+ messages in thread
From: Fenglin Wu via B4 Relay @ 2025-11-19 6:06 UTC (permalink / raw)
To: kernel, Lee Jones, Pavel Machek, Marijn Suijten, Bjorn Andersson,
linux-arm-msm, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Subbaraman Narayanamurthy, Pavel Machek, linux-leds, linux-kernel,
devicetree, Fenglin Wu
From: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
LPG channels can be used for only outputting PWM signals by routing to
PMIC GPIOs without enabling TRILED. Explain this usage in the description
for better clarity.
Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
---
Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
index 841a0229c472a4764426d25d9dbb900adc20fc11..c4b7e57b251845a6970b34bc9ae0c00647b1bf96 100644
--- a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
+++ b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
@@ -13,6 +13,11 @@ description: >
The Qualcomm Light Pulse Generator consists of three different hardware blocks;
a ramp generator with lookup table (LUT), the light pulse generator and a three
channel current sink. These blocks are found in a wide range of Qualcomm PMICs.
+ The light pulse generator (LPG) can also be used independently to output PWM
+ signal for standard PWM applications. In this scenario, the LPG output should
+ be routed to a specific PMIC GPIO by setting the GPIO pin mux to the special
+ functions indicated in the datasheet, the TRILED driver for the channel will
+ not be enabled in this configuration.
properties:
compatible:
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v3 2/2] leds: rgb: leds-qcom-lpg: Don't enable TRILED when configuring PWM
2025-11-19 6:06 [PATCH v3 0/2] leds: rgb: lpg: Don't enable TRILED when configuring PWM Fenglin Wu via B4 Relay
2025-11-19 6:06 ` [PATCH v3 1/2] dt-bindings: leds: qcom-lpg: Explain standalone PWM usage Fenglin Wu via B4 Relay
@ 2025-11-19 6:06 ` Fenglin Wu via B4 Relay
2025-11-19 21:52 ` Bjorn Andersson
2025-11-20 15:25 ` [PATCH v3 0/2] leds: rgb: lpg: " Lee Jones
2 siblings, 1 reply; 7+ messages in thread
From: Fenglin Wu via B4 Relay @ 2025-11-19 6:06 UTC (permalink / raw)
To: kernel, Lee Jones, Pavel Machek, Marijn Suijten, Bjorn Andersson,
linux-arm-msm, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Subbaraman Narayanamurthy, Pavel Machek, linux-leds, linux-kernel,
devicetree, Fenglin Wu
From: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
The PWM signal from the LPG channel can be routed to PMIC GPIOs with
proper GPIO configuration, and it is not necessary to enable the
TRILED channel in that case. This also applies to the LPG channels
that mapped to TRILED channels. Additionally, enabling the TRILED
channel unnecessarily would cause a voltage increase in its power
supply. Hence remove it.
Fixes: 24e2d05d1b68 ("leds: Add driver for Qualcomm LPG")
Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
---
drivers/leds/rgb/leds-qcom-lpg.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
index 4f2a178e3d265a2cc88e651d3e2ca6ae3dfac2e2..e197f548cddb03d079c54c4a0f402402c5d047e2 100644
--- a/drivers/leds/rgb/leds-qcom-lpg.c
+++ b/drivers/leds/rgb/leds-qcom-lpg.c
@@ -2,7 +2,7 @@
/*
* Copyright (c) 2017-2022 Linaro Ltd
* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
- * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#include <linux/bits.h>
#include <linux/bitfield.h>
@@ -1247,8 +1247,6 @@ static int lpg_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
lpg_apply(chan);
- triled_set(lpg, chan->triled_mask, chan->enabled ? chan->triled_mask : 0);
-
out_unlock:
mutex_unlock(&lpg->lock);
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v3 1/2] dt-bindings: leds: qcom-lpg: Explain standalone PWM usage
2025-11-19 6:06 ` [PATCH v3 1/2] dt-bindings: leds: qcom-lpg: Explain standalone PWM usage Fenglin Wu via B4 Relay
@ 2025-11-19 21:51 ` Bjorn Andersson
2025-11-20 16:13 ` Rob Herring
1 sibling, 0 replies; 7+ messages in thread
From: Bjorn Andersson @ 2025-11-19 21:51 UTC (permalink / raw)
To: fenglin.wu
Cc: kernel, Lee Jones, Pavel Machek, Marijn Suijten, linux-arm-msm,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Subbaraman Narayanamurthy, Pavel Machek, linux-leds, linux-kernel,
devicetree
On Wed, Nov 19, 2025 at 02:06:42PM +0800, Fenglin Wu via B4 Relay wrote:
> From: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
>
> LPG channels can be used for only outputting PWM signals by routing to
> PMIC GPIOs without enabling TRILED. Explain this usage in the description
> for better clarity.
>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
> Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
> ---
> Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
> index 841a0229c472a4764426d25d9dbb900adc20fc11..c4b7e57b251845a6970b34bc9ae0c00647b1bf96 100644
> --- a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
> +++ b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
> @@ -13,6 +13,11 @@ description: >
> The Qualcomm Light Pulse Generator consists of three different hardware blocks;
> a ramp generator with lookup table (LUT), the light pulse generator and a three
> channel current sink. These blocks are found in a wide range of Qualcomm PMICs.
> + The light pulse generator (LPG) can also be used independently to output PWM
> + signal for standard PWM applications. In this scenario, the LPG output should
> + be routed to a specific PMIC GPIO by setting the GPIO pin mux to the special
> + functions indicated in the datasheet, the TRILED driver for the channel will
> + not be enabled in this configuration.
>
> properties:
> compatible:
>
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/2] leds: rgb: leds-qcom-lpg: Don't enable TRILED when configuring PWM
2025-11-19 6:06 ` [PATCH v3 2/2] leds: rgb: leds-qcom-lpg: Don't enable TRILED when configuring PWM Fenglin Wu via B4 Relay
@ 2025-11-19 21:52 ` Bjorn Andersson
0 siblings, 0 replies; 7+ messages in thread
From: Bjorn Andersson @ 2025-11-19 21:52 UTC (permalink / raw)
To: fenglin.wu
Cc: kernel, Lee Jones, Pavel Machek, Marijn Suijten, linux-arm-msm,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Subbaraman Narayanamurthy, Pavel Machek, linux-leds, linux-kernel,
devicetree
On Wed, Nov 19, 2025 at 02:06:43PM +0800, Fenglin Wu via B4 Relay wrote:
> From: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
>
> The PWM signal from the LPG channel can be routed to PMIC GPIOs with
> proper GPIO configuration, and it is not necessary to enable the
> TRILED channel in that case. This also applies to the LPG channels
> that mapped to TRILED channels. Additionally, enabling the TRILED
> channel unnecessarily would cause a voltage increase in its power
> supply. Hence remove it.
>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
> Fixes: 24e2d05d1b68 ("leds: Add driver for Qualcomm LPG")
> Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
> ---
> drivers/leds/rgb/leds-qcom-lpg.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c
> index 4f2a178e3d265a2cc88e651d3e2ca6ae3dfac2e2..e197f548cddb03d079c54c4a0f402402c5d047e2 100644
> --- a/drivers/leds/rgb/leds-qcom-lpg.c
> +++ b/drivers/leds/rgb/leds-qcom-lpg.c
> @@ -2,7 +2,7 @@
> /*
> * Copyright (c) 2017-2022 Linaro Ltd
> * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
> - * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved.
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> */
> #include <linux/bits.h>
> #include <linux/bitfield.h>
> @@ -1247,8 +1247,6 @@ static int lpg_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
>
> lpg_apply(chan);
>
> - triled_set(lpg, chan->triled_mask, chan->enabled ? chan->triled_mask : 0);
> -
> out_unlock:
> mutex_unlock(&lpg->lock);
>
>
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 0/2] leds: rgb: lpg: Don't enable TRILED when configuring PWM
2025-11-19 6:06 [PATCH v3 0/2] leds: rgb: lpg: Don't enable TRILED when configuring PWM Fenglin Wu via B4 Relay
2025-11-19 6:06 ` [PATCH v3 1/2] dt-bindings: leds: qcom-lpg: Explain standalone PWM usage Fenglin Wu via B4 Relay
2025-11-19 6:06 ` [PATCH v3 2/2] leds: rgb: leds-qcom-lpg: Don't enable TRILED when configuring PWM Fenglin Wu via B4 Relay
@ 2025-11-20 15:25 ` Lee Jones
2 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2025-11-20 15:25 UTC (permalink / raw)
To: kernel, Lee Jones, Pavel Machek, Marijn Suijten, Bjorn Andersson,
linux-arm-msm, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Fenglin Wu
Cc: Subbaraman Narayanamurthy, Pavel Machek, linux-leds, linux-kernel,
devicetree
On Wed, 19 Nov 2025 14:06:41 +0800, Fenglin Wu wrote:
> The LPG channel can be used for only outputting PWM signal without the
> need to enable TRILED. Update the DT binding document to explain that
> usage and remove the TRILED enabling register write in the driver for
> that use case.
>
>
Applied, thanks!
[1/2] dt-bindings: leds: qcom-lpg: Explain standalone PWM usage
commit: 5d390e7a02e850a995ee25248292d4be61314078
[2/2] leds: rgb: leds-qcom-lpg: Don't enable TRILED when configuring PWM
commit: 072cd5f458d76b9e15d89ebdaea8b5cb1312eeef
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 1/2] dt-bindings: leds: qcom-lpg: Explain standalone PWM usage
2025-11-19 6:06 ` [PATCH v3 1/2] dt-bindings: leds: qcom-lpg: Explain standalone PWM usage Fenglin Wu via B4 Relay
2025-11-19 21:51 ` Bjorn Andersson
@ 2025-11-20 16:13 ` Rob Herring
1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2025-11-20 16:13 UTC (permalink / raw)
To: Fenglin Wu
Cc: kernel, Lee Jones, Pavel Machek, Marijn Suijten, Bjorn Andersson,
linux-arm-msm, Krzysztof Kozlowski, Conor Dooley,
Subbaraman Narayanamurthy, Pavel Machek, linux-leds, linux-kernel,
devicetree
On Wed, Nov 19, 2025 at 02:06:42PM +0800, Fenglin Wu wrote:
> LPG channels can be used for only outputting PWM signals by routing to
> PMIC GPIOs without enabling TRILED. Explain this usage in the description
> for better clarity.
>
> Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
> ---
> Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
> index 841a0229c472a4764426d25d9dbb900adc20fc11..c4b7e57b251845a6970b34bc9ae0c00647b1bf96 100644
> --- a/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
> +++ b/Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml
> @@ -13,6 +13,11 @@ description: >
> The Qualcomm Light Pulse Generator consists of three different hardware blocks;
> a ramp generator with lookup table (LUT), the light pulse generator and a three
> channel current sink. These blocks are found in a wide range of Qualcomm PMICs.
> + The light pulse generator (LPG) can also be used independently to output PWM
Is this a separate paragraph or the same paragraph? The former needs a
blank line.
Acked-by: Rob Herring (Arm) <robh@kernel.org>
> + signal for standard PWM applications. In this scenario, the LPG output should
> + be routed to a specific PMIC GPIO by setting the GPIO pin mux to the special
> + functions indicated in the datasheet, the TRILED driver for the channel will
> + not be enabled in this configuration.
>
> properties:
> compatible:
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-11-20 16:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19 6:06 [PATCH v3 0/2] leds: rgb: lpg: Don't enable TRILED when configuring PWM Fenglin Wu via B4 Relay
2025-11-19 6:06 ` [PATCH v3 1/2] dt-bindings: leds: qcom-lpg: Explain standalone PWM usage Fenglin Wu via B4 Relay
2025-11-19 21:51 ` Bjorn Andersson
2025-11-20 16:13 ` Rob Herring
2025-11-19 6:06 ` [PATCH v3 2/2] leds: rgb: leds-qcom-lpg: Don't enable TRILED when configuring PWM Fenglin Wu via B4 Relay
2025-11-19 21:52 ` Bjorn Andersson
2025-11-20 15:25 ` [PATCH v3 0/2] leds: rgb: lpg: " Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).