public inbox for linux-iio@vger.kernel.org
help / color / mirror / Atom feed
From: Michael Welling <mwelling@ieee.org>
To: Greg Wilson-Lindberg <GWilson@sakuraus.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: BBB touch screen and ADC interactions
Date: Wed, 20 May 2015 17:14:17 -0500 [thread overview]
Message-ID: <20150520221417.GA21017@deathray> (raw)
In-Reply-To: <782E3A02C2EB2347BEA6DEA69DC7AB86021D3C87D53C@sfamail.SAKURAUS.LOCAL>
On Wed, May 20, 2015 at 02:54:35PM -0700, Greg Wilson-Lindberg wrote:
> Hi Michael,
> I've applied your patch and the mouse clicks now work mostly, and I even saw one touch screen click that worked.
>
This is not promising. Perhaps you are accessing the ADC to quickly for it to be available for the touchscreen.
> I only need to read the ADC infrequently so I guess I'll set it up to enable when I need to read the ADC and then disable again.
>
> Do you know if I can set up the context, device and channels and then just enable the channels, do the scan, and then disable the channels until I need them again, without tearing down the channels, device and context?
>
I think you can just enable and disable the buffer.
To disable:
echo 0 > /sys/bus/iio/devices/iio:device0/buffer/disable
or
http://lxr.free-electrons.com/source/drivers/staging/iio/Documentation/generic_buffer.c#L337
To enable:
echo 1 > /sys/bus/iio/devices/iio:device0/buffer/enable
or
http://lxr.free-electrons.com/source/drivers/staging/iio/Documentation/generic_buffer.c#L280
> Regards,
> Greg
>
>
> > -----Original Message-----
> > From: Michael Welling [mailto:mwelling79@gmail.com] On Behalf
> > Of Michael Welling
> > Sent: Tuesday, May 19, 2015 5:35 PM
> > To: Greg Wilson-Lindberg
> > Cc: linux-iio@vger.kernel.org
> > Subject: Re: BBB touch screen and ADC interactions
> >
> > On Tue, May 19, 2015 at 05:16:46PM -0700, Greg Wilson-Lindberg wrote:
> > >
> > > I would be happy to test the patch, better than what I was
> > going to try.
> > >
> > > -Greg
> >
> > Below is the simple workaround patch that I used to eliminate
> > the repeated release events that were occurring without
> > touching the screen.
> >
> > See if it helps.
> >
> > diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c
> > b/drivers/input/touchscreen/ti_am335x_tsc.c
> > index 191a1b8..f876097 100644
> > --- a/drivers/input/touchscreen/ti_am335x_tsc.c
> > +++ b/drivers/input/touchscreen/ti_am335x_tsc.c
> > @@ -281,13 +281,11 @@ static irqreturn_t titsc_irq(int irq, void *dev)
> > if (status & IRQENB_PENUP) {
> > fsm = titsc_readl(ts_dev, REG_ADCFSM);
> > if (fsm == ADCFSM_STEPID) {
> > - ts_dev->pen_down = false;
> > input_report_key(input_dev, BTN_TOUCH, 0);
> > input_report_abs(input_dev, ABS_PRESSURE, 0);
> > input_sync(input_dev);
> > - } else {
> > - ts_dev->pen_down = true;
> > }
> > + ts_dev->pen_down = false;
> > irqclr |= IRQENB_PENUP;
> > }
> >
> >
next prev parent reply other threads:[~2015-05-20 22:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 23:23 BBB touch screen and ADC interactions Greg Wilson-Lindberg
2015-05-13 1:11 ` Michael Welling
2015-05-14 17:00 ` Greg Wilson-Lindberg
2015-05-19 23:30 ` Michael Welling
2015-05-19 23:56 ` Greg Wilson-Lindberg
2015-05-20 0:13 ` mwelling
2015-05-20 0:16 ` Greg Wilson-Lindberg
2015-05-20 0:34 ` Michael Welling
2015-05-20 21:54 ` Greg Wilson-Lindberg
2015-05-20 22:14 ` Michael Welling [this message]
2015-05-20 22:41 ` Greg Wilson-Lindberg
2015-05-20 23:04 ` Michael Welling
2015-05-26 17:42 ` Michael Welling
2015-05-26 18:04 ` Greg Wilson-Lindberg
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=20150520221417.GA21017@deathray \
--to=mwelling@ieee.org \
--cc=GWilson@sakuraus.com \
--cc=linux-iio@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