diff mbox

input question: ambient light sensor button

Message ID 201311221213.49580@pali (mailing list archive)
State New, archived
Headers show

Commit Message

Pali Rohár Nov. 22, 2013, 11:13 a.m. UTC
On Wednesday 20 November 2013 16:59:42 Benjamin Tissoires wrote:
> Hi,
> 
> On Wed, Nov 20, 2013 at 9:50 AM, Pali Rohár <pali.rohar@gmail.com> 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 <pali.rohar@gmail.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
> 
> 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:

Comments

Dmitry Torokhov Nov. 26, 2013, 7:19 p.m. UTC | #1
On Fri, Nov 22, 2013 at 12:13:49PM +0100, Pali Rohár wrote:
> On Wednesday 20 November 2013 16:59:42 Benjamin Tissoires wrote:
> > Hi,
> > 
> > On Wed, Nov 20, 2013 at 9:50 AM, Pali Rohár <pali.rohar@gmail.com> 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 <pali.rohar@gmail.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
> > 
> > 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:

Applied, thank you.

> 
> 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
> 
> 
> -- 
> Pali Rohár
> pali.rohar@gmail.com
diff mbox

Patch

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