linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND v2] input: tca8418: Use the interrupt trigger from the device tree
Date: Tue, 17 Jan 2017 14:16:33 -0800	[thread overview]
Message-ID: <20170117221633.GD6888@dtor-ws> (raw)
In-Reply-To: <20170117210837.20555-1-maxime.ripard@free-electrons.com>

On Tue, Jan 17, 2017 at 10:08:37PM +0100, Maxime Ripard wrote:
> The TCA8418 might be used using different interrupt triggers on various
> boards. This is not working so far because the current code forces a
> falling edge trigger.
> 
> The device tree already provides a trigger type, so let's use whatever it
> sets up, and since we can be loaded without DT, keep the old behaviour for
> the non-DT case.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Applied, thank you.

> 
> ---
> 
> Hi,
> 
> This is the second version of the patch "drivers: tca8418: Change the
> interrupt type" that was sent initially on 14/11, and didn't get any
> answer.
> 
> Changes from v1:
>   - Rely on the trigger type provided by the DT
> 
>  drivers/input/keyboard/tca8418_keypad.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c
> index 3048ef3e3e16..11d5c76d9fb4 100644
> --- a/drivers/input/keyboard/tca8418_keypad.c
> +++ b/drivers/input/keyboard/tca8418_keypad.c
> @@ -277,6 +277,7 @@ static int tca8418_keypad_probe(struct i2c_client *client,
>  	bool irq_is_gpio = false;
>  	int irq;
>  	int error, row_shift, max_keys;
> +	unsigned long trigger = 0;
>  
>  	/* Copy the platform data */
>  	if (pdata) {
> @@ -289,6 +290,7 @@ static int tca8418_keypad_probe(struct i2c_client *client,
>  		cols = pdata->cols;
>  		rep  = pdata->rep;
>  		irq_is_gpio = pdata->irq_is_gpio;
> +		trigger = IRQF_TRIGGER_FALLING;
>  	} else {
>  		struct device_node *np = dev->of_node;
>  		int err;
> @@ -363,9 +365,7 @@ static int tca8418_keypad_probe(struct i2c_client *client,
>  		irq = gpio_to_irq(irq);
>  
>  	error = devm_request_threaded_irq(dev, irq, NULL, tca8418_irq_handler,
> -					  IRQF_TRIGGER_FALLING |
> -						IRQF_SHARED |
> -						IRQF_ONESHOT,
> +					  trigger | IRQF_SHARED | IRQF_ONESHOT,
>  					  client->name, keypad_data);
>  	if (error) {
>  		dev_err(dev, "Unable to claim irq %d; error %d\n",
> -- 
> 2.11.0
> 

-- 
Dmitry

      reply	other threads:[~2017-01-17 22:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-17 21:08 [PATCH RESEND v2] input: tca8418: Use the interrupt trigger from the device tree Maxime Ripard
2017-01-17 22:16 ` Dmitry Torokhov [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=20170117221633.GD6888@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    /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).