2 * QEMU VLYNQ Serial Interface support.
4 * Copyright (C) 2009-2011 Stefan Weil
6 * Portions of the code are copies from ssi.h.
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) version 3 or any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 typedef struct _VLYNQBus VLYNQBus
;
29 typedef struct _VLYNQSlave VLYNQSlave
;
30 typedef struct _VLYNQSlaveInfo VLYNQSlaveInfo
;
35 int (*init
)(VLYNQSlave
*dev
);
36 uint32_t (*transfer
)(VLYNQSlave
*dev
, uint32_t val
);
44 #define VLYNQ_SLAVE_FROM_QDEV(dev) DO_UPCAST(VLYNQSlave, qdev, dev)
45 #define FROM_VLYNQ_SLAVE(type, dev) DO_UPCAST(type, vlynqdev, dev)
50 //~ uint32_t isairq[2];
54 typedef int (*vlynq_qdev_initfn
)(VLYNQDevice
*vlynq_dev
);
55 typedef int (*VLYNQUnregisterFunc
)(VLYNQDevice
*vlynq_dev
);
58 vlynq_qdev_initfn init
;
59 VLYNQUnregisterFunc exit
;
62 void vlynq_qdev_register(VLYNQDeviceInfo
*info
);
64 void vlynq_register_slave(VLYNQSlaveInfo
*info
);
66 DeviceState
*vlynq_create_slave(VLYNQBus
*bus
, const char *name
);
68 /* Master interface. */
69 VLYNQBus
*vlynq_create_bus(DeviceState
*parent
, const char *name
);
71 uint32_t vlynq_transfer(VLYNQBus
*bus
, uint32_t val
);
74 void max111x_set_input(DeviceState
*dev
, int line
, uint8_t value
);