4 #ifdef CONFIG_DM_KEYBOARD
9 * struct keyboard_priv - information about a keyboard, for the uclass
12 * @input: input configuration (the driver may use this if desired)
14 struct keyboard_priv {
15 struct stdio_dev sdev;
18 * This is set up by the uclass but will only be used if the driver
19 * sets input.dev to its device pointer (it is initially NULL).
21 struct input_config input;
25 * struct keyboard_ops - keyboard device operations
29 * start() - enable the keyboard ready for use
31 * @dev: Device to enable
32 * @return 0 if OK, -ve on error
34 int (*start)(struct udevice *dev);
37 * stop() - disable the keyboard when no-longer needed
39 * @dev: Device to disable
40 * @return 0 if OK, -ve on error
42 int (*stop)(struct udevice *dev);
45 * tstc() - check if a key is available
47 * @dev: Device to check
48 * @return 0 if no key is available, 1 if a key is available, -ve on
51 int (*tstc)(struct udevice *dev);
56 * TODO(sjg@chromium.org): At present this method may wait if it calls
59 * @dev: Device to read from
60 * @return -EAGAIN if no key is available, otherwise key value read
63 int (*getc)(struct udevice *dev);
66 * update_leds() - update keyboard LEDs
68 * This is called when the LEDs have changed and need to be updated.
69 * For example, if 'caps lock' is pressed then this method will be
70 * called with the new LED value.
72 * @dev: Device to update
73 * @leds: New LED mask (see INPUT_LED_... in input.h)
75 int (*update_leds)(struct udevice *dev, int leds);
78 #define keyboard_get_ops(dev) ((struct keyboard_ops *)(dev)->driver->ops)
86 #if !defined(kbd_request_region) || \
87 !defined(kbd_request_irq) || \
88 !defined(kbd_read_input) || \
89 !defined(kbd_read_status) || \
90 !defined(kbd_write_output) || \
91 !defined(kbd_write_command)
92 #error PS/2 low level routines not defined
95 extern int kbd_init (void);
96 extern void handle_scancode(unsigned char scancode);
97 extern int kbd_init_hw(void);
98 extern void pckbd_leds(unsigned char leds);
99 #endif /* !CONFIG_DM_KEYBOARD */
101 #if defined(CONFIG_MPC5xxx) || defined(CONFIG_MPC8540) || \
102 defined(CONFIG_MPC8541) || defined(CONFIG_MPC8555)
103 int ps2ser_check(void);
106 #endif /* __KEYBOARD_H */