OK3568 4.19.206 Buildroot PWM PWM Multiplexing Method and Test
Document classification: □ Top secret □ Secret □ Internal information ■ Open
Copyright
The copyright of this manual belongs to Baoding Folinx Embedded Technology Co., Ltd. Without the written permission of our company, no organizations or individuals have the right to copy, distribute, or reproduce any part of this manual in any form, and violators will be held legally responsible.
Forlinx adheres to copyrights of all graphics and texts used in all publications in original or license-free forms.
The drivers and utilities used for the components are subject to the copyrights of the respective manufacturers. The license conditions of the respective manufacturer are to be adhered to. Related license expenses for the operating system and applications should be calculated/declared separately by the related party or its representatives.
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.


Comment out backlight.

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

