> Hi, > > On Fri, Oct 30, 2020 at 10:15:52PM +0900, Jungrae Kim wrote: > > From 23aed4567e234b7e108c31abadb9f3a3ccccf7d2 Mon Sep 17 00:00:00 2001 > > From: Jungrae Kim <jryu.kim@xxxxxxxxxxx> > > Date: Fri, 30 Oct 2020 21:23:12 +0900 > > Subject: [PATCH] Input: add SW_COVER_ATTACHED and SW_EXT_PEN_ATTACHED > > > > SW_COVER_ATTACHED represents the connected state of a removable cover > > of a device. Value 0 means cover was attached with device, value 1 means > > removed it. > > Any reason against using SW_MACHINE_COVER? That was introduced for Nokia > N900, where you actually remove the cover to access battery/SD card/ > SIM card (so there is state 0 = cover removed/open and state 1 = cover > attached/closed). > > -- Sebastian > > > SW_EXT_PEN_ATTACHED represents the state of the pen. > > Some device have internal pen slot. but other some device have external pen > > slot. These two cases has different use case in userspace. So need to > > separate a event. Value 0 means pen was detach on external pen slot on > > device, value 1 means pen was attached external pen slot on device. > > > > Signed-off-by: Jungrae Kim <jryu.kim@xxxxxxxxxxx> > > --- > > include/linux/mod_devicetable.h | 2 +- > > include/uapi/linux/input-event-codes.h | 4 +++- > > 2 files changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h > > index 5b08a473cdba..897f5a3e7721 100644 > > --- a/include/linux/mod_devicetable.h > > +++ b/include/linux/mod_devicetable.h > > @@ -320,7 +320,7 @@ struct pcmcia_device_id { > > #define INPUT_DEVICE_ID_LED_MAX 0x0f > > #define INPUT_DEVICE_ID_SND_MAX 0x07 > > #define INPUT_DEVICE_ID_FF_MAX 0x7f > > -#define INPUT_DEVICE_ID_SW_MAX 0x10 > > +#define INPUT_DEVICE_ID_SW_MAX 0x12 > > #define INPUT_DEVICE_ID_PROP_MAX 0x1f > > > > #define INPUT_DEVICE_ID_MATCH_BUS 1 > > diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h > > index ee93428ced9a..a0506369de6d 100644 > > --- a/include/uapi/linux/input-event-codes.h > > +++ b/include/uapi/linux/input-event-codes.h > > @@ -893,7 +893,9 @@ > > #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ > > #define SW_PEN_INSERTED 0x0f /* set = pen inserted */ > > #define SW_MACHINE_COVER 0x10 /* set = cover closed */ > > -#define SW_MAX 0x10 > > +#define SW_COVER_ATTACHED 0x11 /* set = cover attached */ > > +#define SW_EXT_PEN_ATTACHED 0x12 /* set = external pen attached */ > > +#define SW_MAX 0x12 > > #define SW_CNT (SW_MAX+1) > > > > /* > > -- > > 2.17.1 We need 2 kind of event, cover open/close and cover attach/detach. The open/close of the cover must work only if the cover is attached. So we will check cover open/close status using SW_MACHINE_COVER. Thanks Jungrae Kim 68,1 Bot