Re: [PATCH v5 2/3] Input: Add Novatek NT36xxx touchscreen driver

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

 



Hi AngeloGioacchino,

[obviously not a complete review, but wanted to call out regmap concern]

On Sat, Oct 17, 2020 at 09:01:51PM +0200, kholk11@xxxxxxxxx wrote:
> +static int nt36xxx_read_pid(struct nt36xxx_i2c *ts)
> +{
> +	u8 buf[2] = { 0 };

	__be16 pid;

> +	int ret = 0;
> +
> +	ret = nt36xxx_set_page(ts, ts->mmap->evtbuf_addr);
> +	if (unlikely(ret < 0))
> +		return ret;

regmap is supposed to help with the paged registers, that is why I
recommended using it.

> +
> +	ret = regmap_noinc_read(ts->fw_regmap, NT36XXX_EVT_PROJECTID,
> +				buf, sizeof(buf));
> +	if (unlikely(ret < 0))
> +		return ret;
> +
> +	ts->fw_info.nvt_pid = (buf[1] << 8) + buf[0];

	ts->fw_info.nvt_pid = be16_to_cpu(pid);

Thanks.

-- 
Dmitry



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux