[U-Boot] [PATCH 01/28] dm: input: Create a keyboard uclass
Marek Vasut
marex at denx.de
Wed Sep 9 14:17:11 CEST 2015
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 at 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 at denx.de>
Best regards,
Marek Vasut
More information about the U-Boot
mailing list