Opened 4 years ago

Last modified 3 years ago

#14136 reopened defect

hornet-ub gpio mapping for wps/reset buttons is reversed

Reported by: jrosen@… Owned by: developers
Priority: high Milestone: Barrier Breaker 14.07
Component: kernel Version: Trunk
Keywords: Cc:


I have several Alfa AP121U devices, and they gpio-button-hotplug consistently reports "BUTTON=wps" when the reset button is pressed, and "BUTTON=reset" when the WPS button is pressed. This is exactly backward.

It looks like the problem is that in source:/tags/attitude_adjustment_12.09/target/linux/ar71xx/files/arch/mips/ath79/mach-hornet-ub.c#L31, these two values should be swapped:

	#define HORNET_UB_GPIO_BTN_RESET        11
	#define HORNET_UB_GPIO_BTN_WPS          12

WPS is in fact 11, and RESET is in fact 12.

Having them swapped means that pressing the WPS button on the front of the device can induce factory reset, and the hard-to-access reset button needs to be pressed for more mundane operations.

I'm running Attitude Adjustment 12.09 on these, but the code is identical in trunk.

Attachments (2)

0001-Fix-duplicate-tickets-14136-and-15282-Hornet-UB-GPIO.patch (2.8 KB) - added by janne.cederberg@… 3 years ago.
Patch for ticket
0001-Fix-duplicate-tickets-14136-and-15282-Hornet-UB-GPIO.2.patch (2.8 KB) - added by janne.cederberg@… 3 years ago.
Git patch for ticket

Download all attachments as: .zip

Change History (7)

comment:1 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Changed 3 years ago by janne.cederberg@…

Patch for ticket

Changed 3 years ago by janne.cederberg@…

Git patch for ticket

comment:2 Changed 3 years ago by janne.cederberg@…

This ticket is a duplicate of #15282. My accident attached the patch twice and didn't find how to remove one.

Patching as suggested on #14136/#15282 will result in a situation where simply pressing the RESET button on the bottom will cause FACTORY RESET to be run. This is due to GPIO high/low state being incorrect as a result of the above change and virtually the RESET
button is in the pressed-down state the entire time. When it is then physically pressed, that causes the opposite, release, to be triggered and since to the board it seemed that the button was pressed long before it was released, the FACTORY RESET results.

The attached patch works as expected. I have verified both the incorrect functionality as well as after fixing the issue as described in the patch and flashing the resulting firmware to a Hornet-UB board.

comment:3 Changed 3 years ago by jberg

This change has been committed to trunk as of;a=commitdiff;h=beed4d82d6a0154b0cd5f7b84e2180215ace6718 and will be present in Chaos Calmer release. I've updated the corresponding GPIO info on

A big thank you / shoutout goes to jrosen for the initial research and posting this ticket! Helped a lot!

[This ticket could/should be closed but I don't have sufficient permissions to do so.]

Last edited 3 years ago by jberg (previous) (diff)

comment:4 Changed 3 years ago by rmilecki

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r44692

comment:5 Changed 3 years ago by jrosen@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

Wrong milestone?

Add Comment

Modify Ticket

as reopened .

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

Note: See TracTickets for help on using tickets.