linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Henrik Rydberg <rydberg@euromail.se>,
	linux-input@vger.kernel.org,
	Benjamin Tissoires <benjamin.tissoires@gmail.com>
Subject: Re: [PATCH v2] Input: driver for the Goodix touchpanel
Date: Tue, 28 Oct 2014 23:31:30 +0100	[thread overview]
Message-ID: <1414535490.2406.20.camel@hadess.net> (raw)
In-Reply-To: <20141028191446.GA7461@dtor-ws>

On Tue, 2014-10-28 at 12:14 -0700, Dmitry Torokhov wrote:
> On Tue, Oct 28, 2014 at 07:59:05PM +0100, Bastien Nocera wrote:
> > On Tue, 2014-10-28 at 11:05 -0700, Dmitry Torokhov wrote:
> > > On Tue, Oct 28, 2014 at 06:55:21PM +0100, Bastien Nocera wrote:
> > > > On Tue, 2014-10-07 at 13:58 -0700, Dmitry Torokhov wrote:
> > > > > On Wed, Sep 24, 2014 at 04:43:58PM +0200, Bastien Nocera wrote:
> > > > > > +static irqreturn_t goodix_ts_irq_handler(int irq, void *dev_id)
> > > > > > +{
> > > > > > +	struct goodix_ts_data *ts = dev_id;
> > > > > > +	u8  end_cmd[1] = {0};
> > > > > > +
> > > > > > +	goodix_process_events(ts);
> > > > > > +
> > > > > > +	if (goodix_i2c_write(ts->client,
> > > > > > +				GOODIX_READ_COOR_ADDR, end_cmd, 1) < 0)
> > > > > > +		dev_err(&ts->client->dev, "I2C write end_cmd error");
> > > > > 
> > > > > I am not happy that we need to allocate/deallocate memory for each
> > > > > interrupt. We only write one command to the driver, we could simply use
> > > > > i2c_master_send() with a constant buffer.
> > > > 
> > > > Sure. But I've split up the patch you sent us, and committed the
> > > > different bits separately in:
> > > > https://github.com/hadess/gt9xx/commits/master
> > > > 
> > > > And this one commit about removing goodix_i2c_write():
> > > > https://github.com/hadess/gt9xx/commit/146b4cc2eed5c67bcf1cb91e845bf9f97da4be1e
> > > > 
> > > > Breaks the driver.
> > > 
> > > Ah, I see. In end_cmd I encoded the address as little endian, whereas it
> > > needs to be beg endian. Just swap "GOODIX_READ_COOR_ADDR & 0xff" and
> > > "GOODIX_READ_COOR_ADDR >> 8" around and I thin kit will work.
> > 
> > Indeed, fixed in:
> > https://github.com/hadess/gt9xx/commit/18e507c5c455a3d3d745380c4d0d561ea470a091
> > 
> > As for the various FIXMEs, could you (that includes Benjamin that
> > probably knows the driver more than he would like to) check whether
> > that's sensible?
> > https://github.com/hadess/gt9xx/commit/35b94f327edc04d95a7208a667553566faa871e3
> > 
> > If it is, I'll respin the patch and send it for merging.
> 
> No, the "header" is not 10 bytes as far as I can see. IIUIC the device
> sends packet with 1st byte containing number of contacts + (n_contacts *
> GOODIX_CONTACT_SIZE) worth of data. The driver tries to optimize for
> single-touch scenario and reads the counter and the very first contact
> data and if the counter indicates more than one contact it will issue
> second i2c transaction to read in the rest.
> 
> Your change did not alter the actual code, it just converted constant 10
> into a define.

Not quite, but that's besides the point.

> Please try changing FIXMEs exactly as they were and see if the driver
> still works properly.

I did, and it still works properly. I also don't understand how it could
have worked properly before...

Should I still add those linefeeds to all the print statements in the
driver?

Cheers


  reply	other threads:[~2014-10-28 22:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24 14:43 [PATCH v2] Input: driver for the Goodix touchpanel Bastien Nocera
2014-10-07 20:58 ` Dmitry Torokhov
2014-10-28 17:55   ` Bastien Nocera
2014-10-28 18:05     ` Dmitry Torokhov
2014-10-28 18:59       ` Bastien Nocera
2014-10-28 19:14         ` Dmitry Torokhov
2014-10-28 22:31           ` Bastien Nocera [this message]
2014-10-28 23:04             ` Dmitry Torokhov
2014-10-29  0:54               ` Bastien Nocera
2014-10-28 19:16         ` Benjamin Tissoires

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=1414535490.2406.20.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=benjamin.tissoires@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=rydberg@euromail.se \
    /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).