From ec625d8daccca2e51fa6721c4b158a21ecb1654e Mon Sep 17 00:00:00 2001 From: anjana Date: Wed, 4 Dec 2024 12:49:57 +0530 Subject: [PATCH] os/board/rtl8730e: Add touch power on off using gpio Touch IC power on/off functionality --- os/board/rtl8730e/src/rtl8730e_ist415.c | 16 ++++++++++++++++ os/drivers/input/ist415.c | 2 ++ os/include/tinyara/input/ist415.h | 3 +++ 3 files changed, 21 insertions(+) diff --git a/os/board/rtl8730e/src/rtl8730e_ist415.c b/os/board/rtl8730e/src/rtl8730e_ist415.c index 266af9a1bd..7b9ab88882 100644 --- a/os/board/rtl8730e/src/rtl8730e_ist415.c +++ b/os/board/rtl8730e/src/rtl8730e_ist415.c @@ -72,6 +72,9 @@ struct rtl8730e_ist415_s g_rtl8730e_ist415_priv0; static void rtl8730e_ist415_enable_irq(void); static void rtl8730e_ist415_disable_irq(void); +static void rtl8730e_ist415_gpio_reset(void); +static void rtl8730e_ist415_gpio_on(void); +static void rtl8730e_ist415_gpio_off(void); /**************************************************************************** * Private Data @@ -88,6 +91,9 @@ static struct ist415_dev_s g_ist415_dev0 = { .ops = &(struct ist415_ops_s){ .irq_enable = rtl8730e_ist415_enable_irq, .irq_disable = rtl8730e_ist415_disable_irq, + .reset = rtl8730e_ist415_gpio_reset, + .power_on = rtl8730e_ist415_gpio_on, + .power_off = rtl8730e_ist415_gpio_off, }, .priv = &g_rtl8730e_ist415_priv0, }; @@ -131,6 +137,16 @@ static void rtl8730e_ist415_gpio_reset(void) GPIO_WriteBit(IST415_GPIO_RESET_PIN, PIN_HIGH); } +static void rtl8730e_ist415_gpio_on(void) +{ + GPIO_WriteBit(IST415_GPIO_RESET_PIN, PIN_HIGH); +} + +static void rtl8730e_ist415_gpio_off(void) +{ + GPIO_WriteBit(IST415_GPIO_RESET_PIN, PIN_LOW); +} + static void rtl8730e_ist415_gpio_init(void) { Pinmux_Config(IST415_GPIO_RESET_PIN, PINMUX_FUNCTION_GPIO); diff --git a/os/drivers/input/ist415.c b/os/drivers/input/ist415.c index 022ae3964e..111e74c69e 100755 --- a/os/drivers/input/ist415.c +++ b/os/drivers/input/ist415.c @@ -170,6 +170,7 @@ static int ist415_get_touch_data(struct ist415_dev_s *dev, FAR void *buf) static void ist415_enable(struct touchscreen_s *dev) { struct ist415_dev_s *priv = (struct ist415_dev_s *)dev->priv; + priv->ops->power_on(); priv->ops->irq_enable(); } @@ -181,6 +182,7 @@ static void ist415_disable(struct touchscreen_s *dev) { struct ist415_dev_s *priv = (struct ist415_dev_s *)dev->priv; priv->ops->irq_disable(); + priv->ops->power_off(); } /**************************************************************************** diff --git a/os/include/tinyara/input/ist415.h b/os/include/tinyara/input/ist415.h index a4faee4402..0d290d4d15 100644 --- a/os/include/tinyara/input/ist415.h +++ b/os/include/tinyara/input/ist415.h @@ -259,6 +259,9 @@ struct ts_event_coordinate { struct ist415_ops_s { CODE void (*irq_enable)(void); /* Enables the irq */ CODE void (*irq_disable)(void); /* Disables the irq */ + CODE void (*reset)(void); /* Reset Touch IC */ + CODE void (*power_on)(void); /* Power on Touch IC */ + CODE void (*power_off)(void); /* Power off Touch IC*/ }; /* IST415 Device */