From patchwork Wed Nov 20 14:50:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 3213351 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 806B09F26C for ; Wed, 20 Nov 2013 14:50:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 91D2720761 for ; Wed, 20 Nov 2013 14:50:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22D2620758 for ; Wed, 20 Nov 2013 14:50:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753731Ab3KTOuS (ORCPT ); Wed, 20 Nov 2013 09:50:18 -0500 Received: from mail-bk0-f42.google.com ([209.85.214.42]:64256 "EHLO mail-bk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753442Ab3KTOuL (ORCPT ); Wed, 20 Nov 2013 09:50:11 -0500 Received: by mail-bk0-f42.google.com with SMTP id w11so1283947bkz.29 for ; Wed, 20 Nov 2013 06:50:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=4tQIykvkLq99zDZzZSpPWSgnpUvobYvjlR08ozV61gQ=; b=CH17gMQ7tzOoI9fg8IFPGj+gFjBLTRhSNSa8E4J0FD6A8HqO7iG+gSB7/sdjUZ8MUC CPtTAJNtukvHoQanQUN07Cwg9Cq12Nh5S+4p8I2gWQcB6ZAQnAqcPN09f28nO1TyRwn3 cUVagiioxPFKV0ymUrtmnt1rY+KHGkUDz/A9kSuu/p6+CJPQfmLsCVc3uh1LKeaojXWE feLP3ksHdw/7JW7XGDSXEvHInbShz5NBde4kDI67Mtp6k/d/Gv/mrrSjb0Zi0YeQlRHZ 2oNODVY5TU5GbUDEFo4elTYjPSIN1K6NcApBnC6AoB9HOZrynMMz+n2VveSZ90d3qtww 3Kbg== X-Received: by 10.204.203.12 with SMTP id fg12mr3363bkb.31.1384959008443; Wed, 20 Nov 2013 06:50:08 -0800 (PST) Received: from pali-elitebook.localnet ([2001:718:1e03:a01::1ca]) by mx.google.com with ESMTPSA id l5sm23480871bko.7.2013.11.20.06.50.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Nov 2013 06:50:07 -0800 (PST) From: Pali =?utf-8?q?Roh=C3=A1r?= To: Dmitry Torokhov Subject: Re: input question: ambient light sensor button Date: Wed, 20 Nov 2013 15:50:05 +0100 User-Agent: KMail/1.13.7 (Linux/3.11.0-14-generic; KDE/4.11.2; x86_64; ; ) Cc: Jiri Kosina , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org References: <201309151553.34000@pali> <201311141302.33384@pali> <20131119212736.GA25784@core.coreip.homeip.net> In-Reply-To: <20131119212736.GA25784@core.coreip.homeip.net> MIME-Version: 1.0 Message-Id: <201311201550.05800@pali> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tuesday 19 November 2013 22:27:36 Dmitry Torokhov wrote: > On Thu, Nov 14, 2013 at 01:02:31PM +0100, Pali Rohár wrote: > > On Wednesday 13 November 2013 17:28:40 Dmitry Torokhov wrote: > > > On Wed, Nov 13, 2013 at 11:47:18AM +0100, Jiri Kosina wrote: > > > > On Sun, 15 Sep 2013, Pali Rohár wrote: > > > > > I do not know where to ask this question, but I think > > > > > that kernel developers could help me. > > > > > > > > > > I have notebook with one special button on keyboard > > > > > which is designed for turning ambient light sensor on > > > > > and off. By default pressing button do nothing (I can > > > > > turn ambient light sensor on/off via sysfs platform > > > > > wmi module). Button press is reported by kernel input > > > > > device AT Translated Set 2 keyboard and reports it as > > > > > button "touchpad off". > > > > > > > > > > Of course "touchpad off" is incorrect and I'd like to > > > > > ask which kernel key or button from > > > > > /usr/include/linux/input.h should be mapped for my > > > > > ambient light sensor button? Is there already some? > > > > > And what is strategy for allocating KEY_* and BTN_* > > > > > numbers? > > > > > > > > This is maintained by Dmitry, so he's the one to answer > > > > this. I am adding him to CC. > > > > > > I guess we need patch adding > > > > > > #define KEY_ALS_TOGGLE 0x230 > > > > > > Thanks. > > > > So there is no good key for als yet? > > No, but if you send me a patch adding it I will gladly apply > it. > > Thanks. Ok, here is patch: Add key code for ambient light sensor button More notebooks have special button for enabling/disabling ambient light sensor. This patch adding new als code to input.h header file. Signed-off-by: Pali Rohár diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index a372627..1562f10 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h @@ -719,6 +719,8 @@ struct input_keymap_entry { #define BTN_DPAD_LEFT 0x222 #define BTN_DPAD_RIGHT 0x223 +#define KEY_ALS_TOGGLE 0x230 + #define BTN_TRIGGER_HAPPY 0x2c0 #define BTN_TRIGGER_HAPPY1 0x2c0 #define BTN_TRIGGER_HAPPY2 0x2c1