All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51
@ 2017-02-10 17:48 Pau Espin Pedrol
  2017-02-18 16:16 ` Andy Shevchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Pau Espin Pedrol @ 2017-02-10 17:48 UTC (permalink / raw)
  To: corentin.chary, dvhart, andy
  Cc: acpi4asus-user, platform-driver-x86, linux-kernel, Pau Espin Pedrol

Otherwise those are printed several times when (un)plugging the AC
connector.

Signed-off-by: Pau Espin Pedrol <pespin.shar@gmail.com>
---
 drivers/platform/x86/eeepc-laptop.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 8cdf315f9730..9fab3ee269bb 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -150,6 +150,8 @@ static const struct key_entry eeepc_keymap[] = {
 	{ KE_KEY, 0x32, { KEY_SWITCHVIDEOMODE } },
 	{ KE_KEY, 0x37, { KEY_F13 } }, /* Disable Touchpad */
 	{ KE_KEY, 0x38, { KEY_F14 } },
+	{ KE_IGNORE, 0x50, { KEY_RESERVED } }, /* AC plugged */
+	{ KE_IGNORE, 0x51, { KEY_RESERVED } }, /* AC unplugged */
 	{ KE_END, 0 },
 };
 
-- 
2.11.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51
  2017-02-10 17:48 [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51 Pau Espin Pedrol
@ 2017-02-18 16:16 ` Andy Shevchenko
       [not found]   ` <CAEGpDuaw3uJoxbyOuTWyBodM-JgMd2hSqZUgg_wbyJa+9sJOjw@mail.gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2017-02-18 16:16 UTC (permalink / raw)
  To: Pau Espin Pedrol
  Cc: Corentin Chary, dvhart, Andy Shevchenko, acpi4asus-user,
	Platform Driver, linux-kernel

On Fri, Feb 10, 2017 at 7:48 PM, Pau Espin Pedrol <pespin.shar@gmail.com> wrote:
> Otherwise those are printed several times when (un)plugging the AC
> connector.

If we have a user space tool that supports them better not to ignore.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51
       [not found]   ` <CAEGpDuaw3uJoxbyOuTWyBodM-JgMd2hSqZUgg_wbyJa+9sJOjw@mail.gmail.com>
@ 2017-02-21 13:39     ` Pau Espin Pedrol
  2017-02-21 15:38       ` Andy Shevchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Pau Espin Pedrol @ 2017-02-21 13:39 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: andy, platform-driver-x86, Corentin Chary, linux-kernel,
	acpi4asus-user, dvhart

Hi, resending as I initially replied from my mobile phone and it seem
plain text support is not enabled:

Hi,

If we have user space tools supporting and using this type of event,
then what about adding them properly with a define + entry in the
structure array so that it can be standardized and on top get rid of
those kernel message every time I (un)plug the charger? Would that be
welcomed? I could send a new patch as specified above, adding the
KEY_CHARING_ON/OFF defines + add entries to eeepc_keymap.


> On Feb 18, 2017 17:16, "Andy Shevchenko" <andy.shevchenko@gmail.com> wrote:
>
> On Fri, Feb 10, 2017 at 7:48 PM, Pau Espin Pedrol <pespin.shar@gmail.com>
> wrote:
>> Otherwise those are printed several times when (un)plugging the AC
>> connector.
>
> If we have a user space tool that supports them better not to ignore.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51
  2017-02-21 13:39     ` Pau Espin Pedrol
@ 2017-02-21 15:38       ` Andy Shevchenko
  2017-02-23  8:36         ` Dmitry Torokhov
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2017-02-21 15:38 UTC (permalink / raw)
  To: Pau Espin Pedrol, Dmitry Torokhov
  Cc: Andy Shevchenko, Platform Driver, Corentin Chary, linux-kernel,
	acpi4asus-user, dvhart

On Tue, Feb 21, 2017 at 3:39 PM, Pau Espin Pedrol <pespin.shar@gmail.com> wrote:

> If we have user space tools supporting and using this type of event,
> then what about adding them properly with a define + entry in the
> structure array so that it can be standardized and on top get rid of
> those kernel message every time I (un)plug the charger? Would that be
> welcomed? I could send a new patch as specified above, adding the
> KEY_CHARING_ON/OFF defines + add entries to eeepc_keymap.

Please, do not top posting.

Dmitry, do we have special events for AC (un)plug? What is the best
approach in your opinion?

>> On Feb 18, 2017 17:16, "Andy Shevchenko" <andy.shevchenko@gmail.com> wrote:
>>
>> On Fri, Feb 10, 2017 at 7:48 PM, Pau Espin Pedrol <pespin.shar@gmail.com>
>> wrote:
>>> Otherwise those are printed several times when (un)plugging the AC
>>> connector.
>>
>> If we have a user space tool that supports them better not to ignore.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51
  2017-02-21 15:38       ` Andy Shevchenko
@ 2017-02-23  8:36         ` Dmitry Torokhov
  2017-02-24 13:01           ` Pau Espin Pedrol
  0 siblings, 1 reply; 12+ messages in thread
From: Dmitry Torokhov @ 2017-02-23  8:36 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Pau Espin Pedrol, Andy Shevchenko, Platform Driver,
	Corentin Chary, linux-kernel, acpi4asus-user, dvhart

On Tue, Feb 21, 2017 at 05:38:59PM +0200, Andy Shevchenko wrote:
> On Tue, Feb 21, 2017 at 3:39 PM, Pau Espin Pedrol <pespin.shar@gmail.com> wrote:
> 
> > If we have user space tools supporting and using this type of event,
> > then what about adding them properly with a define + entry in the
> > structure array so that it can be standardized and on top get rid of
> > those kernel message every time I (un)plug the charger? Would that be
> > welcomed? I could send a new patch as specified above, adding the
> > KEY_CHARING_ON/OFF defines + add entries to eeepc_keymap.
> 
> Please, do not top posting.
> 
> Dmitry, do we have special events for AC (un)plug? What is the best
> approach in your opinion?

Not route them through input as they not input events would be the best.

I'd look into hooking up power_supply class.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51
  2017-02-23  8:36         ` Dmitry Torokhov
@ 2017-02-24 13:01           ` Pau Espin Pedrol
  2017-03-01 23:18             ` Andy Shevchenko
  2017-03-07 19:27               ` Dmitry Torokhov
  0 siblings, 2 replies; 12+ messages in thread
From: Pau Espin Pedrol @ 2017-02-24 13:01 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andy Shevchenko, Andy Shevchenko, Platform Driver,
	Corentin Chary, linux-kernel, acpi4asus-user, dvhart

>> Dmitry, do we have special events for AC (un)plug? What is the best
>> approach in your opinion?
>
> Not route them through input as they not input events would be the best.
>
Is my patch good enough for this or would you recommend doing it another way?

> I'd look into hooking up power_supply class.
>
Whys is this necessay? All the related information required is already
present in my system.
I already have two power_supply instances:
* /sys/class/power_supply/AC0/ (provided by module "ac"), contains
property "online" which is correctly updated to 1 when AC is plugged
and 0 when AC is unplugged.
* /sys/class/power_supply/BAT0/ (provided by module "battery"),
contains property "status" which is correctly updated to "Charging"
when AC is plugged and "Discharging" when AC is unplugged.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51
  2017-02-24 13:01           ` Pau Espin Pedrol
@ 2017-03-01 23:18             ` Andy Shevchenko
  2017-03-07 19:27               ` Dmitry Torokhov
  1 sibling, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2017-03-01 23:18 UTC (permalink / raw)
  To: Pau Espin Pedrol
  Cc: Dmitry Torokhov, Platform Driver, Corentin Chary, linux-kernel,
	acpi4asus-user, dvhart

On Fri, Feb 24, 2017 at 3:01 PM, Pau Espin Pedrol <pespin.shar@gmail.com> wrote:
>>> Dmitry, do we have special events for AC (un)plug? What is the best
>>> approach in your opinion?
>>
>> Not route them through input as they not input events would be the best.
>>
> Is my patch good enough for this or would you recommend doing it another way?

Corentin, do you have any opinion regarding the change?

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51
  2017-02-24 13:01           ` Pau Espin Pedrol
@ 2017-03-07 19:27               ` Dmitry Torokhov
  2017-03-07 19:27               ` Dmitry Torokhov
  1 sibling, 0 replies; 12+ messages in thread
From: Dmitry Torokhov @ 2017-03-07 19:27 UTC (permalink / raw)
  To: Pau Espin Pedrol
  Cc: Andy Shevchenko, Andy Shevchenko, Platform Driver,
	Corentin Chary, linux-kernel, acpi4asus-user, dvhart

On Fri, Feb 24, 2017 at 02:01:30PM +0100, Pau Espin Pedrol wrote:
> >> Dmitry, do we have special events for AC (un)plug? What is the best
> >> approach in your opinion?
> >
> > Not route them through input as they not input events would be the best.
> >
> Is my patch good enough for this or would you recommend doing it another way?

>From input POV your patch makes sense.

> 
> > I'd look into hooking up power_supply class.
> >
> Whys is this necessay? All the related information required is already
> present in my system.
> I already have two power_supply instances:
> * /sys/class/power_supply/AC0/ (provided by module "ac"), contains
> property "online" which is correctly updated to 1 when AC is plugged
> and 0 when AC is unplugged.
> * /sys/class/power_supply/BAT0/ (provided by module "battery"),
> contains property "status" which is correctly updated to "Charging"
> when AC is plugged and "Discharging" when AC is unplugged.

If everything is already working then it is not necessary. I was
trying to say that if it does not quite work, then you shoudl look into
integrating it better with power supply subsystem, instead of trying to
shoehorn it into input.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51
@ 2017-03-07 19:27               ` Dmitry Torokhov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry Torokhov @ 2017-03-07 19:27 UTC (permalink / raw)
  To: Pau Espin Pedrol
  Cc: Andy Shevchenko, Andy Shevchenko, Platform Driver,
	Corentin Chary, linux-kernel, acpi4asus-user, dvhart

On Fri, Feb 24, 2017 at 02:01:30PM +0100, Pau Espin Pedrol wrote:
> >> Dmitry, do we have special events for AC (un)plug? What is the best
> >> approach in your opinion?
> >
> > Not route them through input as they not input events would be the best.
> >
> Is my patch good enough for this or would you recommend doing it another way?

From input POV your patch makes sense.

> 
> > I'd look into hooking up power_supply class.
> >
> Whys is this necessay? All the related information required is already
> present in my system.
> I already have two power_supply instances:
> * /sys/class/power_supply/AC0/ (provided by module "ac"), contains
> property "online" which is correctly updated to 1 when AC is plugged
> and 0 when AC is unplugged.
> * /sys/class/power_supply/BAT0/ (provided by module "battery"),
> contains property "status" which is correctly updated to "Charging"
> when AC is plugged and "Discharging" when AC is unplugged.

If everything is already working then it is not necessary. I was
trying to say that if it does not quite work, then you shoudl look into
integrating it better with power supply subsystem, instead of trying to
shoehorn it into input.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51
  2017-03-07 19:27               ` Dmitry Torokhov
  (?)
@ 2017-03-13 16:04               ` Andy Shevchenko
  2017-03-15 22:15                 ` Darren Hart
  2017-03-16 23:54                 ` Dmitry Torokhov
  -1 siblings, 2 replies; 12+ messages in thread
From: Andy Shevchenko @ 2017-03-13 16:04 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Pau Espin Pedrol, Andy Shevchenko, Platform Driver,
	Corentin Chary, linux-kernel, acpi4asus-user, dvhart

On Tue, Mar 7, 2017 at 9:27 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Fri, Feb 24, 2017 at 02:01:30PM +0100, Pau Espin Pedrol wrote:
>> >> Dmitry, do we have special events for AC (un)plug? What is the best
>> >> approach in your opinion?
>> >
>> > Not route them through input as they not input events would be the best.
>> >
>> Is my patch good enough for this or would you recommend doing it another way?
>

> From input POV your patch makes sense.

Could you give your tag?

>
>>
>> > I'd look into hooking up power_supply class.
>> >
>> Whys is this necessay? All the related information required is already
>> present in my system.
>> I already have two power_supply instances:
>> * /sys/class/power_supply/AC0/ (provided by module "ac"), contains
>> property "online" which is correctly updated to 1 when AC is plugged
>> and 0 when AC is unplugged.
>> * /sys/class/power_supply/BAT0/ (provided by module "battery"),
>> contains property "status" which is correctly updated to "Charging"
>> when AC is plugged and "Discharging" when AC is unplugged.
>
> If everything is already working then it is not necessary. I was
> trying to say that if it does not quite work, then you shoudl look into
> integrating it better with power supply subsystem, instead of trying to
> shoehorn it into input.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51
  2017-03-13 16:04               ` Andy Shevchenko
@ 2017-03-15 22:15                 ` Darren Hart
  2017-03-16 23:54                 ` Dmitry Torokhov
  1 sibling, 0 replies; 12+ messages in thread
From: Darren Hart @ 2017-03-15 22:15 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Dmitry Torokhov, Pau Espin Pedrol, Andy Shevchenko,
	Platform Driver, Corentin Chary, linux-kernel, acpi4asus-user

On Mon, Mar 13, 2017 at 06:04:42PM +0200, Andy Shevchenko wrote:
> On Tue, Mar 7, 2017 at 9:27 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > On Fri, Feb 24, 2017 at 02:01:30PM +0100, Pau Espin Pedrol wrote:
> >> >> Dmitry, do we have special events for AC (un)plug? What is the best
> >> >> approach in your opinion?
> >> >
> >> > Not route them through input as they not input events would be the best.
> >> >
> >> Is my patch good enough for this or would you recommend doing it another way?
> >
> 
> > From input POV your patch makes sense.
> 
> Could you give your tag?

Based on this discussion and no additional input from Dmitry or Corentin, and my
own review, I have queued this patch to testing. Thanks.

-- 
Darren Hart
VMware Open Source Technology Center

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51
  2017-03-13 16:04               ` Andy Shevchenko
  2017-03-15 22:15                 ` Darren Hart
@ 2017-03-16 23:54                 ` Dmitry Torokhov
  1 sibling, 0 replies; 12+ messages in thread
From: Dmitry Torokhov @ 2017-03-16 23:54 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Pau Espin Pedrol, Andy Shevchenko, Platform Driver,
	Corentin Chary, linux-kernel, acpi4asus-user, dvhart

On Mon, Mar 13, 2017 at 06:04:42PM +0200, Andy Shevchenko wrote:
> On Tue, Mar 7, 2017 at 9:27 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > On Fri, Feb 24, 2017 at 02:01:30PM +0100, Pau Espin Pedrol wrote:
> >> >> Dmitry, do we have special events for AC (un)plug? What is the best
> >> >> approach in your opinion?
> >> >
> >> > Not route them through input as they not input events would be the best.
> >> >
> >> Is my patch good enough for this or would you recommend doing it another way?
> >
> 
> > From input POV your patch makes sense.
> 
> Could you give your tag?

Sorry for the delay, I was out of service for a couple of days. I see
that Darren already picked up the patch, anyway, for the record:

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

-- 
Dmitry

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-03-16 23:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-10 17:48 [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51 Pau Espin Pedrol
2017-02-18 16:16 ` Andy Shevchenko
     [not found]   ` <CAEGpDuaw3uJoxbyOuTWyBodM-JgMd2hSqZUgg_wbyJa+9sJOjw@mail.gmail.com>
2017-02-21 13:39     ` Pau Espin Pedrol
2017-02-21 15:38       ` Andy Shevchenko
2017-02-23  8:36         ` Dmitry Torokhov
2017-02-24 13:01           ` Pau Espin Pedrol
2017-03-01 23:18             ` Andy Shevchenko
2017-03-07 19:27             ` Dmitry Torokhov
2017-03-07 19:27               ` Dmitry Torokhov
2017-03-13 16:04               ` Andy Shevchenko
2017-03-15 22:15                 ` Darren Hart
2017-03-16 23:54                 ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.