summaryrefslogtreecommitdiff
path: root/board/dragonegg
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-08-01 16:49:27 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-08-08 23:52:11 -0700
commit0053a564e8ed3b529a599aea2e1bd10bce6be60b (patch)
tree0f3fd748f2f736601634398a3edf22ac5cc3a9c4 /board/dragonegg
parenteb980c168c5e8c9242f79f3aa97bfb3efb35e851 (diff)
downloadchrome-ec-0053a564e8ed3b529a599aea2e1bd10bce6be60b.tar.gz
DragonEgg: Add config options and task for keyboard scan
Keyboard scan was not working as the KEYSCAN task was not added and some of the keyboard config options were not defined. BUG=b:112110028 BRANCH=none TEST=Verified that keyboard inputs are received now and sent to AP Change-Id: I36c053d807e83477e044857f5087dcccdf891bfa Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1159835 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'board/dragonegg')
-rw-r--r--board/dragonegg/board.c8
-rw-r--r--board/dragonegg/board.h9
-rw-r--r--board/dragonegg/ec.tasklist1
3 files changed, 13 insertions, 5 deletions
diff --git a/board/dragonegg/board.c b/board/dragonegg/board.c
index e192af33c9..162f596b38 100644
--- a/board/dragonegg/board.c
+++ b/board/dragonegg/board.c
@@ -15,6 +15,7 @@
#include "lid_switch.h"
#include "power.h"
#include "power_button.h"
+#include "pwm_chip.h"
#include "spi.h"
#include "switch.h"
#include "system.h"
@@ -36,6 +37,13 @@ const struct spi_device_t spi_devices[] = {
};
const unsigned int spi_devices_used = ARRAY_SIZE(spi_devices);
+/******************************************************************************/
+/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */
+const struct pwm_t pwm_channels[] = {
+ [PWM_CH_KBLIGHT] = { .channel = 0, .flags = 0, .freq_hz = 100 },
+};
+BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
+
/* GPIO to enable/disable the USB Type-A port. */
const int usb_port_enable[CONFIG_USB_PORT_POWER_SMART_PORT_COUNT] = {
GPIO_EN_USB_A_5V,
diff --git a/board/dragonegg/board.h b/board/dragonegg/board.h
index 17549b3d49..0f6c83a3ee 100644
--- a/board/dragonegg/board.h
+++ b/board/dragonegg/board.h
@@ -13,16 +13,14 @@
/* Optional features */
#define CONFIG_SYSTEM_UNLOCKED /* Allow dangerous commands while in dev. */
-
-#define CONFIG_KEYBOARD_BOARD_CONFIG
-#define CONFIG_KEYBOARD_PROTOCOL_8042
#define CONFIG_LOW_POWER_IDLE
-
#define CONFIG_HOSTCMD_ESPI
-
#undef CONFIG_UART_TX_BUF_SIZE
#define CONFIG_UART_TX_BUF_SIZE 4096
+/* Keyboard features */
+#define CONFIG_PWM_KBLIGHT
+
/* USB and USBC features */
#define CONFIG_USB_PORT_POWER_SMART
#undef CONFIG_USB_PORT_POWER_SMART_PORT_COUNT
@@ -54,6 +52,7 @@ enum adc_channel {
};
enum pwm_channel {
+ PWM_CH_KBLIGHT,
PWM_CH_COUNT
};
diff --git a/board/dragonegg/ec.tasklist b/board/dragonegg/ec.tasklist
index b6092a60a2..afe7ed4aa0 100644
--- a/board/dragonegg/ec.tasklist
+++ b/board/dragonegg/ec.tasklist
@@ -29,5 +29,6 @@
TASK_ALWAYS(HOSTCMD, host_command_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS(CONSOLE, console_task, NULL, VENTI_TASK_STACK_SIZE) \
TASK_ALWAYS(POWERBTN, power_button_task, NULL, LARGER_TASK_STACK_SIZE) \
+ TASK_NOTEST(KEYSCAN, keyboard_scan_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(PD_C0, pd_task, NULL, LARGER_TASK_STACK_SIZE)