From 3054237d2eb6208d0836e51d3522bca45fe15cc5 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Nihei Date: Thu, 8 Apr 2021 06:24:25 -0300 Subject: [PATCH] drivers/input: Rename DJOYSTICK configs to INPUT_DJOYSTICK --- boards/arm/lpc17xx_40xx/lpc4088-devkit/Kconfig | 2 +- boards/arm/lpc17xx_40xx/open1788/Kconfig | 2 +- .../lpc17xx_40xx/open1788/configs/pdcurses/defconfig | 3 +-- boards/arm/stm32/olimex-stm32-p407/include/board.h | 4 ++-- boards/arm/stm32/olimex-stm32-p407/src/Make.defs | 2 +- .../stm32/olimex-stm32-p407/src/olimex-stm32-p407.h | 4 ++-- boards/arm/stm32/olimex-stm32-p407/src/stm32_bringup.c | 2 +- boards/arm/stm32/olimex-stm32-p407/src/stm32_buttons.c | 10 +++++----- .../arm/stm32/olimex-stm32-p407/src/stm32_djoystick.c | 4 ++-- boards/arm/stm32/stm3210e-eval/README.txt | 2 +- boards/arm/stm32/stm3210e-eval/include/board.h | 10 +++++----- boards/arm/stm32/stm3210e-eval/src/Make.defs | 2 +- boards/arm/stm32/stm3210e-eval/src/stm3210e-eval.h | 4 ++-- boards/arm/stm32/stm3210e-eval/src/stm32_bringup.c | 2 +- boards/arm/stm32/stm3210e-eval/src/stm32_buttons.c | 8 ++++---- boards/arm/stm32/stm3210e-eval/src/stm32_djoystick.c | 4 ++-- boards/arm/stm32/stm3210e-eval/src/stm32_pmbuttons.c | 2 +- drivers/input/Kconfig | 10 +++++----- drivers/input/Make.defs | 2 +- drivers/input/djoystick.c | 10 +++++----- include/nuttx/input/djoystick.h | 4 ++-- 21 files changed, 46 insertions(+), 47 deletions(-) diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/Kconfig b/boards/arm/lpc17xx_40xx/lpc4088-devkit/Kconfig index d5382839b7..6c2222142d 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/Kconfig +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/Kconfig @@ -8,7 +8,7 @@ if ARCH_BOARD_LPC4088_DEVKIT config LPC4088_DEVKIT_DJOYSTICK bool "Discrete Joystick Support" default n - depends on !ARCH_BUTTONS && DJOYSTICK + depends on !ARCH_BUTTONS && INPUT_DJOYSTICK config LPC4088_DEVKIT_DJOYDEV string "Joystick Device" diff --git a/boards/arm/lpc17xx_40xx/open1788/Kconfig b/boards/arm/lpc17xx_40xx/open1788/Kconfig index 3cfdf26250..24464a7212 100644 --- a/boards/arm/lpc17xx_40xx/open1788/Kconfig +++ b/boards/arm/lpc17xx_40xx/open1788/Kconfig @@ -8,7 +8,7 @@ if ARCH_BOARD_OPEN1788 config OPEN1788_DJOYSTICK bool "Discrete Joystick Support" default n - depends on !ARCH_BUTTONS && DJOYSTICK + depends on !ARCH_BUTTONS && INPUT_DJOYSTICK config OPEN1788_DJOYDEV string "Joystick Device" diff --git a/boards/arm/lpc17xx_40xx/open1788/configs/pdcurses/defconfig b/boards/arm/lpc17xx_40xx/open1788/configs/pdcurses/defconfig index 78ad6d348e..db79cf970b 100644 --- a/boards/arm/lpc17xx_40xx/open1788/configs/pdcurses/defconfig +++ b/boards/arm/lpc17xx_40xx/open1788/configs/pdcurses/defconfig @@ -17,7 +17,6 @@ CONFIG_ARCH_STACKDUMP=y CONFIG_BOARD_LOOPSPERMSEC=11934 CONFIG_BUILTIN=y CONFIG_DEV_LOOP=y -CONFIG_DJOYSTICK=y CONFIG_DRIVERS_VIDEO=y CONFIG_EXAMPLES_DJOYSTICK=y CONFIG_EXAMPLES_FB=y @@ -27,8 +26,8 @@ CONFIG_FAT_LFN=y CONFIG_FS_FAT=y CONFIG_FS_ROMFS=y CONFIG_GRAPHICS_PDCURSES=y -CONFIG_HOST_WINDOWS=y CONFIG_INPUT=y +CONFIG_INPUT_DJOYSTICK=y CONFIG_INTELHEX_BINARY=y CONFIG_LPC17_40_EXTDRAM=y CONFIG_LPC17_40_EXTDRAMSIZE=67108864 diff --git a/boards/arm/stm32/olimex-stm32-p407/include/board.h b/boards/arm/stm32/olimex-stm32-p407/include/board.h index 8662da107e..d39d24663a 100644 --- a/boards/arm/stm32/olimex-stm32-p407/include/board.h +++ b/boards/arm/stm32/olimex-stm32-p407/include/board.h @@ -196,7 +196,7 @@ #define BUTTON_TAMPER 0 #define BUTTON_WKUP 1 -#ifdef CONFIG_DJOYSTICK +#ifdef CONFIG_INPUT_DJOYSTICK # define NUM_BUTTONS 2 #else # define JOYSTICK_RIGHT 2 @@ -211,7 +211,7 @@ #define BUTTON_TAMPER_BIT (1 << BUTTON_TAMPER) #define BUTTON_WKUP_BIT (1 << BUTTON_WKUP) -#ifndef CONFIG_DJOYSTICK +#ifndef CONFIG_INPUT_DJOYSTICK # define JOYSTICK_RIGHT_BIT (1 << JOYSTICK_RIGHT) # define JOYSTICK_UP_BIT (1 << JOYSTICK_UP) # define JOYSTICK_LEFT_BIT (1 << JOYSTICK_LEFT) diff --git a/boards/arm/stm32/olimex-stm32-p407/src/Make.defs b/boards/arm/stm32/olimex-stm32-p407/src/Make.defs index 676b1f941f..48d23d1b49 100644 --- a/boards/arm/stm32/olimex-stm32-p407/src/Make.defs +++ b/boards/arm/stm32/olimex-stm32-p407/src/Make.defs @@ -56,7 +56,7 @@ ifeq ($(CONFIG_AUDIO_CS4344),y) CSRCS += stm32_cs4344.c endif -ifeq ($(CONFIG_DJOYSTICK),y) +ifeq ($(CONFIG_INPUT_DJOYSTICK),y) CSRCS += stm32_djoystick.c endif diff --git a/boards/arm/stm32/olimex-stm32-p407/src/olimex-stm32-p407.h b/boards/arm/stm32/olimex-stm32-p407/src/olimex-stm32-p407.h index 622e2c7f7e..415b1b5950 100644 --- a/boards/arm/stm32/olimex-stm32-p407/src/olimex-stm32-p407.h +++ b/boards/arm/stm32/olimex-stm32-p407/src/olimex-stm32-p407.h @@ -149,7 +149,7 @@ /* BUTTONS -- NOTE that all have EXTI interrupts configured */ -#ifdef CONFIG_DJOYSTICK +#ifdef CONFIG_INPUT_DJOYSTICK # define MIN_IRQBUTTON BUTTON_TAMPER # define MAX_IRQBUTTON BUTTON_WKUP # define NUM_IRQBUTTONS 2 @@ -349,7 +349,7 @@ int stm32_cs4344_initialize(int minor); * ****************************************************************************/ -#ifdef CONFIG_DJOYSTICK +#ifdef CONFIG_INPUT_DJOYSTICK int stm32_djoy_initialize(void); #endif diff --git a/boards/arm/stm32/olimex-stm32-p407/src/stm32_bringup.c b/boards/arm/stm32/olimex-stm32-p407/src/stm32_bringup.c index 786826d4c2..e33963c2b4 100644 --- a/boards/arm/stm32/olimex-stm32-p407/src/stm32_bringup.c +++ b/boards/arm/stm32/olimex-stm32-p407/src/stm32_bringup.c @@ -208,7 +208,7 @@ int stm32_bringup(void) } #endif -#ifdef CONFIG_DJOYSTICK +#ifdef CONFIG_INPUT_DJOYSTICK ret = stm32_djoy_initialize(); if (ret != OK) { diff --git a/boards/arm/stm32/olimex-stm32-p407/src/stm32_buttons.c b/boards/arm/stm32/olimex-stm32-p407/src/stm32_buttons.c index 3cf5243451..2302c89fac 100644 --- a/boards/arm/stm32/olimex-stm32-p407/src/stm32_buttons.c +++ b/boards/arm/stm32/olimex-stm32-p407/src/stm32_buttons.c @@ -50,12 +50,12 @@ static const uint32_t g_buttons[NUM_BUTTONS] = GPIO_BTN_TAMPER, GPIO_BTN_WKUP, - /* The Joystick is treated like the other buttons unless CONFIG_DJOYSTICK - * is defined, then it is assumed that they should be used by the discrete - * joystick driver. + /* The Joystick is treated like the other buttons unless + * CONFIG_INPUT_DJOYSTICK is defined, then it is assumed that they should + * be used by the discrete joystick driver. */ -#ifndef CONFIG_DJOYSTICK +#ifndef CONFIG_INPUT_DJOYSTICK GPIO_JOY_RIGHT, GPIO_JOY_UP, GPIO_JOY_LEFT, @@ -115,7 +115,7 @@ uint32_t board_buttons(void) ret |= BUTTON_WKUP_BIT; } -#ifndef CONFIG_DJOYSTICK +#ifndef CONFIG_INPUT_DJOYSTICK if (stm32_gpioread(g_buttons[JOYSTICK_RIGHT])) { ret |= JOYSTICK_RIGHT_BIT; diff --git a/boards/arm/stm32/olimex-stm32-p407/src/stm32_djoystick.c b/boards/arm/stm32/olimex-stm32-p407/src/stm32_djoystick.c index 28c717e991..72fd762260 100644 --- a/boards/arm/stm32/olimex-stm32-p407/src/stm32_djoystick.c +++ b/boards/arm/stm32/olimex-stm32-p407/src/stm32_djoystick.c @@ -34,7 +34,7 @@ #include "stm32_gpio.h" #include "olimex-stm32-p407.h" -#ifdef CONFIG_DJOYSTICK +#ifdef CONFIG_INPUT_DJOYSTICK /**************************************************************************** * Pre-processor Definitions @@ -293,4 +293,4 @@ int stm32_djoy_initialize(void) return djoy_register("/dev/djoy0", &g_djoylower); } -#endif /* CONFIG_DJOYSTICK */ +#endif /* CONFIG_INPUT_DJOYSTICK */ diff --git a/boards/arm/stm32/stm3210e-eval/README.txt b/boards/arm/stm32/stm3210e-eval/README.txt index 8b546a6973..9fc66af48f 100644 --- a/boards/arm/stm32/stm3210e-eval/README.txt +++ b/boards/arm/stm32/stm3210e-eval/README.txt @@ -723,7 +723,7 @@ Where is one of the following: Enable the DJoystick driver: CONFIG_INPUT=y # Enable input driver support - CONFIG_DJOYSTICK=y # Enable the joystick drivers + CONFIG_INPUT_DJOYSTICK=y # Enable the joystick drivers # (default parameters should be okay) Enable the DJoystick Example: diff --git a/boards/arm/stm32/stm3210e-eval/include/board.h b/boards/arm/stm32/stm3210e-eval/include/board.h index 713c39d1c2..c246e5e928 100644 --- a/boards/arm/stm32/stm3210e-eval/include/board.h +++ b/boards/arm/stm32/stm3210e-eval/include/board.h @@ -178,16 +178,16 @@ * Joystick right -- Connected to PG.13 * Joystick up -- Connected to PG.15 * - * The Joystick is treated like the other buttons unless CONFIG_DJOYSTICK - * is defined, then it is assumed that they should be used by the discrete - * joystick driver. + * The Joystick is treated like the other buttons unless + * CONFIG_INPUT_DJOYSTICK is defined, then it is assumed that they should be + * used by the discrete joystick driver. */ #define BUTTON_WAKEUP 0 #define BUTTON_TAMPER 1 #define BUTTON_KEY 2 -#ifdef CONFIG_DJOYSTICK +#ifdef CONFIG_INPUT_DJOYSTICK # define NUM_BUTTONS 3 #else # define JOYSTICK_SEL 3 @@ -203,7 +203,7 @@ #define BUTTON_TAMPER_BIT (1 << BUTTON_TAMPER) #define BUTTON_KEY_BIT (1 << BUTTON_KEY) -#ifndef CONFIG_DJOYSTICK +#ifndef CONFIG_INPUT_DJOYSTICK # define JOYSTICK_SEL_BIT (1 << JOYSTICK_SEL) # define JOYSTICK_DOWN_BIT (1 << JOYSTICK_DOWN) # define JOYSTICK_LEFT_BIT (1 << JOYSTICK_LEFT) diff --git a/boards/arm/stm32/stm3210e-eval/src/Make.defs b/boards/arm/stm32/stm3210e-eval/src/Make.defs index 3d0a4be3ee..5412c598d7 100644 --- a/boards/arm/stm32/stm3210e-eval/src/Make.defs +++ b/boards/arm/stm32/stm3210e-eval/src/Make.defs @@ -60,7 +60,7 @@ CSRCS += stm32_pmbuttons.c endif endif -ifeq ($(CONFIG_DJOYSTICK),y) +ifeq ($(CONFIG_INPUT_DJOYSTICK),y) CSRCS += stm32_djoystick.c endif diff --git a/boards/arm/stm32/stm3210e-eval/src/stm3210e-eval.h b/boards/arm/stm32/stm3210e-eval/src/stm3210e-eval.h index 6e561c86c6..15f7fbe126 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm3210e-eval.h +++ b/boards/arm/stm32/stm3210e-eval/src/stm3210e-eval.h @@ -78,7 +78,7 @@ /* BUTTONS -- NOTE that some have EXTI interrupts configured */ -#ifdef CONFIG_DJOYSTICK +#ifdef CONFIG_INPUT_DJOYSTICK # define MIN_IRQBUTTON BUTTON_KEY # define MAX_IRQBUTTON BUTTON_KEY # define NUM_IRQBUTTONS (1) @@ -351,7 +351,7 @@ void stm32_pmbuttons(void); * ****************************************************************************/ -#ifdef CONFIG_DJOYSTICK +#ifdef CONFIG_INPUT_DJOYSTICK int stm32_djoy_initialization(void); #endif diff --git a/boards/arm/stm32/stm3210e-eval/src/stm32_bringup.c b/boards/arm/stm32/stm3210e-eval/src/stm32_bringup.c index 8234b86bd8..3f9d3e7dc2 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm32_bringup.c +++ b/boards/arm/stm32/stm3210e-eval/src/stm32_bringup.c @@ -299,7 +299,7 @@ int stm32_bringup(void) } #endif -#ifdef CONFIG_DJOYSTICK +#ifdef CONFIG_INPUT_DJOYSTICK /* Initialize and register the joystick driver */ ret = stm32_djoy_initialization(); diff --git a/boards/arm/stm32/stm3210e-eval/src/stm32_buttons.c b/boards/arm/stm32/stm3210e-eval/src/stm32_buttons.c index b5d3c7d183..4989ca06c8 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm32_buttons.c +++ b/boards/arm/stm32/stm3210e-eval/src/stm32_buttons.c @@ -48,12 +48,12 @@ static const uint32_t g_buttons[NUM_BUTTONS] = { GPIO_BTN_WAKEUP, GPIO_BTN_TAMPER, GPIO_BTN_KEY, - /* The Joystick is treated like the other buttons unless CONFIG_DJOYSTICK - * is defined, then it is assumed that they should be used by the discrete - * joystick driver. + /* The Joystick is treated like the other buttons unless + * CONFIG_INPUT_DJOYSTICK is defined, then it is assumed that they should + * be used by the discrete joystick driver. */ -#ifndef CONFIG_DJOYSTICK +#ifndef CONFIG_INPUT_DJOYSTICK GPIO_JOY_SEL, GPIO_JOY_DOWN, GPIO_JOY_LEFT, GPIO_JOY_RIGHT, GPIO_JOY_UP #endif }; diff --git a/boards/arm/stm32/stm3210e-eval/src/stm32_djoystick.c b/boards/arm/stm32/stm3210e-eval/src/stm32_djoystick.c index b0829634da..b5fbdc859b 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm32_djoystick.c +++ b/boards/arm/stm32/stm3210e-eval/src/stm32_djoystick.c @@ -34,7 +34,7 @@ #include "stm32_gpio.h" #include "stm3210e-eval.h" -#ifdef CONFIG_DJOYSTICK +#ifdef CONFIG_INPUT_DJOYSTICK /**************************************************************************** * Pre-processor Definitions @@ -293,4 +293,4 @@ int stm32_djoy_initialization(void) return djoy_register("/dev/djoy0", &g_djoylower); } -#endif /* CONFIG_DJOYSTICK */ +#endif /* CONFIG_INPUT_DJOYSTICK */ diff --git a/boards/arm/stm32/stm3210e-eval/src/stm32_pmbuttons.c b/boards/arm/stm32/stm3210e-eval/src/stm32_pmbuttons.c index dfc9883b36..13ccaff093 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm32_pmbuttons.c +++ b/boards/arm/stm32/stm3210e-eval/src/stm32_pmbuttons.c @@ -67,7 +67,7 @@ #endif #define BUTTON_MIN 0 -#ifdef CONFIG_DJOYSTICK +#ifdef CONFIG_INPUT_DJOYSTICK # define BUTTON_MAX 2 #else # define BUTTON_MAX 7 diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig index 2590863bea..e6b6a44476 100644 --- a/drivers/input/Kconfig +++ b/drivers/input/Kconfig @@ -472,7 +472,7 @@ config INPUT_BUTTONS_NPOLLWAITERS endif # INPUT_BUTTONS -config DJOYSTICK +config INPUT_DJOYSTICK bool "Discrete Joystick" default n ---help--- @@ -482,13 +482,13 @@ config DJOYSTICK values like buttons (as opposed to integer values like you might obtain from an analog joystick). -if DJOYSTICK +if INPUT_DJOYSTICK -config DJOYSTICK_NPOLLWAITERS +config INPUT_DJOYSTICK_NPOLLWAITERS int "Max Number of Poll Waiters" default 2 -endif # DJOYSTICK +endif # INPUT_DJOYSTICK config AJOYSTICK bool "Analog Joystick" @@ -541,7 +541,7 @@ if INPUT_SPQ10KBD config SPQ10KBD_DJOY bool "Joystick Interface for Buttons" - select DJOYSTICK + select INPUT_DJOYSTICK default n config SPQ10KBD_REGDBG diff --git a/drivers/input/Make.defs b/drivers/input/Make.defs index e25c72131e..f1b56dda84 100644 --- a/drivers/input/Make.defs +++ b/drivers/input/Make.defs @@ -72,7 +72,7 @@ endif endif -ifeq ($(CONFIG_DJOYSTICK),y) +ifeq ($(CONFIG_INPUT_DJOYSTICK),y) CSRCS += djoystick.c endif diff --git a/drivers/input/djoystick.c b/drivers/input/djoystick.c index 6f8a33ffda..2d28431b3f 100644 --- a/drivers/input/djoystick.c +++ b/drivers/input/djoystick.c @@ -99,7 +99,7 @@ struct djoy_open_s * driver events. */ - FAR struct pollfd *do_fds[CONFIG_DJOYSTICK_NPOLLWAITERS]; + FAR struct pollfd *do_fds[CONFIG_INPUT_DJOYSTICK_NPOLLWAITERS]; }; /**************************************************************************** @@ -192,7 +192,7 @@ static void djoy_enable(FAR struct djoy_upperhalf_s *priv) { /* Are there any poll waiters? */ - for (i = 0; i < CONFIG_DJOYSTICK_NPOLLWAITERS; i++) + for (i = 0; i < CONFIG_INPUT_DJOYSTICK_NPOLLWAITERS; i++) { if (opriv->do_fds[i]) { @@ -299,7 +299,7 @@ static void djoy_sample(FAR struct djoy_upperhalf_s *priv) { /* Yes.. Notify all waiters */ - for (i = 0; i < CONFIG_DJOYSTICK_NPOLLWAITERS; i++) + for (i = 0; i < CONFIG_INPUT_DJOYSTICK_NPOLLWAITERS; i++) { FAR struct pollfd *fds = opriv->do_fds[i]; if (fds) @@ -704,7 +704,7 @@ static int djoy_poll(FAR struct file *filep, FAR struct pollfd *fds, * slot for the poll structure reference */ - for (i = 0; i < CONFIG_DJOYSTICK_NPOLLWAITERS; i++) + for (i = 0; i < CONFIG_INPUT_DJOYSTICK_NPOLLWAITERS; i++) { /* Find an available slot */ @@ -718,7 +718,7 @@ static int djoy_poll(FAR struct file *filep, FAR struct pollfd *fds, } } - if (i >= CONFIG_DJOYSTICK_NPOLLWAITERS) + if (i >= CONFIG_INPUT_DJOYSTICK_NPOLLWAITERS) { ierr("ERROR: Too man poll waiters\n"); fds->priv = NULL; diff --git a/include/nuttx/input/djoystick.h b/include/nuttx/input/djoystick.h index 4bee72c52a..fff707f3c6 100644 --- a/include/nuttx/input/djoystick.h +++ b/include/nuttx/input/djoystick.h @@ -51,8 +51,8 @@ /* Configuration ************************************************************/ -#ifndef CONFIG_DJOYSTICK_NPOLLWAITERS -# define CONFIG_DJOYSTICK_NPOLLWAITERS 2 +#ifndef CONFIG_INPUT_DJOYSTICK_NPOLLWAITERS +# define CONFIG_INPUT_DJOYSTICK_NPOLLWAITERS 2 #endif /* Joystick Interface *******************************************************/