Gary-Hobson commented on a change in pull request #5736: URL: https://github.com/apache/incubator-nuttx/pull/5736#discussion_r827036203
########## File path: drivers/input/uinput.c ########## @@ -244,14 +543,79 @@ int uinput_button_initialize(FAR const char *name) ubtn_lower->lower.bl_enable = uinput_button_enable; ubtn_lower->lower.bl_supported = uinput_button_supported; ubtn_lower->lower.bl_write = uinput_button_write; +#ifdef CONFIG_UINPUT_RPMSG + ubtn_lower->ctx.notify = uinput_button_notify; +#endif snprintf(devname, UINPUT_NAME_SIZE, "/dev/%s", name); ret = btn_register(devname, &ubtn_lower->lower); if (ret < 0) { kmm_free(ubtn_lower); + ierr("ERROR: uinput button initialize failed\n"); + return ret; } - return ret; +#ifdef CONFIG_UINPUT_RPMSG + uinput_rpmsg_initialize(&ubtn_lower->ctx, name); +#endif + + return 0; } -#endif /* CONFIG_INPUT_BUTTONS */ + +#endif /* CONFIG_UINPUT_BUTTONS */ + +/**************************************************************************** + * Name: uinput_keyboard_initialize + * + * Description: + * Initialized the uinput keyboard device + * + * Input Parameters: + * name: keyboard devices name + * + * Returned Value: + * Zero is returned on success. Otherwise, a negated errno value is + * returned to indicate the nature of the failure. + * + ****************************************************************************/ + +#ifdef CONFIG_UINPUT_KEYBOARD + +int uinput_keyboard_initialize(FAR const char *name) +{ + char devname[UINPUT_NAME_SIZE]; + FAR struct uinput_keyboard_lowerhalf_s *ukbd_lower; + int ret; + + ukbd_lower = kmm_zalloc(sizeof(struct uinput_keyboard_lowerhalf_s)); + if (ukbd_lower == NULL) + { + return -ENOMEM; + } + + ukbd_lower->lower.write = uinput_keyboard_write; + +#ifdef CONFIG_UINPUT_RPMSG + ukbd_lower->ctx.notify = uinput_keyboard_notify; +#endif + + /* Regiest Touchscreen device */ + + snprintf(devname, UINPUT_NAME_SIZE, "/dev/%s", name); Review comment: done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org