lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 20 Nov 2013 15:50:05 +0100
From:	Pali Rohár <pali.rohar@...il.com>
To:	Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:	Jiri Kosina <jkosina@...e.cz>, linux-kernel@...r.kernel.org,
	linux-input@...r.kernel.org
Subject: Re: input question: ambient light sensor button

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 <pali.rohar@...il.com>

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


-- 
Pali Rohár
pali.rohar@...il.com

Download attachment "signature.asc " of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ