
9 Sep
2015
9 Sep
'15
2:17 p.m.
On Wednesday, September 09, 2015 at 06:32:24 AM, Simon Glass wrote:
Add a uclass for keyboard input, mirroring the existing stdio methods. This is enabled by a new CONFIG_DM_KEYBOARD option.
Signed-off-by: Simon Glass sjg@chromium.org
[...]
+static int keyboard_pre_probe(struct udevice *dev) +{
- struct keyboard_priv *priv = dev_get_uclass_priv(dev);
- struct stdio_dev *sdev = &priv->sdev;
- int ret;
- strlcpy(sdev->name, dev->name, sizeof(sdev->name));
- sdev->flags = DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
- sdev->getc = keyboard_getc;
- sdev->tstc = keyboard_tstc;
- sdev->start = keyboard_start;
- sdev->stop = keyboard_stop;
- sdev->priv = dev;
- ret = input_init(&priv->input, 0);
- if (ret) {
debug("%s: Cannot set up input\n", __func__);
Some better identification of the failing input here would be nice.
return ret;
- }
- return 0;
+}
Otherwise,
Reviewed-by: Marek Vasut marex@denx.de
Best regards, Marek Vasut