lkml.org 
[lkml]   [2020]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 2/3] Input: Add Novatek NT36xxx touchscreen driver
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@gmail.com 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

\
 
 \ /
  Last update: 2020-10-21 23:17    [W:0.061 / U:4.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site