linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Bastien Nocera <hadess@hadess.net>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] Input - surface3_spi: add new driver for the Surface 3
Date: Tue, 17 May 2016 12:09:25 +0200	[thread overview]
Message-ID: <20160517100925.GC23234@mail.corp.redhat.com> (raw)
In-Reply-To: <20160516195118.GG12752@dtor-ws>

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@redhat.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

      reply	other threads:[~2016-05-17 10:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13 15:37 [PATCH v2] Input - surface3_spi: add new driver for the Surface 3 Benjamin Tissoires
2016-05-16 19:51 ` Dmitry Torokhov
2016-05-17 10:09   ` Benjamin Tissoires [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160517100925.GC23234@mail.corp.redhat.com \
    --to=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hadess@hadess.net \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).