Re: [PATCH v5 2/2] Input: add support for the Samsung S6SY761 touchscreen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux