Modify

Opened 4 years ago

Last modified 3 years ago

#15477 new defect

second button doesn't work - missing gpio link

Reported by: kadanss Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: packages Version: Trunk
Keywords: Cc:

Description

model: TP-LINK WR1043ND V2 on Bleeding Edge, r4038
(sticker says: TL-WR1043ND Ver 2.1)

button 'reset' works fine
button 'wps' doesn't work

also tested:
button 'wlan' doesn't work

stickers on unit say:
black button 'reset': 'WPS/Reset'
grey button: Wireless On/Off'

cfr. https://forum.openwrt.org/viewtopic.php?pid=229363#p229363

Attachments (0)

Change History (4)

comment:1 Changed 4 years ago by hnyman

I copy my comments from forum also here:

It looks to me as if the second button gets defined with a reference KEY_WLAN that has no corresponding mapping in gpio-button-hotplug. The button actions thus probably get left unhandled by the hotplug mechanism.

wr1043nd v2 buttons: https://dev.openwrt.org/browser/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v2.c#L87
gpio-button-hotplug mappings: https://dev.openwrt.org/browser/trunk/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c#L84

The first button is defined as KEY_RESTART and mapped to "reset". That is ok.
The other button is defined as KEY_WLAN, but I fail to find a mapping for it. 1043ndv2 device is the only place in Openwrt trunk sources where KEY_WLAN is mentioned (except a few brcm63xx patches).

Support for the device has been implemented by r38955 about 4 months ago, so there aren't probably that many users, yet.

As the mapping is not found, index value returned is negative, and the actions gets dropped here:
https://dev.openwrt.org/browser/trunk/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c#L251

Of the same ar71xx platform, wr1043nd v1 defines buttons as KEY_RESTART and KEY_WPS_BUTTON, which both are mapped ok. My own wndr3700 has KEY_RESTART, KEY_WPS_BUTTON and BTN_2, which all are mapped ok.

comment:2 Changed 4 years ago by anonymous

See also #15354.

comment:3 Changed 3 years ago by rlindeman@…

The root cause of the problem might be related to a recent change to the gpio_button_hotplug.c file in the package/kernel/gpio-button-hotplug/src directory. Specifically there was a #ifdef CONFIG_HOTPLUG added to the file along with an #else clause that defines a button_hotplug_event method that does nothing on GPIO button events. I believe what happened is the Makefile didn't pass along a CONFIG_HOTPLUG define to the src file during the compile step. The solution should be to either modify the Makefile to include the CONFIG_HOTPLUG definition or remove the #ifdef that was added to the file.

comment:4 Changed 3 years ago by rlindeman@…

Looks like this was solved in issue #16413.

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.