mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Arve Hj?nnev?g <arve@android.com>,
	kernel list <linux-kernel@vger.kernel.org>,
	Brian Swetland <swetland@google.com>,
	linux-input@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	Greg KH <greg@kroah.com>
Subject: HTC Dream for staging: small cleanups [was Re: Support for synaptic touchscreen in HTC dream]
Date: Sat, 8 Aug 2009 16:02:51 +0200	[thread overview]
Message-ID: <20090808140250.GC13226@elf.ucw.cz> (raw)
In-Reply-To: <20090714175201.GB14661@dtor-d630.eng.vmware.com>

Hi!

> > This adds support for synaptic touchscreen, used in HTC dream
> > cellphone.
> > 
> > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> 
> This is pretty large body of code, could we get a sign-off from Arve as
> well since he seems to be the author?

Yes; it is now in staging with his sign-offs.

> > +config TOUCHSCREEN_SYNAPTICS_I2C_RMI
> > +	tristate "Synaptics i2c touchscreen"
> > +	depends on I2C
> > +	help
> > +	  This enables support for Synaptics RMI over I2C based touchscreens.
> > +	  Such touchscreen is used in HTC Dream.
> > +
> 
> To compile this driver as a module...

Ok.

> > +static struct workqueue_struct *synaptics_wq;
> 
> Do we need a separate workqueue? Is reading the device that slow that we
> can use keventd?

Added to the TODO.

> > +	int snap_up[2];
> > +	u32 flags;
> > +	int (*power)(int on);
> 
> 'bool on'?

Added to the TODO.

> > +static int i2c_read(struct synaptics_ts_data *ts, u8 reg, char *msg)
> > +{
> > +	int ret = i2c_smbus_read_byte_data(ts->client, 0xf0);
> 
> We are not using 'reg'?

Fixed, thanks.

> Some more info as to what you are trying to do here would be nice.

Done, Arve provided a comment.

> > +	input_report_abs(ts->input_dev, ABS_PRESSURE, z);
> > +	input_report_abs(ts->input_dev, ABS_TOOL_WIDTH, w);
> > +	input_report_key(ts->input_dev, BTN_TOUCH, finger);
> > +	finger2_pressed = finger > 1 && finger != 7;
> > +	input_report_key(ts->input_dev, BTN_2, finger2_pressed);
> > +	if (finger2_pressed) {
> > +		input_report_abs(ts->input_dev, ABS_HAT0X, pos[1][0]);
> > +		input_report_abs(ts->input_dev, ABS_HAT0Y, pos[1][1]);
> 
> ABS_HAT is pretty unusual for a touchscreen...

Added to the TODO list. It should be cleaned up before merge.

> > +		if ((buf[14] & 0xc0) != 0x40) {
> > +			printk(KERN_WARNING "synaptics_ts_work_func:"
> > +			       " bad read %x %x %x %x %x %x %x %x %x"
> > +			       " %x %x %x %x %x %x, ret %d\n",
> > +			       buf[0], buf[1], buf[2], buf[3],
> > +			       buf[4], buf[5], buf[6], buf[7],
> > +			       buf[8], buf[9], buf[10], buf[11],
> > +			       buf[12], buf[13], buf[14], ret);
> 
> Umm... for ()?

I removed debugging instead.

> > +static int synaptics_ts_probe(
> 
> __devinit()

Done.

> > +	ts->input_dev = input_allocate_device();
> > +	if (ts->input_dev == NULL) {
> > +		ret = -ENOMEM;
> > +		pr_err("synaptics: Failed to allocate input device\n");
> > +		goto err_input_dev_alloc_failed;
> > +	}
> > +	ts->input_dev->name = "synaptics-rmi-touchscreen";
> 
> BUS_I2C, etc.

I'm doing this:

	ts->input_dev->name = "synaptics-rmi-touchscreen";
	ts->input_dev->phys = "msm/input0";
	ts->input_dev->id.bustype = BUS_I2C;

I don't know if it is right; if you can suggest better strings...

> > +	set_bit(EV_SYN, ts->input_dev->evbit);
> 
> __set_bit(), no need to lock the bus.

Done.

> > +	if (client->irq) {
> > +		ret = request_irq(client->irq, synaptics_ts_irq_handler,
> > +				  0, client->name, ts);
> 
> I think threaded IRQ will fit the bill and will take care of
> IRQ/workqueue shutdown races. Of course you still need to use workqueue
> if polling.

Yep, but that's TODO for now.

> > +	pr_info("synaptics: Start touchscreen %s in %s mode\n", 
> 
> Probably "synaptics_ts" throughout so nobody is confused?

Yep.

> > +static int synaptics_ts_remove(struct i2c_client *client)
> 
> __devexit()

Ok.

> > +MODULE_DESCRIPTION("Synaptics Touchscreen Driver");
> > +MODULE_LICENSE("GPL");
> 
> MODULE_AUTHOR()?

Fixed; this, and some others were fixed before. Here is just the new
stuff.

---

Small fixes to synaptics touchscreen driver, and add a TODO list of
stuff that should be fixed between merge into kernel proper.

Signed-off-by: Pavel Machek <pavel@ucw.cz>

diff --git a/drivers/staging/dream/Kconfig b/drivers/staging/dream/Kconfig
index 1fdbd48..e19d403 100644
--- a/drivers/staging/dream/Kconfig
+++ b/drivers/staging/dream/Kconfig
@@ -8,4 +8,8 @@ config TOUCHSCREEN_SYNAPTICS_I2C_RMI
 	help
 	  This enables support for Synaptics RMI over I2C based touchscreens.
 
+	  To compile this driver as a module, choose M here: the
+	  module will be called synaptics_i2c_rmi.
+
+
 
diff --git a/drivers/staging/dream/synaptics_i2c_rmi.c b/drivers/staging/dream/synaptics_i2c_rmi.c
index 6e23276..d786a55 100644
--- a/drivers/staging/dream/synaptics_i2c_rmi.c
+++ b/drivers/staging/dream/synaptics_i2c_rmi.c
@@ -189,13 +189,7 @@ static void synaptics_ts_work_func(struct work_struct *work)
 			continue;
 		}
 		if ((buf[14] & 0xc0) != 0x40) {
-			pr_warning("synaptics_ts_work_func:"
-			       " bad read %x %x %x %x %x %x %x %x %x"
-			       " %x %x %x %x %x %x, ret %d\n",
-			       buf[0], buf[1], buf[2], buf[3],
-			       buf[4], buf[5], buf[6], buf[7],
-			       buf[8], buf[9], buf[10], buf[11],
-			       buf[12], buf[13], buf[14], ret);
+			pr_warning("synaptics_ts_work_func: bad data\n");
 			if (bad_data)
 				synaptics_init_panel(ts);
 			bad_data = 1;
@@ -517,7 +511,7 @@ static int __devinit synaptics_ts_probe(
 	register_early_suspend(&ts->early_suspend);
 #endif
 
-	pr_info("synaptics: Start touchscreen %s in %s mode\n", 
+	pr_info("synaptics_ts: Start touchscreen %s in %s mode\n", 
 		ts->input_dev->name, ts->use_irq ? "interrupt" : "polling");
 
 	return 0;
@@ -534,7 +528,7 @@ err_check_functionality_failed:
 	return ret;
 }
 
-static int synaptics_ts_remove(struct i2c_client *client)
+static int __devexit synaptics_ts_remove(struct i2c_client *client)
 {
 	struct synaptics_ts_data *ts = i2c_get_clientdata(client);
 #ifdef CONFIG_HAS_EARLYSUSPEND


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  parent reply	other threads:[~2009-08-08 14:03 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-14 10:06 Support for synaptic touchscreen in HTC dream Pavel Machek
2009-07-14 10:20 ` Trilok Soni
2009-07-15 13:36   ` Pavel Machek
2009-07-15 17:33     ` Trilok Soni
2009-07-21 10:21       ` Pavel Machek
2009-07-21 10:34         ` Trilok Soni
2009-08-08 13:40           ` Synaptics touchscreen for HTC Dream: check that smbus is available Pavel Machek
2009-08-17 23:47             ` Andrew Morton
2009-08-21 14:23               ` Pavel Machek
2009-07-21 10:59       ` Threaded interrupts for synaptic touchscreen in HTC dream Pavel Machek
2009-07-21 11:36         ` Mark Brown
2009-07-21 12:18           ` Trilok Soni
2009-07-21 12:30             ` Trilok Soni
2009-07-21 12:49               ` Mark Brown
2009-07-21 16:04                 ` Dmitry Torokhov
2009-07-21 20:30                   ` Thomas Gleixner
2009-07-21 20:58                     ` Dmitry Torokhov
2009-07-21 21:48                       ` Thomas Gleixner
2009-07-21 22:25                     ` Mark Brown
2009-07-22 10:44                       ` Thomas Gleixner
2009-07-22 12:18                         ` Mark Brown
2009-07-22 12:58                           ` Thomas Gleixner
2009-07-22 13:30                             ` Peter Zijlstra
2009-07-22 14:18                               ` Thomas Gleixner
2009-07-22 14:32                                 ` Mark Brown
2009-07-22 14:52                                   ` Thomas Gleixner
2009-07-22 14:56                                     ` Mark Brown
2009-07-22 15:15                                       ` Thomas Gleixner
2009-07-22 15:56                                         ` Mark Brown
2009-07-22 16:57                               ` David Brownell
2009-07-22 21:04                                 ` Thomas Gleixner
2009-07-22 21:57                                   ` Arve Hjønnevåg
2009-07-22 22:15                                     ` David Brownell
2009-07-22 23:30                                       ` Arve Hjønnevåg
2009-07-22 22:09                                   ` David Brownell
2009-07-23  4:43                                   ` Dmitry Torokhov
2009-07-22 13:31                             ` Mark Brown
2009-07-22 17:04                               ` David Brownell
2009-07-22 17:08                                 ` Mark Brown
2009-07-22 16:04                             ` Dmitry Torokhov
2009-07-22 16:40                               ` Thomas Gleixner
2009-07-22 16:57                                 ` Mark Brown
2009-07-22 17:08                                 ` Dmitry Torokhov
2009-07-22 17:13                                 ` David Brownell
2009-07-22 16:51                             ` David Brownell
2009-07-22 16:39                     ` David Brownell
2009-07-22 16:43                       ` Thomas Gleixner
2009-07-22 17:34                         ` David Brownell
2009-07-22 16:50                       ` Mark Brown
2009-07-22 17:41                     ` David Brownell
2009-07-21 20:43                   ` Daniel Ribeiro
2009-07-21 12:30             ` Mark Brown
2009-07-23 14:55           ` Pavel Machek
2009-07-15 21:33     ` Support " Arve Hjønnevåg
2009-07-21 10:40       ` Pavel Machek
2009-07-14 17:52 ` Dmitry Torokhov
2009-07-15 13:48   ` Pavel Machek
2009-07-15 15:27     ` Dmitry Torokhov
2009-07-15 15:33       ` Brian Swetland
2009-07-15 17:26         ` Trilok Soni
2009-07-15 18:43       ` Arve Hjønnevåg
2009-07-15 20:24     ` Arve Hjønnevåg
2009-07-15 13:50   ` Pavel Machek
2009-08-08 14:02   ` Pavel Machek [this message]
2009-07-14 20:25 ` Andreas Mohr
2009-07-14 20:33   ` Andreas Mohr

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=20090808140250.GC13226@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=akpm@osdl.org \
    --cc=arve@android.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swetland@google.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

all inboxes | Powered by JetHome®