summaryrefslogtreecommitdiff
path: root/board/hatch/board.c
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2018-12-19 11:06:58 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-30 13:06:36 -0800
commit9726522566fc1169df30d54764d78719e0dc75b3 (patch)
treee7c98eba3338ae66d31bf73d9ca5523a57488eab /board/hatch/board.c
parentf0efcfb98fa5fca8a7c56b10ea48b808cc0f144a (diff)
downloadchrome-ec-9726522566fc1169df30d54764d78719e0dc75b3.tar.gz
hatch: Add support for keyboard backlight
This CL adds board specific config options, functions and GPIO signal required for keyboard backlight support. BRANCH=none BUG=b:122251649 TEST=make buildall Change-Id: Ib60a7c861d2a85939592556437bd6202e6815947 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1387590 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/hatch/board.c')
-rw-r--r--board/hatch/board.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/board/hatch/board.c b/board/hatch/board.c
index 0277164932..185794f0bc 100644
--- a/board/hatch/board.c
+++ b/board/hatch/board.c
@@ -12,6 +12,8 @@
#include "lid_switch.h"
#include "power.h"
#include "power_button.h"
+#include "pwm.h"
+#include "pwm_chip.h"
#include "spi.h"
#include "switch.h"
#include "system.h"
@@ -71,6 +73,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 = 3, .flags = 0, .freq = 10000 }
+};
+BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
+
void board_overcurrent_event(int port, int is_overcurrented)
{
/* Sanity check the port. */