Gary-Hobson commented on a change in pull request #5736: URL: https://github.com/apache/incubator-nuttx/pull/5736#discussion_r826590033
########## 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) Review comment: done ########## File path: drivers/input/uinput.c ########## @@ -188,35 +476,45 @@ static void uinput_button_enable(FAR const struct btn_lowerhalf_s *lower, * ****************************************************************************/ -#ifdef CONFIG_INPUT_TOUCHSCREEN +#ifdef CONFIG_UINPUT_TOUCHSCREEN + int uinput_touch_initialize(FAR const char *name, int maxpoint, int buffnums) { char devname[UINPUT_NAME_SIZE]; - FAR struct touch_lowerhalf_s *lower; + FAR struct uinput_touch_lowerhalf_s *utcs_lower; int ret; - lower = kmm_zalloc(sizeof(struct touch_lowerhalf_s)); - if (!lower) + utcs_lower = kmm_zalloc(sizeof(struct uinput_touch_lowerhalf_s)); + if (!utcs_lower) Review comment: done ########## File path: drivers/input/uinput.c ########## @@ -21,42 +21,123 @@ #include <nuttx/config.h> #include <sys/types.h> +#include <assert.h> +#include <debug.h> #include <errno.h> #include <stdio.h> #include <nuttx/input/buttons.h> +#include <nuttx/input/keyboard.h> #include <nuttx/input/touchscreen.h> #include <nuttx/input/uinput.h> #include <nuttx/kmalloc.h> +#ifdef CONFIG_UINPUT_RPMSG +#include <nuttx/list.h> +#include <nuttx/rptun/openamp.h> 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