OK3568 4.19.206 Buildroot PWM PWM Multiplexing Method and Test

Document classification: □ Top secret □ Secret □ Internal information ■ Open

PWM Multiplexing Method and Test

This method causes the LVDS screen to not work properly.

Turn off the PWM multiplexing function

To modify the device tree file:

/OK3568-linux-source/kernel/arch/arm64/boot/dts/rockchip/OK3568-C-common.dtsi

Comment out LVDS _ backlight nodes.

Image

Image

Comment out backlight.

Image

Compile the kernel input./build. sh kernel command.

forlinx@ubuntu:~/linux-3568/OK3568-linux-release/./build.sh kernel

Single-step flash /OK 3568-linux-release/kernel/boot.img files to the development board.

PWM user state operation interface/sys/class/PWM.

If several PWMs are set in the device tree, several corresponding PWM chipNs will be generated in the/sys/class/PWM directory.

Bring up the PWM subdirectory.

echo 0 > /sys/class/pwm/pwmchip2/export

Turn off the PWM subdirectory.

echo 0 > /sys/class/pwm/pwmchip2/unexport

Pin level normal or flipped.

echo normal> /sys/class/pwm/pwmchip2/pwm0/polarity

Frequency * period = 1, calculate the frequency.

Set the PWM period in ns.

echo 50000 > /sys/class/pwm/pwmchip2/pwm0/period

Set the PWM duty cycle in ns.

echo 10000 > /sys/class/pwm/pwmchip2/pwm0/duty_cycle

Enable PWM.

echo 1 > /sys/class/pwm/pwmchip2/pwm0/enable

Turn off the PWM.

echo 0 > /sys/class/pwm/pwmchip2/pwm0/enable

Image

Image