lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1632152.oGNe5Yk2uo@pebbles>
Date:   Fri, 8 Dec 2017 21:33:29 +0100
From:   Stefan Brüns <stefan.bruens@...h-aachen.de>
To:     Darren Hart <dvhart@...radead.org>
CC:     <platform-driver-x86@...r.kernel.org>,
        <linux-input@...r.kernel.org>,
        AceLan Kao <acelan.kao@...onical.com>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Andy Shevchenko <andy@...radead.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/5] platform/x86: intel-vbtn: Support separate press/release events

On Friday, November 10, 2017 3:15:55 AM CET Darren Hart wrote:
> On Thu, Nov 09, 2017 at 11:44:33PM +0100, Stefan Brüns wrote:
> > Currently all key events use autorelease, but this forbids use as a
> > modifier key.
> > 
> > As all event codes come in even/odd pairs, we can lookup the key type
> > (KE_KEY/KE_IGNORE) for the key up event corresponding to the currently
> > handled key down event. If the key up is ignored, we keep setting the
> > autorelease flag for the key down.
> > 
> > Signed-off-by: Stefan Brüns <stefan.bruens@...h-aachen.de>
> 
> +Dmitry, curious for your take on this approach.

Any response would be appreciated. This is required to make Volume keys work 
properly.
 
> > ---
> > 
> > Changes in v2:
> > - New patch, add support for seperate key up/down in intel-vbtn
> > 
> >  drivers/platform/x86/intel-vbtn.c | 17 +++++++++++++++--
> >  1 file changed, 15 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/platform/x86/intel-vbtn.c
> > b/drivers/platform/x86/intel-vbtn.c index ae55be91a64b..e3f6375af85c
> > 100644
> > --- a/drivers/platform/x86/intel-vbtn.c
> > +++ b/drivers/platform/x86/intel-vbtn.c
> > @@ -76,14 +76,27 @@ static void notify_handler(acpi_handle handle, u32
> > event, void *context)> 
> >  {
> >  
> >  	struct platform_device *device = context;
> >  	struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev);
> > 
> > +	const struct key_entry *ke_rel;
> > +	bool autorelease;
> > 
> >  	if (priv->wakeup_mode) {
> >  	
> >  		if (sparse_keymap_entry_from_scancode(priv->input_dev, event)) {
> >  		
> >  			pm_wakeup_hard_event(&device->dev);
> >  			return;
> >  		
> >  		}
> > 
> > -	} else if (sparse_keymap_report_event(priv->input_dev, event, 1, true))
> > {
> > -		return;
> > +	} else {
> > +		/* Use the fact press/release come in even/odd pairs */
> > +		if ((event & 1) && sparse_keymap_report_event(priv->input_dev,
> > +							      event, 0, false))
> > +			return;
> > +
> > +		ke_rel = sparse_keymap_entry_from_scancode(priv->input_dev,
> > +							   event | 1);
> > +		autorelease = !ke_rel || ke_rel->type == KE_IGNORE;
> > +
> > +		if (sparse_keymap_report_event(priv->input_dev, event, 1,
> > +					       autorelease))
> > +			return;
> > 
> >  	}
> >  	dev_dbg(&device->dev, "unknown event index 0x%x\n", event);
> >  
> >  }


-- 
Stefan Brüns  /  Bergstraße 21  /  52062 Aachen
home: +49 241 53809034     mobile: +49 151 50412019
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ