From 5719dab8ecc0b767e73faf7655eb9fbbcf25bc53 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Nihei Date: Thu, 8 Apr 2021 06:02:31 -0300 Subject: [PATCH] drivers/input: Rename MOUSE configs to INPUT_MOUSE --- drivers/input/Kconfig | 8 ++++---- drivers/usbhost/Kconfig | 4 ++-- drivers/usbhost/usbhost_hidmouse.c | 22 +++++++++++----------- drivers/usbhost/usbhost_xboxcontroller.c | 2 +- include/nuttx/input/mouse.h | 2 +- include/nuttx/usb/hid.h | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig index a3cd3268cf..e74cc939b3 100644 --- a/drivers/input/Kconfig +++ b/drivers/input/Kconfig @@ -13,22 +13,22 @@ menuconfig INPUT if INPUT -config MOUSE +config INPUT_MOUSE bool "Enable mouse support" default n ---help--- Enable support for mouse devices. -if MOUSE +if INPUT_MOUSE -config MOUSE_WHEEL +config INPUT_MOUSE_WHEEL bool "Enable mouse wheel support" default n ---help--- Enable support for a 4-button mouse report that includes a while position. -endif # MOUSE +endif # INPUT_MOUSE config INPUT_TOUCHSCREEN bool diff --git a/drivers/usbhost/Kconfig b/drivers/usbhost/Kconfig index 51934b0037..60e399eb84 100644 --- a/drivers/usbhost/Kconfig +++ b/drivers/usbhost/Kconfig @@ -488,7 +488,7 @@ config HIDMOUSE_THRESHY Default: 12 -if MOUSE_WHEEL +if INPUT_MOUSE_WHEEL config HIDMOUSE_WMAX int "Maximum wheel position" @@ -523,7 +523,7 @@ config HIDMOUSE_WTHRESH Default: 1 -endif # MOUSE_WHEEL +endif # INPUT_MOUSE_WHEEL endif # USBHOST_HIDMOUSE config USBHOST_XBOXCONTROLLER diff --git a/drivers/usbhost/usbhost_hidmouse.c b/drivers/usbhost/usbhost_hidmouse.c index 4aba01958d..92eebef2fa 100644 --- a/drivers/usbhost/usbhost_hidmouse.c +++ b/drivers/usbhost/usbhost_hidmouse.c @@ -108,10 +108,10 @@ #define HIDMOUSE_YTHRESH_B16 (CONFIG_HIDMOUSE_YTHRESH << 16) #ifdef CONFIG_HIDMOUSE_TSCIF -# undef CONFIG_MOUSE_WHEEL +# undef CONFIG_INPUT_MOUSE_WHEEL #endif -#ifdef CONFIG_MOUSE_WHEEL +#ifdef CONFIG_INPUT_MOUSE_WHEEL # ifndef CONFIG_HIDMOUSE_WMAX # define CONFIG_HIDMOUSE_WMAX 100 @@ -129,7 +129,7 @@ # define HIDMOUSE_WTHRESH_B16 (CONFIG_HIDMOUSE_WTHRESH << 16) -#endif /* CONFIG_MOUSE_WHEEL */ +#endif /* CONFIG_INPUT_MOUSE_WHEEL */ #ifndef CONFIG_HIDMOUSE_DEFPRIO # define CONFIG_HIDMOUSE_DEFPRIO 50 @@ -221,7 +221,7 @@ struct mouse_sample_s uint8_t buttons; /* Button state (see MOUSE_BUTTON_* definitions) */ uint16_t x; /* Accumulated X position */ uint16_t y; /* Accumulated Y position */ -#ifdef CONFIG_MOUSE_WHEEL +#ifdef CONFIG_INPUT_MOUSE_WHEEL uint16_t wheel; /* Reported wheel position */ #endif }; @@ -264,7 +264,7 @@ struct usbhost_state_s b16_t yaccum; /* Current integrated Y position */ b16_t xlast; /* Last reported X position */ b16_t ylast; /* Last reported Y position */ -#ifdef CONFIG_MOUSE_WHEEL +#ifdef CONFIG_INPUT_MOUSE_WHEEL b16_t waccum; /* Current integrated while position */ b16_t wlast; /* Last reported wheel position */ #endif @@ -798,7 +798,7 @@ static void usbhost_position(FAR struct usbhost_state_s *priv, priv->yaccum = pos; -#ifdef CONFIG_MOUSE_WHEEL +#ifdef CONFIG_INPUT_MOUSE_WHEEL /* Do the same for the wheel position */ disp = rpt->wdisp; @@ -982,7 +982,7 @@ static bool usbhost_threshold(FAR struct usbhost_state_s *priv) return true; } -#ifdef CONFIG_MOUSE_WHEEL +#ifdef CONFIG_INPUT_MOUSE_WHEEL /* Get the difference in the wheel position from the last report */ pos = priv->waccum; @@ -1159,14 +1159,14 @@ static int usbhost_mouse_poll(int argc, char *argv[]) priv->xlast = priv->xaccum; priv->ylast = priv->yaccum; -#ifdef CONFIG_MOUSE_WHEEL +#ifdef CONFIG_INPUT_MOUSE_WHEEL priv->wlast = priv->waccum; #endif /* Update the sample X/Y positions */ priv->sample.x = b16toi(priv->xaccum); priv->sample.y = b16toi(priv->yaccum); -#ifdef CONFIG_MOUSE_WHEEL +#ifdef CONFIG_INPUT_MOUSE_WHEEL priv->sample.wheel = b16toi(priv->waccum); #endif @@ -2195,7 +2195,7 @@ static int usbhost_open(FAR struct file *filep) priv->xlast = INVALID_POSITION_B16; priv->ylast = INVALID_POSITION_B16; -#ifdef CONFIG_MOUSE_WHEEL +#ifdef CONFIG_INPUT_MOUSE_WHEEL priv->wlast = INVALID_POSITION_B16; #endif /* Set the reported position to the center of the range */ @@ -2450,7 +2450,7 @@ static ssize_t usbhost_read(FAR struct file *filep, FAR char *buffer, report->buttons = sample.buttons; report->x = sample.x; report->y = sample.y; -#ifdef CONFIG_MOUSE_WHEEL +#ifdef CONFIG_INPUT_MOUSE_WHEEL report->wheel = sample.wheel; #endif diff --git a/drivers/usbhost/usbhost_xboxcontroller.c b/drivers/usbhost/usbhost_xboxcontroller.c index 859db86358..f3e3a160b1 100644 --- a/drivers/usbhost/usbhost_xboxcontroller.c +++ b/drivers/usbhost/usbhost_xboxcontroller.c @@ -1904,7 +1904,7 @@ static int usbhost_open(FAR struct file *filep) #ifdef NEVER priv->xlast = INVALID_POSITION_B16; priv->ylast = INVALID_POSITION_B16; -#ifdef CONFIG_MOUSE_WHEEL +#ifdef CONFIG_INPUT_MOUSE_WHEEL priv->wlast = INVALID_POSITION_B16; #endif /* Set the reported position to the center of the range */ diff --git a/include/nuttx/input/mouse.h b/include/nuttx/input/mouse.h index da10f88dde..59885f79c6 100644 --- a/include/nuttx/input/mouse.h +++ b/include/nuttx/input/mouse.h @@ -63,7 +63,7 @@ struct mouse_report_s /* Possibly padded with 1 byte here */ int16_t x; /* X coordinate of the mouse position */ int16_t y; /* Y coordinate of the mouse position */ -#ifdef CONFIG_MOUSE_WHEEL +#ifdef CONFIG_INPUT_MOUSE_WHEEL int16_t wheel; /* Mouse wheel position */ #endif }; diff --git a/include/nuttx/usb/hid.h b/include/nuttx/usb/hid.h index 9ff5671ea3..c59136dcc4 100644 --- a/include/nuttx/usb/hid.h +++ b/include/nuttx/usb/hid.h @@ -656,7 +656,7 @@ struct usbhid_mousereport_s uint8_t xdisp; /* X displacement */ uint8_t ydisp; /* y displacement */ /* Device specific additional bytes may follow */ -#ifdef CONFIG_MOUSE_WHEEL +#ifdef CONFIG_INPUT_MOUSE_WHEEL uint8_t wdisp; /* Wheel displacement */ #endif };