summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2021-10-27 13:23:00 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-03 20:08:20 +0000
commit0b202341702f75303238b8972f4c5decc0ae30e4 (patch)
treeccd0c5b1076863b01eb60c9ee66f2e03812cfa59 /include
parentfd1ac67b8cbaf12b245c4eb0e9544705cb5d3a65 (diff)
downloadchrome-ec-0b202341702f75303238b8972f4c5decc0ae30e4.tar.gz
ec: Implement keyboard backlight get enabled
Prior to crrev/c/1051027, the EC_CMD_PWM_GET_KEYBOARD_BACKLIGHT host cmd returned an enabled flag, which the FAFT test firmware_ECLidSwitch depends on. That test, however, was broken, and wasn't actually running the kb backlight portion of the test on any models, so no one ever noticed that the HC and the kblight ec console commands don't return the enabled status. Add a get_enabled function to the kblight driver struct, and add an implementation for each existing driver. BRANCH=None BUG=b:194908032 TEST=CP'd to leona branch, build EC, flash board kblight 100 ; lidclose ; kblight ; lidopen ; kblight Verified the cmd returned enabled: 1 when lights were on Change-Id: Ia6ab025901869933cf70bb49f3bf2def2987b7b3 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3248888 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/keyboard_backlight.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/keyboard_backlight.h b/include/keyboard_backlight.h
index e0a1f4d30e..96bf69aaae 100644
--- a/include/keyboard_backlight.h
+++ b/include/keyboard_backlight.h
@@ -43,6 +43,12 @@ struct kblight_drv {
* @return EC_SUCCESS or EC_ERROR_*
*/
int (*enable)(int enable);
+
+ /**
+ * Get the enabled state.
+ * @return 1=Enable, 0=Disable, -1=Failed to read enabled state.
+ */
+ int (*get_enabled)(void);
};
/**