From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-input@vger.kernel.org, patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH] Input: wm831x - Add driver for Wolfson WM831x PMIC touchscreen controllers
Date: Tue, 25 Jan 2011 09:07:29 -0800 [thread overview]
Message-ID: <20110125170729.GD19701@core.coreip.homeip.net> (raw)
In-Reply-To: <1295964556-1024-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Hi Mark,
On Tue, Jan 25, 2011 at 02:09:16PM +0000, Mark Brown wrote:
> Some of the WM831x series of PMICs from Wolfson Microelectronics include
> a resistive touchscreen controller. Implement support for these controllers
> within the input API.
>
> Platform data is supported to allow configuration of system parameters such
> as selection between four and five wire touchscreens and for specification
> of optional direct to CPU IRQs for sample availability and for pen down.
> Use of this feature for at least the data IRQ is strongly recommended.
>
> Thanks to Julien Boibessot for extensive testing and detailed feedback.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> Tested-by: Julien Boibessot <julien.boibessot@armadeus.com>
Just a couple small concerns here:
> +
> +struct wm831x_ts {
> + struct input_dev *input_dev;
> + struct wm831x *wm831x;
> + int data_irq;
> + int pd_irq;
Maybe make irqs unsigned?
> +
> +static void wm831x_ts_input_close(struct input_dev *idev)
> +{
> + struct wm831x_ts *wm831x_ts = input_get_drvdata(idev);
> + struct wm831x *wm831x = wm831x_ts->wm831x;
> +
> + wm831x_set_bits(wm831x, WM831X_TOUCH_CONTROL_1,
> + WM831X_TCH_ENA | WM831X_TCH_CVT_ENA |
> + WM831X_TCH_X_ENA | WM831X_TCH_Y_ENA |
> + WM831X_TCH_Z_ENA, 0);
> +
> + if (wm831x_ts->pen_down)
> + disable_irq_nosync(wm831x_ts->data_irq);
Why nosync?
> +
> + ret = request_threaded_irq(wm831x_ts->data_irq, NULL,
> + wm831x_ts_data_irq,
> + IRQF_ONESHOT,
> + "Touchscreen data", wm831x_ts);
> + if (ret < 0) {
> + dev_err(&pdev->dev, "Failed to request data IRQ %d: %d\n",
> + wm831x_ts->data_irq, ret);
> + goto err_alloc;
> + }
> + disable_irq(wm831x_ts->data_irq);
> +
> + ret = request_threaded_irq(wm831x_ts->pd_irq, NULL,
> + wm831x_ts_pen_down_irq, IRQF_ONESHOT,
> + "Touchscreen pen down", wm831x_ts);
> + if (ret < 0) {
> + dev_err(&pdev->dev, "Failed to request pen down IRQ %d: %d\n",
> + wm831x_ts->pd_irq, ret);
> + goto err_data_irq;
> + }
> +
> + platform_set_drvdata(pdev, wm831x_ts);
> +
> + input_dev = input_allocate_device();
Are we 100% sure it is impossible for the 2 irqs above to fire up before
we get here? Like if we happen to have hardware in half-active state
while binding?
I'd feel safer if we allocated input device earlier, together with the
touchscreen structure.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2011-01-25 17:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-25 14:09 [PATCH] Input: wm831x - Add driver for Wolfson WM831x PMIC touchscreen controllers Mark Brown
2011-01-25 17:07 ` Dmitry Torokhov [this message]
2011-01-25 19:34 ` Mark Brown
2011-01-25 19:50 ` Dmitry Torokhov
2011-01-25 19:51 ` Dmitry Torokhov
-- strict thread matches above, loose matches on Subject: below --
2011-01-25 19:46 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=20110125170729.GD19701@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-input@vger.kernel.org \
--cc=patches@opensource.wolfsonmicro.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).