Lines Matching +full:keyboard +full:- +full:controller
5 * SPDX-License-Identifier: GPL-2.0+
8 /* i8042.c - Intel 8042 keyboard driver routines */
15 #include <keyboard.h>
58 while ((in8(I8042_STS_REG) & STATUS_IBF) && kbd_timeout--) in kbd_input_empty()
61 return kbd_timeout != -1; in kbd_input_empty()
68 while (((in8(I8042_STS_REG) & STATUS_OBF) == 0) && kbd_timeout--) in kbd_output_full()
71 return kbd_timeout != -1; in kbd_output_full()
75 * check_leds() - Check the keyboard LEDs and update them it needed
93 return -1; in kbd_write()
102 return -1; in kbd_read()
110 return -1; in kbd_cmd_read()
118 return -1; in kbd_cmd_write()
127 /* controller self test */ in kbd_reset()
131 /* keyboard reset */ in kbd_reset()
143 if (config == -1) in kbd_reset()
155 /* enable keyboard */ in kbd_reset()
162 debug("%s: Keyboard failure\n", __func__); in kbd_reset()
163 return -1; in kbd_reset()
188 * The delay is to give the keyboard controller some time in i8042_flush()
195 timeout--; in i8042_flush()
209 return -1; in i8042_disable()
211 /* Disable keyboard */ in i8042_disable()
215 return -1; in i8042_disable()
222 struct i8042_kbd_priv *priv = dev_get_priv(input->dev); in i8042_kbd_check()
235 priv->extended = true; in i8042_kbd_check()
242 if (priv->extended) { in i8042_kbd_check()
243 priv->extended = false; in i8042_kbd_check()
260 /* i8042_kbd_init - reset keyboard and init state flags */
265 struct input_config *input = &uc_priv->input; in i8042_start()
271 debug("i8042 keyboard controller is not present\n"); in i8042_start()
272 return -ENOENT; in i8042_start()
275 /* Init keyboard device (default US layout) */ in i8042_start()
283 for (try = 0; kbd_reset(priv->quirks) != 0; try++) { in i8042_start()
285 return -1; in i8042_start()
299 * Set up the i8042 keyboard. This is called by the stdio device handler
301 * We want to do this init when the keyboard is actually used rather than
302 * at start-up, since keyboard input may not currently be selected.
304 * Once the keyboard starts there will be a period during which we must
305 * wait for the keyboard to init. We do this only when a key is first
306 * read - see kbd_wait_for_fifo_init().
308 * @return 0 if ok, -ve on error
314 struct stdio_dev *sdev = &uc_priv->sdev; in i8042_kbd_probe()
315 struct input_config *input = &uc_priv->input; in i8042_kbd_probe()
318 if (fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev), in i8042_kbd_probe()
319 "intel,duplicate-por")) in i8042_kbd_probe()
320 priv->quirks |= QUIRK_DUP_POR; in i8042_kbd_probe()
323 input->dev = dev; in i8042_kbd_probe()
324 input->read_keys = i8042_kbd_check; in i8042_kbd_probe()
326 strcpy(sdev->name, "i8042-kbd"); in i8042_kbd_probe()
343 { .compatible = "intel,i8042-keyboard" },