mach-imx: bootaux: fix building with disabled bootelf
[platform/kernel/u-boot.git] / include / button.h
index 688b63b..207f4a0 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef __BUTTON_H
 #define __BUTTON_H
 
+struct udevice;
+
 /**
  * struct button_uc_plat - Platform data the uclass stores about each device
  *
@@ -35,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)
@@ -44,7 +54,7 @@ struct button_ops {
  *
  * @label:     button label to look up
  * @devp:      Returns the associated device, if found
- * @return 0 if found, -ENODEV if not found, other -ve on error
+ * Return: 0 if found, -ENODEV if not found, other -ve on error
  */
 int button_get_by_label(const char *label, struct udevice **devp);
 
@@ -52,8 +62,16 @@ int button_get_by_label(const char *label, struct udevice **devp);
  * button_get_state() - get the state of a button
  *
  * @dev:       button device to change
- * @return button state button_state_t, or -ve on error
+ * Return: button state button_state_t, or -ve on error
  */
 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