mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
qdev: Implement named GPIOs
Implement named GPIOs on the Device layer. Listifies the existing GPIOs stuff using string keys. Legacy un-named GPIOs are preserved by using a NULL name string - they are just a single matchable element in the name list. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
6b1b144019
commit
a5f54290ce
4 changed files with 120 additions and 24 deletions
|
@ -613,14 +613,20 @@ static void qdev_print(Monitor *mon, DeviceState *dev, int indent)
|
|||
{
|
||||
ObjectClass *class;
|
||||
BusState *child;
|
||||
NamedGPIOList *ngl;
|
||||
|
||||
qdev_printf("dev: %s, id \"%s\"\n", object_get_typename(OBJECT(dev)),
|
||||
dev->id ? dev->id : "");
|
||||
indent += 2;
|
||||
if (dev->num_gpio_in) {
|
||||
qdev_printf("gpio-in %d\n", dev->num_gpio_in);
|
||||
}
|
||||
if (dev->num_gpio_out) {
|
||||
qdev_printf("gpio-out %d\n", dev->num_gpio_out);
|
||||
QLIST_FOREACH(ngl, &dev->gpios, node) {
|
||||
if (ngl->num_in) {
|
||||
qdev_printf("gpio-in \"%s\" %d\n", ngl->name ? ngl->name : "",
|
||||
ngl->num_in);
|
||||
}
|
||||
if (ngl->num_out) {
|
||||
qdev_printf("gpio-out \"%s\" %d\n", ngl->name ? ngl->name : "",
|
||||
ngl->num_out);
|
||||
}
|
||||
}
|
||||
class = object_get_class(OBJECT(dev));
|
||||
do {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue