From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756159AbdCGT1S (ORCPT ); Tue, 7 Mar 2017 14:27:18 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33568 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755737AbdCGT1P (ORCPT ); Tue, 7 Mar 2017 14:27:15 -0500 Date: Tue, 7 Mar 2017 11:27:01 -0800 From: Dmitry Torokhov To: Pau Espin Pedrol Cc: Andy Shevchenko , Andy Shevchenko , Platform Driver , Corentin Chary , "linux-kernel@vger.kernel.org" , acpi4asus-user , "dvhart@infradead.org" Subject: Re: [PATCH] eeepc-laptop: Skip unknown key messages 0x50 0x51 Message-ID: <20170307192701.GG13740@dtor-ws> References: <20170210174837.1078-1-pespin.shar@gmail.com> <20170223083631.GE18639@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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