linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: robh+dt@kernel.org, andriy.shevchenko@linux.intel.com,
	bparrot@ti.com, andy.shevchenko@gmail.com,
	simon.budig@kernelconcepts.de, hdegoede@redhat.com,
	fcooper@ti.com, mripard@kernel.org,
	alexandre.belloni@bootlin.com, shawnguo@kernel.org,
	devicetree@vger.kernel.org, kernel@pengutronix.de,
	linux-input@vger.kernel.org,
	Philipp Zabel <p.zabel@pengutronix.de>
Subject: Re: [PATCH v3 1/6] Input: edt-ft5x06: work around first register access error
Date: Thu, 9 Jan 2020 17:06:37 -0800	[thread overview]
Message-ID: <20200110010637.GK8314@dtor-ws> (raw)
In-Reply-To: <20200108111050.19001-2-m.felsch@pengutronix.de>

On Wed, Jan 08, 2020 at 12:10:45PM +0100, Marco Felsch wrote:
> From: Philipp Zabel <p.zabel@pengutronix.de>
> 
> The EP0700MLP1 returns bogus data on the first register read access
> (reading the threshold parameter from register 0x00):
> 
>     edt_ft5x06 2-0038: crc error: 0xfc expected, got 0x40
> 
> It ignores writes until then. This patch adds a dummy read after which
> the number of sensors and parameter read/writes work correctly.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied, thank you.

> ---
>  drivers/input/touchscreen/edt-ft5x06.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
> index d61731c0037d..b87b1e074f62 100644
> --- a/drivers/input/touchscreen/edt-ft5x06.c
> +++ b/drivers/input/touchscreen/edt-ft5x06.c
> @@ -1050,6 +1050,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
>  {
>  	const struct edt_i2c_chip_data *chip_data;
>  	struct edt_ft5x06_ts_data *tsdata;
> +	u8 buf[2] = { 0xfc, 0x00 };
>  	struct input_dev *input;
>  	unsigned long irq_flags;
>  	int error;
> @@ -1140,6 +1141,12 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
>  		return error;
>  	}
>  
> +	/*
> +	 * Dummy read access. EP0700MLP1 returns bogus data on the first
> +	 * register read access and ignores writes.
> +	 */
> +	edt_ft5x06_ts_readwrite(tsdata->client, 2, buf, 2, buf);
> +
>  	edt_ft5x06_ts_set_regs(tsdata);
>  	edt_ft5x06_ts_get_defaults(&client->dev, tsdata);
>  	edt_ft5x06_ts_get_parameters(tsdata);
> -- 
> 2.20.1
> 

-- 
Dmitry

  reply	other threads:[~2020-01-10  1:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08 11:10 [PATCH v3 0/6] EDT-FT5x06 improvements Marco Felsch
2020-01-08 11:10 ` [PATCH v3 1/6] Input: edt-ft5x06: work around first register access error Marco Felsch
2020-01-10  1:06   ` Dmitry Torokhov [this message]
2020-01-08 11:10 ` [PATCH v3 2/6] Input: edt-ft5x06 - alphabetical include reorder Marco Felsch
2020-01-10  1:06   ` Dmitry Torokhov
2020-01-08 11:10 ` [PATCH v3 3/6] dt-bindings: Input: edt-ft5x06 - document wakeup-source capability Marco Felsch
2020-01-10  1:07   ` Dmitry Torokhov
2020-01-08 11:10 ` [PATCH v3 4/6] Input: edt-ft5x06 - make wakeup-source switchable Marco Felsch
2020-01-10  1:07   ` Dmitry Torokhov
2020-01-08 11:10 ` [PATCH v3 5/6] Input: edt-ft5x06 - use pm core to enable/disable the wake irq Marco Felsch
2020-01-10  1:07   ` Dmitry Torokhov
2020-01-08 11:10 ` [PATCH v3 6/6] Input: edt-ft5x06 - improve power management operations Marco Felsch
2020-01-10  1:09   ` Dmitry Torokhov
2020-01-10  7:16     ` Marco Felsch
2020-01-10  7:18       ` Marco Felsch
2020-01-16 13:32         ` Marco Felsch
2020-01-22  6:00           ` Dmitry Torokhov

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=20200110010637.GK8314@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bparrot@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fcooper@ti.com \
    --cc=hdegoede@redhat.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-input@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=mripard@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=simon.budig@kernelconcepts.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;
as well as URLs for NNTP newsgroup(s).