~vcs-imports/qemu/maemo

« back to all changes in this revision

Viewing changes to hw/ssi.h

  • Committer: Riku Voipio
  • Date: 2009-06-08 15:31:58 UTC
  • mfrom: (6281.2.366)
  • mto: This revision was merged to the branch mainline in revision 6452.
  • Revision ID: git-v1:759b334a9739814df2883aa4c41b1c0f5670e90a
Merge commit 'gnu/master' into test

Epic merge

Conflicts:
        Makefile
        block.c
        block.h
        configure
        hw/boards.h
        hw/flash.h
        hw/integratorcp.c
        hw/nand.c
        hw/omap2.c
        hw/omap_i2c.c
        hw/sd.c
        hw/smc91c111.c
        hw/tsc2005.c
        hw/tusb6010.c
        hw/usb-musb.c
        linux-user/syscall.c
        target-arm/machine.c
        target-arm/translate.c

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
16
typedef struct SSISlave SSISlave;
 
17
 
 
18
/* Slave devices.  */
 
19
typedef struct {
 
20
    DeviceInfo qdev;
 
21
    void (*init)(SSISlave *dev);
 
22
    uint32_t (*transfer)(SSISlave *dev, uint32_t val);
 
23
} SSISlaveInfo;
 
24
 
 
25
struct SSISlave {
 
26
    DeviceState qdev;
 
27
    SSISlaveInfo *info;
 
28
};
 
29
 
 
30
#define SSI_SLAVE_FROM_QDEV(dev) DO_UPCAST(SSISlave, qdev, dev)
 
31
#define FROM_SSI_SLAVE(type, dev) DO_UPCAST(type, ssidev, dev)
 
32
 
 
33
void ssi_register_slave(const char *name, int size, SSISlaveInfo *info);
 
34
 
 
35
DeviceState *ssi_create_slave(SSIBus *bus, const char *name);
 
36
 
 
37
/* Master interface.  */
 
38
SSIBus *ssi_create_bus(DeviceState *parent, const char *name);
 
39
 
 
40
uint32_t ssi_transfer(SSIBus *bus, uint32_t val);
 
41
 
 
42
/* max111x.c */
 
43
void max111x_set_input(DeviceState *dev, int line, uint8_t value);
 
44
 
 
45
#endif