touchpad_elan: Rename task/interrupts functions

Change the names to generic touchpad_* functions, instead of
vendor-specific names. Makes it a little easier to add drivers
for other touchpads.

Also fix console_channel.inc to add the channel whenever any
touchpad is used.

BRANCH=none
BUG=b:68934906
TEST=make buildall -j

Change-Id: I6d268db5ebd53db272fb2ee7bbf06bbe80845734
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/778750
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Nicolas Boichat
2017-11-12 18:01:58 -08:00
committed by chrome-bot
parent 3b80b4e827
commit 4cb524de67
7 changed files with 21 additions and 25 deletions

View File

@@ -6,7 +6,7 @@
#include "common.h"
#include "ec_version.h"
#include "touchpad_elan.h"
#include "touchpad.h"
#include "gpio.h"
#include "hooks.h"
#include "hwtimer.h"

View File

@@ -19,6 +19,6 @@
#define CONFIG_TASK_LIST \
TASK_ALWAYS_RO(RWSIG, rwsig_task, NULL, 1280) \
TASK_ALWAYS (HOOKS, hook_task, NULL, 2048) \
TASK_ALWAYS_RW(TOUCHPAD, elan_tp_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS_RW(TOUCHPAD, touchpad_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS (CONSOLE, console_task, NULL, 1024) \
TASK_NOTEST_RW(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE)

View File

@@ -8,11 +8,13 @@
/* Declare symbolic names for all the GPIOs that we care about.
* Note: Those with interrupt handlers must be declared first. */
#ifdef SECTION_IS_RW
#ifdef BOARD_WHISKERS
GPIO_INT(TOUCHPAD_INT, PIN(B, 9), GPIO_INT_FALLING, elan_tp_interrupt)
GPIO_INT(TOUCHPAD_INT, PIN(B, 9), GPIO_INT_FALLING, touchpad_interrupt)
#else
GPIO_INT(TOUCHPAD_INT, PIN(B, 8), GPIO_INT_FALLING, elan_tp_interrupt)
GPIO_INT(TOUCHPAD_INT, PIN(B, 8), GPIO_INT_FALLING, touchpad_interrupt)
#endif
#endif /* SECTION_IS_RW */
/* Keyboard inputs */
#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP | GPIO_INT_BOTH)

View File

@@ -5,13 +5,13 @@
#include "common.h"
#include "console.h"
#include "touchpad_elan.h"
#include "gpio.h"
#include "hwtimer.h"
#include "hooks.h"
#include "i2c.h"
#include "task.h"
#include "timer.h"
#include "touchpad.h"
#include "update_fw.h"
#include "util.h"
#include "usb_hid_touchpad.h"
@@ -514,14 +514,14 @@ int touchpad_debug(const uint8_t *param, unsigned int param_size,
}
#endif
void elan_tp_interrupt(enum gpio_signal signal)
void touchpad_interrupt(enum gpio_signal signal)
{
irq_ts = __hw_clock_source_read();
task_wake(TASK_ID_TOUCHPAD);
}
void elan_tp_task(void *u)
void touchpad_task(void *u)
{
elan_tp_init();

View File

@@ -1,17 +0,0 @@
/* Copyright 2016 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Elan touchpad driver for Chrome EC */
#ifndef __CROS_EC_TOUCHPAD_ELAN_H
#define __CROS_EC_TOUCHPAD_ELAN_H
#ifdef CONFIG_TOUCHPAD_ELAN
void elan_tp_interrupt(enum gpio_signal signal);
#else
static inline void elan_tp_interrupt(enum gpio_signal signal) { }
#endif /* !CONFIG_TOUCHPAD_ELAN */
#endif

View File

@@ -72,7 +72,7 @@ CONSOLE_CHANNEL(CC_SWITCH, "switch")
#endif
CONSOLE_CHANNEL(CC_SYSTEM, "system")
CONSOLE_CHANNEL(CC_TASK, "task")
#ifdef CONFIG_TOUCHPAD_ELAN
#ifdef CONFIG_TOUCHPAD
CONSOLE_CHANNEL(CC_TOUCHPAD, "touchpad")
#endif
#ifdef CONFIG_DPTF

11
include/touchpad.h Normal file
View File

@@ -0,0 +1,11 @@
/* Copyright 2017 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef __CROS_EC_TOUCHPAD_H
#define __CROS_EC_TOUCHPAD_H
void touchpad_interrupt(enum gpio_signal signal);
#endif