RK3399+Android7.1.2 添加HOME和返回键

这两天在研究rk3399跑Android7.1.2系统,自己添加HOME和返回键。

研究linux或者Android驱动移植一直秉承自下向上的研究

首先硬件,Android7.1.2HOME和返回键已经可以脱离实体硬件,用虚拟按键充当了。

设备树目录 Android_Src_Path/kernel/arch/arm64/boot/dts/rockchip/

rk3399-android.dtsi中定义了HOME,BACK等按键。可以看到power键是实体按键,HOME,返回,MENU键没有实体按键。

 /*rk3399-android.dtsi文件部分内容*/

    rk_key: rockchip-key {
        compatible = "rockchip,key";
        status = "okay";

        io-channels = <&saradc 1>;

        vol-up-key {
            linux,code = <113>;
            label = "volume up";
            rockchip,adc_value = <1>;
        };

        vol-down-key {
            linux,code = <114>;
            label = "volume down";
            rockchip,adc_value = <170>;
        };

        power-key {
            gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
            linux,code = <116>;
            label = "power";
            gpio-key,wakeup;
        };

        menu-key {
            linux,code = <59>;
            label = "menu";
            rockchip,adc_value = <746>;
        };
      home-key {
            linux,code = <102>;
            label = "home";
            rockchip,adc_value = <355>;
        };

        back-key {
            linux,code = <158>;
            label = "back";
            rockchip,adc_value = <560>;
        };

        camera-key {
            linux,code = <212>;
            label = "camera";
            rockchip,adc_value = <450>;
        };
    };

 

你可能感兴趣的:(Android,Framework)