From: kernel test robot <lkp@intel.com>
To: Carl Philipp Klemm <philipp@uvos.xyz>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
tony@atomide.com
Cc: kbuild-all@lists.01.org, linux-omap@vger.kernel.org,
linux-input@vger.kernel.org
Subject: Re: [PATCH v3] ARM: dts: motorola-mapphone-common: Add dts configureation for the android buttons beneath the screen
Date: Tue, 3 Nov 2020 17:20:31 +0800 [thread overview]
Message-ID: <202011031755.GhZYr9dh-lkp@intel.com> (raw)
In-Reply-To: <20201030100550.010bfe4f3cdc2f4e5a599c8b@uvos.xyz>
[-- Attachment #1: Type: text/plain, Size: 10489 bytes --]
Hi Carl,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on input/next]
[also build test WARNING on omap/for-next balbi-usb/testing/next v5.10-rc2 next-20201103]
[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/Carl-Philipp-Klemm/ARM-dts-motorola-mapphone-common-Add-dts-configureation-for-the-android-buttons-beneath-the-screen/20201030-170644
base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
config: riscv-randconfig-r013-20201030 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 9.3.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/7a00d245fade30bef33d962c11b7bc121c007910
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Carl-Philipp-Klemm/ARM-dts-motorola-mapphone-common-Add-dts-configureation-for-the-android-buttons-beneath-the-screen/20201030-170644
git checkout 7a00d245fade30bef33d962c11b7bc121c007910
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv
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/misc/touchscreen-buttons.c: In function 'touchscreen_buttons_input_event':
drivers/input/misc/touchscreen-buttons.c:187:34: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
187 | && buttons->queue.lastindex >= 0) {
| ^~
drivers/input/misc/touchscreen-buttons.c: At top level:
>> drivers/input/misc/touchscreen-buttons.c:240:6: warning: no previous prototype for 'merge_task_handler' [-Wmissing-prototypes]
240 | void merge_task_handler(struct work_struct *work)
| ^~~~~~~~~~~~~~~~~~
>> drivers/input/misc/touchscreen-buttons.c:252:6: warning: no previous prototype for 'close_task_handler' [-Wmissing-prototypes]
252 | void close_task_handler(struct work_struct *work)
| ^~~~~~~~~~~~~~~~~~
>> drivers/input/misc/touchscreen-buttons.c:263:6: warning: no previous prototype for 'open_task_handler' [-Wmissing-prototypes]
263 | void open_task_handler(struct work_struct *work)
| ^~~~~~~~~~~~~~~~~
>> drivers/input/misc/touchscreen-buttons.c:411:5: warning: no previous prototype for 'touchscreen_buttons_idev_opened' [-Wmissing-prototypes]
411 | int touchscreen_buttons_idev_opened(struct input_dev *idev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/input/misc/touchscreen-buttons.c:434:6: warning: no previous prototype for 'touchscreen_buttons_idev_closed' [-Wmissing-prototypes]
434 | void touchscreen_buttons_idev_closed(struct input_dev *idev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/merge_task_handler +240 drivers/input/misc/touchscreen-buttons.c
239
> 240 void merge_task_handler(struct work_struct *work)
241 {
242 struct touchscreen_buttons *buttons =
243 container_of(work, struct touchscreen_buttons, merge_task);
244
245 mutex_lock(&buttons->mutex);
246 if (buttons->ts_handle && buttons->ts_handle->dev)
247 touchscreen_buttons_merge_capabilitys(buttons->filtered_ts_idev,
248 buttons->ts_handle->dev);
249 mutex_unlock(&buttons->mutex);
250 }
251
> 252 void close_task_handler(struct work_struct *work)
253 {
254 struct touchscreen_buttons *buttons =
255 container_of(work, struct touchscreen_buttons, close_task);
256
257 mutex_lock(&buttons->mutex);
258 if (buttons && buttons->ts_handle && buttons->ts_handle->open != 0)
259 input_close_device(buttons->ts_handle);
260 mutex_unlock(&buttons->mutex);
261 }
262
> 263 void open_task_handler(struct work_struct *work)
264 {
265 struct touchscreen_buttons *buttons =
266 container_of(work, struct touchscreen_buttons, open_task);
267 int error;
268
269 mutex_lock(&buttons->mutex);
270 if (buttons && buttons->ts_handle) {
271 error = input_open_device(buttons->ts_handle);
272 if (error) {
273 dev_err(buttons->dev,
274 "Failed to open input device, error %d\n",
275 error);
276 input_unregister_handle(buttons->ts_handle);
277 kfree(buttons->ts_handle);
278 buttons->ts_handle = NULL;
279 }
280 }
281 mutex_unlock(&buttons->mutex);
282 }
283
284 static int touchscreen_buttons_input_connect(struct input_handler *handler,
285 struct input_dev *dev,
286 const struct input_device_id *id)
287 {
288 struct touchscreen_buttons *buttons;
289
290 buttons = handler->private;
291
292 mutex_lock(&buttons->mutex);
293
294 if ((!buttons->ts_handle
295 && device_match_of_node(&dev->dev, buttons->map->ts_node))
296 || (dev->dev.parent
297 && device_match_of_node(dev->dev.parent,
298 buttons->map->ts_node))) {
299 int error;
300
301 dev_info(buttons->dev, "Binding to device: %s\n",
302 dev_name(&dev->dev));
303
304 buttons->ts_handle =
305 kzalloc(sizeof(*buttons->ts_handle), GFP_KERNEL);
306 if (!buttons->ts_handle) {
307 mutex_unlock(&buttons->mutex);
308 return -ENOMEM;
309 }
310
311 buttons->ts_handle->dev = dev;
312 buttons->ts_handle->handler = handler;
313 buttons->ts_handle->name = "touchscreen-buttons";
314 buttons->ts_handle->private = handler->private;
315 buttons->queue.lastindex = 0;
316
317 error = input_register_handle(buttons->ts_handle);
318 if (error) {
319 dev_err(buttons->dev,
320 "Failed to register input handler, error %d\n",
321 error);
322 kfree(buttons->ts_handle);
323 buttons->ts_handle = NULL;
324 mutex_unlock(&buttons->mutex);
325 return error;
326 }
327
328 queue_work(buttons->workqueue, &buttons->merge_task);
329
330 if (buttons->filtered_ts_idev->users > 0
331 && buttons->ts_handle->open == 0)
332 queue_work(buttons->workqueue, &buttons->open_task);
333 }
334
335 mutex_unlock(&buttons->mutex);
336 return 0;
337 }
338
339 static void touchscreen_buttons_input_disconnect(struct input_handle *handle)
340 {
341 struct touchscreen_buttons *buttons;
342
343 buttons = handle->private;
344
345 mutex_lock(&buttons->mutex);
346 if (handle == buttons->ts_handle) {
347 input_close_device(handle);
348 input_unregister_handle(handle);
349 kfree(handle);
350 buttons->ts_handle = NULL;
351 dev_info(buttons->dev,
352 "Touchscreen device disconnected buttons disabled\n");
353 } else {
354 dev_err(buttons->dev,
355 "Unknown device disconnected, %p should be %p", handle,
356 buttons->ts_handle);
357 }
358 mutex_unlock(&buttons->mutex);
359 }
360
361 static struct touchscreen_button_map
362 *touchscreen_buttons_get_devtree_pdata(struct device *dev)
363 {
364 struct touchscreen_button_map *map;
365 struct fwnode_handle *child_node;
366 struct device_node *node;
367 int i;
368
369 map = kzalloc(sizeof(*map), GFP_KERNEL);
370 if (!map)
371 return ERR_PTR(-ENOMEM);
372
373 map->count = device_get_child_node_count(dev);
374 if (map->count == 0)
375 return ERR_PTR(-ENODEV);
376
377 map->buttons = kcalloc(map->count, sizeof(*map->buttons), GFP_KERNEL);
378 if (!map->buttons)
379 return ERR_PTR(-ENOMEM);
380
381 node = dev->of_node;
382 map->ts_node = of_parse_phandle(node, "touchscreen_phandle", 0);
383 if (!map->ts_node) {
384 dev_err(dev, "touchscreen_phandle node missing\n");
385 return ERR_PTR(-ENODEV);
386 }
387
388 dev_info(dev, "Device_node name: %s\n", map->ts_node->name);
389
390 i = 0;
391 device_for_each_child_node(dev, child_node) {
392 struct touchscreen_button *button;
393
394 button = &map->buttons[i];
395
396 fwnode_property_read_u32(child_node, "x-position", &button->x);
397 fwnode_property_read_u32(child_node, "y-position", &button->y);
398 fwnode_property_read_u32(child_node, "x-size", &button->width);
399 fwnode_property_read_u32(child_node, "y-size", &button->height);
400 fwnode_property_read_u32(child_node, "keycode",
401 &button->keycode);
402 dev_info(dev,
403 "Adding button at x=%u y=%u size %u x %u keycode=%u\n",
404 button->x, button->y, button->width, button->height,
405 button->keycode);
406 ++i;
407 }
408 return map;
409 }
410
> 411 int touchscreen_buttons_idev_opened(struct input_dev *idev)
412 {
413 struct touchscreen_buttons *buttons;
414
415 buttons = dev_get_drvdata(idev->dev.parent);
416
417 mutex_lock(&buttons->mutex);
418 if (buttons && buttons->ts_handle) {
419 if (buttons->ts_handle->open == 0) {
420 queue_work(buttons->workqueue, &buttons->open_task);
421 dev_dbg(idev->dev.parent, "idev opened\n");
422 } else {
423 dev_info(idev->dev.parent, "idev allready opened\n");
424 }
425 } else {
426 dev_warn(idev->dev.parent,
427 "Input device opend but touchscreen not opened. %p %p\n",
428 buttons, buttons->ts_handle);
429 }
430 mutex_unlock(&buttons->mutex);
431 return 0;
432 }
433
> 434 void touchscreen_buttons_idev_closed(struct input_dev *idev)
435 {
436 struct touchscreen_buttons *buttons;
437
438 buttons = dev_get_drvdata(idev->dev.parent);
439
440 mutex_lock(&buttons->mutex);
441 if (buttons && buttons->ts_handle && buttons->ts_handle->open != 0) {
442 queue_work(buttons->workqueue, &buttons->close_task);
443 dev_dbg(idev->dev.parent, "idev closed\n");
444 }
445 mutex_unlock(&buttons->mutex);
446 }
447
---
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: 28749 bytes --]
prev parent reply other threads:[~2020-11-03 9:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 9:05 [PATCH v3] ARM: dts: motorola-mapphone-common: Add dts configureation for the android buttons beneath the screen Carl Philipp Klemm
2020-10-31 7:15 ` Tony Lindgren
[not found] ` <20201031103722.6efbf69b084ed35d2f700fe9@uvos.xyz>
2020-10-31 9:55 ` Carl Philipp Klemm
2020-11-03 9:20 ` kernel test robot [this message]
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=202011031755.GhZYr9dh-lkp@intel.com \
--to=lkp@intel.com \
--cc=dmitry.torokhov@gmail.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=philipp@uvos.xyz \
--cc=tony@atomide.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox