summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2017-02-06 15:02:25 +0100
committerStefan Reinauer <stefan.reinauer@coreboot.org>2017-06-28 00:56:53 +0000
commit837da6ade7aebe9541b5a13e40b75ab2b308ac77 (patch)
treeb5e26cdd1f7400b358ba991fa11465dafe5b2648 /payloads/libpayload/include
parent8eb55bbfe7e3bd601c4bece24e0772dba5410827 (diff)
libpayload: Add mouse cursor driver
Add a driver to handle multiple low level mouse drivers and provide basic cursor acceleration support. Tested on Lenovo T500. Change-Id: Ib7cec736631b8acf81a14d28daa29ff720777b10 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/18593 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'payloads/libpayload/include')
-rw-r--r--payloads/libpayload/include/libpayload.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 97d5944c63..54e01623a1 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -164,6 +164,20 @@ int keyboard_set_layout(char *country);
/** @} */
/**
+ * @defgroup mouse Mouse cursor functions
+ * @ingroup input
+ * @{
+ */
+void mouse_cursor_poll(void);
+void mouse_cursor_get_rel(int *x, int *y, int *z);
+u32 mouse_cursor_get_buttons(void);
+void mouse_cursor_set_speed(u32 val);
+u32 mouse_cursor_get_speed(void);
+void mouse_cursor_set_acceleration(u8 val);
+u8 mouse_cursor_get_acceleration(void);
+/** @} */
+
+/**
* @defgroup serial Serial functions
* @ingroup input
* @{
@@ -304,6 +318,29 @@ int console_remove_output_driver(void *function);
#define havechar havekey
/** @} */
+/**
+ * @defgroup mouse_cursor Mouse cursor functions
+ * @{
+ */
+typedef enum {
+ CURSOR_INPUT_TYPE_UNKNOWN = 0,
+ CURSOR_INPUT_TYPE_USB,
+ CURSOR_INPUT_TYPE_PS2,
+} cursor_input_type;
+
+void mouse_cursor_init(void);
+
+struct mouse_cursor_input_driver;
+struct mouse_cursor_input_driver {
+ struct mouse_cursor_input_driver *next;
+ /* X,Y,Z axis and buttons */
+ void (*get_state)(int *, int *, int *, u32 *);
+ cursor_input_type input_type;
+};
+
+void mouse_cursor_add_input_driver(struct mouse_cursor_input_driver *in);
+
+/** @} */
/**
* @defgroup exec Execution functions