diff options
author | Dzmitry Sankouski <dsankouski@gmail.com> | 2023-01-22 18:21:24 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-02-10 12:50:01 -0500 |
commit | ea6fdc135954186ada5df9cca3f063a9a785d1b2 (patch) | |
tree | 7da52a5aafa491db923bb77352acaf08f268cd97 /include | |
parent | 298ffdd5d65c4d67b958080c1a712f8f1c923af3 (diff) |
dm: button: add support for linux_code in button-gpio.c driver
Linux event code must be used in input devices, using buttons.
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/button.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/button.h b/include/button.h index 96e6b1901fc..207f4a0f4db 100644 --- a/include/button.h +++ b/include/button.h @@ -37,6 +37,14 @@ struct button_ops { * @return button state button_state_t, or -ve on error */ enum button_state_t (*get_state)(struct udevice *dev); + + /** + * get_code() - get linux event code of a button + * + * @dev: button device to change + * @return button code, or -ENODATA on error + */ + int (*get_code)(struct udevice *dev); }; #define button_get_ops(dev) ((struct button_ops *)(dev)->driver->ops) @@ -58,4 +66,12 @@ int button_get_by_label(const char *label, struct udevice **devp); */ enum button_state_t button_get_state(struct udevice *dev); +/** + * button_get_code() - get linux event code of a button + * + * @dev: button device to change + * @return button code, or -ve on error + */ +int button_get_code(struct udevice *dev); + #endif |