Thread (13 messages) 13 messages, 6 authors, 2023-06-26

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

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2020-12-07 06:44:25
Also in: linux-devicetree, lkml, phone-devel

Hi AngeloGioacchino,

On Wed, Oct 28, 2020 at 11:13:01PM +0100, kholk11@gmail.com wrote:
+/**
+ * nt36xxx_set_page - Set page number for read/write
+ * @ts: Main driver structure
+ *
+ * Return: Always zero for success, negative number for error
+ */
+static int nt36xxx_set_page(struct nt36xxx_i2c *ts, u32 pageaddr)
+{
+	u32 data = cpu_to_be32(pageaddr) >> 8;
+	int ret;
+
+	ret = regmap_noinc_write(ts->fw_regmap, NT36XXX_CMD_SET_PAGE,
+				 &data, sizeof(data));
+	if (ret)
+		return ret;
+
+	usleep_range(100, 200);
+	return ret;
+}
Regmap is supposed to handle paged access for you as long as you set it
up for paged access. Why do you need custom page handling here?

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