Fix IMX PWM period setting
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): 20251030084727.4098222-1-user@jenkins
PATCH 1/1 Fix IMX PWM period setting
From: Olaf krebs <[email protected]>
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 <[email protected]>
--- drivers/pwm/pwm-imx-tpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-imx-tpm.c +1 -1
@@ -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
Quoted 3 lines · Olaf
From: Olaf krebs <[email protected]>
We use 3 PWM channels to control an RGB LED. Without this patch we get an error:
Not build-tested.
drivers/pwm/pwm-imx-tpm.c static int pwm_imx_tpm_apply_hw(struct pwm_chip *chip, · line 193
Quoted 2 lines
drivers/pwm/pwm-imx-tpm.c +1
-1-if (tpm->user_count >1 ) +if ((tpm->user_count >1 ) && (tmp->real_period !=0 ))
"tmp" vs "tpm". As there's no variable called "tmp" in this function...
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!