public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Andi Shyti <andi-ahk0KpmfxKRAfugRpC6u6w@public.gmane.org>
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Andi Shyti <andi.shyti-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
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-ahk0KpmfxKRAfugRpC6u6w@public.gmane.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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent 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] add support for the Samsung S6SY761 touchscreen Andi Shyti
2017-11-02  6:07   ` [PATCH v5 1/2] dt-bindings: Input: add Samsung S6SY761 touchscreen binding file Andi Shyti
2017-11-02  6:07   ` [PATCH v5 2/2] Input: add support for the Samsung S6SY761 touchscreen Andi Shyti
     [not found]     ` <20171102060726.3745-3-andi-ahk0KpmfxKRAfugRpC6u6w@public.gmane.org>
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-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=andi-ahk0KpmfxKRAfugRpC6u6w@public.gmane.org \
    --cc=andi.shyti-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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