~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to .pc/linaro/0049-Add-triton2-twl4030-driver.patch/include/hw/i2c/i2c.h

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-04 12:13:08 UTC
  • mfrom: (10.1.45 sid)
  • Revision ID: package-import@ubuntu.com-20140204121308-1xq92lrfs75agw2g
Tags: 1.7.0+dfsg-3ubuntu1~ppa1
* Merge 1.7.0+dfsg-3 from debian.  Remaining changes:
  - debian/patches/ubuntu:
    * expose-vmx_qemu64cpu.patch
    * linaro (omap3) and arm64 patches
    * ubuntu/target-ppc-add-stubs-for-kvm-breakpoints: fix FTBFS
      on ppc
    * ubuntu/CVE-2013-4377.patch: fix denial of service via virtio
  - debian/qemu-system-x86.modprobe: set kvm_intel nested=1 options
  - debian/control:
    * add arm64 to Architectures
    * add qemu-common and qemu-system-aarch64 packages
  - debian/qemu-system-common.install: add debian/tmp/usr/lib
  - debian/qemu-system-common.preinst: add kvm group
  - debian/qemu-system-common.postinst: remove acl placed by udev,
    and add udevadm trigger.
  - qemu-system-x86.links: add eepro100.rom, remove pxe-virtio,
    pxe-e1000 and pxe-rtl8139.
  - add qemu-system-x86.qemu-kvm.upstart and .default
  - qemu-user-static.postinst-in: remove arm64 binfmt
  - debian/rules:
    * allow parallel build
    * add aarch64 to system_targets and sys_systems
    * add qemu-kvm-spice links
    * install qemu-system-x86.modprobe
  - add debian/qemu-system-common.links for OVMF.fd link
* Remove kvm-img, kvm-nbd, kvm-ifup and kvm-ifdown symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef QEMU_I2C_H
2
 
#define QEMU_I2C_H
3
 
 
4
 
#include "hw/qdev.h"
5
 
 
6
 
/* The QEMU I2C implementation only supports simple transfers that complete
7
 
   immediately.  It does not support slave devices that need to be able to
8
 
   defer their response (eg. CPU slave interfaces where the data is supplied
9
 
   by the device driver in response to an interrupt).  */
10
 
 
11
 
enum i2c_event {
12
 
    I2C_START_RECV,
13
 
    I2C_START_SEND,
14
 
    I2C_FINISH,
15
 
    I2C_NACK /* Masker NACKed a receive byte.  */
16
 
};
17
 
 
18
 
typedef struct I2CSlave I2CSlave;
19
 
 
20
 
#define TYPE_I2C_SLAVE "i2c-slave"
21
 
#define I2C_SLAVE(obj) \
22
 
     OBJECT_CHECK(I2CSlave, (obj), TYPE_I2C_SLAVE)
23
 
#define I2C_SLAVE_CLASS(klass) \
24
 
     OBJECT_CLASS_CHECK(I2CSlaveClass, (klass), TYPE_I2C_SLAVE)
25
 
#define I2C_SLAVE_GET_CLASS(obj) \
26
 
     OBJECT_GET_CLASS(I2CSlaveClass, (obj), TYPE_I2C_SLAVE)
27
 
 
28
 
typedef struct I2CSlaveClass
29
 
{
30
 
    DeviceClass parent_class;
31
 
 
32
 
    /* Callbacks provided by the device.  */
33
 
    int (*init)(I2CSlave *dev);
34
 
 
35
 
    /* Master to slave.  */
36
 
    int (*send)(I2CSlave *s, uint8_t data);
37
 
 
38
 
    /* Slave to master.  */
39
 
    int (*recv)(I2CSlave *s);
40
 
 
41
 
    /* Notify the slave of a bus state change.  */
42
 
    void (*event)(I2CSlave *s, enum i2c_event event);
43
 
} I2CSlaveClass;
44
 
 
45
 
struct I2CSlave
46
 
{
47
 
    DeviceState qdev;
48
 
 
49
 
    /* Remaining fields for internal use by the I2C code.  */
50
 
    uint8_t address;
51
 
};
52
 
 
53
 
i2c_bus *i2c_init_bus(DeviceState *parent, const char *name);
54
 
void i2c_set_slave_address(I2CSlave *dev, uint8_t address);
55
 
int i2c_bus_busy(i2c_bus *bus);
56
 
int i2c_start_transfer(i2c_bus *bus, uint8_t address, int recv);
57
 
void i2c_end_transfer(i2c_bus *bus);
58
 
void i2c_nack(i2c_bus *bus);
59
 
int i2c_send(i2c_bus *bus, uint8_t data);
60
 
int i2c_recv(i2c_bus *bus);
61
 
 
62
 
#define FROM_I2C_SLAVE(type, dev) DO_UPCAST(type, i2c, dev)
63
 
 
64
 
DeviceState *i2c_create_slave(i2c_bus *bus, const char *name, uint8_t addr);
65
 
 
66
 
/* wm8750.c */
67
 
void wm8750_data_req_set(DeviceState *dev,
68
 
                void (*data_req)(void *, int, int), void *opaque);
69
 
void wm8750_dac_dat(void *opaque, uint32_t sample);
70
 
uint32_t wm8750_adc_dat(void *opaque);
71
 
void *wm8750_dac_buffer(void *opaque, int samples);
72
 
void wm8750_dac_commit(void *opaque);
73
 
void wm8750_set_bclk_in(void *opaque, int new_hz);
74
 
 
75
 
/* lm832x.c */
76
 
void lm832x_key_event(DeviceState *dev, int key, int state);
77
 
 
78
 
extern const VMStateDescription vmstate_i2c_slave;
79
 
 
80
 
#define VMSTATE_I2C_SLAVE(_field, _state) {                          \
81
 
    .name       = (stringify(_field)),                               \
82
 
    .size       = sizeof(I2CSlave),                                  \
83
 
    .vmsd       = &vmstate_i2c_slave,                                \
84
 
    .flags      = VMS_STRUCT,                                        \
85
 
    .offset     = vmstate_offset_value(_state, _field, I2CSlave),    \
86
 
}
87
 
 
88
 
#endif