AnsweredAssumed Answered

PWM Buzzer doesn't work with Kernel 4.14

Question asked by Erich Schmidt on Mar 7, 2019
Latest reply on Mar 25, 2019 by Erich Schmidt

Hello to all,

i configured pwm1 with linux kernel 3.14.38 and my pwm buzzer works. I try to upgrade the kernel to 4.14.101 and take the same device tree configuration. I've connected the pin to an oscilloscope. When I turn on the buzzer, however, no frequency is generated. As a gpio the pin generates a signal. Is it possible that the driver for the pwm has a bug?

 

 

defconfig

 

CONFIG_PWM=y
CONFIG_PWM_IMX=y
CONFIG_PWM_SYSFS=y

 


Freescale part of the device tree (imx6ul.dtsi)

 

pwm1: pwm@02080000 {
compatible = "fsl,imx6ul-pwm", "fsl,imx27-pwm";
reg = <0x02080000 0x4000>;
interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks IMX6UL_CLK_PWM1>,
<&clks IMX6UL_CLK_PWM1>;
clock-names = "ipg", "per";
#pwm-cells = <2>;
status = "disabled";
};

 


My device tree extension

 

&iomuxc {
pinctrl_pwm1: pwm1grp {
fsl,pin = <
MX6UL_PAD_GPIO1_IO08__PWM1_OUT 0x110b0
>;
};
}

&pwm1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm1>;
status = "okay";
};

 


cat /sys/kernel/debug/pwm gives:

 

platform/2080000.pwm, 1 PWM device
pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: normal

 

 

I export and configure the with:


echo 0 > /sys/class/pwm/pwmchip0/export
echo 190000 > /sys/class/pwm/pwmchip0/pwm0/
echo 190000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable

 

 

After that cat /sys/kernel/debug/pwm gives

 

platform/2080000.pwm, 1 PWM device
pwm-0 (sysfs ): requested enabled period: 250000 ns duty: 190000 ns polarity: normal

Outcomes