From: "Krebs, Olaf" <Olaf.Krebs@emh-metering.com>
To: "Uwe Kleine-König" <ukleinek@kernel.org>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"open list:PWM SUBSYSTEM" <linux-pwm@vger.kernel.org>,
"open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<imx@lists.linux.dev>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
"open list" <linux-kernel@vger.kernel.org>
Subject: [PATCH] Fix IMX PWM period setting
Date: Thu, 30 Oct 2025 08:51:20 +0000 [thread overview]
Message-ID: <c26fde7dff3a41ff9f7e6c97e2a31801@emh-metering.com> (raw)
In-Reply-To: <20251030084727.4098222-1-user@jenkins>
From: Olaf krebs <olaf.krebs@emh-metering.com>
We use 3 PWM channels to control an RGB LED. Without this patch we get an error:
[ 7.395326] leds_pwm_multicolor led-controller: error -EBUSY: failed to set led PWM value for (null)
[ 7.405167] leds_pwm_multicolor led-controller: probe with driver leds_pwm_multicolor failed with error -16
Our DTS-Config for an imx93-Board:
...
led-controller {
compatible = "pwm-leds-multicolor";
multi-led {
label = "RGBled";
color = <LED_COLOR_ID_RGB>;
function = LED_FUNCTION_INDICATOR;
max-brightness = <255>;
led-red {
pwms = <&tpm5 0 1000000 PWM_POLARITY_INVERTED>;
color = <LED_COLOR_ID_RED>;
};
led-green {
pwms = <&tpm6 2 1000000 PWM_POLARITY_INVERTED>;
color = <LED_COLOR_ID_GREEN>;
};
led-blue {
pwms = <&tpm5 1 1000000 PWM_POLARITY_INVERTED>;
color = <LED_COLOR_ID_BLUE>;
};
};
};
...
Signed-off-by: Olaf krebs <olaf.krebs@emh-metering.com>
---
drivers/pwm/pwm-imx-tpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pwm/pwm-imx-tpm.c b/drivers/pwm/pwm-imx-tpm.c index 5b399de16d60..82db43f56da8 100644
--- a/drivers/pwm/pwm-imx-tpm.c
+++ b/drivers/pwm/pwm-imx-tpm.c
@@ -190,7 +190,7 @@ static int pwm_imx_tpm_apply_hw(struct pwm_chip *chip,
* there are multiple channels in use with different
* period settings.
*/
- if (tpm->user_count > 1)
+ if ((tpm->user_count > 1) && (tmp->real_period != 0))
return -EBUSY;
val = readl(tpm->base + PWM_IMX_TPM_SC);
--
2.43.0
next parent reply other threads:[~2025-10-30 8:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20251030084727.4098222-1-user@jenkins>
2025-10-30 8:51 ` Krebs, Olaf [this message]
2025-10-30 10:40 ` Russell King (Oracle)
[not found] <20251030114641.4109598-1-user@jenkins>
2025-10-30 11:53 ` Krebs, Olaf
2025-10-30 17:13 ` Uwe Kleine-König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c26fde7dff3a41ff9f7e6c97e2a31801@emh-metering.com \
--to=olaf.krebs@emh-metering.com \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=ukleinek@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®