[OpenWrt-Devel] [RFC] ar71xx: add TP-Link TL-WR810N support

Jens Steinhauser jens.steinhauser at gmail.com
Sun May 1 18:05:47 EDT 2016


On 04/25/2016 10:02 PM, John Crispin wrote:
> Hi
> 
> On 10/04/2016 14:00, Jens Steinhauser wrote:
>> This patch adds support for the TP-Link TL-WR810N.
>> https://wiki.openwrt.org/toh/tp-link/tl-wr810n
>>
>> The device has a slide switch to select its mode of operation when using
>> the stock firmware. After looking at how it's implemented for similar
>> devices, I also used 'struct gpio_keys_button { .type = EV_SW, .code = BTN_... }'
>> to support the switch, but both 'switch_b0' and 'switch_b1' are missing
>> when using 'evtest' and 'thd', only the 'reset' button shows up in the
>> output of the programs.
>>
>> Changing '.code' to some SW_ value, for example SW_LID and SW_TABLET_MODE,
>> makes them usable with both 'evtest' and 'thd'. Am I missing something,
>> or is EV_SW + BTN_... an invalid combination?
> 
> i use EV_SW and KEY_RFKILL on various boards and it works well. look at
> package/base-files/files/etc/rc.button/rfkill to see how to handle the
> events in userland
> 
> 	John

Thanks for the hint, indeed the switches can be used like ordinary buttons with procd. What's missing is a way to get the initial switch state after start-up, but that seems to be a limitation of the gpio-button-hotplug driver and procd, not an error in the initialization code.

I'll resend the patch rebased onto current git.

	Jens
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list