Thread (8 messages) 8 messages, 4 authors, 2020-10-21

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

From: dmitry.torokhov@gmail.com
Date: 2020-10-21 21:16:54
Also in: linux-devicetree, lkml, phone-devel

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help