All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Add Novatek NT36xxx touchscreen driver
@ 2020-09-27 12:35 kholk11
  2020-09-27 12:35 ` [PATCH v2 1/3] dt-bindings: Add vendor prefix for Novatek Microelectronics Corp kholk11
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: kholk11 @ 2020-09-27 12:35 UTC (permalink / raw)
  To: dmitry.torokhov
  Cc: robh+dt, rydberg, priv.luk, linux-input, linux-kernel, kholk11,
	marijns95, konradybcio, martin.botka1, phone-devel

From: AngeloGioacchino Del Regno <kholk11@gmail.com>

This patch series adds support for the Novatek NT36xxx Series' In-Cell
touchscreen (integrated into the DriverIC).

This patch series has been tested against the following devices:
 - Sony Xperia 10        (SDM630 Ganges Kirin)
 - Sony Xperia 10 Plus   (SDM636 Ganges Mermaid)

Changes in v2:
- Fixed sparse warnings from lkp kernel test robot

AngeloGioacchino Del Regno (3):
  dt-bindings: Add vendor prefix for Novatek Microelectronics Corp.
  Input: Add Novatek NT36xxx touchscreen driver
  dt-bindings: touchscreen: Add binding for Novatek NT36xxx series
    driver

 .../input/touchscreen/novatek,nt36xxx.yaml    |  56 ++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 drivers/input/touchscreen/Kconfig             |  12 +
 drivers/input/touchscreen/Makefile            |   1 +
 drivers/input/touchscreen/nt36xxx.c           | 742 ++++++++++++++++++
 drivers/input/touchscreen/nt36xxx.h           | 122 +++
 6 files changed, 935 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/novatek,nt36xxx.yaml
 create mode 100644 drivers/input/touchscreen/nt36xxx.c
 create mode 100644 drivers/input/touchscreen/nt36xxx.h

-- 
2.28.0


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/3] Input: Add Novatek NT36xxx touchscreen driver
@ 2020-10-03  3:26 kernel test robot
  0 siblings, 0 replies; 12+ messages in thread
From: kernel test robot @ 2020-10-03  3:26 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 7298 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200927123542.553852-3-kholk11@gmail.com>
References: <20200927123542.553852-3-kholk11@gmail.com>
TO: kholk11(a)gmail.com
TO: dmitry.torokhov(a)gmail.com
CC: robh+dt(a)kernel.org
CC: rydberg(a)bitmath.org
CC: priv.luk(a)gmail.com
CC: linux-input(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
CC: kholk11(a)gmail.com
CC: marijns95(a)gmail.com
CC: konradybcio(a)gmail.com
CC: martin.botka1(a)gmail.com

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on input/next]
[also build test WARNING on robh/for-next v5.9-rc7 next-20201002]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/kholk11-gmail-com/Add-Novatek-NT36xxx-touchscreen-driver/20200927-203756
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
:::::: branch date: 6 days ago
:::::: commit date: 6 days ago
config: i386-randconfig-m021-20201003 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/input/touchscreen/nt36xxx.c:470 nt36xxx_i2c_chip_version_init() warn: calling memset(x, y, ARRAY_SIZE());

vim +470 drivers/input/touchscreen/nt36xxx.c

6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  442  
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  443  static int nt36xxx_i2c_chip_version_init(struct nt36xxx_i2c *ts)
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  444  {
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  445  	u8 buf[7] = { 0 };
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  446  	int retry = NT36XXX_MAX_RETRIES;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  447  	int sz = sizeof(trim_id_table) / sizeof(struct nt36xxx_trim_table);
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  448  	int i, list, mapid, ret;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  449  
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  450  	ret = nt36xxx_bootloader_reset(ts);
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  451  	if (ret < 0) {
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  452  		dev_err(&ts->client->dev, "Can't reset the nvt IC\n");
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  453  		return ret;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  454  	}
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  455  
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  456  	do {
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  457  		ret = nt36xxx_sw_reset_idle(ts);
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  458  		if (ret < 0)
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  459  			continue;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  460  
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  461  		buf[0] = 0x00;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  462  		buf[1] = NT36XXX_CMD_UNLOCK;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  463  		nt36xxx_write(ts->client, ts->client->addr, buf, 2);
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  464  		usleep_range(10000, 11000);
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  465  
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  466  		ret = nt36xxx_set_page(ts, NT36XXX_PAGE_CHIP_INFO);
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  467  		if (ret < 0)
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  468  			continue;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  469  
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27 @470  		memset(buf, 0, ARRAY_SIZE(buf));
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  471  		buf[0] = NT36XXX_EVT_CHIPID;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  472  		nt36xxx_read(ts->client, NT36XXX_BLDR_ADDR, buf, 7);
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  473  
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  474  		/* Compare read chip id with trim list */
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  475  		for (list = 0; list < sz; list++) {
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  476  			/* Compare each not masked byte */
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  477  			for (i = 0; i < NT36XXX_ID_LEN_MAX; i++) {
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  478  				if (trim_id_table[list].mask[i] &&
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  479  				    buf[i + 1] != trim_id_table[list].id[i])
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  480  					break;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  481  			}
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  482  
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  483  			if (i == NT36XXX_ID_LEN_MAX) {
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  484  				mapid = trim_id_table[list].mapid;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  485  				ts->mmap = &nt36xxx_memory_maps[mapid];
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  486  				return 0;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  487  			}
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  488  
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  489  			ts->mmap = NULL;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  490  			ret = -ENOENT;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  491  		}
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  492  
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  493  		/* Stop CRC check to prevent IC auto reboot */
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  494  		if (((buf[1] == 0xFC) && (buf[2] == 0xFC) &&
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  495  		     (buf[3] == 0xFC)) ||
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  496  		    ((buf[1] == 0xFF) && (buf[2] == 0xFF) &&
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  497  		     (buf[3] == 0xFF))) {
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  498  			ret = nvt_stop_crc_reboot(ts);
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  499  			if (ret < 0)
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  500  				continue;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  501  		}
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  502  
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  503  		usleep_range(10000, 11000);
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  504  	} while (--retry);
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  505  
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  506  	return ret;
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  507  }
6375d650f6f53aa AngeloGioacchino Del Regno 2020-09-27  508  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31853 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-10-06 18:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-27 12:35 [PATCH v2 0/3] Add Novatek NT36xxx touchscreen driver kholk11
2020-09-27 12:35 ` [PATCH v2 1/3] dt-bindings: Add vendor prefix for Novatek Microelectronics Corp kholk11
2020-09-27 12:35 ` [PATCH v2 2/3] Input: Add Novatek NT36xxx touchscreen driver kholk11
2020-09-28  9:48   ` Amit Pundir
2020-09-28 21:51     ` Dmitry Torokhov
2020-09-29  7:58       ` Amit Pundir
2020-09-28 22:16   ` Dmitry Torokhov
2020-10-06 18:34   ` Dan Carpenter
2020-10-06 18:34     ` Dan Carpenter
2020-10-06 18:34     ` Dan Carpenter
2020-09-27 12:35 ` [PATCH v2 3/3] dt-bindings: touchscreen: Add binding for Novatek NT36xxx series driver kholk11
2020-10-03  3:26 [PATCH v2 2/3] Input: Add Novatek NT36xxx touchscreen driver kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.