From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-input@atrey.karlin.mff.cuni.cz,
linux-kernel@vger.kernel.org,
Liam Girdwood <liam.girdwood@wolfsonmicro.com>,
Graeme Gregory <gg@opensource.wolfsonmicro.com>,
Mike Arthur <mike.arthur@wolfsonmicro.com>,
Stanley Cai <stanley.cai@intel.com>,
Rodolfo Giometti <giometti@enneenne.com>,
Russell King <rmk@arm.linux.org.uk>,
Marc Kleine-Budde <mkl@pengutronix.de>,
Ian Molton <spyro@f2s.com>, Vincent Sanders <vince@kyllikki.org>,
Andrew Zabolotny <zap@homelink.ru>
Subject: Re: [PATCH] Core driver for WM97xx touchscreens
Date: Fri, 18 Jan 2008 12:23:41 -0500 [thread overview]
Message-ID: <20080118120148.ZZRA012@mailhub.coreip.homeip.net> (raw)
In-Reply-To: <1200673631-366-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Hi Mark,
On Fri, Jan 18, 2008 at 04:27:06PM +0000, Mark Brown wrote:
> This patch series adds support for the touchscreen controllers provided
> by Wolfson Microelectronics WM97xx series chips in both polled and
> streaming modes.
>
Thank you for the patches. Some comments below.
> +static int wm97xx_ts_input_open(struct input_dev *idev)
> +{
> + struct wm97xx *wm = (struct wm97xx *)input_get_drvdata(idev);
No need to cast.
> +
> + mutex_lock(&wm->ts_mutex);
> + /* first time opened ? */
> + if (wm->ts_use_count++ == 0) {
You do not need to implement a counter here. Input core makes sure
that open and close are only called for the fist and last user
respectivly. ts_mutex can go away as well.
> + /* set up touch configuration */
> + wm->input_dev->name = "wm97xx touchscreen";
> + wm->input_dev->open = wm97xx_ts_input_open;
> + wm->input_dev->close = wm97xx_ts_input_close;
> + set_bit(EV_ABS, wm->input_dev->evbit);
> + set_bit(ABS_X, wm->input_dev->absbit);
> + set_bit(ABS_Y, wm->input_dev->absbit);
> + set_bit(ABS_PRESSURE, wm->input_dev->absbit);
> + wm->input_dev->absmax[ABS_X] = abs_x[1];
> + wm->input_dev->absmax[ABS_Y] = abs_y[1];
> + wm->input_dev->absmax[ABS_PRESSURE] = abs_p[1];
> + wm->input_dev->absmin[ABS_X] = abs_x[0];
> + wm->input_dev->absmin[ABS_Y] = abs_y[0];
> + wm->input_dev->absmin[ABS_PRESSURE] = abs_p[0];
> + wm->input_dev->absfuzz[ABS_X] = abs_x[2];
> + wm->input_dev->absfuzz[ABS_Y] = abs_y[2];
> + wm->input_dev->absfuzz[ABS_PRESSURE] = abs_p[2];
input_set-abs_params(wm->input_dev, ABS_X, ...);
input_set-abs_params(wm->input_dev, ABS_Y, ...);
input_set-abs_params(wm->input_dev, ABS_X, ...);
I'd also recoomend using a temp for wm->input_dev, shoudl save a couple
of bytes.
> + input_set_drvdata(wm->input_dev, wm);
Also wm->input_dev->dev.parent = &dev; to put it in the proper place
in sysfs hierarchy.
> + ret = input_register_device(wm->input_dev);
> + if (ret < 0) {
Add input_free_device(); here.
> + kfree(wm);
> + return -ENOMEM;
> + }
I will need some more time to review and understand the need for the new bus
in the driver.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2008-01-18 17:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-18 16:26 [UPDATED] WM97xx touchscreen drivers Mark Brown
2008-01-18 16:27 ` [PATCH] Core driver for WM97xx touchscreens Mark Brown
2008-01-18 16:27 ` [PATCH] Add chip driver for WM9705 touchscreen Mark Brown
2008-01-18 16:27 ` [PATCH] Add chip driver for WM9712 touchscreen Mark Brown
2008-01-18 16:27 ` [PATCH] Add chip driver for WM9713 touchscreen Mark Brown
2008-01-18 16:27 ` [PATCH] Driver for WM97xx touchscreens in streaming mode on Mainstone Mark Brown
2008-01-18 16:27 ` [PATCH] Build system and MAINTAINERS entry for WM97xx touchscreen drivers Mark Brown
2008-01-18 17:23 ` Dmitry Torokhov [this message]
2008-01-18 18:11 ` [PATCH] Core driver for WM97xx touchscreens Dmitry Baryshkov
2008-01-18 21:57 ` Ben Dooks
2008-01-19 19:53 ` Dmitry Baryshkov
2008-01-19 17:00 ` Mark Brown
2008-01-19 19:48 ` Dmitry
2008-01-19 21:55 ` Mark Brown
2008-01-19 22:18 ` Dmitry
-- strict thread matches above, loose matches on Subject: below --
2008-02-08 11:27 [PATCH 1/6] " Mark Brown
2008-02-08 11:27 ` [PATCH] " 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=20080118120148.ZZRA012@mailhub.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=gg@opensource.wolfsonmicro.com \
--cc=giometti@enneenne.com \
--cc=liam.girdwood@wolfsonmicro.com \
--cc=linux-input@atrey.karlin.mff.cuni.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.arthur@wolfsonmicro.com \
--cc=mkl@pengutronix.de \
--cc=rmk@arm.linux.org.uk \
--cc=spyro@f2s.com \
--cc=stanley.cai@intel.com \
--cc=vince@kyllikki.org \
--cc=zap@homelink.ru \
/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).