From patchwork Fri Nov 22 11:13:49 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: 3222131 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CCED2C045B for ; Fri, 22 Nov 2013 11:13:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BB586204CF for ; Fri, 22 Nov 2013 11:13:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3C2120798 for ; Fri, 22 Nov 2013 11:13:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752132Ab3KVLNx (ORCPT ); Fri, 22 Nov 2013 06:13:53 -0500 Received: from mail-bk0-f48.google.com ([209.85.214.48]:61434 "EHLO mail-bk0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751956Ab3KVLNx (ORCPT ); Fri, 22 Nov 2013 06:13:53 -0500 Received: by mail-bk0-f48.google.com with SMTP id v10so737421bkz.7 for ; Fri, 22 Nov 2013 03:13:51 -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=WuoL7ZxGfZQHY3OoNvge+IzNYu9kLjlTJZlQxPjaU5U=; b=EchlWo3vkqNKhhlIjTBynHKyh/DH88qiScL7XHNqGDIlT46jlzl5SSwJz8M7CfRAg1 xLoCf7y1QnFh9xpBU0y/yZpoiMKz2Q+0C7oVk+GqrdC31m8sE2L0Eo4AczGbVKJ/dvra iMX623207YR2DvxwtrLfMjTiFNWCWIOCJleCcAyFipBMalDsdk3mtoxJOu3bjaF/d6/I fiYXuLcEzj+fWFXgketXxAcwcbAXcvoDQxqwZIhnimIQ1SEToAcCr6jS6FJdJ1XXg4TU Lc+fuOGbJaI+Y79V6vrF0hZWLXo75xJ1KCf2jlC/Qf78FZB+GpPMICgWzYNzANC6uiox OKDQ== X-Received: by 10.205.10.132 with SMTP id pa4mr9276980bkb.15.1385118831369; Fri, 22 Nov 2013 03:13:51 -0800 (PST) Received: from pali-elitebook.localnet ([2001:718:1e03:a01::1ca]) by mx.google.com with ESMTPSA id t2sm31614740bkh.3.2013.11.22.03.13.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Nov 2013 03:13:50 -0800 (PST) From: Pali =?utf-8?q?Roh=C3=A1r?= To: Benjamin Tissoires , Dmitry Torokhov Subject: Re: input question: ambient light sensor button Date: Fri, 22 Nov 2013 12:13:49 +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" References: <201309151553.34000@pali> <201311201550.05800@pali> In-Reply-To: MIME-Version: 1.0 Message-Id: <201311221213.49580@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=ham 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 Wednesday 20 November 2013 16:59:42 Benjamin Tissoires wrote: > Hi, > > On Wed, Nov 20, 2013 at 9:50 AM, Pali Rohár wrote: > >> > > 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 > > Could you just add a comment explaining that ALS is ambiant > light sensor? Otherwise, I'm sure someone else will use this > event code for an other thing... :) > > Cheers, > Benjamin Ok, here is new diff with comment: diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index a372627..7bacdb5 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 /* Ambient light sensor */ + #define BTN_TRIGGER_HAPPY 0x2c0 #define BTN_TRIGGER_HAPPY1 0x2c0 #define BTN_TRIGGER_HAPPY2 0x2c1