input: Move uinput initialization from boards/sim to drivers

since uinput can be used not only on simulator but also on real device

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-03-19 23:37:11 +08:00 committed by Petro Karashchenko
parent fd5fb26f51
commit d19aa5aca4
2 changed files with 9 additions and 17 deletions

View File

@ -36,7 +36,6 @@
#include <nuttx/fs/nxffs.h>
#include <nuttx/fs/rpmsgfs.h>
#include <nuttx/i2c/i2c_master.h>
#include <nuttx/input/uinput.h>
#include <nuttx/spi/spi_transfer.h>
#include <nuttx/rc/lirc_dev.h>
#include <nuttx/rc/dummy.h>
@ -319,22 +318,6 @@ int sim_bringup(void)
}
#endif
#ifdef CONFIG_UINPUT_TOUCH
ret = uinput_touch_initialize("utouch", 1, 4);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: uinput_touch_initialize failed: %d\n", ret);
}
#endif /* CONFIG_UINPUT_TOUCH */
#ifdef CONFIG_UINPUT_BUTTONS
ret = uinput_button_initialize("ubutton");
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: uinput_button_initialize failed: %d\n", ret);
}
#endif /* CONFIG_UINPUT_BUTTONS */
#ifdef CONFIG_IEEE802154_LOOPBACK
/* Initialize and register the IEEE802.15.4 MAC network loop device */

View File

@ -25,6 +25,7 @@
#include <nuttx/crypto/crypto.h>
#include <nuttx/drivers/drivers.h>
#include <nuttx/fs/loop.h>
#include <nuttx/input/uinput.h>
#include <nuttx/net/loopback.h>
#include <nuttx/net/tun.h>
#include <nuttx/net/telnet.h>
@ -119,6 +120,14 @@ void drivers_initialize(void)
devcrypto_register();
#endif
#ifdef CONFIG_UINPUT_TOUCH
uinput_touch_initialize("utouch", 1, 4);
#endif
#ifdef CONFIG_UINPUT_BUTTONS
uinput_button_initialize("ubutton");
#endif
#ifdef CONFIG_NET_LOOPBACK
/* Initialize the local loopback device */