diff options
author | Damien Hedde | 2020-04-06 15:52:45 +0200 |
---|---|---|
committer | Peter Maydell | 2020-04-30 16:35:40 +0200 |
commit | 0e6934f26484abef4a96946078a34746f8855801 (patch) | |
tree | 0bdc3532609498a48f3c8c9168cde67a7245ea83 /include/hw/qdev-core.h | |
parent | hw/core/clock-vmstate: define a vmstate entry for clock state (diff) | |
download | qemu-0e6934f26484abef4a96946078a34746f8855801.tar.gz qemu-0e6934f26484abef4a96946078a34746f8855801.tar.xz qemu-0e6934f26484abef4a96946078a34746f8855801.zip |
qdev: add clock input&output support to devices.
Add functions to easily handle clocks with devices.
Clock inputs and outputs should be used to handle clock propagation
between devices.
The API is very similar the GPIO API.
This is based on the original work of Frederic Konrad.
Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20200406135251.157596-4-damien.hedde@greensocs.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/hw/qdev-core.h')
-rw-r--r-- | include/hw/qdev-core.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 1405b8a990..d87d989e72 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -149,6 +149,17 @@ struct NamedGPIOList { QLIST_ENTRY(NamedGPIOList) node; }; +typedef struct Clock Clock; +typedef struct NamedClockList NamedClockList; + +struct NamedClockList { + char *name; + Clock *clock; + bool output; + bool alias; + QLIST_ENTRY(NamedClockList) node; +}; + /** * DeviceState: * @realized: Indicates whether the device has been fully constructed. @@ -171,6 +182,7 @@ struct DeviceState { bool allow_unplug_during_migration; BusState *parent_bus; QLIST_HEAD(, NamedGPIOList) gpios; + QLIST_HEAD(, NamedClockList) clocks; QLIST_HEAD(, BusState) child_bus; int num_child_bus; int instance_id_alias; |