Commit 2d57286d authored by Gerd Hoffmann's avatar Gerd Hoffmann

chardev: add braille support to qapi

This patch adds 'braille' support to qapi and also switches over
the braille chardev initialization to the new qapi code path.
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent f5a51cab
......@@ -561,7 +561,7 @@ static void baum_close(struct CharDriverState *chr)
g_free(baum);
}
static CharDriverState *chr_baum_init(QemuOpts *opts)
CharDriverState *chr_baum_init(void)
{
BaumDriverState *baum;
CharDriverState *chr;
......@@ -627,7 +627,7 @@ fail_handle:
static void register_types(void)
{
register_char_driver("braille", chr_baum_init);
register_char_driver_qapi("braille", CHARDEV_BACKEND_KIND_BRAILLE, NULL);
}
type_init(register_types);
......@@ -264,4 +264,7 @@ CharDriverState *qemu_char_get_next_serial(void);
/* msmouse */
CharDriverState *qemu_chr_open_msmouse(void);
/* baum.c */
CharDriverState *chr_baum_init(void);
#endif
......@@ -3211,7 +3211,8 @@
'pty' : 'ChardevDummy',
'null' : 'ChardevDummy',
'mux' : 'ChardevMux',
'msmouse': 'ChardevDummy' } }
'msmouse': 'ChardevDummy',
'braille': 'ChardevDummy' } }
##
# @ChardevReturn:
......
......@@ -3722,6 +3722,11 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
case CHARDEV_BACKEND_KIND_MSMOUSE:
chr = qemu_chr_open_msmouse();
break;
#ifdef CONFIG_BRLAPI
case CHARDEV_BACKEND_KIND_BRAILLE:
chr = chr_baum_init();
break;
#endif
default:
error_setg(errp, "unknown chardev backend (%d)", backend->kind);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment