Skip to contentSkip to conversation

eeepc-laptop: Skip unknown key messages 0x50 0x51

PATCH In review Pau Espin Pedrol 4 participants 11 messages Feb 10, 2017 – Mar 16, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eeepc-laptop: Skip unknown key messages 0x50 0x51

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

---
 drivers/platform/x86/eeepc-laptop.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/x86/eeepc-laptop.c +2 -0
index 8cdf315f9730..9fab3ee269bb 100644
@@ -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 },
 };
 
Signature · 1 line
2.11.1
#1 lore raw
Quoted 2 lines · Pau Espin Pedrol

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.

Signature · 2 lines
With Best Regards,
Andy Shevchenko

A message that is not in the archive (sent off-list or not yet received): CAEGpDuaw3uJoxbyOuTWyBodM-JgMd2hSqZUgg_wbyJa+9sJOjw@mail.gmail.com

#3 lore raw

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.

Quoted 14 lines · Andy Shevchenko
Quoted 2 lines · Pau Espin Pedrol

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

#4 lore raw
Quoted 6 lines · Pau Espin Pedrol

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?

Quoted 8 lines
Quoted 8 lines · Andy Shevchenko
Quoted 2 lines · Pau Espin Pedrol

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.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#5 lore raw
Quoted 9 lines · Andy Shevchenko
Quoted 6 lines · Pau Espin Pedrol

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.

Quoted 4 lines

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.

Signature · 1 line
Dmitry
#6 lore raw
Quoted 5 lines
Quoted 2 lines

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?

Quoted 2 lines

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.

#7 lore raw
Quoted 6 lines · Pau Espin Pedrol
Quoted 5 lines
Quoted 2 lines

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?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#8 lore raw
In reply to Pau Espin Pedrol
Quoted 6 lines · Pau Espin Pedrol
Quoted 5 lines
Quoted 2 lines

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.

Quoted 12 lines
Quoted 3 lines

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.

Signature · 1 line
Dmitry
#9 lore raw
Quoted 10 lines · Dmitry Torokhov
Quoted 6 lines · Pau Espin Pedrol
Quoted 5 lines
Quoted 2 lines

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?

Quoted 18 lines
Quoted 4 lines
Quoted 4 lines

I'd look into hooking up power_supply class.

Quoted 9 lines

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.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#10 lore raw
Quoted 6 lines · Andy Shevchenko
Quoted 4 lines · Dmitry Torokhov
Quoted 3 lines · Pau Espin Pedrol
Quoted 3 lines
Quoted 2 lines

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

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

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.

Signature · 2 lines
Darren Hart
VMware Open Source Technology Center
#11 lore raw
In reply to Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
Quoted 4 lines · Dmitry Torokhov
Quoted 3 lines · Pau Espin Pedrol
Quoted 3 lines
Quoted 2 lines

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

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

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:

Signature · 1 line
Dmitry