diff options
author | Simon Glass <sjg@chromium.org> | 2016-01-14 18:10:41 -0700 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2016-01-30 10:55:37 +0100 |
commit | 7b9f7e445e13de4f3169d9e5ba5e3b28c4d79ce4 (patch) | |
tree | b79a245825071d87f981fcb9e749848c3c9585cf /drivers/video | |
parent | 58c733a70ff1967490af1fd69aab2ba7bb86eb2c (diff) | |
download | u-boot-imx-7b9f7e445e13de4f3169d9e5ba5e3b28c4d79ce4.zip u-boot-imx-7b9f7e445e13de4f3169d9e5ba5e3b28c4d79ce4.tar.gz u-boot-imx-7b9f7e445e13de4f3169d9e5ba5e3b28c4d79ce4.tar.bz2 |
video: Provide a backspace method
With proportional fonts the vidconsole uclass cannot itself erase the
previous character. Provide an optional method so that the driver can
handle this operation.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/vidconsole-uclass.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index bea563a..f6326b6 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -57,9 +57,17 @@ static int vidconsole_entry_start(struct udevice *dev) } /* Move backwards one space */ -static void vidconsole_back(struct udevice *dev) +static int vidconsole_back(struct udevice *dev) { struct vidconsole_priv *priv = dev_get_uclass_priv(dev); + struct vidconsole_ops *ops = vidconsole_get_ops(dev); + int ret; + + if (ops->backspace) { + ret = ops->backspace(dev); + if (ret != -ENOSYS) + return ret; + } priv->xcur_frac -= VID_TO_POS(priv->x_charsize); if (priv->xcur_frac < priv->xstart_frac) { @@ -69,6 +77,8 @@ static void vidconsole_back(struct udevice *dev) if (priv->ycur < 0) priv->ycur = 0; } + + return 0; } /* Move to a newline, scrolling the display if necessary */ |