From patchwork Sun Jun 19 11:59:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Leiten X-Patchwork-Id: 9186107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A612860465 for ; Sun, 19 Jun 2016 11:59:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92D28262AE for ; Sun, 19 Jun 2016 11:59:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FC21269A3; Sun, 19 Jun 2016 11:59:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EA45262AE for ; Sun, 19 Jun 2016 11:59:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751807AbcFSL7n (ORCPT ); Sun, 19 Jun 2016 07:59:43 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35883 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbcFSL7b (ORCPT ); Sun, 19 Jun 2016 07:59:31 -0400 Received: by mail-lf0-f66.google.com with SMTP id a2so3137767lfe.3 for ; Sun, 19 Jun 2016 04:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:reply-to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=TdUmVWENOU9skd1zEOyK/1RTJRcQ0A2EpvJzdiP0mM8=; b=IcmMnpI3ujVPhEYpj6ERvpqFVOn+slaxyLkXHrPISD6385i5blp1QX8J+uWbr3KIOG 4+6riKzKYyXwR/eEbI9EX6rhDxjqN3E0KzQe6EhUsdz/m34Mu6YgkAYE5wdLQgXxwUk1 oWJX3qwYiyZ4RYRnKfjl4Y8xZiZMRtlAdQnlbTmr5ZiJ0234QMo1t0xDYeXP3MCQffOm HpfCrW/TtbsjbJzEjGch0JiF/iFQauLSNngjl9EthKk1hyWnqkohDyovqO82e584V7rq kiJHuuojWLllYO45OhVOWBZYaq2/XHELrlxgA3sEb/CZjkPE6jSPBUMFeG/s0rlzvGLm Cf2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:reply-to:subject:date:message-id :user-agent:mime-version:content-transfer-encoding; bh=TdUmVWENOU9skd1zEOyK/1RTJRcQ0A2EpvJzdiP0mM8=; b=mT8TGpAugl4+E6Afx/mWo8AOPRZJCpNL9PmeGbXE0oLg03zcm0ND9OGS9XR5iGl8rn iWxwfjxCmoC1JLufccbIkecl9LubRRMHNc1QY1vr99N6Iy+CS8fIP4fbqmy7+EPOHZv4 SM21a0raeccI0umjlyjtm7QwX1Viri/dM6SMGSexsqOcYe6gCgYi6YSpCsyJYuuwX3Hv r9Mb97n5VwFzNr69O+H5yC0n+K3+GAOEr4RDWKuD0l9n4EeILAQl2W4JUiLORCBuVsC0 6wpFx1t01qOnpaMAZ6/Z55L7suCtZ7d3fXhKu8UN+CSeDWiqsoYOIgoNtrbnPXkvke05 cIgQ== X-Gm-Message-State: ALyK8tJhSPZojpeHdlChreT2p0LUeFDIh0uOaNe1bFiLJP3EGyjARJ5xXKCXAkXnxG42eQ== X-Received: by 10.46.71.206 with SMTP id u197mr2469072lja.16.1466337569774; Sun, 19 Jun 2016 04:59:29 -0700 (PDT) Received: from nl-ubook.localnet ([134.249.130.86]) by smtp.gmail.com with ESMTPSA id 39sm4501976lja.37.2016.06.19.04.59.28 for (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2016 04:59:28 -0700 (PDT) From: Nick Leiten To: "platform-driver-x86@vger.kernel.org" Reply-To: nickleiten@gmail.com Subject: [PATCH] asus-wmi: Ambient sensor toggle key Date: Sun, 19 Jun 2016 14:59:26 +0300 Message-ID: <9711814.jjoeah4X4e@nl-ubook> User-Agent: KMail/5.2.1 (Linux/4.6.0-THOR; KDE/5.22.0; x86_64; ; ) MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, here is little patch for Fn+A key assignment in asus-nb-wmi.c file so userspace can control ALS (ambient light sensor) on/off state. As I can see mentions in Internet Asus makes 0x7a code in all their laptops to be assigned to Toggle ALS. Tested on Asus U38N. Signed-off-by: Nick Leiten Reviewed-By: Corentin Chary --- To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -Npru a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c --- linux-4.6-orig/drivers/platform/x86/asus-nb-wmi.c 2016-05-16 01:43:13.000000000 +0300 +++ linux-4.6-diff/drivers/platform/x86/asus-nb-wmi.c 2016-06-06 07:00:27.000000000 +0300 @@ -356,6 +356,7 @@ static const struct key_entry asus_nb_wm { KE_KEY, 0x67, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV */ { KE_KEY, 0x6B, { KEY_TOUCHPAD_TOGGLE } }, { KE_IGNORE, 0x6E, }, /* Low Battery notification */ + { KE_KEY, 0x7a, { KEY_ALS_TOGGLE } }, /* Ambient Light Sensor Toggle, Fn+A*/ { KE_KEY, 0x7D, { KEY_BLUETOOTH } }, /* Bluetooth Enable */ { KE_KEY, 0x7E, { KEY_BLUETOOTH } }, /* Bluetooth Disable */ { KE_KEY, 0x82, { KEY_CAMERA } },