搜索
bottom↓
回复: 2

rk3288使用gpio-keys.c,系统里找不到gpio-keys,求助

[复制链接]

出0入0汤圆

发表于 2017-12-28 18:21:16 | 显示全部楼层 |阅读模式
本帖最后由 thy110 于 2017-12-28 18:33 编辑

我参照晚上移植按键的教程,直接在设备树下面添加gpio口信息,然后make menuconfig ,添加按键模块,然后编译烧录,
  1. gpio_keys {
  2.                         compatible = "gpio-keys";
  3.                         #address-cells = <1>;
  4.                         #size-cells = <0>;
  5.                         autorepeat;
  6.                         button@1 {
  7.                                 label = "Key1";
  8.                                 linux,code = <49>;
  9.                                 gpios = <&gpio8 GPIO_A0 GPIO_ACTIVE_LOW>;
  10.                         };
  11.                         button@2 {
  12.                                 label = "Key2";
  13.                                 linux,code = <50>;
  14.                                 gpios = <&gpio8 GPIO_A1 GPIO_ACTIVE_LOW>;
  15.                         };
  16.                        
  17.                         button@3 {
  18.                                 label = "Key3";
  19.                                 linux,code = <51>;
  20.                                 gpios = <&gpio8 GPIO_A2 GPIO_ACTIVE_LOW>;
  21.                         };
  22.                        
  23.                         button@4 {
  24.                                 label = "Key4";
  25.                                 linux,code = <52>;
  26.                                 gpios = <&gpio8 GPIO_A3 GPIO_ACTIVE_LOW>;
  27.                         };
  28.                        
  29.                         button@5 {
  30.                                 label = "Key5";
  31.                                 linux,code = <53>;
  32.                                 gpios = <&gpio8 GPIO_A4 GPIO_ACTIVE_LOW>;
  33.                         };
  34.                        
  35.                         button@6 {
  36.                                 label = "Key6";
  37.                                 linux,code = <54>;
  38.                                 gpios = <&gpio6 GPIO_A0 GPIO_ACTIVE_LOW>;
  39.                         };
  40.                        
  41.                         button@7 {
  42.                                 label = "Key7";
  43.                                 linux,code = <55>;
  44.                                 gpios = <&gpio6 GPIO_A1 GPIO_ACTIVE_LOW>;
  45.                         };
  46.                        
  47.                         button@8 {
  48.                                 label = "Key8";
  49.                                 linux,code = <56>;
  50.                                 gpios = <&gpio6 GPIO_A2 GPIO_ACTIVE_LOW>;
  51.                         };
  52.                        
  53.                         button@9 {
  54.                                 label = "Key9";
  55.                                 linux,code = <57>;
  56.                                 gpios = <&gpio6 GPIO_A3 GPIO_ACTIVE_LOW>;
  57.                         };
  58.                        
  59.                         button@10 {
  60.                                 label = "Key10";
  61.                                 linux,code = <58>;
  62.                                 gpios = <&gpio6 GPIO_A4 GPIO_ACTIVE_LOW>;
  63.                         };
  64.                        
  65.                         button@11 {
  66.                                 label = "Key11";
  67.                                 linux,code = <59>;
  68.                                 gpios = <&gpio2 GPIO_A0 GPIO_ACTIVE_LOW>;
  69.                         };
  70.                        
  71.                         button@12 {
  72.                                 label = "Key12";
  73.                                 linux,code = <60>;
  74.                                 gpios = <&gpio2 GPIO_A1 GPIO_ACTIVE_LOW>;
  75.                         };
  76.                         button@13 {
  77.                                 label = "Key13";
  78.                                 linux,code = <61>;
  79.                                 gpios = <&gpio2 GPIO_A2 GPIO_ACTIVE_LOW>;
  80.                         };
  81.                         button@14 {
  82.                                 label = "Key14";
  83.                                 linux,code = <62>;
  84.                                 gpios = <&gpio2 GPIO_A3 GPIO_ACTIVE_LOW>;
  85.                         };
  86.                         button@15 {
  87.                                 label = "Key15";
  88.                                 linux,code = <63>;
  89.                                 gpios = <&gpio2 GPIO_A4 GPIO_ACTIVE_LOW>;
  90.                         };
  91.                         button@16 {
  92.                                 label = "Key16";
  93.                                 linux,code = <64>;
  94.                                 gpios = <&gpio2 GPIO_A5 GPIO_ACTIVE_LOW>;
  95.                         };
  96.                         };
复制代码


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

 楼主| 发表于 2017-12-28 18:34:15 | 显示全部楼层
好吧,解决了,GPIO还要在pinctrl初始化一下

出0入0汤圆

发表于 2017-12-28 18:41:43 来自手机 | 显示全部楼层
用什么开发板,能不能推荐一下,也想玩下RK的芯片
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-5-6 06:28

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表