From patchwork Thu Feb 22 22:11:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Cieslakiewicz X-Patchwork-Id: 876849 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=wp.pl header.i=@wp.pl header.b="AHioV6f/"; dkim-atps=neutral Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3znTB46N5cz9sX5 for ; Fri, 23 Feb 2018 09:12:39 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 7DC30B8038F; Thu, 22 Feb 2018 23:12:32 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Thu, 22 Feb 2018 23:12:32 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id E7D18B80192 for ; Thu, 22 Feb 2018 23:12:30 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .wp. - helo: .mx3. - helo-domain: .mx3.) FROM/MX_MATCHES_NOT_HELO(DOMAIN)=1; rate: -4 Received: from mx3.wp.pl (mx3.wp.pl [212.77.101.9]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 22 Feb 2018 23:12:30 +0100 (CET) Received: (wp-smtpd smtp.wp.pl 10857 invoked from network); 22 Feb 2018 23:12:28 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1519337548; bh=r4SE9cZ2dB619LDYNDeQuquIZo9GXq5DOR90ZCDs46A=; h=From:To:Subject; b=AHioV6f/h1dSBKjsluWbm/Y1k9nSRYT2DgSCpAJNo5sOowmRAJo2rs+yPU+U9HUE0 Fzddqp/+mTdJ0xjNxfweaYAHyGU6ffbAAOSq5R2NmGcVfcV346DO8JuNKF+I9s5fK3 v44tJY7xTe0XXLL9rFoS80yohUF8xSvRrrDD7Xg8= Received: from 89-71-105-244.dynamic.chello.pl (HELO kosmio.komorska) (michal.cieslakiewicz@wp.pl@[89.71.105.244]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 22 Feb 2018 23:12:28 +0100 Date: Thu, 22 Feb 2018 23:11:08 +0100 From: Michal To: "openwrt-devel@lists.openwrt.org" Message-ID: <20180222231108.24a63cb9@kosmio.komorska> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-slackware-linux-gnu) MIME-Version: 1.0 X-WP-MailID: 877e115333d294278d13a903cf55ff12 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 000000A [AeMU] Subject: [OpenWrt-Devel] [LEDE-DEV] [PATCH] ar71xx: WNDR3700: enable RFKILL function for Wifi button X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Wifi button for WNDR3700 dual band routers has been renamed to "rfkill" and its emitted keycode changed to KEY_RFKILL. This allows OpenWrt/LEDE to support it 'out of the box' without additional tweaking. Until this patch, button had been sending BTN_2 keycode which was ignored by default (no action script present). To get expected behaviour of switching radios on and off, user had to manually rename/link 'rfkill' script to name 'BTN_2' in /etc/rc.button directory. This patch follows similar changes for other Netgear ar71xx routers, for example WNR2000v3. It applies cleanly to both latest trunk and 17.01 branch. Tested on WNDR3700v1. Signed-off-by: Michal Cieslakiewicz --- target/linux/ar71xx/files/arch/mips/ath79/mach-wndr3700.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wndr3700.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wndr3700.c index 1315bab037..b9132fc363 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wndr3700.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wndr3700.c @@ -33,7 +33,7 @@ #define WNDR3700_GPIO_BTN_WPS 3 #define WNDR3700_GPIO_BTN_RESET 8 -#define WNDR3700_GPIO_BTN_WIFI 11 +#define WNDR3700_GPIO_BTN_RFKILL 11 #define WNDR3700_GPIO_RTL8366_SDA 5 #define WNDR3700_GPIO_RTL8366_SCK 7 @@ -89,11 +89,11 @@ static struct gpio_keys_button wndr3700_gpio_keys[] __initdata = { .gpio = WNDR3700_GPIO_BTN_WPS, .active_low = 1, }, { - .desc = "wifi", + .desc = "rfkill", .type = EV_KEY, - .code = BTN_2, + .code = KEY_RFKILL, .debounce_interval = WNDR3700_KEYS_DEBOUNCE_INTERVAL, - .gpio = WNDR3700_GPIO_BTN_WIFI, + .gpio = WNDR3700_GPIO_BTN_RFKILL, .active_low = 1, } };