]> Git Repo - qemu.git/blame - hw/ssi.h
PXA SSI qdev conversion
[qemu.git] / hw / ssi.h
CommitLineData
90d37239
PB
1/* QEMU Synchronous Serial Interface support. */
2
3/* In principle SSI is a point-point interface. As such the qemu
4 implementation has a single slave device on a "bus".
5 However it is fairly common for boards to have multiple slaves
6 connected to a single master, and select devices with an external
7 chip select. This is implemented in qemu by having an explicit mux device.
8 It is assumed that master and slave are both using the same transfer width.
9 */
10
11#ifndef QEMU_SSI_H
12#define QEMU_SSI_H
13
14#include "qdev.h"
15
16typedef struct SSISlave SSISlave;
17
18/* Slave devices. */
19typedef struct {
20 void (*init)(SSISlave *dev);
21 uint32_t (*transfer)(SSISlave *dev, uint32_t val);
22} SSISlaveInfo;
23
24struct SSISlave {
25 DeviceState qdev;
26 SSISlaveInfo *info;
27};
28
29#define SSI_SLAVE_FROM_QDEV(dev) DO_UPCAST(SSISlave, qdev, dev)
30#define FROM_SSI_SLAVE(type, dev) DO_UPCAST(type, ssidev, dev)
31
32void ssi_register_slave(const char *name, int size, SSISlaveInfo *info);
33
34DeviceState *ssi_create_slave(SSIBus *bus, const char *name);
35
36/* Master interface. */
37SSIBus *ssi_create_bus(void);
38
39uint32_t ssi_transfer(SSIBus *bus, uint32_t val);
40
a984a69e
PB
41/* max111x.c */
42void max111x_set_input(DeviceState *dev, int line, uint8_t value);
43
90d37239 44#endif
This page took 0.02531 seconds and 4 git commands to generate.