|
RK3399 PWM3 的使用
发表于 2019-11-28 11:11:46
浏览:17529
|
回复:15
打印
只看该作者
[复制链接]
楼主
本帖最后由 jpchen 于 2019-12-16 11:58 编辑
在Firefly 中RK3399系列,我们选择AIO-3399C(AI) 机器,有一路PWM3是用做红外遥控的功能,但是如果用成普通的PWM功能改如何修改呢?其实比较简单,把dts里面配置PWM3红外的相关信息删除,然后在rk3399-firefly-demo.dtsi 里面设置pwm_id 为3,state设置
- --- a/kernel/arch/arm64/boot/dts/rockchip/rk3399-firefly-demo.dtsi
- +++ b/kernel/arch/arm64/boot/dts/rockchip/rk3399-firefly-demo.dtsi
- @@ -57,9 +57,9 @@
- };
-
- pwm_demo: pwm_demo {
- - status = "disabled";
- + status = "okay";
- compatible = "firefly,rk3399-pwm";
- - pwm_id = <1>;
- + pwm_id = <3>;
- min_period = <0>;
- max_period = <10000>;
- duty_ns = <5000>;
- --- a/kernel/arch/arm64/boot/dts/rockchip/rk3399-firefly-port.dtsi
- +++ b/kernel/arch/arm64/boot/dts/rockchip/rk3399-firefly-port.dtsi
- @@ -306,32 +306,10 @@
-
- };
-
- +
- &pwm3 {
- status = "okay";
- - interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH 0>;
- - compatible = "rockchip,remotectl-pwm";
- - remote_pwm_id = <3>;
- - handle_cpu_id = <0>;
- - remote_support_psci = <1>;
- -
- - ir_key1{
- - rockchip,usercode = <0xff00>;
- - rockchip,key_table =
- - <0xeb KEY_POWER>,
- - <0xec KEY_MENU>,
- - <0xfe KEY_BACK>,
- - <0xb7 KEY_HOME>,
- - <0xa3 KEY_WWW>,
- - <0xf4 KEY_VOLUMEUP>,
- - <0xa7 KEY_VOLUMEDOWN>,
- - <0xf8 KEY_REPLY>,
- - <0xfc KEY_UP>,
- - <0xfd KEY_DOWN>,
- - <0xf1 KEY_LEFT>,
- - <0xe5 KEY_RIGHT>;
- - };
- };
复制代码
同时,我们可以cat节点看到对应pwm的信息
- rk3399_firefly_aioc_ai_lvds_box:/ # cat sys/kernel/debug/pwm
- platform/ff420030.pwm, 1 PWM device
- pwm-0 (firefly-pwm ): requested enabled period: 10003 ns duty: 4991 ns polarity: inverse
- platform/ff420020.pwm, 1 PWM device
- pwm-0 (vdd-log ): requested enabled period: 24997 ns duty: 16485 ns polarity: inverse
- platform/ff420010.pwm, 1 PWM device
- pwm-0 ((null) ): period: 0 ns duty: 0 ns polarity: inverse
- platform/ff420000.pwm, 1 PWM device
- pwm-0 (backlight ): requested enabled period: 24997 ns duty: 13524 ns polarity: inverse
复制代码 结果如图所示
|
|