linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Luca Weiss <luca@z3ntu.xyz>
Cc: linux-input@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Sven Van Asbroeck <thesven73@gmail.com>,
	Marek Vasut <marex@denx.de>, Thomas Gleixner <tglx@linutronix.de>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] Input: ili210x - add ili2120 support
Date: Sat, 15 Feb 2020 15:48:52 -0800	[thread overview]
Message-ID: <20200215234852.GM183709@dtor-ws> (raw)
In-Reply-To: <20200209151904.661210-1-luca@z3ntu.xyz>

On Sun, Feb 09, 2020 at 04:19:03PM +0100, Luca Weiss wrote:
> This adds support for the Ilitek ili2120 touchscreen found in the
> Fairphone 2 smartphone.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>

Applied, thank you.

> ---
> Changes from v1:
> - Rebase on master, adjust for upstream changes
> 
>  .../bindings/input/ilitek,ili2xxx.txt         |  3 +-
>  drivers/input/touchscreen/ili210x.c           | 32 +++++++++++++++++++
>  2 files changed, 34 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/ilitek,ili2xxx.txt b/Documentation/devicetree/bindings/input/ilitek,ili2xxx.txt
> index dc194b2c151a..cdcaa3f52d25 100644
> --- a/Documentation/devicetree/bindings/input/ilitek,ili2xxx.txt
> +++ b/Documentation/devicetree/bindings/input/ilitek,ili2xxx.txt
> @@ -1,9 +1,10 @@
> -Ilitek ILI210x/ILI2117/ILI251x touchscreen controller
> +Ilitek ILI210x/ILI2117/ILI2120/ILI251x touchscreen controller
>  
>  Required properties:
>  - compatible:
>      ilitek,ili210x for ILI210x
>      ilitek,ili2117 for ILI2117
> +    ilitek,ili2120 for ILI2120
>      ilitek,ili251x for ILI251x
>  
>  - reg: The I2C address of the device
> diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
> index 84bf51d79888..199cf3daec10 100644
> --- a/drivers/input/touchscreen/ili210x.c
> +++ b/drivers/input/touchscreen/ili210x.c
> @@ -167,6 +167,36 @@ static const struct ili2xxx_chip ili211x_chip = {
>  	.resolution		= 2048,
>  };
>  
> +static bool ili212x_touchdata_to_coords(const u8 *touchdata,
> +					unsigned int finger,
> +					unsigned int *x, unsigned int *y)
> +{
> +	u16 val;
> +
> +	val = get_unaligned_be16(touchdata + 3 + (finger * 5) + 0);
> +	if (!(val & BIT(15)))	/* Touch indication */
> +		return false;
> +
> +	*x = val & 0x3fff;
> +	*y = get_unaligned_be16(touchdata + 3 + (finger * 5) + 2);
> +
> +	return true;
> +}
> +
> +static bool ili212x_check_continue_polling(const u8 *data, bool touch)
> +{
> +	return touch;
> +}
> +
> +static const struct ili2xxx_chip ili212x_chip = {
> +	.read_reg		= ili210x_read_reg,
> +	.get_touch_data		= ili210x_read_touch_data,
> +	.parse_touch_data	= ili212x_touchdata_to_coords,
> +	.continue_polling	= ili212x_check_continue_polling,
> +	.max_touches		= 10,
> +	.has_calibrate_reg	= true,
> +};
> +
>  static int ili251x_read_reg(struct i2c_client *client,
>  			    u8 reg, void *buf, size_t len)
>  {
> @@ -447,6 +477,7 @@ static int ili210x_i2c_probe(struct i2c_client *client,
>  static const struct i2c_device_id ili210x_i2c_id[] = {
>  	{ "ili210x", (long)&ili210x_chip },
>  	{ "ili2117", (long)&ili211x_chip },
> +	{ "ili2120", (long)&ili212x_chip },
>  	{ "ili251x", (long)&ili251x_chip },
>  	{ }
>  };
> @@ -455,6 +486,7 @@ MODULE_DEVICE_TABLE(i2c, ili210x_i2c_id);
>  static const struct of_device_id ili210x_dt_ids[] = {
>  	{ .compatible = "ilitek,ili210x", .data = &ili210x_chip },
>  	{ .compatible = "ilitek,ili2117", .data = &ili211x_chip },
> +	{ .compatible = "ilitek,ili2120", .data = &ili212x_chip },
>  	{ .compatible = "ilitek,ili251x", .data = &ili251x_chip },
>  	{ }
>  };
> -- 
> 2.25.0
> 

-- 
Dmitry

      reply	other threads:[~2020-02-15 23:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-09 15:19 [PATCH v2] Input: ili210x - add ili2120 support Luca Weiss
2020-02-15 23:48 ` Dmitry Torokhov [this message]

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=20200215234852.GM183709@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca@z3ntu.xyz \
    --cc=marex@denx.de \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thesven73@gmail.com \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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).