summaryrefslogtreecommitdiff
path: root/include/button.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/button.h')
-rw-r--r--include/button.h16
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