hw/isa/Kconfig: Add missing dependency VIA VT82C686 -> APM
[qemu/ar7.git] / hw / char / parallel-isa.c
blob1ccbb96e7080c57dbfe8462c6e4a493bd2255bfc
1 /*
2 * QEMU Parallel PORT (ISA bus helpers)
4 * These functions reside in a separate file since they also might be
5 * required for linking when compiling QEMU without CONFIG_PARALLEL.
7 * Copyright (c) 2003 Fabrice Bellard
9 * SPDX-License-Identifier: MIT
12 #include "qemu/osdep.h"
13 #include "sysemu/sysemu.h"
14 #include "hw/isa/isa.h"
15 #include "hw/qdev-properties.h"
16 #include "hw/char/parallel.h"
17 #include "qapi/error.h"
19 static void parallel_init(ISABus *bus, int index, Chardev *chr)
21 DeviceState *dev;
22 ISADevice *isadev;
24 isadev = isa_new("isa-parallel");
25 dev = DEVICE(isadev);
26 qdev_prop_set_uint32(dev, "index", index);
27 qdev_prop_set_chr(dev, "chardev", chr);
28 isa_realize_and_unref(isadev, bus, &error_fatal);
31 void parallel_hds_isa_init(ISABus *bus, int n)
33 int i;
35 assert(n <= MAX_PARALLEL_PORTS);
37 for (i = 0; i < n; i++) {
38 if (parallel_hds[i]) {
39 parallel_init(bus, i, parallel_hds[i]);