mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Trilok Soni <soni.trilok@gmail.com>
Cc: Arve Hj?nnev?g <arve@android.com>,
	kernel list <linux-kernel@vger.kernel.org>,
	Brian Swetland <swetland@google.com>,
	dmitry.torokhov@gmail.com, dtor@mail.ru,
	linux-input@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	linux-i2c@vger.kernel.org
Subject: Re: Support for synaptic touchscreen in HTC dream
Date: Wed, 15 Jul 2009 15:36:27 +0200	[thread overview]
Message-ID: <20090715133627.GA2538@elf.ucw.cz> (raw)
In-Reply-To: <5d5443650907140320w334864f4uc1ee13ed32fdb874@mail.gmail.com>

Hi!

> > +static void decode_report(struct synaptics_ts_data *ts, u8 *buf)
> > +{
> 
> some documentation about this logic would be great.

Arve, can you help here?


> > +       int pos[2][2];
> > +       int f, a;
> > +       int base = 2;
> > +       int z = buf[1];
> > +       int w = buf[0] >> 4;
> > +       int finger = buf[0] & 7;
> > +       int finger2_pressed;
> > +
> > +       for (f = 0; f < 2; f++) {
> > +               u32 flip_flag = SYNAPTICS_FLIP_X;
> > +               for (a = 0; a < 2; a++) {
> > +                       int p = buf[base + 1];
> > +                       p |= (u16)(buf[base] & 0x1f) << 8;
> > +                       if (ts->flags & flip_flag)
> > +                               p = ts->max[a] - p;
> > +                       if (ts->flags & SYNAPTICS_SNAP_TO_INACTIVE_EDGE) {


> > +static irqreturn_t synaptics_ts_irq_handler(int irq, void *dev_id)
> > +{
> > +       struct synaptics_ts_data *ts = dev_id;
> > +
> > +       disable_irq(ts->client->irq);
> 
> disable_irq_nosync or convert this to request_threaded_irq(...).
> Please see recent discussion on linux-input for MAX key switch
> controller.

Do you have a link? (I replaced it with disable_irq_nosync, if that is
enough...)

> > +static int synaptics_ts_probe(
> > +       struct i2c_client *client, const struct i2c_device_id *id)
> > +{
> 
> __devinit ?

Ok.

> > +       if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
> 
> check for SMBUS? I have added linux-i2c as this driver has i2c bits,
> so not removing any code.

I guess this driver is only probed on mach-pxa... on machines that
have the neccessary hardware.

> > +               printk(KERN_ERR "synaptics_ts_probe: need I2C_FUNC_I2C\n");
> 
> dev_xxx/pr_xxx friends?

Fixed all occurences.


> > +       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";
> 
> other parameters of input_dev, like vendor, bus etc.,

Ok, what are those for? I can probably invent some dummy values, but...

> > +       set_bit(EV_SYN, ts->input_dev->evbit);
> > +       set_bit(EV_KEY, ts->input_dev->evbit);
> > +       set_bit(BTN_TOUCH, ts->input_dev->keybit);
> > +       set_bit(BTN_2, ts->input_dev->keybit);
> > +       set_bit(EV_ABS, ts->input_dev->evbit);
> > +
> 
> __set_bit or input_set_capability please.

__set_bit is easier, done.

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

Applied.


> > +static int synaptics_ts_suspend(struct i2c_client *client, pm_message_t mesg)
> > +{
> 
> #ifdef CONFIG_PM ?

Yep.

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

Umm, why? This is loaded from board-*.c files, and I don't think i2c
has enumeration capabilities.
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2009-07-15 13:36 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-14 10:06 Pavel Machek
2009-07-14 10:20 ` Trilok Soni
2009-07-15 13:36   ` Pavel Machek [this message]
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   ` HTC Dream for staging: small cleanups [was Re: Support for synaptic touchscreen in HTC dream] Pavel Machek
2009-07-14 20:25 ` Support for synaptic touchscreen in HTC dream 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=20090715133627.GA2538@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=akpm@osdl.org \
    --cc=arve@android.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dtor@mail.ru \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=soni.trilok@gmail.com \
    --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®