[Concept,03/14] mouse: Add comment for mouse_get_event()

Message ID 20251006205856.2009292-4-sjg@u-boot.org
State New
Headers
Series expo: More mouse development for expo |

Commit Message

Simon Glass Oct. 6, 2025, 8:58 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

Document the mouse_get_event() function to explain what it does and its
return values.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
---

 include/mouse.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
  

Patch

diff --git a/include/mouse.h b/include/mouse.h
index 7fe263b289f..8212a1e89d4 100644
--- a/include/mouse.h
+++ b/include/mouse.h
@@ -86,11 +86,35 @@  struct mouse_event {
 };
 
 struct mouse_ops {
+	/**
+	 * mouse_get_event() - Get a mouse event
+	 *
+	 * Gets the next available mouse event from the device. This can be a
+	 * motion event (mouse movement) or a button event (button press or
+	 * release).
+	 *
+	 * @dev: Mouse device
+	 * @event: Returns the mouse event
+	 * Returns: 0 if OK, -EAGAIN if no event available, -ENOSYS if not
+	 * supported
+	 */
 	int (*get_event)(struct udevice *dev, struct mouse_event *event);
 };
 
 #define mouse_get_ops(dev)	((struct mouse_ops *)(dev)->driver->ops)
 
+/**
+ * mouse_get_event() - Get a mouse event
+ *
+ * Gets the next available mouse event from the device. This can be a
+ * motion event (mouse movement) or a button event (button press or
+ * release).
+ *
+ * @dev: Mouse device
+ * @event: Returns the mouse event
+ * Returns: 0 if OK, -EAGAIN if no event available, -ENOSYS if not
+ * supported
+ */
 int mouse_get_event(struct udevice *dev, struct mouse_event *event);
 
 /**