All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Dyer <nick.dyer@itdev.co.uk>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Sekhar Nori <nsekhar@ti.com>, Stephen Warren <swarren@nvidia.com>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	Linux OMAP List <linux-omap@vger.kernel.org>,
	"swarren@wwwdotorg.org" <swarren@wwwdotorg.org>
Subject: Re: atmel_mxt_ts: defaulting irqflags to IRQF_TRIGGER_FALLING
Date: Thu, 03 Jul 2014 15:16:06 +0100	[thread overview]
Message-ID: <53B565A6.9020306@itdev.co.uk> (raw)
In-Reply-To: <CAKdAkRTueVK8ynFR7AJeeJL7SPK60U0EHESeONqqoBF_vXJQxA@mail.gmail.com>

On 02/07/14 18:25, Dmitry Torokhov wrote:
> In this case board code should take care of setting up the interrupt
> properly and the driver should simply use 0 as flags in request_irq().
> By the way, doesn't generic DT infrastructure already allow specifying
> interrupt triggers and sets them up properly?

Yes. I've checked and tested this behaviour today. If you don't specify a
trigger type, then when you request the irq it trusts that the platform has
already set it up correctly:
http://lxr.free-electrons.com/source/kernel/irq/manage.c#L1208

Stephen: you should be able to set up the interrupt config in the device
tree. I believe this should be done by putting IRQ_TYPE_LEVEL_LOW or
IRQ_TYPE_EDGE_FALLING in the third field in the "interrupts" definition,
although I haven't a tegra DTS device to test on at the moment.

I've applied the patch below, which is basically what Sekhar had
originally, with a minor extra fix.

I've merged it into the appropriate parts of my for upstream series at
https://github.com/ndyer/linux/commits/for-next

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c
b/drivers/input/touchscree
index dc46100..15efb3b 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -1453,7 +1453,7 @@ static int mxt_check_retrigen(struct mxt_data *data)
        int error;
        int val;

-       if (data->pdata->irqflags & IRQF_TRIGGER_LOW)
+       if (irq_get_trigger_type(data->irq) & IRQF_TRIGGER_LOW)
                return 0;

        if (data->T18_address) {
@@ -3155,9 +3155,6 @@ static struct mxt_platform_data *mxt_parse_dt(struct
i2c_c
        pdata->gpio_reset = of_get_named_gpio_flags(dev->of_node,
                "atmel,reset-gpio", 0, NULL);

-       /* Default to this. Properties can be added to configure it later */
-       pdata->irqflags = IRQF_TRIGGER_FALLING;
-
        of_property_read_string(dev->of_node, "atmel,cfg_name",
                                &pdata->cfg_name);


  reply	other threads:[~2014-07-03 14:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01  9:51 atmel_mxt_ts: defaulting irqflags to IRQF_TRIGGER_FALLING Sekhar Nori
2014-07-01 16:14 ` Stephen Warren
2014-07-02 10:49   ` Sekhar Nori
2014-07-02 11:54     ` Nick Dyer
2014-07-02 17:25       ` Dmitry Torokhov
2014-07-03 14:16         ` Nick Dyer [this message]
2014-07-03  6:15       ` Sekhar Nori

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=53B565A6.9020306@itdev.co.uk \
    --to=nick.dyer@itdev.co.uk \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=swarren@nvidia.com \
    --cc=swarren@wwwdotorg.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.