2Q按键注册,麻烦帮忙看一下,注册成功没有

mach-wrtnode2q.c 中
 
>static struct gpio_keys_button wrtnode2q_gpio_keys[] __initdata = { 
{
.desc = "WPS button",
.type = EV_KEY,
.code = KEY_WPS_BUTTON,
.debounce_interval = WRTNODE2Q_KEYS_DEBOUNCE_INTERVAL,
.gpio = WRTNODE2Q_GPIO_BTN_WPS, //GPIO 13
.active_low = 1,
},
};

GPIO 13 没用于led灯,是可用的。
 
在OpenWrt系统中:
root@OpenWrt:~# modprobe gpio-button-hotplug
gpio-button-hotplug is already loaded
 
 
在  /ect/rc.button/ 下创建脚本 wps 内容为
#!/bin/sh

ifconfig > ip.txt

用排线测试GPIO13 口,先接高电平,在接低电平没反应(wps没执行)
dmesg 如下:
[    0.000000] MyLoader: sysp=5122047b, boardp=61102168, parts=cb611ec0
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[ 0.000000] SoC: Qualcomm Atheros QCA9533 ver 2 rev 0
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 08000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x07ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x07ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x00000000-0x07ffffff]
[ 0.000000] On node 0 totalpages: 32768
[ 0.000000] free_area_init_node: node 0, pgdat 80362120, node_mem_map 81000000
[ 0.000000] Normal zone: 256 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 32768 pages, LIFO batch:7
[ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
[ 0.000000] Kernel command line: board=WRTNODE2Q console=ttyS0,115200 mtdparts=spi0.0:192k(u-boot),64k(u-boot-env),64k(art),1472k(kernel),14592k(rootfs),16064k@0x50000(firmware),16384k@0x0(fullflash) rootfstype=squashfs,jffs2 noinitrd
[ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Writing ErrCtl register=00000000
[ 0.000000] Readback ErrCtl register=00000000
[ 0.000000] Memory: 125920K/131072K available (2510K kernel code, 129K rwdata, 532K rodata, 212K init, 188K bss, 5152K reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:51
[ 0.000000] Clocks: CPU:650.000MHz, DDR:391.503MHz, AHB:216.666MHz, Ref:25.000MHz
[ 0.000000] Calibrating delay loop... 432.53 BogoMIPS (lpj=2162688)
[ 0.060000] pid_max: default: 32768 minimum: 301
[ 0.060000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.070000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.080000] NET: Registered protocol family 16
[ 0.080000] MIPS: machine is WRTnode2Q board
[ 0.090000] ar724x-pci ar724x-pci.0: PCIe link is down
[ 0.090000] registering PCI controller with io_map_base unset
[ 0.100000] ar71xx: invalid MDIO id 1
[ 0.540000] PCI host bridge to bus 0000:00
[ 0.540000] pci_bus 0000:00: root bus resource [mem 0x10000000-0x11ffffff]
[ 0.550000] pci_bus 0000:00: root bus resource [io 0x0000]
[ 0.550000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[ 0.560000] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[ 0.560000] Switched to clocksource MIPS
[ 0.560000] NET: Registered protocol family 2
[ 0.570000] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.570000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.580000] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.590000] TCP: reno registered
[ 0.590000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.600000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.600000] NET: Registered protocol family 1
[ 0.610000] PCI: CLS 0 bytes, default 32
[ 0.610000] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.640000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.640000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.650000] msgmni has been set to 245
[ 0.660000] io scheduler noop registered
[ 0.660000] io scheduler deadline registered (default)
[ 0.670000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[ 0.680000] console [ttyS0] disabled
[ 0.700000] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 1562500) is a 16550A
[ 0.710000] console [ttyS0] enabled
[ 0.720000] bootconsole [early0] disabled
[ 0.730000] m25p80 spi0.0: found mx25l12805d, expected m25p80
[ 0.730000] m25p80 spi0.0: mx25l12805d (16384 Kbytes)
[ 0.740000] 7 cmdlinepart partitions found on MTD device spi0.0
[ 0.740000] Creating 7 MTD partitions on "spi0.0":
[ 0.750000] 0x000000000000-0x000000030000 : "u-boot"
[ 0.760000] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.760000] 0x000000040000-0x000000050000 : "art"
[ 0.770000] 0x000000050000-0x0000001c0000 : "kernel"
[ 0.770000] 0x0000001c0000-0x000001000000 : "rootfs"
[ 0.780000] mtd: device 4 (rootfs) set to be root filesystem
[ 0.790000] 1 squashfs-split partitions found on MTD device rootfs
[ 0.790000] 0x000000400000-0x000001000000 : "rootfs_data"
[ 0.800000] 0x000000050000-0x000001000000 : "firmware"
[ 0.800000] 0x000000000000-0x000001000000 : "fullflash"
[ 0.840000] libphy: ag71xx_mdio: probed
[ 1.430000] ag71xx-mdio.1: Found an AR934X built-in switch
[ 1.470000] eth0: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[ 2.070000] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd042, driver=Generic PHY]
[ 2.080000] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[ 2.090000] TCP: cubic registered
[ 2.090000] NET: Registered protocol family 17
[ 2.090000] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[ 2.110000] 8021q: 802.1Q VLAN Support v1.8
[ 2.120000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[ 2.130000] Freeing unused kernel memory: 212K (8037b000 - 803b0000)
[ 3.080000] init: Console is alive
[ 3.080000] init: - watchdog -
[ 4.300000] usbcore: registered new interface driver usbfs
[ 4.300000] usbcore: registered new interface driver hub
[ 4.310000] usbcore: registered new device driver usb
[ 4.330000] SCSI subsystem initialized
[ 4.340000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 4.350000] ehci-platform: EHCI generic platform driver
[ 4.350000] ehci-platform ehci-platform: EHCI Host Controller
[ 4.360000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[ 4.370000] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[ 4.390000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[ 4.390000] hub 1-0:1.0: USB hub found
[ 4.400000] hub 1-0:1.0: 1 port detected
[ 4.400000] usbcore: registered new interface driver usb-storage
[ 5.220000] init: - preinit -
[ 5.760000] random: mktemp urandom read with 9 bits of entropy available
[ 9.010000] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[ 9.050000] procd: - early -
[ 9.050000] procd: - watchdog -
[ 9.680000] procd: - ubus -
[ 10.690000] procd: - init -
[ 11.560000] NET: Registered protocol family 10
[ 11.570000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 11.580000] i2c /dev entries driver
[ 11.590000] Loading modules backported from Linux version v4.4-rc5-1913-gc8fdf68
[ 11.600000] Backport generated by backports.git backports-20151218-0-g2f58d9d
[ 11.610000] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 11.630000] nf_conntrack version 0.5.0 (1970 buckets, 7880 max)
[ 11.680000] xt_time: kernel timezone is -0000
[ 11.780000] PPP generic driver version 2.4.2
[ 11.780000] NET: Registered protocol family 24
[ 11.840000] ath: EEPROM regdomain: 0x0
[ 11.840000] ath: EEPROM indicates default country code should be used
[ 11.840000] ath: doing EEPROM country->regdmn map search
[ 11.840000] ath: country maps to regdmn code: 0x3a
[ 11.840000] ath: Country alpha2 being used: US
[ 11.840000] ath: Regpair used: 0x3a
[ 11.850000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[ 11.860000] ieee80211 phy0: Atheros AR9531 Rev:2 mem=0xb8100000, irq=47
[ 19.710000] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[ 19.720000] jffs2_build_filesystem(): unlocking the mtd device... done.
[ 19.730000] jffs2_build_filesystem(): erasing all blocks after the end marker...
[ 22.450000] device eth0 entered promiscuous mode
[ 22.500000] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[ 22.570000] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 25.010000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 25.060000] device wlan0 entered promiscuous mode
[ 26.620000] br-lan: port 2(wlan0) entered forwarding state
[ 26.630000] br-lan: port 2(wlan0) entered forwarding state
[ 26.640000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 26.650000] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[ 28.630000] br-lan: port 2(wlan0) entered forwarding state
[ 46.620000] random: nonblocking pool is initialized
[ 76.180000] done.
[ 76.180000] jffs2: notice: (945) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.

请问:button注册成功没有,  按键的测试方法对不对
 
 
 
 

 
已邀请:

xzmu - 10w

赞同来自:

要回复问题请先登录注册