linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Magnus Damm" <magnus.damm@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-sh@vger.kernel.org,
	lethal@linux-sh.org, broonie@sirena.org.uk,
	akpm@linux-foundation.org
Subject: Re: [PATCH] Touch screen driver for the SuperH MigoR board V2
Date: Fri, 4 Apr 2008 17:21:48 +0900	[thread overview]
Message-ID: <aec7e5c30804040121k584a0ae5o909b48fbd970245d@mail.gmail.com> (raw)
In-Reply-To: <20080402060819.GB14189@anvil.corenet.prv>

Hi Dmitry,

On Wed, Apr 2, 2008 at 3:08 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>  On Fri, Mar 28, 2008 at 06:51:01PM +0900, Magnus Damm wrote:
>  > This is V2 of the MigoR touch screen driver. The chip we interface to
>  > is unfortunately a custom designed microcontroller speaking some
>  > undocumented protocol over i2c.
>
>  Thank you for the patch, I just have a couple of comments below...

Your comments are much appreciated.

>  > +     if ((event == EVENT_PENDOWN) || (event == EVENT_REPEAT)) {
>  > +             input_report_key(priv->input, BTN_TOUCH, 1);
>  > +             input_report_abs(priv->input, ABS_X, ypos); /*X-Y swap*/
>  > +             input_report_abs(priv->input, ABS_Y, xpos);
>  > +             input_report_abs(priv->input, ABS_PRESSURE, 120);
>  > +             input_sync(priv->input);
>  > +     } else if (event == EVENT_PENUP) {
>  > +             input_report_abs(priv->input, ABS_PRESSURE, 0);
>
>  Don't you need to signal BTN_TOUCH release here?

Yes, you are correct. It is missing.

>  > +     input_set_abs_params(priv->input, ABS_X, 95, 955, 0, 0);
>  > +     input_set_abs_params(priv->input, ABS_Y, 85, 935, 0, 0);
>  > +     input_set_abs_params(priv->input, ABS_PRESSURE, 0, 0, 0, 0);
>
>  The device does not support pressure reporting so don't pretend
>  to send one. If this was done because of tslib please fix tslib
>  instead.

Right, there is no need to pretend.

>  > +     priv->input->name = client->driver_name;
>  > +     priv->input->phys = "input/event0";
>
>  Normally we encode bus slot or port in phys. If this data
>  is unavailable it is better to omit phys altogether.
>
>  What we can and should do is properly set up input device in
>  sysfs hierarchy by parenting it to the i2c client:
>
>         input->dev.parent = &client->dev;

Much better, thank you.

>  > +     priv->input->id.bustype = BUS_ISA;
>
>  Not BUS_i2C?

Yes please, BUS_I2C. =)

>  > +     if (request_irq(priv->irq, migor_ts_isr, IRQF_TRIGGER_LOW,
>  > +                     client->driver_name, priv)) {
>  > +             dev_err(&client->dev, "Unable to request touchscreen IRQ.\n");
>  > +             res = -EBUSY;
>  > +             goto err2;
>  > +     }
>  > +
>  > +     /* enable controller */
>  > +     if (i2c_master_send(client, migor_ts_ena_seq, sizeof(migor_ts_ena_seq))
>  > +         == sizeof(migor_ts_ena_seq))
>  > +             return 0;
>  > +
>  > +     dev_err(&client->dev, "Unable to enable touchscreen.\n");
>  > +
>
>  Since you are not setting res here you will signal success the module
>  loader and bad things will happen.

Yeah. Good catch.

>  I tried implementing my suggestions in the patch below, please let me
>  know if it still works for you and I will apply it.

I just tested using latest sh-2.6 git with evtest. Everything seems to
work well. The patch is much cleaner now. Please apply.

Thank you!

/ magnus

  reply	other threads:[~2008-04-04  8:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28  9:51 [PATCH] Touch screen driver for the SuperH MigoR board V2 Magnus Damm
2008-04-02  6:08 ` Dmitry Torokhov
2008-04-04  8:21   ` Magnus Damm [this message]
2008-04-04 16:14     ` Dmitry Torokhov
2008-04-25 10:29       ` Magnus Damm
2008-04-27  5:07         ` Dmitry Torokhov
2008-05-07 12:14           ` Magnus Damm

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=aec7e5c30804040121k584a0ae5o909b48fbd970245d@mail.gmail.com \
    --to=magnus.damm@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=broonie@sirena.org.uk \
    --cc=dmitry.torokhov@gmail.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-sh@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).