I am trying to get a pwm signal on gpio 1 1 for an i.MX7s processor. Here is my device tree configuration but I see nothing on the pin. Any help would be greatly appreciated.
/ {
pwm-leds {
compatible = "pwm-leds";
pwm_led1 {
label = "pwm_led1";
pwms = <&pwm1 0 100000 50000>;
max-brightness = <255>;
};
};
};
&pwm1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm_led1>;
status = "okay";
};
&iomuxc {
pinctrl_pwm_led1: pwm_led1 {
fsl,pins = <
MX7D_PAD_LPSR_GPIO1_IO01__PWM1_OUT 0x14
>;
};
};
Hi,
Thank you for your interest in NXP Semiconductor products,
Please change the driver according to this document.
Also, this solution provided by a colleague may help debug this issue.
Regards
I updated the line from: compatible = "pwm-leds";
to: compatible = "fsl,imx7d-pwm";
but I still have no pwm signal on the pin,
Hi,
You can base on 7d-sdb device tree,
pwm1: pwm@30660000 {
compatible = "fsl,imx7d-pwm", "fsl,imx27-pwm";
reg = <0x30660000 0x10000>;
interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX7D_PWM1_ROOT_CLK>,
<&clks IMX7D_PWM1_ROOT_CLK>;
clock-names = "ipg", "per";
#pwm-cells = <3>;
status = "disabled";
};
...
&pwm1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm1>;
status = "okay";
};
...
- backlight: backlight {
- compatible = "pwm-backlight";
- pwms = <&pwm1 0 5000000 0>;
- brightness-levels = <0 4 8 16 32 64 128 255>;
- default-brightness-level = <6>;
- status = "okay";
- };
I reproduced in 8mp-evk with the device tree,
pwm1: pwm@30660000 {
compatible = "fsl,imx8mp-pwm", "fsl,imx27-pwm";
reg = <0x30660000 0x10000>;
interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MP_CLK_PWM1_ROOT>,
<&clk IMX8MP_CLK_PWM1_ROOT>;
clock-names = "ipg", "per";
#pwm-cells = <3>;
status = "disabled";
};
...
&pwm1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm1>;
status = "okay";
};
And these steps from the post I mentioned,
root@imx8mpevk:~# cat /sys/class/pwm/pwmchip0/npwm
1
root@imx8mpevk:~# echo 0 > /sys/class/pwm/pwmchip0/export
root@imx8mpevk:~# ls /sys/class/pwm/pwmchip0/pwm0/
capture duty_cycle enable period polarity power uevent
root@imx8mpevk:~# echo 10000 > /sys/class/pwm/pwmchip0/pwm0/period
root@imx8mpevk:~# echo 2000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
root@imx8mpevk:~# echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
Regards,