From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] iio: exynos-adc: add experimental touchscreen support
Date: Mon, 21 Jul 2014 17:11:27 +0200 [thread overview]
Message-ID: <6569004.FG0IRy8WyL@wuerfel> (raw)
In-Reply-To: <20140721144442.GB9112@core.coreip.homeip.net>
On Monday 21 July 2014 07:44:42 Dmitry Torokhov wrote:
> > >
> > > It would be nice to actually close the device even if someone is
> > > touching screen. Please implement open/close methods and have them set a
> > > flag that you would check here.
> >
> > Ok. I think it's even better to move the request_irq() into the open function,
> > which will avoid the flag and defer the error handling into the actual opening,
> > as well as syncing the running irq with the close function.
>
> I do not quite like acquiring resources needed in open. I think drivers should
> do all resource acquisition in probe() and leave open()/close() to
> activate/quiesce devices.
Ok, I'll move it back then. I'm not sure what I'm supposed to do
in open/close then. Isn't it enough to check info->input->users
like this?
static irqreturn_t exynos_ts_isr(int irq, void *dev_id)
{
struct exynos_adc *info = dev_id;
struct iio_dev *dev = dev_get_drvdata(info->dev);
u32 x, y;
bool pressed;
int ret;
while (info->input->users) {
ret = exynos_read_s3c64xx_ts(dev, &x, &y);
if (ret == -ETIMEDOUT)
break;
pressed = x & y & ADC_DATX_PRESSED;
if (!pressed) {
input_report_key(info->input, BTN_TOUCH, 0);
input_sync(info->input);
break;
}
input_report_abs(info->input, ABS_X, x & ADC_DATX_MASK);
input_report_abs(info->input, ABS_Y, y & ADC_DATY_MASK);
input_report_key(info->input, BTN_TOUCH, 1);
input_sync(info->input);
msleep(1);
};
writel(0, ADC_V1_CLRINTPNDNUP(info->regs));
return IRQ_HANDLED;
}
I could do enable_irq()/disable_irq(), but that leaves a small
race at startup where we request the irq line and then immediately
disable it again.
Arnd
next prev parent reply other threads:[~2014-07-21 15:11 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 5:59 [PATCHv6 0/4] iio: adc: exynos_adc: Support Exynos3250 ADC and code clean Chanwoo Choi
2014-07-18 5:59 ` [PATCHv6 1/4] iio: adc: exynos_adc: Add exynos_adc_data structure to improve readability Chanwoo Choi
2014-07-18 9:42 ` Arnd Bergmann
2014-07-18 10:11 ` Naveen Krishna Ch
2014-07-18 11:16 ` Arnd Bergmann
2014-07-18 5:59 ` [PATCHv6 2/4] iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC Chanwoo Choi
2014-07-18 9:47 ` Arnd Bergmann
2014-07-18 10:00 ` Chanwoo Choi
2014-07-18 11:14 ` Arnd Bergmann
2014-07-18 15:15 ` Chanwoo Choi
2014-07-18 15:23 ` Arnd Bergmann
2014-07-18 16:11 ` Chanwoo Choi
2014-07-18 16:31 ` Arnd Bergmann
2014-07-18 16:48 ` Chanwoo Choi
2014-07-18 5:59 ` [PATCHv6 3/4] iio: devicetree: Add DT binding documentation for " Chanwoo Choi
2014-07-18 9:50 ` Arnd Bergmann
2014-07-18 16:23 ` Chanwoo Choi
2014-07-18 16:33 ` Arnd Bergmann
2014-07-18 17:02 ` Chanwoo Choi
2014-07-18 18:48 ` Arnd Bergmann
2014-07-21 1:52 ` Chanwoo Choi
2014-07-21 8:00 ` Arnd Bergmann
2014-07-21 10:38 ` Tomasz Figa
2014-07-21 10:47 ` Arnd Bergmann
2014-07-18 5:59 ` [PATCHv6 4/4] ARM: dts: Fix wrong compatible string " Chanwoo Choi
2014-07-18 9:38 ` [PATCHv6 0/4] iio: adc: exynos_adc: Support Exynos3250 ADC and code clean Arnd Bergmann
2014-07-18 10:13 ` Naveen Krishna Ch
2014-07-18 10:16 ` Naveen Krishna Ch
2014-07-18 19:27 ` [PATCH 1/2] iio: exynos-adc: add support for s3c64xx adc Arnd Bergmann
2014-07-18 19:29 ` [PATCH 2/2] iio: exynos-adc: add experimental touchscreen support Arnd Bergmann
2014-07-20 13:49 ` Jonathan Cameron
2014-07-20 13:51 ` Jonathan Cameron
2014-07-20 20:28 ` Dmitry Torokhov
2014-07-21 10:23 ` Arnd Bergmann
2014-07-21 10:26 ` Arnd Bergmann
2014-07-21 14:44 ` Dmitry Torokhov
2014-07-21 15:11 ` Arnd Bergmann [this message]
2014-07-21 16:19 ` Dmitry Torokhov
2014-07-20 21:37 ` Hartmut Knaack
2014-07-21 10:06 ` Arnd Bergmann
2014-07-20 21:37 ` [PATCH 1/2] iio: exynos-adc: add support for s3c64xx adc Hartmut Knaack
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=6569004.FG0IRy8WyL@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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