linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Dmitry Osipenko <digetx@gmail.com>,
	Johnny Chuang <johnny.chuang.emc@gmail.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624
Date: Thu, 10 Dec 2020 23:22:09 -0800	[thread overview]
Message-ID: <X9MeISZqBcvcnYXe@google.com> (raw)
In-Reply-To: <fa6a0e3f95803d6eab39cd0e3ba188842274a1e0.1607669375.git.mirq-linux@rere.qmqm.pl>

Hi Michał,

On Fri, Dec 11, 2020 at 07:53:56AM +0100, Michał Mirosław wrote:
> +
> +	if (!phy_x || !phy_y) {
> +		dev_warn(&client->dev,
> +			 "invalid size data: %d x %d mm\n",
> +			 phy_x, phy_y);
> +		return 0;

Given we are not treating this as hard error mind dropping this "return"
and making the below an "else" branch?

> +	}
> +
> +	dev_dbg(&client->dev, "phy_x=%d, phy_y=%d\n", phy_x, phy_y);
> +
> +	/* calculate resolution from size */
> +	ts->x_max = 2240-1;
> +	ts->x_res = DIV_ROUND_CLOSEST(ts->prop.max_x, phy_x);
> +
> +	ts->y_max = 1408-1;
> +	ts->y_res = DIV_ROUND_CLOSEST(ts->prop.max_y, phy_y);
> +
> +	return 0;
> +}
> +

>  
> +	if (client->dev.of_node)
> +		ts->chip_id = (uintptr_t)of_device_get_match_data(&client->dev);

Why don't we add EKTH3500 tag to the ACPI entry and make this
unconditional device_get_match_data()?

> +
>  	ts->vcc33 = devm_regulator_get(&client->dev, "vcc33");
>  	if (IS_ERR(ts->vcc33)) {
>  		error = PTR_ERR(ts->vcc33);
> @@ -1495,7 +1568,8 @@ MODULE_DEVICE_TABLE(acpi, elants_acpi_id);
>  
>  #ifdef CONFIG_OF
>  static const struct of_device_id elants_of_match[] = {
> -	{ .compatible = "elan,ekth3500" },
> +	{ .compatible = "elan,ekth3500", .data = (void *)EKTH3500 },
> +	{ .compatible = "elan,ektf3624", .data = (void *)EKTF3624 },
>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, elants_of_match);
> -- 
> 2.20.1
> 

Thanks.

-- 
Dmitry

  reply	other threads:[~2020-12-11  7:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11  6:53 [PATCH RESEND v8 0/4] input: elants: Support Asus TF300T and Nexus 7 touchscreens Michał Mirosław
2020-12-11  6:53 ` [PATCH RESEND v8 2/4] input: elants: support old touch report format Michał Mirosław
2020-12-11  7:29   ` Dmitry Torokhov
2020-12-11 16:09     ` Michał Mirosław
2020-12-11 16:39       ` Dmitry Osipenko
2020-12-11 17:04         ` Michał Mirosław
2020-12-11 18:48           ` Dmitry Torokhov
2021-01-07 22:06             ` Dmitry Osipenko
2021-01-22 20:10               ` Dmitry Osipenko
2021-01-22 22:37                 ` Michał Mirosław
2021-01-23 14:07                   ` Dmitry Osipenko
2020-12-11  6:53 ` [PATCH RESEND v8 1/4] input: elants: document some registers and values Michał Mirosław
2020-12-11  7:11   ` Dmitry Torokhov
2020-12-11  6:53 ` [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624 Michał Mirosław
2020-12-11  7:22   ` Dmitry Torokhov [this message]
2020-12-11 16:38     ` Michał Mirosław
2020-12-11  6:53 ` [PATCH RESEND v8 4/4] input: elants: support 0x66 reply opcode for reporting touches Michał Mirosław
2020-12-11  7:36   ` Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2020-11-09 17:28 [PATCH RESEND v8 0/4] input: elants: Support Asus TF300T and Nexus 7 touchscreens Michał Mirosław
2020-11-09 17:28 ` [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624 Michał Mirosław

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=X9MeISZqBcvcnYXe@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=digetx@gmail.com \
    --cc=johnny.chuang.emc@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --subject='Re: [PATCH RESEND v8 3/4] input: elants: read touchscreen size for EKTF3624' \
    /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

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).