linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Van Asbroeck <thesven73@gmail.com>
To: Adam Ford <aford173@gmail.com>
Cc: Marek Vasut <marex@denx.de>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] Input: ili210x - add ILI2117 support
Date: Mon, 4 Nov 2019 16:43:32 -0500	[thread overview]
Message-ID: <CAGngYiXp52g7X=KLVqxTAhK0AJ9mpgGyaptbkYvhwWfRkQCaXQ@mail.gmail.com> (raw)
In-Reply-To: <CAHCN7xJc6DeyQV27OVjD14a8hZT+_Fo9qo-iHgLO414t3y6hVQ@mail.gmail.com>

Hi Adam,

On Mon, Nov 4, 2019 at 4:28 PM Adam Ford <aford173@gmail.com> wrote:
>
> I am using IRQ_TYPE_EDGE_RISING for the 2117A.  Is that correct?  For
> my touchscreen, the IRQ line is low until a touch is detected, so I
> assume we want to capure on the rising edge.

That is correct for the 2117A, as far as I know. I am using the same
setting.

>
> Regarding Dmitry's patch,
> Is it a good idea to use msleep in an IRQ?  It seems like using the
> schedule_delayed_work() call seems like it will get in and get out of
> the ISR faster.
>
> If we use msleep and scan again, isn't it possible to starve other processes?

I believe using msleep() is ok because this is not a "real" interrupt handler,
but a threaded one. It runs in a regular kernel thread, with its interrupt
turned off (but all other interrupts remain enabled). Its interrupt is
re-enabled automatically after the threaded handler returns.

See
https://elixir.bootlin.com/linux/latest/source/include/linux/interrupt.h#L50

> > @@ -268,7 +278,7 @@ static irqreturn_t ili210x_irq(int irq, void *irq_data)
> >                 }
> >
> >                 touch = ili210x_report_events(priv, touchdata);
> > -               keep_polling = touch || chip->continue_polling(touchdata);
> > +               keep_polling = chip->continue_polling(touchdata, touch);
> >                 if (keep_polling)
>
> Why not just check the value of touch instead of invoking the function
> pointer which takes the value of touch in as a parameter?
>

The value of touch must be checked inside the callback, because
some variants use it to decide if they should poll again, and
some do not, such as the ili211x.

If I have misinterpreted your suggestion, could you perhaps
express it in C, so I can understand better?

  reply	other threads:[~2019-11-04 21:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190302141704.32547-1-marex@denx.de>
2019-11-01 20:48 ` [PATCH 2/2] Input: ili210x - add ILI2117 support Sven Van Asbroeck
2019-11-03 23:55   ` Adam Ford
2019-11-04  0:16     ` Marek Vasut
2019-11-04  7:02       ` Dmitry Torokhov
2019-11-04  7:01   ` Dmitry Torokhov
2019-11-04  9:13     ` Marek Vasut
2019-11-04 13:49     ` Sven Van Asbroeck
2019-11-04 14:19       ` Adam Ford
2019-11-04 18:36         ` Dmitry Torokhov
2019-11-04 18:37     ` Sven Van Asbroeck
2019-11-04 21:28       ` Adam Ford
2019-11-04 21:43         ` Sven Van Asbroeck [this message]
2019-11-04 23:25           ` Adam Ford
2019-11-04 23:36             ` Dmitry Torokhov
2019-11-04 23:40               ` Adam Ford
2019-11-05  2:04                 ` Sven Van Asbroeck
2019-11-05 13:27                   ` Adam Ford
2019-11-05 15:26               ` Sven Van Asbroeck
2019-11-05 15:29               ` Sven Van Asbroeck
2019-11-05 15:53                 ` Sven Van Asbroeck
2019-11-11 18:16                 ` Dmitry Torokhov
2019-11-11 18:43                   ` Rob Herring
2019-11-12  0:19                     ` Dmitry Torokhov

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='CAGngYiXp52g7X=KLVqxTAhK0AJ9mpgGyaptbkYvhwWfRkQCaXQ@mail.gmail.com' \
    --to=thesven73@gmail.com \
    --cc=aford173@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    /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).