Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/board/rtl8730e: Add touch power on off using gpio #6554

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions os/board/rtl8730e/src/rtl8730e_ist415.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
};
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions os/drivers/input/ist415.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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();
}

/****************************************************************************
Expand Down
3 changes: 3 additions & 0 deletions os/include/tinyara/input/ist415.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down