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: <20160517100925.GC23234@mail.corp.redhat.com>
Date:	Tue, 17 May 2016 12:09:25 +0200
From:	Benjamin Tissoires <benjamin.tissoires@...hat.com>
To:	Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:	Bastien Nocera <hadess@...ess.net>, linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] Input - surface3_spi: add new driver for the Surface 3

On May 16 2016 or thereabouts, Dmitry Torokhov wrote:
> On Fri, May 13, 2016 at 05:37:06PM +0200, Benjamin Tissoires wrote:
> > This is a basic driver for the Surface 3. I am not so sure it will work
> > with any firmwares as most values are encoded, but given that I only have
> > access to my current device with its firmware and I don't have the
> > datasheet, it should be OK for now.
> > 
> > The Surface Pen is not supported (if it is supposed to be). I'll work on
> > this when I get one.
> > 
> > Signed-off-by: Benjamin Tissoires <benjamin.tissoires@...hat.com>
> > ---
> > 
> > Changes in v2:
> > 
> > - module renamed from ntrig_spi to surface3_spi
> > - took into account Dmitry's remarks
> > - kept the retrieval of the GPIO as mandatory as otherwise the device fails to work
> > 
> >  drivers/input/touchscreen/Kconfig        |  11 ++
> >  drivers/input/touchscreen/Makefile       |   1 +
> >  drivers/input/touchscreen/surface3_spi.c | 320 +++++++++++++++++++++++++++++++
> >  3 files changed, 332 insertions(+)
> >  create mode 100644 drivers/input/touchscreen/surface3_spi.c
> > 

[snipped]

> > +static int surface3_spi_request_irq(struct surface3_ts_data *data)
> > +{
> > +	struct spi_device *spi = data->spi;
> > +
> > +	return devm_request_threaded_irq(&spi->dev, spi->irq,
> > +					  NULL, surface3_spi_irq_handler,
> > +					  IRQ_TYPE_EDGE_RISING | IRQF_ONESHOT,
> > +					  "Surface3-irq", data);
> > +}
> 
> Please just call devm_request_threaded_irq directly in probe.
> 
> Do you really need to specify IRQ_TYPE_EDGE_RISING? Does not ACPI has
> proper trigger specifier for the IRQ?

The ACPI indeed specify ActiveHigh (see line 12681 of the dump of the
DSDT in the kernel bug #104291:
https://bugzilla.kernel.org/attachment.cgi?id=187171 )

So I can detect this and use IRQ_TYPE_EDGE_RISING or
IRQ_TYPE_EDGE_FALLING accordingly.

Cheers,
Benjamin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ