8 * struct keyboard_priv - information about a keyboard, for the uclass
11 * @input: input configuration (the driver may use this if desired)
13 struct keyboard_priv {
14 struct stdio_dev sdev;
17 * This is set up by the uclass but will only be used if the driver
18 * sets input.dev to its device pointer (it is initially NULL).
20 struct input_config input;
24 * struct keyboard_ops - keyboard device operations
28 * start() - enable the keyboard ready for use
30 * @dev: Device to enable
31 * @return 0 if OK, -ve on error
33 int (*start)(struct udevice *dev);
36 * stop() - disable the keyboard when no-longer needed
38 * @dev: Device to disable
39 * @return 0 if OK, -ve on error
41 int (*stop)(struct udevice *dev);
44 * tstc() - check if a key is available
46 * @dev: Device to check
47 * @return 0 if no key is available, 1 if a key is available, -ve on
50 int (*tstc)(struct udevice *dev);
55 * TODO(sjg@chromium.org): At present this method may wait if it calls
58 * @dev: Device to read from
59 * @return -EAGAIN if no key is available, otherwise key value read
62 int (*getc)(struct udevice *dev);
65 * update_leds() - update keyboard LEDs
67 * This is called when the LEDs have changed and need to be updated.
68 * For example, if 'caps lock' is pressed then this method will be
69 * called with the new LED value.
71 * @dev: Device to update
72 * @leds: New LED mask (see INPUT_LED_... in input.h)
74 int (*update_leds)(struct udevice *dev, int leds);
77 #define keyboard_get_ops(dev) ((struct keyboard_ops *)(dev)->driver->ops)
79 #endif /* __KEYBOARD_H */