All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Alistair Francis <alistair@alistair23.me>,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Cc: kbuild-all@lists.01.org, andreas@kemnade.info,
	alistair23@gmail.com, dmitry.torokhov@gmail.com,
	linus.walleij@linaro.org, robh+dt@kernel.org,
	rydberg@bitmath.org
Subject: Re: [PATCH 1/4] Input: Add driver for Cypress Generation 5 touchscreen
Date: Wed, 27 Oct 2021 11:45:15 +0800	[thread overview]
Message-ID: <202110271135.i0WiktuX-lkp@intel.com> (raw)
In-Reply-To: <20211025114214.44617-2-alistair@alistair23.me>

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

Hi Alistair,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on arm/for-next]
[also build test WARNING on xilinx-xlnx/master soc/for-next rockchip/for-next arm64/for-next/core shawnguo/for-next clk/clk-next linus/master keystone/next v5.15-rc7 next-20211026]
[cannot apply to dtor-input/next]
[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/Alistair-Francis/Add-support-for-the-Cypress-cyttsp5/20211025-194449
base:   git://git.armlinux.org.uk/~rmk/linux-arm.git for-next
config: sparc-randconfig-m031-20211027 (attached as .config)
compiler: sparc-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/0709ecf257374af4472f599dddb75dc13e7e46c9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alistair-Francis/Add-support-for-the-Cypress-cyttsp5/20211025-194449
        git checkout 0709ecf257374af4472f599dddb75dc13e7e46c9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sparc 

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

All warnings (new ones prefixed by >>):

   drivers/input/touchscreen/cyttsp5.c: In function 'cyttsp5_write':
>> drivers/input/touchscreen/cyttsp5.c:243:9: warning: ISO C90 forbids variable length array 'cmd' [-Wvla]
     243 |         u8 cmd[size + 1];
         |         ^~
   drivers/input/touchscreen/cyttsp5.c: In function 'cyttsp5_get_touch_axis':
>> drivers/input/touchscreen/cyttsp5.c:305:13: warning: variable 'next' set but not used [-Wunused-but-set-variable]
     305 |         int next;
         |             ^~~~
   drivers/input/touchscreen/cyttsp5.c: In function 'cyttsp5_get_mt_touches':
>> drivers/input/touchscreen/cyttsp5.c:333:9: warning: ISO C90 forbids variable length array 'ids' [-Wvla]
     333 |         DECLARE_BITMAP(ids, si->tch_abs[CY_TCH_T].max);
         |         ^~~~~~~~~~~~~~


vim +/cmd +243 drivers/input/touchscreen/cyttsp5.c

   239	
   240	static int cyttsp5_write(struct cyttsp5 *ts, unsigned int reg, u8 *data,
   241				 size_t size)
   242	{
 > 243		u8 cmd[size + 1];
   244	
   245		/* High bytes of register address needed as first byte of cmd */
   246		cmd[0] = HI_BYTE(reg);
   247	
   248		/* Copy the rest of the data */
   249		if (data)
   250			memcpy(&cmd[1], data, size);
   251	
   252		/* The hardware wants to receive a frame with the address register
   253		 * contains in the first two bytes. As the regmap_write function
   254		 * add the register adresse in the frame, we use the LOW_BYTE as
   255		 * first frame byte for the address register and the first
   256		 * data byte is the high register + left of the cmd to send
   257		 */
   258		return regmap_bulk_write(ts->regmap, LOW_BYTE(reg), cmd, size + 1);
   259	}
   260	
   261	static void cyttsp5_final_sync(struct input_dev *input, int max_slots,
   262				       unsigned long *ids)
   263	{
   264		int t;
   265	
   266		for (t = 0; t < max_slots; t++) {
   267			if (test_bit(t, ids))
   268				continue;
   269			input_mt_slot(input, t);
   270			input_mt_report_slot_state(input, MT_TOOL_FINGER, false);
   271		}
   272	
   273		input_sync(input);
   274	}
   275	
   276	static void cyttsp5_report_slot_liftoff(struct cyttsp5 *ts, int max_slots)
   277	{
   278		int t;
   279	
   280		if (ts->num_prv_rec == 0)
   281			return;
   282	
   283		for (t = 0; t < max_slots; t++) {
   284			input_mt_slot(ts->input, t);
   285			input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, false);
   286		}
   287	}
   288	
   289	static void cyttsp5_mt_lift_all(struct cyttsp5 *ts)
   290	{
   291		struct cyttsp5_sysinfo *si = &ts->sysinfo;
   292		int max = si->tch_abs[CY_TCH_T].max;
   293	
   294		if (ts->num_prv_rec != 0) {
   295			cyttsp5_report_slot_liftoff(ts, max);
   296			input_sync(ts->input);
   297			ts->num_prv_rec = 0;
   298		}
   299	}
   300	
   301	static void cyttsp5_get_touch_axis(int *axis, int size, int max, u8 *xy_data,
   302					   int bofs)
   303	{
   304		int nbyte;
 > 305		int next;
   306	
   307		for (nbyte = 0, *axis = 0, next = 0; nbyte < size; nbyte++)
   308			*axis = *axis + ((xy_data[nbyte] >> bofs) << (nbyte * 8));
   309	
   310		*axis &= max - 1;
   311	}
   312	
   313	static void cyttsp5_get_touch_record(struct cyttsp5 *ts,
   314					     struct cyttsp5_touch *touch, u8 *xy_data)
   315	{
   316		struct cyttsp5_sysinfo *si = &ts->sysinfo;
   317		enum cyttsp5_tch_abs abs;
   318	
   319		for (abs = CY_TCH_X; abs < CY_TCH_NUM_ABS; abs++) {
   320			cyttsp5_get_touch_axis(&touch->abs[abs],
   321					       si->tch_abs[abs].size,
   322					       si->tch_abs[abs].max,
   323					       xy_data + si->tch_abs[abs].ofs,
   324					       si->tch_abs[abs].bofs);
   325		}
   326	}
   327	
   328	static void cyttsp5_get_mt_touches(struct cyttsp5 *ts,
   329					   struct cyttsp5_touch *tch, int num_cur_tch)
   330	{
   331		struct cyttsp5_sysinfo *si = &ts->sysinfo;
   332		int i, t = 0;
 > 333		DECLARE_BITMAP(ids, si->tch_abs[CY_TCH_T].max);
   334		u8 *tch_addr;
   335		int tmp;
   336	
   337		bitmap_zero(ids, si->tch_abs[CY_TCH_T].max);
   338		memset(tch->abs, 0, sizeof(tch->abs));
   339	
   340		for (i = 0; i < num_cur_tch; i++) {
   341			tch_addr = si->xy_data + (i * TOUCH_REPORT_SIZE);
   342			cyttsp5_get_touch_record(ts, tch, tch_addr);
   343	
   344			/* Convert MAJOR/MINOR from mm to resolution */
   345			tmp = tch->abs[CY_TCH_MAJ] * 100 * si->sensing_conf_data.res_x;
   346			tch->abs[CY_TCH_MAJ] = tmp / si->sensing_conf_data.len_x;
   347			tmp = tch->abs[CY_TCH_MIN] * 100 * si->sensing_conf_data.res_x;
   348			tch->abs[CY_TCH_MIN] = tmp / si->sensing_conf_data.len_x;
   349	
   350			t = tch->abs[CY_TCH_T];
   351			input_mt_slot(ts->input, t);
   352			input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, true);
   353			__set_bit(t, ids);
   354	
   355			/* position and pressure fields */
   356			input_report_abs(ts->input, ABS_MT_POSITION_X,
   357					 tch->abs[CY_TCH_X]);
   358			input_report_abs(ts->input, ABS_MT_POSITION_Y,
   359					 tch->abs[CY_TCH_Y]);
   360			input_report_abs(ts->input, ABS_MT_PRESSURE,
   361					 tch->abs[CY_TCH_P]);
   362	
   363			/* Get the extended touch fields */
   364			input_report_abs(ts->input, ABS_MT_TOUCH_MAJOR,
   365					 tch->abs[CY_TCH_MAJ]);
   366			input_report_abs(ts->input, ABS_MT_TOUCH_MINOR,
   367					 tch->abs[CY_TCH_MIN]);
   368	
   369			touchscreen_report_pos(ts->input, &ts->prop,
   370					       tch->abs[CY_TCH_X], tch->abs[CY_TCH_Y],
   371					       true);
   372		}
   373	
   374		cyttsp5_final_sync(ts->input, si->tch_abs[CY_TCH_T].max, ids);
   375	
   376		ts->num_prv_rec = num_cur_tch;
   377	}
   378	

---
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: 31091 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Alistair Francis <alistair@alistair23.me>,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Cc: kbuild-all@lists.01.org, andreas@kemnade.info,
	alistair23@gmail.com, dmitry.torokhov@gmail.com,
	linus.walleij@linaro.org, robh+dt@kernel.org,
	rydberg@bitmath.org
Subject: Re: [PATCH 1/4] Input: Add driver for Cypress Generation 5 touchscreen
Date: Wed, 27 Oct 2021 11:45:15 +0800	[thread overview]
Message-ID: <202110271135.i0WiktuX-lkp@intel.com> (raw)
In-Reply-To: <20211025114214.44617-2-alistair@alistair23.me>

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

Hi Alistair,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on arm/for-next]
[also build test WARNING on xilinx-xlnx/master soc/for-next rockchip/for-next arm64/for-next/core shawnguo/for-next clk/clk-next linus/master keystone/next v5.15-rc7 next-20211026]
[cannot apply to dtor-input/next]
[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/Alistair-Francis/Add-support-for-the-Cypress-cyttsp5/20211025-194449
base:   git://git.armlinux.org.uk/~rmk/linux-arm.git for-next
config: sparc-randconfig-m031-20211027 (attached as .config)
compiler: sparc-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/0709ecf257374af4472f599dddb75dc13e7e46c9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alistair-Francis/Add-support-for-the-Cypress-cyttsp5/20211025-194449
        git checkout 0709ecf257374af4472f599dddb75dc13e7e46c9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sparc 

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

All warnings (new ones prefixed by >>):

   drivers/input/touchscreen/cyttsp5.c: In function 'cyttsp5_write':
>> drivers/input/touchscreen/cyttsp5.c:243:9: warning: ISO C90 forbids variable length array 'cmd' [-Wvla]
     243 |         u8 cmd[size + 1];
         |         ^~
   drivers/input/touchscreen/cyttsp5.c: In function 'cyttsp5_get_touch_axis':
>> drivers/input/touchscreen/cyttsp5.c:305:13: warning: variable 'next' set but not used [-Wunused-but-set-variable]
     305 |         int next;
         |             ^~~~
   drivers/input/touchscreen/cyttsp5.c: In function 'cyttsp5_get_mt_touches':
>> drivers/input/touchscreen/cyttsp5.c:333:9: warning: ISO C90 forbids variable length array 'ids' [-Wvla]
     333 |         DECLARE_BITMAP(ids, si->tch_abs[CY_TCH_T].max);
         |         ^~~~~~~~~~~~~~


vim +/cmd +243 drivers/input/touchscreen/cyttsp5.c

   239	
   240	static int cyttsp5_write(struct cyttsp5 *ts, unsigned int reg, u8 *data,
   241				 size_t size)
   242	{
 > 243		u8 cmd[size + 1];
   244	
   245		/* High bytes of register address needed as first byte of cmd */
   246		cmd[0] = HI_BYTE(reg);
   247	
   248		/* Copy the rest of the data */
   249		if (data)
   250			memcpy(&cmd[1], data, size);
   251	
   252		/* The hardware wants to receive a frame with the address register
   253		 * contains in the first two bytes. As the regmap_write function
   254		 * add the register adresse in the frame, we use the LOW_BYTE as
   255		 * first frame byte for the address register and the first
   256		 * data byte is the high register + left of the cmd to send
   257		 */
   258		return regmap_bulk_write(ts->regmap, LOW_BYTE(reg), cmd, size + 1);
   259	}
   260	
   261	static void cyttsp5_final_sync(struct input_dev *input, int max_slots,
   262				       unsigned long *ids)
   263	{
   264		int t;
   265	
   266		for (t = 0; t < max_slots; t++) {
   267			if (test_bit(t, ids))
   268				continue;
   269			input_mt_slot(input, t);
   270			input_mt_report_slot_state(input, MT_TOOL_FINGER, false);
   271		}
   272	
   273		input_sync(input);
   274	}
   275	
   276	static void cyttsp5_report_slot_liftoff(struct cyttsp5 *ts, int max_slots)
   277	{
   278		int t;
   279	
   280		if (ts->num_prv_rec == 0)
   281			return;
   282	
   283		for (t = 0; t < max_slots; t++) {
   284			input_mt_slot(ts->input, t);
   285			input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, false);
   286		}
   287	}
   288	
   289	static void cyttsp5_mt_lift_all(struct cyttsp5 *ts)
   290	{
   291		struct cyttsp5_sysinfo *si = &ts->sysinfo;
   292		int max = si->tch_abs[CY_TCH_T].max;
   293	
   294		if (ts->num_prv_rec != 0) {
   295			cyttsp5_report_slot_liftoff(ts, max);
   296			input_sync(ts->input);
   297			ts->num_prv_rec = 0;
   298		}
   299	}
   300	
   301	static void cyttsp5_get_touch_axis(int *axis, int size, int max, u8 *xy_data,
   302					   int bofs)
   303	{
   304		int nbyte;
 > 305		int next;
   306	
   307		for (nbyte = 0, *axis = 0, next = 0; nbyte < size; nbyte++)
   308			*axis = *axis + ((xy_data[nbyte] >> bofs) << (nbyte * 8));
   309	
   310		*axis &= max - 1;
   311	}
   312	
   313	static void cyttsp5_get_touch_record(struct cyttsp5 *ts,
   314					     struct cyttsp5_touch *touch, u8 *xy_data)
   315	{
   316		struct cyttsp5_sysinfo *si = &ts->sysinfo;
   317		enum cyttsp5_tch_abs abs;
   318	
   319		for (abs = CY_TCH_X; abs < CY_TCH_NUM_ABS; abs++) {
   320			cyttsp5_get_touch_axis(&touch->abs[abs],
   321					       si->tch_abs[abs].size,
   322					       si->tch_abs[abs].max,
   323					       xy_data + si->tch_abs[abs].ofs,
   324					       si->tch_abs[abs].bofs);
   325		}
   326	}
   327	
   328	static void cyttsp5_get_mt_touches(struct cyttsp5 *ts,
   329					   struct cyttsp5_touch *tch, int num_cur_tch)
   330	{
   331		struct cyttsp5_sysinfo *si = &ts->sysinfo;
   332		int i, t = 0;
 > 333		DECLARE_BITMAP(ids, si->tch_abs[CY_TCH_T].max);
   334		u8 *tch_addr;
   335		int tmp;
   336	
   337		bitmap_zero(ids, si->tch_abs[CY_TCH_T].max);
   338		memset(tch->abs, 0, sizeof(tch->abs));
   339	
   340		for (i = 0; i < num_cur_tch; i++) {
   341			tch_addr = si->xy_data + (i * TOUCH_REPORT_SIZE);
   342			cyttsp5_get_touch_record(ts, tch, tch_addr);
   343	
   344			/* Convert MAJOR/MINOR from mm to resolution */
   345			tmp = tch->abs[CY_TCH_MAJ] * 100 * si->sensing_conf_data.res_x;
   346			tch->abs[CY_TCH_MAJ] = tmp / si->sensing_conf_data.len_x;
   347			tmp = tch->abs[CY_TCH_MIN] * 100 * si->sensing_conf_data.res_x;
   348			tch->abs[CY_TCH_MIN] = tmp / si->sensing_conf_data.len_x;
   349	
   350			t = tch->abs[CY_TCH_T];
   351			input_mt_slot(ts->input, t);
   352			input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, true);
   353			__set_bit(t, ids);
   354	
   355			/* position and pressure fields */
   356			input_report_abs(ts->input, ABS_MT_POSITION_X,
   357					 tch->abs[CY_TCH_X]);
   358			input_report_abs(ts->input, ABS_MT_POSITION_Y,
   359					 tch->abs[CY_TCH_Y]);
   360			input_report_abs(ts->input, ABS_MT_PRESSURE,
   361					 tch->abs[CY_TCH_P]);
   362	
   363			/* Get the extended touch fields */
   364			input_report_abs(ts->input, ABS_MT_TOUCH_MAJOR,
   365					 tch->abs[CY_TCH_MAJ]);
   366			input_report_abs(ts->input, ABS_MT_TOUCH_MINOR,
   367					 tch->abs[CY_TCH_MIN]);
   368	
   369			touchscreen_report_pos(ts->input, &ts->prop,
   370					       tch->abs[CY_TCH_X], tch->abs[CY_TCH_Y],
   371					       true);
   372		}
   373	
   374		cyttsp5_final_sync(ts->input, si->tch_abs[CY_TCH_T].max, ids);
   375	
   376		ts->num_prv_rec = num_cur_tch;
   377	}
   378	

---
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: 31091 bytes --]

[-- Attachment #3: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 1/4] Input: Add driver for Cypress Generation 5 touchscreen
Date: Wed, 27 Oct 2021 11:45:15 +0800	[thread overview]
Message-ID: <202110271135.i0WiktuX-lkp@intel.com> (raw)
In-Reply-To: <20211025114214.44617-2-alistair@alistair23.me>

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

Hi Alistair,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on arm/for-next]
[also build test WARNING on xilinx-xlnx/master soc/for-next rockchip/for-next arm64/for-next/core shawnguo/for-next clk/clk-next linus/master keystone/next v5.15-rc7 next-20211026]
[cannot apply to dtor-input/next]
[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/Alistair-Francis/Add-support-for-the-Cypress-cyttsp5/20211025-194449
base:   git://git.armlinux.org.uk/~rmk/linux-arm.git for-next
config: sparc-randconfig-m031-20211027 (attached as .config)
compiler: sparc-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/0709ecf257374af4472f599dddb75dc13e7e46c9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alistair-Francis/Add-support-for-the-Cypress-cyttsp5/20211025-194449
        git checkout 0709ecf257374af4472f599dddb75dc13e7e46c9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sparc 

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

All warnings (new ones prefixed by >>):

   drivers/input/touchscreen/cyttsp5.c: In function 'cyttsp5_write':
>> drivers/input/touchscreen/cyttsp5.c:243:9: warning: ISO C90 forbids variable length array 'cmd' [-Wvla]
     243 |         u8 cmd[size + 1];
         |         ^~
   drivers/input/touchscreen/cyttsp5.c: In function 'cyttsp5_get_touch_axis':
>> drivers/input/touchscreen/cyttsp5.c:305:13: warning: variable 'next' set but not used [-Wunused-but-set-variable]
     305 |         int next;
         |             ^~~~
   drivers/input/touchscreen/cyttsp5.c: In function 'cyttsp5_get_mt_touches':
>> drivers/input/touchscreen/cyttsp5.c:333:9: warning: ISO C90 forbids variable length array 'ids' [-Wvla]
     333 |         DECLARE_BITMAP(ids, si->tch_abs[CY_TCH_T].max);
         |         ^~~~~~~~~~~~~~


vim +/cmd +243 drivers/input/touchscreen/cyttsp5.c

   239	
   240	static int cyttsp5_write(struct cyttsp5 *ts, unsigned int reg, u8 *data,
   241				 size_t size)
   242	{
 > 243		u8 cmd[size + 1];
   244	
   245		/* High bytes of register address needed as first byte of cmd */
   246		cmd[0] = HI_BYTE(reg);
   247	
   248		/* Copy the rest of the data */
   249		if (data)
   250			memcpy(&cmd[1], data, size);
   251	
   252		/* The hardware wants to receive a frame with the address register
   253		 * contains in the first two bytes. As the regmap_write function
   254		 * add the register adresse in the frame, we use the LOW_BYTE as
   255		 * first frame byte for the address register and the first
   256		 * data byte is the high register + left of the cmd to send
   257		 */
   258		return regmap_bulk_write(ts->regmap, LOW_BYTE(reg), cmd, size + 1);
   259	}
   260	
   261	static void cyttsp5_final_sync(struct input_dev *input, int max_slots,
   262				       unsigned long *ids)
   263	{
   264		int t;
   265	
   266		for (t = 0; t < max_slots; t++) {
   267			if (test_bit(t, ids))
   268				continue;
   269			input_mt_slot(input, t);
   270			input_mt_report_slot_state(input, MT_TOOL_FINGER, false);
   271		}
   272	
   273		input_sync(input);
   274	}
   275	
   276	static void cyttsp5_report_slot_liftoff(struct cyttsp5 *ts, int max_slots)
   277	{
   278		int t;
   279	
   280		if (ts->num_prv_rec == 0)
   281			return;
   282	
   283		for (t = 0; t < max_slots; t++) {
   284			input_mt_slot(ts->input, t);
   285			input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, false);
   286		}
   287	}
   288	
   289	static void cyttsp5_mt_lift_all(struct cyttsp5 *ts)
   290	{
   291		struct cyttsp5_sysinfo *si = &ts->sysinfo;
   292		int max = si->tch_abs[CY_TCH_T].max;
   293	
   294		if (ts->num_prv_rec != 0) {
   295			cyttsp5_report_slot_liftoff(ts, max);
   296			input_sync(ts->input);
   297			ts->num_prv_rec = 0;
   298		}
   299	}
   300	
   301	static void cyttsp5_get_touch_axis(int *axis, int size, int max, u8 *xy_data,
   302					   int bofs)
   303	{
   304		int nbyte;
 > 305		int next;
   306	
   307		for (nbyte = 0, *axis = 0, next = 0; nbyte < size; nbyte++)
   308			*axis = *axis + ((xy_data[nbyte] >> bofs) << (nbyte * 8));
   309	
   310		*axis &= max - 1;
   311	}
   312	
   313	static void cyttsp5_get_touch_record(struct cyttsp5 *ts,
   314					     struct cyttsp5_touch *touch, u8 *xy_data)
   315	{
   316		struct cyttsp5_sysinfo *si = &ts->sysinfo;
   317		enum cyttsp5_tch_abs abs;
   318	
   319		for (abs = CY_TCH_X; abs < CY_TCH_NUM_ABS; abs++) {
   320			cyttsp5_get_touch_axis(&touch->abs[abs],
   321					       si->tch_abs[abs].size,
   322					       si->tch_abs[abs].max,
   323					       xy_data + si->tch_abs[abs].ofs,
   324					       si->tch_abs[abs].bofs);
   325		}
   326	}
   327	
   328	static void cyttsp5_get_mt_touches(struct cyttsp5 *ts,
   329					   struct cyttsp5_touch *tch, int num_cur_tch)
   330	{
   331		struct cyttsp5_sysinfo *si = &ts->sysinfo;
   332		int i, t = 0;
 > 333		DECLARE_BITMAP(ids, si->tch_abs[CY_TCH_T].max);
   334		u8 *tch_addr;
   335		int tmp;
   336	
   337		bitmap_zero(ids, si->tch_abs[CY_TCH_T].max);
   338		memset(tch->abs, 0, sizeof(tch->abs));
   339	
   340		for (i = 0; i < num_cur_tch; i++) {
   341			tch_addr = si->xy_data + (i * TOUCH_REPORT_SIZE);
   342			cyttsp5_get_touch_record(ts, tch, tch_addr);
   343	
   344			/* Convert MAJOR/MINOR from mm to resolution */
   345			tmp = tch->abs[CY_TCH_MAJ] * 100 * si->sensing_conf_data.res_x;
   346			tch->abs[CY_TCH_MAJ] = tmp / si->sensing_conf_data.len_x;
   347			tmp = tch->abs[CY_TCH_MIN] * 100 * si->sensing_conf_data.res_x;
   348			tch->abs[CY_TCH_MIN] = tmp / si->sensing_conf_data.len_x;
   349	
   350			t = tch->abs[CY_TCH_T];
   351			input_mt_slot(ts->input, t);
   352			input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, true);
   353			__set_bit(t, ids);
   354	
   355			/* position and pressure fields */
   356			input_report_abs(ts->input, ABS_MT_POSITION_X,
   357					 tch->abs[CY_TCH_X]);
   358			input_report_abs(ts->input, ABS_MT_POSITION_Y,
   359					 tch->abs[CY_TCH_Y]);
   360			input_report_abs(ts->input, ABS_MT_PRESSURE,
   361					 tch->abs[CY_TCH_P]);
   362	
   363			/* Get the extended touch fields */
   364			input_report_abs(ts->input, ABS_MT_TOUCH_MAJOR,
   365					 tch->abs[CY_TCH_MAJ]);
   366			input_report_abs(ts->input, ABS_MT_TOUCH_MINOR,
   367					 tch->abs[CY_TCH_MIN]);
   368	
   369			touchscreen_report_pos(ts->input, &ts->prop,
   370					       tch->abs[CY_TCH_X], tch->abs[CY_TCH_Y],
   371					       true);
   372		}
   373	
   374		cyttsp5_final_sync(ts->input, si->tch_abs[CY_TCH_T].max, ids);
   375	
   376		ts->num_prv_rec = num_cur_tch;
   377	}
   378	

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

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

  parent reply	other threads:[~2021-10-27  3:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 11:42 [PATCH 0/4] Add support for the Cypress cyttsp5 Alistair Francis
2021-10-25 11:42 ` Alistair Francis
2021-10-25 11:42 ` [PATCH 1/4] Input: Add driver for Cypress Generation 5 touchscreen Alistair Francis
2021-10-25 11:42   ` Alistair Francis
2021-10-25 20:10   ` Randy Dunlap
2021-10-25 20:10     ` Randy Dunlap
2021-10-27  3:45   ` kernel test robot [this message]
2021-10-27  3:45     ` kernel test robot
2021-10-27  3:45     ` kernel test robot
2021-10-25 11:42 ` [PATCH 2/4] Documentation: DT: bindings: input: Add documentation for cyttsp5 Alistair Francis
2021-10-25 11:42   ` Alistair Francis
2021-10-25 18:16   ` Rob Herring
2021-10-25 18:16     ` Rob Herring
2021-10-25 23:18   ` Linus Walleij
2021-10-25 23:18     ` Linus Walleij
2021-10-26  7:16     ` Andreas Kemnade
2021-10-26  7:16       ` Andreas Kemnade
2021-10-27 12:28       ` Alistair Francis
2021-10-27 12:28         ` Alistair Francis
2021-10-31 16:49   ` Andreas Kemnade
2021-10-31 16:49     ` Andreas Kemnade
2021-10-25 11:42 ` [PATCH 3/4] ARM: imx_v6_v7_defconfig: Enable the cyttsp5 touchscreen Alistair Francis
2021-10-25 11:42   ` Alistair Francis
2021-10-25 11:42 ` [PATCH 4/4] ARM: dts: imx7d: remarkable2: Enable the cyttsp5 Alistair Francis
2021-10-25 11:42   ` Alistair Francis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202110271135.i0WiktuX-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alistair23@gmail.com \
    --cc=alistair@alistair23.me \
    --cc=andreas@kemnade.info \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=rydberg@bitmath.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.