mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andi Shyti <andi@etezian.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Andi Shyti <andi.shyti@samsung.com>
Subject: Re: [PATCH v5 2/2] Input: add support for the Samsung S6SY761 touchscreen
Date: Fri, 3 Nov 2017 16:57:40 -0700	[thread overview]
Message-ID: <20171103235740.cmdbenzsqts2mtsy@dtor-ws> (raw)
In-Reply-To: <20171102060726.3745-3-andi@etezian.org>

Hi Andi,

On Thu, Nov 02, 2017 at 03:07:26PM +0900, Andi Shyti wrote:
> +
> +	err = s6sy761_hw_init(sdata);
> +	if (err)
> +		return err;
> +
> +	sdata->input = devm_input_allocate_device(&client->dev);
> +	if (!sdata->input)
> +		return -ENOMEM;
> +
> +	sdata->input->name = S6SY761_DEV_NAME;
> +	sdata->input->id.bustype = BUS_I2C;
> +	sdata->input->open = s6sy761_input_open;
> +	sdata->input->close = s6sy761_input_close;
> +
> +	/* the range has been previously read in hw_init */
> +	if (sdata->prop.max_x && sdata->prop.max_y) {

You do not need make this a conditional, if sdata->prop.max_x or
sdata->prop.max_y is 0 is it OK.

However, there is a slight problem: you call hw_init() on resume,
potentially updating prop.max_x and prop.max_y and taking them out of
sync if they have been overridden by the DT data and
touchscreen_parse_properties(). I think it would be best if
s6sy761_hw_init() had 2 additional arguments for max_x and max_y and you
passed them to input_set_abs_params() and left sdata->prop to be managed
solely by touchscreen_parse_properties().

Also, is everything in s6sy761_hw_init() needed at resume time?

Thanks.

-- 
Dmitry

      reply	other threads:[~2017-11-03 23:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20171102060735epcas1p11d1055bff699a680e723abc4f4f52186@epcas1p1.samsung.com>
2017-11-02  6:07 ` [PATCH v5 0/2] " Andi Shyti
     [not found]   ` <CGME20171102060735epcas1p2885274174b0936c26741edf29678fc69@epcas1p2.samsung.com>
2017-11-02  6:07     ` [PATCH v5 1/2] dt-bindings: Input: add Samsung S6SY761 touchscreen binding file Andi Shyti
     [not found]   ` <CGME20171102060735epcas1p15ac186761046eb93f467cd69161e7b50@epcas1p1.samsung.com>
2017-11-02  6:07     ` [PATCH v5 2/2] Input: add support for the Samsung S6SY761 touchscreen Andi Shyti
2017-11-03 23:57       ` 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=20171103235740.cmdbenzsqts2mtsy@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=andi.shyti@samsung.com \
    --cc=andi@etezian.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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

all inboxes | Powered by JetHome®