mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/1 v2] input: add qt1070 touch keyboard support
Date: Sat, 3 Nov 2012 08:32:43 +0100	[thread overview]
Message-ID: <20121103073243.GV29599@game.jcrosoft.org> (raw)
In-Reply-To: <20121102201535.GO1641@pengutronix.de>

> > +}
> > +
> > +static int __init qt1070_probe(struct device_d *dev)
> > +{
> > +	struct console_device *cdev;
> > +	struct qt1070_data *data;
> > +	u8 fw_version, chip_id;
> > +	int ret;
> > +	char buf[6];
> > +
> > +	data = xzalloc(sizeof(*data));
> > +	data->client = to_i2c_client(dev);
> > +
> > +	ret = qt1070_read(data, QT1070_READ_CHIP_ID, &chip_id);
> > +	if (ret) {
> > +		dev_err(dev, "can not read chip id (%d)\n", ret);
> > +		goto err;
> > +	}
> > +
> > +	if (chip_id != QT1070_CHIP_ID) {
> > +		dev_err(dev, "unsupported id 0x%x\n", chip_id);
> > +		ret = -ENXIO;
> > +		goto err;
> > +	}
> > +
> > +	ret = qt1070_read(data, QT1070_FW_VERSION, &fw_version);
> > +	if (ret) {
> > +		dev_err(dev, "can not read firmware version (%d)\n", ret);
> > +		goto err;
> > +	}
> > +
> > +	sprintf(buf, "0x%x", fw_version);
> > +	dev_add_param_fixed(dev, "fw_version", buf);
> > +	sprintf(buf, "0x%x", chip_id);
> > +	dev_add_param_fixed(dev, "chip_ip", buf);
> > +
> > +	/* Calibrate device */
> > +	qt1070_write(data, QT1070_CALIBRATE_CMD, 1);
> > +	if (ret) {
> > +		dev_err(dev, "can not calibreate the chip (%d)\n", ret);
> 
> s/calibreate/calibrate/
> 
> > +		goto err;
> > +	}
> > +	mdelay(QT1070_CAL_TIME);
> > +
> > +	/* Soft reset */
> > +	ret = qt1070_write(data, QT1070_RESET, 1);
> > +	if (ret) {
> > +		dev_err(dev, "can not reset the chip (%d)\n", ret);
> > +		goto err;
> > +	}
> > +	mdelay(QT1070_RESET_TIME);
> > +
> 
> This delays the boot by about half a second. If you register
> a poller anyway you could use it to wait until the reset finished.
ok
> 
> > +	memcpy(data->code, default_code, sizeof(int) * ARRAY_SIZE(default_code));
> > +	if (dev->platform_data) {
> > +		struct qt1070_platform_data *pdata = dev->platform_data;
> > +
> > +		memcpy(data->code, pdata->code, sizeof(int) * pdata->nb_code);
> > +	}
> > +
> > +	data->fifo_size = 50;
> 
> I wonder if such a deep fifo is useful. If the user
> plays with the buttons when and nobody empties the fifo
> at that time you will end up with 50 old button presses
> in the fifo. It may be better to just store the last button
> in a variable. This would also fix the problem that when
> the fifo is full you discard the newest buttons. It's
> better to drop the oldest buttons.
no the touch can report 7 keys at the same time so I put 50.

If we pessed 2 times 7 keys before barebox read we have 14 * sifeod(int) = 56
bytes so I think 50 is ok

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-11-03  7:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01 13:22 [PATCH 1/1] " Jean-Christophe PLAGNIOL-VILLARD
2012-11-01 13:52 ` [PATCH 1/1 v2] " Jean-Christophe PLAGNIOL-VILLARD
2012-11-02 20:15   ` Sascha Hauer
2012-11-03  7:32     ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-11-03 11:26   ` [PATCH 1/1 v3] " Jean-Christophe PLAGNIOL-VILLARD

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=20121103073243.GV29599@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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