summaryrefslogtreecommitdiff
path: root/board/grunt/board.c
diff options
context:
space:
mode:
authorBenjamin Gordon <bmgordon@chromium.org>2017-12-06 10:11:36 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-12-11 12:47:47 -0800
commitb23fdca572d5078c3722616a37d76963b68e0f33 (patch)
tree30a83126e15bdbea14078c6fad67d169858e5649 /board/grunt/board.c
parent48cb289e0cd1d78e600508b5f2e9ba0d250f7052 (diff)
downloadchrome-ec-b23fdca572d5078c3722616a37d76963b68e0f33.tar.gz
grunt: Add keyboard backlight
This gets the pins set up. Not yet sure if we may need additional support for the LM3630A or if it will use the generic PWM support. BUG=b:69379749 TEST=make -j buildall BRANCH=None Change-Id: I80a1a10818483666461bf47500e3956880dcc1fc Signed-off-by: Benjamin Gordon <bmgordon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/812064 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board/grunt/board.c')
-rw-r--r--board/grunt/board.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/board/grunt/board.c b/board/grunt/board.c
index 24c3588b9b..f1ca30358f 100644
--- a/board/grunt/board.c
+++ b/board/grunt/board.c
@@ -26,6 +26,8 @@
#include "lid_switch.h"
#include "power.h"
#include "power_button.h"
+#include "pwm.h"
+#include "pwm_chip.h"
#include "registers.h"
#include "switch.h"
#include "system.h"
@@ -305,6 +307,12 @@ struct keyboard_scan_config keyscan_config = {
},
};
+/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */
+const struct pwm_t pwm_channels[] = {
+ [PWM_CH_KBLIGHT] = { 5, 0, 100 },
+};
+BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
+
/*
* We use 11 as the scaling factor so that the maximum mV value below (2761)
* can be compressed to fit in a uint8_t.