linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Miao <eric.y.miao@gmail.com>
To: Eric Miao <ymiao3@marvell.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"david-b@pacbell.net" <david-b@pacbell.net>
Subject: Re: [patch 22/22] input: ads7846: introduce platform specific way to synchronize sampling
Date: Fri, 13 Mar 2009 10:50:27 +0800	[thread overview]
Message-ID: <f17812d70903121950h768fb7d0t234e040f34656f0c@mail.gmail.com> (raw)
In-Reply-To: <F71A24FDAED97E4CB6D3A8E8A97D5C544A38E1D6@SC-VEXCH1.marvell.com>

2009/3/13 Eric Miao <ymiao3@marvell.com>:
>
>
>> -----Original Message-----
>> From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
>> Sent: 2009年3月13日 10:34
>> To: akpm@linux-foundation.org
>> Cc: linux-input@vger.kernel.org; Eric Miao; david-b@pacbell.net
>> Subject: Re: [patch 22/22] input: ads7846: introduce platform specific way
>> to synchronize sampling
>>
>> Hi,
>>
>> On Wed, Mar 04, 2009 at 11:59:13AM -0800, akpm@linux-foundation.org wrote:
>> > From: Eric Miao <eric.miao@marvell.com>
>> >
>> > Noises can be introduced when LCD signals are being driven, some platforms
>> > provide a signal to assist the synchronization of this sampling procedure.
>> >
>> > Signed-off-by: Eric Miao <eric.miao@marvell.com>
>> > Cc: David Brownell <david-b@pacbell.net>
>> > Cc: Dmitry Torokhov <dtor@mail.ru>
>> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>> > ---
>> >
>> >  drivers/input/touchscreen/ads7846.c |   10 ++++++++++
>> >  include/linux/spi/ads7846.h         |    2 ++
>> >  2 files changed, 12 insertions(+)
>> >
>> > diff -puN drivers/input/touchscreen/ads7846.c~input-ads7846-introduce-
>> platform-specific-way-to-synchronize-sampling
>> drivers/input/touchscreen/ads7846.c
>> > --- a/drivers/input/touchscreen/ads7846.c~input-ads7846-introduce-
>> platform-specific-way-to-synchronize-sampling
>> > +++ a/drivers/input/touchscreen/ads7846.c
>> > @@ -127,6 +127,8 @@ struct ads7846 {
>> >       void                    (*filter_cleanup)(void *data);
>> >       int                     (*get_pendown_state)(void);
>> >       int                     gpio_pendown;
>> > +
>> > +     void                    (*wait_for_sync)(void);
>> >  };
>> >
>> >  /* leave chip selected when we're done, for quicker re-select? */
>> > @@ -511,6 +513,10 @@ static int get_pendown_state(struct ads7
>> >       return !gpio_get_value(ts->gpio_pendown);
>> >  }
>> >
>> > +static void null_wait_for_sync(void)
>> > +{
>> > +}
>> > +
>> >  /*
>> >   * PENIRQ only kicks the timer.  The timer only reissues the SPI transfer,
>> >   * to retrieve touchscreen status.
>> > @@ -686,6 +692,7 @@ static void ads7846_rx_val(void *ads)
>> >       default:
>> >               BUG();
>> >       }
>> > +     ts->wait_for_sync();
>> >       status = spi_async(ts->spi, m);
>> >       if (status)
>> >               dev_err(&ts->spi->dev, "spi_async --> %d\n",
>> > @@ -723,6 +730,7 @@ static enum hrtimer_restart ads7846_time
>> >       } else {
>> >               /* pen is still down, continue with the measurement */
>> >               ts->msg_idx = 0;
>> > +             ts->wait_for_sync();
>>
>> We are in hard IRQ context here. What is the expectation of
>> wait_for_sync()? How long are we waiting here?
>>
>
> This should be a workaround for broken hardware and I don't expect
> this sync time on every boards.
>

The sync time depends on the moment of this sync between two HSYNC,
I don't expect that to be very long, yet the hardware is broken enough to
endure this latency.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-03-13  2:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04 19:59 [patch 22/22] input: ads7846: introduce platform specific way to synchronize sampling akpm
2009-03-13  2:34 ` Dmitry Torokhov
2009-03-13  2:42   ` Eric Miao
2009-03-13  2:50     ` Eric Miao [this message]
2009-03-14  1:09       ` David Brownell
2009-03-14  3:41         ` Eric Miao
2009-03-14 12:55           ` Mark Brown

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=f17812d70903121950h768fb7d0t234e040f34656f0c@mail.gmail.com \
    --to=eric.y.miao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=david-b@pacbell.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=ymiao3@marvell.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).