From 0d085198e9bafae34dcb77d1e75305785f1e5d08 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 31 Mar 2015 13:21:25 -0600 Subject: rch_tcinitialize() and arch_tcunitinitialize() renamed to board_tsc_setup() and board_tsc_teardown(). These are not long called directly by applications but only indirectly throught the crappy boardctl() OS interface. --- NxWidgets/ChangeLog.txt | 5 ++ NxWidgets/Kconfig | 11 ++--- NxWidgets/nxwm/src/ctouchscreen.cxx | 3 +- apps/NxWidgets/Kconfig | 11 ++--- apps/examples/README.txt | 11 +++-- apps/examples/touchscreen/Kconfig | 25 ++++------ apps/examples/touchscreen/tc_main.c | 7 +-- nuttx/arch/sim/src/up_touchscreen.c | 9 ++-- nuttx/configs/Kconfig | 5 ++ nuttx/configs/arduino-due/src/sam_touchscreen.c | 9 ++-- nuttx/configs/boardctl.c | 35 ++++++++------ nuttx/configs/hymini-stm32v/nsh2/defconfig | 2 + nuttx/configs/hymini-stm32v/src/stm32_ts.c | 15 +++--- nuttx/configs/mikroe-stm32f4/fulldemo/defconfig | 2 + .../configs/mikroe-stm32f4/src/stm32_touchscreen.c | 9 ++-- nuttx/configs/olimex-lpc1766stk/hidmouse/defconfig | 2 + .../configs/olimex-lpc1766stk/src/lpc17_hidmouse.c | 9 ++-- nuttx/configs/open1788/src/lpc17_touchscreen.c | 8 ++-- nuttx/configs/pic32mx7mmb/src/pic32_touchscreen.c | 9 ++-- nuttx/configs/sam3u-ek/src/sam_touchscreen.c | 9 ++-- nuttx/configs/sam4e-ek/src/sam_ads7843e.c | 9 ++-- nuttx/configs/sama5d3x-ek/src/sam_touchscreen.c | 10 ++-- nuttx/configs/sama5d4-ek/ipv6/defconfig | 2 + nuttx/configs/sama5d4-ek/nsh/defconfig | 2 + nuttx/configs/sama5d4-ek/src/sam_maxtouch.c | 9 ++-- nuttx/configs/samv71-xult/mxtxplnd/defconfig | 2 + nuttx/configs/samv71-xult/src/sam_maxtouch.c | 9 ++-- nuttx/configs/shenzhou/src/stm32_touchscreen.c | 9 ++-- nuttx/configs/sim/README.txt | 2 +- nuttx/configs/sim/nsh2/defconfig | 2 + nuttx/configs/sim/src/sim_touchscreen.c | 13 +++--- nuttx/configs/sim/touchscreen/defconfig | 2 + nuttx/configs/stm3220g-eval/src/stm32_stmpe811.c | 9 ++-- nuttx/configs/stm3240g-eval/src/stm32_boot.c | 4 +- nuttx/configs/stm3240g-eval/src/stm32_stmpe811.c | 9 ++-- .../viewtool-stm32f107/src/stm32_touchscreen.c | 9 ++-- nuttx/include/nuttx/board.h | 54 +++++++++++++++++++++- nuttx/include/nuttx/input/touchscreen.h | 38 --------------- nuttx/include/sys/boardctl.h | 18 +++++--- 39 files changed, 236 insertions(+), 172 deletions(-) diff --git a/NxWidgets/ChangeLog.txt b/NxWidgets/ChangeLog.txt index ff21d8852..6cf53f54c 100644 --- a/NxWidgets/ChangeLog.txt +++ b/NxWidgets/ChangeLog.txt @@ -544,3 +544,8 @@ NuttX 7.6 and previous versions of the UnitTest code. 1.15 2015-xx-xx Gregory Nutt + +* In NuttX 7.9, the interface arch_tcinitialize() was replaced with the + boardctl() interface. Old versions of NxWM will then be incompatible + with Versions of NuttX at 7.9 and beyond (2015-03-31). + diff --git a/NxWidgets/Kconfig b/NxWidgets/Kconfig index 89e7e222d..066cdb2da 100644 --- a/NxWidgets/Kconfig +++ b/NxWidgets/Kconfig @@ -782,12 +782,11 @@ config NXWM_TOUCHSCREEN_DEVINIT depends on !BUILD_PROTECTED && !BUILD_KERNEL ---help--- It this option is selected, then the NxWM:CTouchscreen listener - thread will call a function arch_tcinitialize(NXWM_TOUCHSCREEN_DEVNO) - in order to instantiate the touchscreen driver at path - NXWM_TOUCHSCREEN_DEVPATH. If NXWM_TOUCHSCREEN_DEVINIT is not - selected, then the NxWM:CTouchscreen listener thread will assume - that the driver has already been initialized at - NXWM_TOUCHSCREEN_DEVPATH. + thread will call a function boardctl() in order to instantiate the + touchscreen driver at path NXWM_TOUCHSCREEN_DEVPATH. If + NXWM_TOUCHSCREEN_DEVINIT is not selected, then the NxWM:CTouchscreen + listener thread will assume that the driver has already been + initialized at NXWM_TOUCHSCREEN_DEVPATH. NOTE that in the kernel build, all touchscreen initialize must be performed in kernel logic prior to the execution of NxWM. diff --git a/NxWidgets/nxwm/src/ctouchscreen.cxx b/NxWidgets/nxwm/src/ctouchscreen.cxx index dc462727d..3792811a4 100644 --- a/NxWidgets/nxwm/src/ctouchscreen.cxx +++ b/NxWidgets/nxwm/src/ctouchscreen.cxx @@ -43,6 +43,7 @@ #include #include +#include #include #include #include @@ -281,7 +282,7 @@ FAR void *CTouchscreen::listener(FAR void *arg) #ifdef CONFIG_NXWM_TOUCHSCREEN_DEVINIT // Initialize the touchscreen device - int ret = arch_tcinitialize(CONFIG_NXWM_TOUCHSCREEN_DEVNO); + int ret = boardctl(BOARDIOC_TSCTEST_SETUP, CONFIG_NXWM_TOUCHSCREEN_DEVNO); if (ret < 0) { dbg("ERROR Failed initialize the touchscreen device: %d\n", ret); diff --git a/apps/NxWidgets/Kconfig b/apps/NxWidgets/Kconfig index 89e7e222d..066cdb2da 100644 --- a/apps/NxWidgets/Kconfig +++ b/apps/NxWidgets/Kconfig @@ -782,12 +782,11 @@ config NXWM_TOUCHSCREEN_DEVINIT depends on !BUILD_PROTECTED && !BUILD_KERNEL ---help--- It this option is selected, then the NxWM:CTouchscreen listener - thread will call a function arch_tcinitialize(NXWM_TOUCHSCREEN_DEVNO) - in order to instantiate the touchscreen driver at path - NXWM_TOUCHSCREEN_DEVPATH. If NXWM_TOUCHSCREEN_DEVINIT is not - selected, then the NxWM:CTouchscreen listener thread will assume - that the driver has already been initialized at - NXWM_TOUCHSCREEN_DEVPATH. + thread will call a function boardctl() in order to instantiate the + touchscreen driver at path NXWM_TOUCHSCREEN_DEVPATH. If + NXWM_TOUCHSCREEN_DEVINIT is not selected, then the NxWM:CTouchscreen + listener thread will assume that the driver has already been + initialized at NXWM_TOUCHSCREEN_DEVPATH. NOTE that in the kernel build, all touchscreen initialize must be performed in kernel logic prior to the execution of NxWM. diff --git a/apps/examples/README.txt b/apps/examples/README.txt index 1a4047592..27ff6d1e2 100644 --- a/apps/examples/README.txt +++ b/apps/examples/README.txt @@ -1809,12 +1809,13 @@ examples/touchscreen CONFIG_EXAMPLES_TOUCHSREEN=y - The board-specific logic must provide the following interfaces that will - be called by the example in order to initialize and uninitialize the - touchscreen hardware: + This example code will call boardctl() to setup the touchscreen driver + for texting. The implementation of boardctl() will require that board- + specific logic provide the following interfaces that will be called by + the boardctl() in order to initialize and uninitialize the touchscreen hardware: - int arch_tcinitialize(int minor); - int arch_tcuninitialize(void); + int board_tsc_setup(int minor); + void board_tsc_teardown(void); examples/udp ^^^^^^^^^^^^ diff --git a/apps/examples/touchscreen/Kconfig b/apps/examples/touchscreen/Kconfig index e266972b6..2edad5915 100644 --- a/apps/examples/touchscreen/Kconfig +++ b/apps/examples/touchscreen/Kconfig @@ -46,12 +46,13 @@ config EXAMPLES_TOUCHSCREEN_MOUSE config EXAMPLES_TOUCHSCREEN_ARCHINIT bool "Architecture-specific initialization" default y - depends on !BUILD_PROTECTED && !BUILD_KERNEL + depends on LIB_BOARDCTL + select BOARDCTL_TSCTEST ---help--- - By default, the touchscreen example will call arch_tcinitialize() to + By default, the touchscreen example will call boardctl() to register the touchscreen device before it attempts to open it. - Similarly, it will call arch_tcuninitialize() to unregister the - touchscreen device when it is finished. + Similarly, it will call boardctl() to unregister the touchscreen + device when it is finished. This works well for the typical touchscreen controller but there are other devices that cannot be initialized and uninitialized in this @@ -60,17 +61,9 @@ config EXAMPLES_TOUCHSCREEN_ARCHINIT mouse is disconnected. So, in cases like this, there are two options: (1) provide dummy - arch_tcinitialize() and arch_tcuninitialize() just to satisfy the - linking requirements or, (2) select this option. if this option is - de-selected, then the arch_tcinitialize() and arch_tcuninitialize() will - never be called. - - NOTE also that the functions arch_tcinitialize() and - arch_tcuninitialize() are effective non-standard operating system - calls. This is cheap shortcut and a violation of the OS interface. - You can get away with this in the flat build (CONFIG_BUILD_FLAT), - but not in the protected or kernel builds (CONFIG_BUILD_PROTECTED - or CONFIG)BUILD_KERNEL). In those cases, you will need to perform - one-time touchscreen initialization in board_initialize(). + board_tsc_setup() and board_tsc_teardown() just to satisfy the + linking requirements of boardctl() or, (2) de-select this option. + If this option is de-selected, then the boardctl() will never be + called. endif diff --git a/apps/examples/touchscreen/tc_main.c b/apps/examples/touchscreen/tc_main.c index c2c451f2f..8e35630d2 100644 --- a/apps/examples/touchscreen/tc_main.c +++ b/apps/examples/touchscreen/tc_main.c @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -130,10 +131,10 @@ int tc_main(int argc, char *argv[]) */ printf("tc_main: Initializing external touchscreen device\n"); - ret = arch_tcinitialize(CONFIG_EXAMPLES_TOUCHSCREEN_MINOR); + ret = boardctl(BOARDIOC_TSCTEST_SETUP, CONFIG_EXAMPLES_TOUCHSCREEN_MINOR); if (ret != OK) { - printf("tc_main: arch_tcinitialize failed: %d\n", ret); + printf("tc_main: board_tsc_setup failed: %d\n", ret); errval = 1; goto errout; } @@ -260,7 +261,7 @@ errout_with_dev: errout_with_tc: #ifdef CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT - arch_tcuninitialize(); + boardctl(BOARDIOC_TSCTEST_TEARDOWN, 0); errout: #endif diff --git a/nuttx/arch/sim/src/up_touchscreen.c b/nuttx/arch/sim/src/up_touchscreen.c index 9ee99cbe9..a7f6d68fb 100644 --- a/nuttx/arch/sim/src/up_touchscreen.c +++ b/nuttx/arch/sim/src/up_touchscreen.c @@ -52,6 +52,7 @@ #include #include +#include #include #include #include @@ -625,7 +626,7 @@ errout: ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Configure the simulated touchscreen. This will register the driver as @@ -640,7 +641,7 @@ errout: * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { FAR struct up_dev_s *priv = ( FAR struct up_dev_s *)&g_simtouchscreen; char devname[DEV_NAMELEN]; @@ -687,7 +688,7 @@ errout_with_priv: } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Uninitialized the simulated touchscreen @@ -700,7 +701,7 @@ errout_with_priv: * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { FAR struct up_dev_s *priv = ( FAR struct up_dev_s *)&g_simtouchscreen; char devname[DEV_NAMELEN]; diff --git a/nuttx/configs/Kconfig b/nuttx/configs/Kconfig index 403002594..c1dc72ca9 100644 --- a/nuttx/configs/Kconfig +++ b/nuttx/configs/Kconfig @@ -1585,3 +1585,8 @@ endif config LIB_BOARDCTL bool "Enabled boardctl() interface" default n + +config BOARDCTL_TSCTEST + bool "Enable touchscreen test interfaces" + default n + depends on LIB_BOARDCTL diff --git a/nuttx/configs/arduino-due/src/sam_touchscreen.c b/nuttx/configs/arduino-due/src/sam_touchscreen.c index 5e5a22a8d..6a7c1cfed 100644 --- a/nuttx/configs/arduino-due/src/sam_touchscreen.c +++ b/nuttx/configs/arduino-due/src/sam_touchscreen.c @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -335,7 +336,7 @@ static FAR struct spi_dev_s *sam_tsc_spiinitialize(void) ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this function. @@ -352,7 +353,7 @@ static FAR struct spi_dev_s *sam_tsc_spiinitialize(void) * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { FAR struct spi_dev_s *dev; static bool initialized = false; @@ -405,7 +406,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -420,7 +421,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* No support for un-initializing the touchscreen XPT2046 device. It will * continue to run and process touch interrupts in the background. diff --git a/nuttx/configs/boardctl.c b/nuttx/configs/boardctl.c index a41c1d2e6..d865fff68 100755 --- a/nuttx/configs/boardctl.c +++ b/nuttx/configs/boardctl.c @@ -98,24 +98,31 @@ int boardctl(unsigned int cmd, uintptr_t arg) break; #ifdef CONFIG_BOARDCTL_TSCTEST - /* CMD: BOARDIOC_TSCTEST + /* CMD: BOARDIOC_TSCTEST_SETUP * DESCRIPTION: Touchscreen controller test configuration - * ARG: 0: Setup touchscreen test, 1: Teardown touchscreen test - * CONFIGURATION: CONFIG_LIB_BOARDCTL && - * DEPENDENCIES: Board logic must provide board_tsc_setup() and - * board_tsc_teardown(). + * ARG: Touch controller device minor number + * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST + * DEPENDENCIES: Board logic must provide board_tsc_setup() */ - case BOARDIOC_TSCTEST: - if (arg) - { - ret = board_tsc_setup(); - } - else - { - ret = board_tsc_teardown(); - } + case BOARDIOC_TSCTEST_SETUP: + { + ret = board_tsc_setup((int)arg); + } + break; + + /* CMD: BOARDIOC_TSCTEST_TEARDOWN + * DESCRIPTION: Touchscreen controller test configuration + * ARG: None + * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST + * DEPENDENCIES: Board logic must provide board_tsc_teardown() + */ + case BOARDIOC_TSCTEST_TEARDOWN: + { + board_tsc_teardown(); + ret = OK; + } break; #endif diff --git a/nuttx/configs/hymini-stm32v/nsh2/defconfig b/nuttx/configs/hymini-stm32v/nsh2/defconfig index a588d9301..3c92af404 100644 --- a/nuttx/configs/hymini-stm32v/nsh2/defconfig +++ b/nuttx/configs/hymini-stm32v/nsh2/defconfig @@ -714,6 +714,8 @@ CONFIG_EXAMPLES_NXIMAGE=y # CONFIG_EXAMPLES_THTTPD is not set # CONFIG_EXAMPLES_TIFF is not set CONFIG_EXAMPLES_TOUCHSCREEN=y +CONFIG_LIB_BOARDCTL=y +CONFIG_BOARDCTL_TSCTEST=y CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0 CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0" CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT=y diff --git a/nuttx/configs/hymini-stm32v/src/stm32_ts.c b/nuttx/configs/hymini-stm32v/src/stm32_ts.c index 0c384048d..6d156d860 100644 --- a/nuttx/configs/hymini-stm32v/src/stm32_ts.c +++ b/nuttx/configs/hymini-stm32v/src/stm32_ts.c @@ -45,12 +45,13 @@ #include #include -#include "stm32.h" -#include "hymini_stm32v-internal.h" - +#include #include #include +#include "stm32.h" +#include "hymini_stm32v-internal.h" + /************************************************************************************ * Pre-processor Defintiions ************************************************************************************/ @@ -131,7 +132,7 @@ static bool hymini_ts_pendown(FAR struct ads7843e_config_s *state) } /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this function. @@ -148,7 +149,7 @@ static bool hymini_ts_pendown(FAR struct ads7843e_config_s *state) * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { FAR struct spi_dev_s *dev; @@ -169,7 +170,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -184,7 +185,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* FIXME What can/should we do here ? */ } diff --git a/nuttx/configs/mikroe-stm32f4/fulldemo/defconfig b/nuttx/configs/mikroe-stm32f4/fulldemo/defconfig index 9e3dc090a..ba66239b8 100644 --- a/nuttx/configs/mikroe-stm32f4/fulldemo/defconfig +++ b/nuttx/configs/mikroe-stm32f4/fulldemo/defconfig @@ -1146,6 +1146,8 @@ CONFIG_EXAMPLES_NX_NOTIFYSIGNO=4 # CONFIG_EXAMPLES_THTTPD is not set # CONFIG_EXAMPLES_TIFF is not set CONFIG_EXAMPLES_TOUCHSCREEN=y +CONFIG_LIB_BOARDCTL=y +CONFIG_BOARDCTL_TSCTEST=y CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0 CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0" # CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE is not set diff --git a/nuttx/configs/mikroe-stm32f4/src/stm32_touchscreen.c b/nuttx/configs/mikroe-stm32f4/src/stm32_touchscreen.c index 210c11d19..f15c688ed 100644 --- a/nuttx/configs/mikroe-stm32f4/src/stm32_touchscreen.c +++ b/nuttx/configs/mikroe-stm32f4/src/stm32_touchscreen.c @@ -50,6 +50,7 @@ #include #include +#include #include #include #include @@ -1473,7 +1474,7 @@ errout: ************************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this function. @@ -1490,7 +1491,7 @@ errout: * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { FAR struct tc_dev_s *priv; char devname[DEV_NAMELEN]; @@ -1583,7 +1584,7 @@ errout_with_priv: } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -1598,7 +1599,7 @@ errout_with_priv: * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* Need to unregister the /dev/inputN device here. */ } diff --git a/nuttx/configs/olimex-lpc1766stk/hidmouse/defconfig b/nuttx/configs/olimex-lpc1766stk/hidmouse/defconfig index 68f5381c5..da70dc4a2 100644 --- a/nuttx/configs/olimex-lpc1766stk/hidmouse/defconfig +++ b/nuttx/configs/olimex-lpc1766stk/hidmouse/defconfig @@ -703,6 +703,8 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_THTTPD is not set # CONFIG_EXAMPLES_TIFF is not set CONFIG_EXAMPLES_TOUCHSCREEN=y +CONFIG_LIB_BOARDCTL=y +CONFIG_BOARDCTL_TSCTEST=y CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0 CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/mouse0" CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE=y diff --git a/nuttx/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c b/nuttx/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c index d78579245..24fa5aa17 100644 --- a/nuttx/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c +++ b/nuttx/configs/olimex-lpc1766stk/src/lpc17_hidmouse.c @@ -45,6 +45,7 @@ #include #include +#include #include #include @@ -90,7 +91,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this @@ -108,7 +109,7 @@ * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { static bool initialized = false; int ret; @@ -142,7 +143,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -157,7 +158,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* No support for un-initializing the USB mouse driver. It will continue * to run and process touch interrupts in the background. diff --git a/nuttx/configs/open1788/src/lpc17_touchscreen.c b/nuttx/configs/open1788/src/lpc17_touchscreen.c index 09dcb0a33..2dfb69c55 100644 --- a/nuttx/configs/open1788/src/lpc17_touchscreen.c +++ b/nuttx/configs/open1788/src/lpc17_touchscreen.c @@ -254,7 +254,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this @@ -271,7 +271,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { static bool initialized = false; FAR struct spi_dev_s *dev; @@ -323,7 +323,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -338,7 +338,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* No support for un-initializing the touchscreen XPT2046 device yet */ } diff --git a/nuttx/configs/pic32mx7mmb/src/pic32_touchscreen.c b/nuttx/configs/pic32mx7mmb/src/pic32_touchscreen.c index e4b8a2d64..33434bd8e 100644 --- a/nuttx/configs/pic32mx7mmb/src/pic32_touchscreen.c +++ b/nuttx/configs/pic32mx7mmb/src/pic32_touchscreen.c @@ -48,6 +48,7 @@ #include #include +#include #include #include #include @@ -1343,7 +1344,7 @@ errout: ************************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this function. @@ -1360,7 +1361,7 @@ errout: * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { FAR struct tc_dev_s *priv; char devname[DEV_NAMELEN]; @@ -1436,7 +1437,7 @@ errout_with_priv: } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -1451,7 +1452,7 @@ errout_with_priv: * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* Need to unregister the /dev/inputN device here. */ } diff --git a/nuttx/configs/sam3u-ek/src/sam_touchscreen.c b/nuttx/configs/sam3u-ek/src/sam_touchscreen.c index 0becba782..533b3b26b 100644 --- a/nuttx/configs/sam3u-ek/src/sam_touchscreen.c +++ b/nuttx/configs/sam3u-ek/src/sam_touchscreen.c @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -213,7 +214,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this function. @@ -230,7 +231,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { FAR struct spi_dev_s *dev; int ret; @@ -270,7 +271,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -285,7 +286,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* No support for un-initializing the touchscreen ADS7843E device yet */ } diff --git a/nuttx/configs/sam4e-ek/src/sam_ads7843e.c b/nuttx/configs/sam4e-ek/src/sam_ads7843e.c index 1f3265bcf..1fe76919f 100644 --- a/nuttx/configs/sam4e-ek/src/sam_ads7843e.c +++ b/nuttx/configs/sam4e-ek/src/sam_ads7843e.c @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -210,7 +211,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this function. @@ -227,7 +228,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { FAR struct spi_dev_s *dev; int ret; @@ -267,7 +268,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -282,7 +283,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* No support for un-initializing the touchscreen ADS7843E device yet */ } diff --git a/nuttx/configs/sama5d3x-ek/src/sam_touchscreen.c b/nuttx/configs/sama5d3x-ek/src/sam_touchscreen.c index 51345ab66..3ab2572b2 100644 --- a/nuttx/configs/sama5d3x-ek/src/sam_touchscreen.c +++ b/nuttx/configs/sama5d3x-ek/src/sam_touchscreen.c @@ -47,6 +47,8 @@ #include "sam_tsd.h" #include "sama5d3x-ek.h" +#include + #ifdef CONFIG_SAMA5_TSD /**************************************************************************** @@ -83,7 +85,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this @@ -100,7 +102,7 @@ * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { struct sam_adc_s *adc; static bool initialized = false; @@ -141,7 +143,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -156,7 +158,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* No support for un-initializing the touchscreen yet */ } diff --git a/nuttx/configs/sama5d4-ek/ipv6/defconfig b/nuttx/configs/sama5d4-ek/ipv6/defconfig index 77f44963e..ca5ee10e7 100644 --- a/nuttx/configs/sama5d4-ek/ipv6/defconfig +++ b/nuttx/configs/sama5d4-ek/ipv6/defconfig @@ -1220,6 +1220,8 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_EXAMPLES_THTTPD is not set # CONFIG_EXAMPLES_TIFF is not set CONFIG_EXAMPLES_TOUCHSCREEN=y +CONFIG_LIB_BOARDCTL=y +CONFIG_BOARDCTL_TSCTEST=y CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0 CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0" # CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE is not set diff --git a/nuttx/configs/sama5d4-ek/nsh/defconfig b/nuttx/configs/sama5d4-ek/nsh/defconfig index 49badb8f9..82c1de894 100644 --- a/nuttx/configs/sama5d4-ek/nsh/defconfig +++ b/nuttx/configs/sama5d4-ek/nsh/defconfig @@ -1222,6 +1222,8 @@ CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT=16 # CONFIG_EXAMPLES_THTTPD is not set # CONFIG_EXAMPLES_TIFF is not set CONFIG_EXAMPLES_TOUCHSCREEN=y +CONFIG_LIB_BOARDCTL=y +CONFIG_BOARDCTL_TSCTEST=y CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0 CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0" # CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE is not set diff --git a/nuttx/configs/sama5d4-ek/src/sam_maxtouch.c b/nuttx/configs/sama5d4-ek/src/sam_maxtouch.c index 6a73fb4ce..8de590332 100644 --- a/nuttx/configs/sama5d4-ek/src/sam_maxtouch.c +++ b/nuttx/configs/sama5d4-ek/src/sam_maxtouch.c @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -218,7 +219,7 @@ static int mxt_interrupt(int irq, FAR void *context) ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this function. @@ -235,7 +236,7 @@ static int mxt_interrupt(int irq, FAR void *context) * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { FAR struct i2c_dev_s *i2c; static bool initialized = false; @@ -290,7 +291,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -305,7 +306,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* No support for un-initializing the touchscreen maXTouch device. It will * continue to run and process touch interrupts in the background. diff --git a/nuttx/configs/samv71-xult/mxtxplnd/defconfig b/nuttx/configs/samv71-xult/mxtxplnd/defconfig index a514a3bd2..ff5f597db 100644 --- a/nuttx/configs/samv71-xult/mxtxplnd/defconfig +++ b/nuttx/configs/samv71-xult/mxtxplnd/defconfig @@ -792,6 +792,8 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_THTTPD is not set # CONFIG_EXAMPLES_TIFF is not set CONFIG_EXAMPLES_TOUCHSCREEN=y +CONFIG_LIB_BOARDCTL=y +CONFIG_BOARDCTL_TSCTEST=y CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0 CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0" # CONFIG_EXAMPLES_TOUCHSCREEN_MOUSE is not set diff --git a/nuttx/configs/samv71-xult/src/sam_maxtouch.c b/nuttx/configs/samv71-xult/src/sam_maxtouch.c index b0559b325..14615cc22 100644 --- a/nuttx/configs/samv71-xult/src/sam_maxtouch.c +++ b/nuttx/configs/samv71-xult/src/sam_maxtouch.c @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -214,7 +215,7 @@ static int mxt_interrupt(int irq, FAR void *context) ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this function. @@ -231,7 +232,7 @@ static int mxt_interrupt(int irq, FAR void *context) * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { FAR struct i2c_dev_s *i2c; static bool initialized = false; @@ -286,7 +287,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -301,7 +302,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* No support for un-initializing the touchscreen maXTouch device. It will * continue to run and process touch interrupts in the background. diff --git a/nuttx/configs/shenzhou/src/stm32_touchscreen.c b/nuttx/configs/shenzhou/src/stm32_touchscreen.c index 5128733ef..e2c6ba0d0 100644 --- a/nuttx/configs/shenzhou/src/stm32_touchscreen.c +++ b/nuttx/configs/shenzhou/src/stm32_touchscreen.c @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -228,7 +229,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this function. @@ -245,7 +246,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { FAR struct spi_dev_s *dev; int ret; @@ -280,7 +281,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -295,7 +296,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* No support for un-initializing the touchscreen ADS7843E device yet */ } diff --git a/nuttx/configs/sim/README.txt b/nuttx/configs/sim/README.txt index 6d6192a33..aaeba1c1d 100644 --- a/nuttx/configs/sim/README.txt +++ b/nuttx/configs/sim/README.txt @@ -490,7 +490,7 @@ nx11 CONFIG_SIM_TOUCHSCREEN=y Then you must also have some application logic that will call - arch_tcinitialize(0) to register the touchscreen driver. See + board_tsc_setup(0) to register the touchscreen driver. See also configuration "touchscreen" NOTES: diff --git a/nuttx/configs/sim/nsh2/defconfig b/nuttx/configs/sim/nsh2/defconfig index 067434c8e..3bc73dad5 100644 --- a/nuttx/configs/sim/nsh2/defconfig +++ b/nuttx/configs/sim/nsh2/defconfig @@ -517,6 +517,8 @@ CONFIG_EXAMPLES_NXLINES_BPP=32 # CONFIG_EXAMPLES_THTTPD is not set # CONFIG_EXAMPLES_TIFF is not set CONFIG_EXAMPLES_TOUCHSCREEN=y +CONFIG_LIB_BOARDCTL=y +CONFIG_BOARDCTL_TSCTEST=y CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0 CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0" CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT=y diff --git a/nuttx/configs/sim/src/sim_touchscreen.c b/nuttx/configs/sim/src/sim_touchscreen.c index f91674c44..57ec36c1a 100644 --- a/nuttx/configs/sim/src/sim_touchscreen.c +++ b/nuttx/configs/sim/src/sim_touchscreen.c @@ -44,6 +44,7 @@ #include #include +#include #include #include #include @@ -83,7 +84,7 @@ static struct sim_touchscreen_s g_simtc; ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize() + * Name: board_tsc_setup() * * Description: * Perform architecuture-specific initialization of the touchscreen @@ -92,7 +93,7 @@ static struct sim_touchscreen_s g_simtc; * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { FAR NX_DRIVERTYPE *dev; nxgl_mxpixel_t color; @@ -143,10 +144,10 @@ int arch_tcinitialize(int minor) /* Finally, initialize the touchscreen simulation on the X window */ - ret = arch_tcinitialize(minor); + ret = board_tsc_setup(minor); if (ret < 0) { - idbg("arch_tcinitialize failed: %d\n", ret); + idbg("board_tsc_setup failed: %d\n", ret); goto errout_with_nx; } return OK; @@ -161,7 +162,7 @@ errout: } /**************************************************************************** - * Name: arch_tcuninitialize() + * Name: board_tsc_teardown() * * Description: * Perform architecuture-specific un-initialization of the touchscreen @@ -170,7 +171,7 @@ errout: * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* Shut down the touchscreen driver */ diff --git a/nuttx/configs/sim/touchscreen/defconfig b/nuttx/configs/sim/touchscreen/defconfig index 7b914fa5f..399eab66d 100644 --- a/nuttx/configs/sim/touchscreen/defconfig +++ b/nuttx/configs/sim/touchscreen/defconfig @@ -511,6 +511,8 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_EXAMPLES_THTTPD is not set # CONFIG_EXAMPLES_TIFF is not set CONFIG_EXAMPLES_TOUCHSCREEN=y +CONFIG_LIB_BOARDCTL=y +CONFIG_BOARDCTL_TSCTEST=y CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0 CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0" CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES=25 diff --git a/nuttx/configs/stm3220g-eval/src/stm32_stmpe811.c b/nuttx/configs/stm3220g-eval/src/stm32_stmpe811.c index a9e788608..30f2ea3de 100644 --- a/nuttx/configs/stm3220g-eval/src/stm32_stmpe811.c +++ b/nuttx/configs/stm3220g-eval/src/stm32_stmpe811.c @@ -44,6 +44,7 @@ #include #include +#include #include #include #include @@ -255,7 +256,7 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state) ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this function. @@ -272,7 +273,7 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state) * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { #ifndef CONFIG_STMPE811_TSC_DISABLE FAR struct i2c_dev_s *dev; @@ -328,7 +329,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -343,7 +344,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* No support for un-initializing the touchscreen STMPE811 device yet */ } diff --git a/nuttx/configs/stm3240g-eval/src/stm32_boot.c b/nuttx/configs/stm3240g-eval/src/stm32_boot.c index d6d14e50a..bbf5bc533 100644 --- a/nuttx/configs/stm3240g-eval/src/stm32_boot.c +++ b/nuttx/configs/stm3240g-eval/src/stm32_boot.c @@ -181,10 +181,10 @@ static int board_initthread(int argc, char *argv[]) /* Initialize the touchscreen */ #ifdef HAVE_TCINIT - ret = arch_tcinitialize(CONFIG_NXWM_TOUCHSCREEN_DEVNO); + ret = board_tsc_setup(CONFIG_NXWM_TOUCHSCREEN_DEVNO); if (ret < 0) { - gdbg("ERROR: arch_tcinitialize failed: %d\n", ret); + gdbg("ERROR: board_tsc_setup failed: %d\n", ret); } #endif diff --git a/nuttx/configs/stm3240g-eval/src/stm32_stmpe811.c b/nuttx/configs/stm3240g-eval/src/stm32_stmpe811.c index 6ef8eb269..0418283c2 100644 --- a/nuttx/configs/stm3240g-eval/src/stm32_stmpe811.c +++ b/nuttx/configs/stm3240g-eval/src/stm32_stmpe811.c @@ -44,6 +44,7 @@ #include #include +#include #include #include #include @@ -255,7 +256,7 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state) ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this function. @@ -272,7 +273,7 @@ static void stmpe811_clear(FAR struct stmpe811_config_s *state) * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { #ifndef CONFIG_STMPE811_TSC_DISABLE FAR struct i2c_dev_s *dev; @@ -328,7 +329,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -343,7 +344,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* No support for un-initializing the touchscreen STMPE811 device yet */ } diff --git a/nuttx/configs/viewtool-stm32f107/src/stm32_touchscreen.c b/nuttx/configs/viewtool-stm32f107/src/stm32_touchscreen.c index e2061e469..a0edfcabf 100644 --- a/nuttx/configs/viewtool-stm32f107/src/stm32_touchscreen.c +++ b/nuttx/configs/viewtool-stm32f107/src/stm32_touchscreen.c @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -234,7 +235,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) ****************************************************************************/ /**************************************************************************** - * Name: arch_tcinitialize + * Name: board_tsc_setup * * Description: * Each board that supports a touchscreen device must provide this function. @@ -251,7 +252,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state) * ****************************************************************************/ -int arch_tcinitialize(int minor) +int board_tsc_setup(int minor) { FAR struct spi_dev_s *dev; static bool initialized = false; @@ -300,7 +301,7 @@ int arch_tcinitialize(int minor) } /**************************************************************************** - * Name: arch_tcuninitialize + * Name: board_tsc_teardown * * Description: * Each board that supports a touchscreen device must provide this function. @@ -315,7 +316,7 @@ int arch_tcinitialize(int minor) * ****************************************************************************/ -void arch_tcuninitialize(void) +void board_tsc_teardown(void) { /* No support for un-initializing the touchscreen XPT2046 device. It will * continue to run and process touch interrupts in the background. diff --git a/nuttx/include/nuttx/board.h b/nuttx/include/nuttx/board.h index cfbbb8331..2942b0217 100644 --- a/nuttx/include/nuttx/board.h +++ b/nuttx/include/nuttx/board.h @@ -142,7 +142,59 @@ void board_initialize(void); #ifdef CONFIG_LIB_BOARDCTL int board_app_initialize(void); -#endif +#endif /* CONFIG_LIB_BOARDCTL */ + +/**************************************************************************** + * Name: board_tsc_setup + * + * Description: + * Each board that supports a touchscreen device must provide this function. + * This function is called by application-specific, setup logic to + * configure the touchscreen device. This function will register the driver + * as /dev/inputN where N is the minor device number. + * + * This is an internal OS interface but may be invoked indirectly from + * application-level touchscreen testing logic (perhaps by + * apps/examples/touchscreen). If CONFIG_LIB_BOARDCTL=y and + * CONFIG_BOARDCTL_TSCTEST=y, then this functions will be invoked via the + * (non-standard) boardctl() interface using the commands + * BOARDIOC_TSCTEST_SETUP command. + * + * Input Parameters: + * minor - The input device minor number + * + * Returned Value: + * Zero is returned on success. Otherwise, a negated errno value is + * returned to indicate the nature of the failure. + * + ****************************************************************************/ + +int board_tsc_setup(int minor); + +/**************************************************************************** + * Name: board_tsc_teardown + * + * Description: + * Each board that supports a touchscreen device must provide this function. + * This function is called by application-specific, setup logic to + * uninitialize the touchscreen device. + * + * This is an internal OS interface but may be invoked indirectly from + * application-level touchscreen testing logic (perhaps by + * apps/examples/touchscreen). If CONFIG_LIB_BOARDCTL=y and + * CONFIG_BOARDCTL_TSCTEST=y, then this functions will be invoked via the + * (non-standard) boardctl() interface using the commands + * BOARDIOC_TSCTEST_TEARDOWN command. + * + * Input Parameters: + * None + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void board_tsc_teardown(void); /**************************************************************************** * Name: board_led_initialize diff --git a/nuttx/include/nuttx/input/touchscreen.h b/nuttx/include/nuttx/input/touchscreen.h index d9e531d5f..dcd91b4d5 100644 --- a/nuttx/include/nuttx/input/touchscreen.h +++ b/nuttx/include/nuttx/input/touchscreen.h @@ -134,44 +134,6 @@ extern "C" #define EXTERN extern #endif -/**************************************************************************** - * Name: arch_tcinitialize - * - * Description: - * Each board that supports a touchscreen device must provide this function. - * This function is called by application-specific, setup logic to - * configure the touchscreen device. This function will register the driver - * as /dev/inputN where N is the minor device number. - * - * Input Parameters: - * minor - The input device minor number - * - * Returned Value: - * Zero is returned on success. Otherwise, a negated errno value is - * returned to indicate the nature of the failure. - * - ****************************************************************************/ - -int arch_tcinitialize(int minor); - -/**************************************************************************** - * Name: arch_tcuninitialize - * - * Description: - * Each board that supports a touchscreen device must provide this function. - * This function is called by application-specific, setup logic to - * uninitialize the touchscreen device. - * - * Input Parameters: - * None - * - * Returned Value: - * None. - * - ****************************************************************************/ - -void arch_tcuninitialize(void); - #undef EXTERN #ifdef __cplusplus } diff --git a/nuttx/include/sys/boardctl.h b/nuttx/include/sys/boardctl.h index 811953e08..675daa802 100644 --- a/nuttx/include/sys/boardctl.h +++ b/nuttx/include/sys/boardctl.h @@ -58,16 +58,22 @@ * CONFIGURATION: CONFIG_LIB_BOARDCTL * DEPENDENCIES: Board logic must provide board_app_initialization * - * CMD: BOARDIOC_TSCTEST + * CMD: BOARDIOC_TSCTEST_SETUP * DESCRIPTION: Touchscreen controller test configuration - * ARG: 0: Setup touchscreen test, 1: Teardown touchscreen test + * ARG: Touch controller device minor number * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST - * DEPENDENCIES: Board logic must provide board_tsc_setup() and - * board_tsc_teardown(). + * DEPENDENCIES: Board logic must provide board_tsc_setup() + * + * CMD: BOARDIOC_TSCTEST_TEARDOWN + * DESCRIPTION: Touchscreen controller test configuration + * ARG: None + * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST + * DEPENDENCIES: Board logic must provide board_tsc_teardown() */ -#define BOARDIOC_INIT _BOARDIOC(0x0001) -#define BOARDIOC_TSCTEST _BOARDIOC(0x0002) +#define BOARDIOC_INIT _BOARDIOC(0x0001) +#define BOARDIOC_TSCTEST_SETUP _BOARDIOC(0x0002) +#define BOARDIOC_TSCTEST_TEARDOWN _BOARDIOC(0x0003) /**************************************************************************** * Public Type Definitions -- cgit v1.2.3