summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-06 17:52:32 +0300
committerTom Rini <trini@konsulko.com>2023-01-17 02:26:50 +0300
commit0e38bd848d41bcfc7a113603ee37805016a09a42 (patch)
treed5baf4431832523dd046345cc47debcd3019e617 /cmd
parent5abd8bb0f23aaa07cdeb17713b4bfaf116da0ad8 (diff)
downloadu-boot-0e38bd848d41bcfc7a113603ee37805016a09a42.tar.xz
video: Add font functions to the vidconsole API
Support for fonts currently depends on the type of vidconsole in use. Add two new methods to enumerate fonts and to set the font. Fix a few other method comments while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/font.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/font.c b/cmd/font.c
index 3e522f3aaa..7b4347f32b 100644
--- a/cmd/font.c
+++ b/cmd/font.c
@@ -15,7 +15,11 @@
static int do_font_list(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
- vidconsole_list_fonts();
+ struct udevice *dev;
+
+ if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev))
+ return CMD_RET_FAILURE;
+ vidconsole_list_fonts(dev);
return 0;
}
@@ -47,6 +51,7 @@ static int do_font_select(struct cmd_tbl *cmdtp, int flag, int argc,
static int do_font_size(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
+ const char *font_name;
struct udevice *dev;
uint size;
int ret;
@@ -56,9 +61,11 @@ static int do_font_size(struct cmd_tbl *cmdtp, int flag, int argc,
if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev))
return CMD_RET_FAILURE;
+ font_name = vidconsole_get_font_size(dev, &size);
size = dectoul(argv[1], NULL);
- ret = vidconsole_select_font(dev, NULL, size);
+
+ ret = vidconsole_select_font(dev, font_name, size);
if (ret) {
printf("Failed (error %d)\n", ret);
return CMD_RET_FAILURE;