Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mirror_resources
Qemu
提交
9e07bdf8
Q
Qemu
项目概览
mirror_resources
/
Qemu
12 个月 前同步成功
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
Qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9e07bdf8
编写于
12月 04, 2011
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
i2c: rename i2c_slave -> I2CSlave
Signed-off-by:
N
Anthony Liguori
<
aliguori@us.ibm.com
>
上级
cd6c4cf2
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
88 addition
and
86 deletion
+88
-86
hw/ds1338.c
hw/ds1338.c
+5
-5
hw/i2c.c
hw/i2c.c
+15
-15
hw/i2c.h
hw/i2c.h
+12
-10
hw/lm832x.c
hw/lm832x.c
+5
-5
hw/max7310.c
hw/max7310.c
+5
-5
hw/pxa2xx.c
hw/pxa2xx.c
+5
-5
hw/smbus.c
hw/smbus.c
+4
-4
hw/smbus.h
hw/smbus.h
+1
-1
hw/spitz.c
hw/spitz.c
+1
-1
hw/ssd0303.c
hw/ssd0303.c
+5
-5
hw/tmp105.c
hw/tmp105.c
+7
-7
hw/tosa.c
hw/tosa.c
+5
-5
hw/twl92230.c
hw/twl92230.c
+6
-6
hw/wm8750.c
hw/wm8750.c
+7
-7
hw/z2.c
hw/z2.c
+5
-5
未找到文件。
hw/ds1338.c
浏览文件 @
9e07bdf8
...
...
@@ -13,7 +13,7 @@
#include "i2c.h"
typedef
struct
{
i2c_s
lave
i2c
;
I2CS
lave
i2c
;
time_t
offset
;
struct
tm
now
;
uint8_t
nvram
[
56
];
...
...
@@ -21,7 +21,7 @@ typedef struct {
int
addr_byte
;
}
DS1338State
;
static
void
ds1338_event
(
i2c_s
lave
*
i2c
,
enum
i2c_event
event
)
static
void
ds1338_event
(
I2CS
lave
*
i2c
,
enum
i2c_event
event
)
{
DS1338State
*
s
=
FROM_I2C_SLAVE
(
DS1338State
,
i2c
);
...
...
@@ -51,7 +51,7 @@ static void ds1338_event(i2c_slave *i2c, enum i2c_event event)
}
}
static
int
ds1338_recv
(
i2c_s
lave
*
i2c
)
static
int
ds1338_recv
(
I2CS
lave
*
i2c
)
{
DS1338State
*
s
=
FROM_I2C_SLAVE
(
DS1338State
,
i2c
);
uint8_t
res
;
...
...
@@ -61,7 +61,7 @@ static int ds1338_recv(i2c_slave *i2c)
return
res
;
}
static
int
ds1338_send
(
i2c_s
lave
*
i2c
,
uint8_t
data
)
static
int
ds1338_send
(
I2CS
lave
*
i2c
,
uint8_t
data
)
{
DS1338State
*
s
=
FROM_I2C_SLAVE
(
DS1338State
,
i2c
);
if
(
s
->
addr_byte
)
{
...
...
@@ -113,7 +113,7 @@ static int ds1338_send(i2c_slave *i2c, uint8_t data)
return
0
;
}
static
int
ds1338_init
(
i2c_s
lave
*
i2c
)
static
int
ds1338_init
(
I2CS
lave
*
i2c
)
{
return
0
;
}
...
...
hw/i2c.c
浏览文件 @
9e07bdf8
...
...
@@ -12,8 +12,8 @@
struct
i2c_bus
{
BusState
qbus
;
i2c_s
lave
*
current_dev
;
i2c_s
lave
*
dev
;
I2CS
lave
*
current_dev
;
I2CS
lave
*
dev
;
uint8_t
saved_address
;
};
...
...
@@ -21,7 +21,7 @@ static struct BusInfo i2c_bus_info = {
.
name
=
"I2C"
,
.
size
=
sizeof
(
i2c_bus
),
.
props
=
(
Property
[])
{
DEFINE_PROP_UINT8
(
"address"
,
struct
i2c_s
lave
,
address
,
0
),
DEFINE_PROP_UINT8
(
"address"
,
struct
I2CS
lave
,
address
,
0
),
DEFINE_PROP_END_OF_LIST
(),
}
};
...
...
@@ -66,7 +66,7 @@ i2c_bus *i2c_init_bus(DeviceState *parent, const char *name)
return
bus
;
}
void
i2c_set_slave_address
(
i2c_s
lave
*
dev
,
uint8_t
address
)
void
i2c_set_slave_address
(
I2CS
lave
*
dev
,
uint8_t
address
)
{
dev
->
address
=
address
;
}
...
...
@@ -82,10 +82,10 @@ int i2c_bus_busy(i2c_bus *bus)
int
i2c_start_transfer
(
i2c_bus
*
bus
,
uint8_t
address
,
int
recv
)
{
DeviceState
*
qdev
;
i2c_s
lave
*
slave
=
NULL
;
I2CS
lave
*
slave
=
NULL
;
QTAILQ_FOREACH
(
qdev
,
&
bus
->
qbus
.
children
,
sibling
)
{
i2c_s
lave
*
candidate
=
I2C_SLAVE_FROM_QDEV
(
qdev
);
I2CS
lave
*
candidate
=
I2C_SLAVE_FROM_QDEV
(
qdev
);
if
(
candidate
->
address
==
address
)
{
slave
=
candidate
;
break
;
...
...
@@ -104,7 +104,7 @@ int i2c_start_transfer(i2c_bus *bus, uint8_t address, int recv)
void
i2c_end_transfer
(
i2c_bus
*
bus
)
{
i2c_s
lave
*
dev
=
bus
->
current_dev
;
I2CS
lave
*
dev
=
bus
->
current_dev
;
if
(
!
dev
)
return
;
...
...
@@ -116,7 +116,7 @@ void i2c_end_transfer(i2c_bus *bus)
int
i2c_send
(
i2c_bus
*
bus
,
uint8_t
data
)
{
i2c_s
lave
*
dev
=
bus
->
current_dev
;
I2CS
lave
*
dev
=
bus
->
current_dev
;
if
(
!
dev
)
return
-
1
;
...
...
@@ -126,7 +126,7 @@ int i2c_send(i2c_bus *bus, uint8_t data)
int
i2c_recv
(
i2c_bus
*
bus
)
{
i2c_s
lave
*
dev
=
bus
->
current_dev
;
I2CS
lave
*
dev
=
bus
->
current_dev
;
if
(
!
dev
)
return
-
1
;
...
...
@@ -136,7 +136,7 @@ int i2c_recv(i2c_bus *bus)
void
i2c_nack
(
i2c_bus
*
bus
)
{
i2c_s
lave
*
dev
=
bus
->
current_dev
;
I2CS
lave
*
dev
=
bus
->
current_dev
;
if
(
!
dev
)
return
;
...
...
@@ -146,7 +146,7 @@ void i2c_nack(i2c_bus *bus)
static
int
i2c_slave_post_load
(
void
*
opaque
,
int
version_id
)
{
i2c_s
lave
*
dev
=
opaque
;
I2CS
lave
*
dev
=
opaque
;
i2c_bus
*
bus
;
bus
=
FROM_QBUS
(
i2c_bus
,
qdev_get_parent_bus
(
&
dev
->
qdev
));
if
(
bus
->
saved_address
==
dev
->
address
)
{
...
...
@@ -156,13 +156,13 @@ static int i2c_slave_post_load(void *opaque, int version_id)
}
const
VMStateDescription
vmstate_i2c_slave
=
{
.
name
=
"
i2c_s
lave"
,
.
name
=
"
I2CS
lave"
,
.
version_id
=
1
,
.
minimum_version_id
=
1
,
.
minimum_version_id_old
=
1
,
.
post_load
=
i2c_slave_post_load
,
.
fields
=
(
VMStateField
[])
{
VMSTATE_UINT8
(
address
,
i2c_s
lave
),
VMSTATE_UINT8
(
address
,
I2CS
lave
),
VMSTATE_END_OF_LIST
()
}
};
...
...
@@ -170,7 +170,7 @@ const VMStateDescription vmstate_i2c_slave = {
static
int
i2c_slave_qdev_init
(
DeviceState
*
dev
,
DeviceInfo
*
base
)
{
I2CSlaveInfo
*
info
=
container_of
(
base
,
I2CSlaveInfo
,
qdev
);
i2c_s
lave
*
s
=
I2C_SLAVE_FROM_QDEV
(
dev
);
I2CS
lave
*
s
=
I2C_SLAVE_FROM_QDEV
(
dev
);
s
->
info
=
info
;
...
...
@@ -179,7 +179,7 @@ static int i2c_slave_qdev_init(DeviceState *dev, DeviceInfo *base)
void
i2c_register_slave
(
I2CSlaveInfo
*
info
)
{
assert
(
info
->
qdev
.
size
>=
sizeof
(
i2c_s
lave
));
assert
(
info
->
qdev
.
size
>=
sizeof
(
I2CS
lave
));
info
->
qdev
.
init
=
i2c_slave_qdev_init
;
info
->
qdev
.
bus_info
=
&
i2c_bus_info
;
qdev_register
(
&
info
->
qdev
);
...
...
hw/i2c.h
浏览文件 @
9e07bdf8
...
...
@@ -15,14 +15,16 @@ enum i2c_event {
I2C_NACK
/* Masker NACKed a receive byte. */
};
typedef
struct
I2CSlave
I2CSlave
;
/* Master to slave. */
typedef
int
(
*
i2c_send_cb
)(
i2c_s
lave
*
s
,
uint8_t
data
);
typedef
int
(
*
i2c_send_cb
)(
I2CS
lave
*
s
,
uint8_t
data
);
/* Slave to master. */
typedef
int
(
*
i2c_recv_cb
)(
i2c_s
lave
*
s
);
typedef
int
(
*
i2c_recv_cb
)(
I2CS
lave
*
s
);
/* Notify the slave of a bus state change. */
typedef
void
(
*
i2c_event_cb
)(
i2c_s
lave
*
s
,
enum
i2c_event
event
);
typedef
void
(
*
i2c_event_cb
)(
I2CS
lave
*
s
,
enum
i2c_event
event
);
typedef
int
(
*
i2c_slave_initfn
)(
i2c_s
lave
*
dev
);
typedef
int
(
*
i2c_slave_initfn
)(
I2CS
lave
*
dev
);
typedef
struct
{
DeviceInfo
qdev
;
...
...
@@ -34,7 +36,7 @@ typedef struct {
i2c_send_cb
send
;
}
I2CSlaveInfo
;
struct
i2c_s
lave
struct
I2CS
lave
{
DeviceState
qdev
;
I2CSlaveInfo
*
info
;
...
...
@@ -44,7 +46,7 @@ struct i2c_slave
};
i2c_bus
*
i2c_init_bus
(
DeviceState
*
parent
,
const
char
*
name
);
void
i2c_set_slave_address
(
i2c_s
lave
*
dev
,
uint8_t
address
);
void
i2c_set_slave_address
(
I2CS
lave
*
dev
,
uint8_t
address
);
int
i2c_bus_busy
(
i2c_bus
*
bus
);
int
i2c_start_transfer
(
i2c_bus
*
bus
,
uint8_t
address
,
int
recv
);
void
i2c_end_transfer
(
i2c_bus
*
bus
);
...
...
@@ -52,7 +54,7 @@ void i2c_nack(i2c_bus *bus);
int
i2c_send
(
i2c_bus
*
bus
,
uint8_t
data
);
int
i2c_recv
(
i2c_bus
*
bus
);
#define I2C_SLAVE_FROM_QDEV(dev) DO_UPCAST(
i2c_s
lave, qdev, dev)
#define I2C_SLAVE_FROM_QDEV(dev) DO_UPCAST(
I2CS
lave, qdev, dev)
#define FROM_I2C_SLAVE(type, dev) DO_UPCAST(type, i2c, dev)
void
i2c_register_slave
(
I2CSlaveInfo
*
type
);
...
...
@@ -69,7 +71,7 @@ void wm8750_dac_commit(void *opaque);
void
wm8750_set_bclk_in
(
void
*
opaque
,
int
new_hz
);
/* tmp105.c */
void
tmp105_set
(
i2c_s
lave
*
i2c
,
int
temp
);
void
tmp105_set
(
I2CS
lave
*
i2c
,
int
temp
);
/* lm832x.c */
void
lm832x_key_event
(
DeviceState
*
dev
,
int
key
,
int
state
);
...
...
@@ -78,10 +80,10 @@ extern const VMStateDescription vmstate_i2c_slave;
#define VMSTATE_I2C_SLAVE(_field, _state) { \
.name = (stringify(_field)), \
.size = sizeof(
i2c_slave),
\
.size = sizeof(
I2CSlave),
\
.vmsd = &vmstate_i2c_slave, \
.flags = VMS_STRUCT, \
.offset = vmstate_offset_value(_state, _field,
i2c_slave),
\
.offset = vmstate_offset_value(_state, _field,
I2CSlave),
\
}
#endif
hw/lm832x.c
浏览文件 @
9e07bdf8
...
...
@@ -24,7 +24,7 @@
#include "console.h"
typedef
struct
{
i2c_s
lave
i2c
;
I2CS
lave
i2c
;
uint8_t
i2c_dir
;
uint8_t
i2c_cycle
;
uint8_t
reg
;
...
...
@@ -378,7 +378,7 @@ static void lm_kbd_write(LM823KbdState *s, int reg, int byte, uint8_t value)
}
}
static
void
lm_i2c_event
(
i2c_s
lave
*
i2c
,
enum
i2c_event
event
)
static
void
lm_i2c_event
(
I2CS
lave
*
i2c
,
enum
i2c_event
event
)
{
LM823KbdState
*
s
=
FROM_I2C_SLAVE
(
LM823KbdState
,
i2c
);
...
...
@@ -394,14 +394,14 @@ static void lm_i2c_event(i2c_slave *i2c, enum i2c_event event)
}
}
static
int
lm_i2c_rx
(
i2c_s
lave
*
i2c
)
static
int
lm_i2c_rx
(
I2CS
lave
*
i2c
)
{
LM823KbdState
*
s
=
FROM_I2C_SLAVE
(
LM823KbdState
,
i2c
);
return
lm_kbd_read
(
s
,
s
->
reg
,
s
->
i2c_cycle
++
);
}
static
int
lm_i2c_tx
(
i2c_s
lave
*
i2c
,
uint8_t
data
)
static
int
lm_i2c_tx
(
I2CS
lave
*
i2c
,
uint8_t
data
)
{
LM823KbdState
*
s
=
(
LM823KbdState
*
)
i2c
;
...
...
@@ -458,7 +458,7 @@ static const VMStateDescription vmstate_lm_kbd = {
};
static
int
lm8323_init
(
i2c_s
lave
*
i2c
)
static
int
lm8323_init
(
I2CS
lave
*
i2c
)
{
LM823KbdState
*
s
=
FROM_I2C_SLAVE
(
LM823KbdState
,
i2c
);
...
...
hw/max7310.c
浏览文件 @
9e07bdf8
...
...
@@ -10,7 +10,7 @@
#include "i2c.h"
typedef
struct
{
i2c_s
lave
i2c
;
I2CS
lave
i2c
;
int
i2c_command_byte
;
int
len
;
...
...
@@ -33,7 +33,7 @@ static void max7310_reset(DeviceState *dev)
s
->
command
=
0x00
;
}
static
int
max7310_rx
(
i2c_s
lave
*
i2c
)
static
int
max7310_rx
(
I2CS
lave
*
i2c
)
{
MAX7310State
*
s
=
(
MAX7310State
*
)
i2c
;
...
...
@@ -68,7 +68,7 @@ static int max7310_rx(i2c_slave *i2c)
return
0xff
;
}
static
int
max7310_tx
(
i2c_s
lave
*
i2c
,
uint8_t
data
)
static
int
max7310_tx
(
I2CS
lave
*
i2c
,
uint8_t
data
)
{
MAX7310State
*
s
=
(
MAX7310State
*
)
i2c
;
uint8_t
diff
;
...
...
@@ -123,7 +123,7 @@ static int max7310_tx(i2c_slave *i2c, uint8_t data)
return
0
;
}
static
void
max7310_event
(
i2c_s
lave
*
i2c
,
enum
i2c_event
event
)
static
void
max7310_event
(
I2CS
lave
*
i2c
,
enum
i2c_event
event
)
{
MAX7310State
*
s
=
(
MAX7310State
*
)
i2c
;
s
->
len
=
0
;
...
...
@@ -175,7 +175,7 @@ static void max7310_gpio_set(void *opaque, int line, int level)
/* MAX7310 is SMBus-compatible (can be used with only SMBus protocols),
* but also accepts sequences that are not SMBus so return an I2C device. */
static
int
max7310_init
(
i2c_s
lave
*
i2c
)
static
int
max7310_init
(
I2CS
lave
*
i2c
)
{
MAX7310State
*
s
=
FROM_I2C_SLAVE
(
MAX7310State
,
i2c
);
...
...
hw/pxa2xx.c
浏览文件 @
9e07bdf8
...
...
@@ -1243,7 +1243,7 @@ static SysBusDeviceInfo pxa2xx_rtc_sysbus_info = {
/* I2C Interface */
typedef
struct
{
i2c_s
lave
i2c
;
I2CS
lave
i2c
;
PXA2xxI2CState
*
host
;
}
PXA2xxI2CSlaveState
;
...
...
@@ -1279,7 +1279,7 @@ static void pxa2xx_i2c_update(PXA2xxI2CState *s)
}
/* These are only stubs now. */
static
void
pxa2xx_i2c_event
(
i2c_s
lave
*
i2c
,
enum
i2c_event
event
)
static
void
pxa2xx_i2c_event
(
I2CS
lave
*
i2c
,
enum
i2c_event
event
)
{
PXA2xxI2CSlaveState
*
slave
=
FROM_I2C_SLAVE
(
PXA2xxI2CSlaveState
,
i2c
);
PXA2xxI2CState
*
s
=
slave
->
host
;
...
...
@@ -1303,7 +1303,7 @@ static void pxa2xx_i2c_event(i2c_slave *i2c, enum i2c_event event)
pxa2xx_i2c_update
(
s
);
}
static
int
pxa2xx_i2c_rx
(
i2c_s
lave
*
i2c
)
static
int
pxa2xx_i2c_rx
(
I2CS
lave
*
i2c
)
{
PXA2xxI2CSlaveState
*
slave
=
FROM_I2C_SLAVE
(
PXA2xxI2CSlaveState
,
i2c
);
PXA2xxI2CState
*
s
=
slave
->
host
;
...
...
@@ -1318,7 +1318,7 @@ static int pxa2xx_i2c_rx(i2c_slave *i2c)
return
s
->
data
;
}
static
int
pxa2xx_i2c_tx
(
i2c_s
lave
*
i2c
,
uint8_t
data
)
static
int
pxa2xx_i2c_tx
(
I2CS
lave
*
i2c
,
uint8_t
data
)
{
PXA2xxI2CSlaveState
*
slave
=
FROM_I2C_SLAVE
(
PXA2xxI2CSlaveState
,
i2c
);
PXA2xxI2CState
*
s
=
slave
->
host
;
...
...
@@ -1466,7 +1466,7 @@ static const VMStateDescription vmstate_pxa2xx_i2c = {
}
};
static
int
pxa2xx_i2c_slave_init
(
i2c_s
lave
*
i2c
)
static
int
pxa2xx_i2c_slave_init
(
I2CS
lave
*
i2c
)
{
/* Nothing to do. */
return
0
;
...
...
hw/smbus.c
浏览文件 @
9e07bdf8
...
...
@@ -65,7 +65,7 @@ static void smbus_do_write(SMBusDevice *dev)
}
}
static
void
smbus_i2c_event
(
i2c_s
lave
*
s
,
enum
i2c_event
event
)
static
void
smbus_i2c_event
(
I2CS
lave
*
s
,
enum
i2c_event
event
)
{
SMBusDevice
*
dev
=
FROM_I2C_SLAVE
(
SMBusDevice
,
s
);
...
...
@@ -148,7 +148,7 @@ static void smbus_i2c_event(i2c_slave *s, enum i2c_event event)
}
}
static
int
smbus_i2c_recv
(
i2c_s
lave
*
s
)
static
int
smbus_i2c_recv
(
I2CS
lave
*
s
)
{
SMBusDeviceInfo
*
t
=
container_of
(
s
->
info
,
SMBusDeviceInfo
,
i2c
);
SMBusDevice
*
dev
=
FROM_I2C_SLAVE
(
SMBusDevice
,
s
);
...
...
@@ -182,7 +182,7 @@ static int smbus_i2c_recv(i2c_slave *s)
return
ret
;
}
static
int
smbus_i2c_send
(
i2c_s
lave
*
s
,
uint8_t
data
)
static
int
smbus_i2c_send
(
I2CS
lave
*
s
,
uint8_t
data
)
{
SMBusDevice
*
dev
=
FROM_I2C_SLAVE
(
SMBusDevice
,
s
);
...
...
@@ -198,7 +198,7 @@ static int smbus_i2c_send(i2c_slave *s, uint8_t data)
return
0
;
}
static
int
smbus_device_init
(
i2c_s
lave
*
i2c
)
static
int
smbus_device_init
(
I2CS
lave
*
i2c
)
{
SMBusDeviceInfo
*
t
=
container_of
(
i2c
->
info
,
SMBusDeviceInfo
,
i2c
);
SMBusDevice
*
dev
=
FROM_I2C_SLAVE
(
SMBusDevice
,
i2c
);
...
...
hw/smbus.h
浏览文件 @
9e07bdf8
...
...
@@ -26,7 +26,7 @@
struct
SMBusDevice
{
/* The SMBus protocol is implemented on top of I2C. */
i2c_s
lave
i2c
;
I2CS
lave
i2c
;
/* Remaining fields for internal use only. */
int
mode
;
...
...
hw/spitz.c
浏览文件 @
9e07bdf8
...
...
@@ -717,7 +717,7 @@ static void spitz_microdrive_attach(PXA2xxState *cpu, int slot)
static
void
spitz_wm8750_addr
(
void
*
opaque
,
int
line
,
int
level
)
{
i2c_slave
*
wm
=
(
i2c_s
lave
*
)
opaque
;
I2CSlave
*
wm
=
(
I2CS
lave
*
)
opaque
;
if
(
level
)
i2c_set_slave_address
(
wm
,
SPITZ_WM_ADDRH
);
else
...
...
hw/ssd0303.c
浏览文件 @
9e07bdf8
...
...
@@ -42,7 +42,7 @@ enum ssd0303_cmd {
};
typedef
struct
{
i2c_s
lave
i2c
;
I2CS
lave
i2c
;
DisplayState
*
ds
;
int
row
;
int
col
;
...
...
@@ -57,13 +57,13 @@ typedef struct {
uint8_t
framebuffer
[
132
*
8
];
}
ssd0303_state
;
static
int
ssd0303_recv
(
i2c_s
lave
*
i2c
)
static
int
ssd0303_recv
(
I2CS
lave
*
i2c
)
{
BADF
(
"Reads not implemented
\n
"
);
return
-
1
;
}
static
int
ssd0303_send
(
i2c_s
lave
*
i2c
,
uint8_t
data
)
static
int
ssd0303_send
(
I2CS
lave
*
i2c
,
uint8_t
data
)
{
ssd0303_state
*
s
=
(
ssd0303_state
*
)
i2c
;
enum
ssd0303_cmd
old_cmd_state
;
...
...
@@ -173,7 +173,7 @@ static int ssd0303_send(i2c_slave *i2c, uint8_t data)
return
0
;
}
static
void
ssd0303_event
(
i2c_s
lave
*
i2c
,
enum
i2c_event
event
)
static
void
ssd0303_event
(
I2CS
lave
*
i2c
,
enum
i2c_event
event
)
{
ssd0303_state
*
s
=
(
ssd0303_state
*
)
i2c
;
switch
(
event
)
{
...
...
@@ -283,7 +283,7 @@ static const VMStateDescription vmstate_ssd0303 = {
}
};
static
int
ssd0303_init
(
i2c_s
lave
*
i2c
)
static
int
ssd0303_init
(
I2CS
lave
*
i2c
)
{
ssd0303_state
*
s
=
FROM_I2C_SLAVE
(
ssd0303_state
,
i2c
);
...
...
hw/tmp105.c
浏览文件 @
9e07bdf8
...
...
@@ -22,7 +22,7 @@
#include "i2c.h"
typedef
struct
{
i2c_s
lave
i2c
;
I2CS
lave
i2c
;
uint8_t
len
;
uint8_t
buf
[
2
];
qemu_irq
pin
;
...
...
@@ -65,7 +65,7 @@ static void tmp105_alarm_update(TMP105State *s)
}
/* Units are 0.001 centigrades relative to 0 C. */
void
tmp105_set
(
i2c_s
lave
*
i2c
,
int
temp
)
void
tmp105_set
(
I2CS
lave
*
i2c
,
int
temp
)
{
TMP105State
*
s
=
(
TMP105State
*
)
i2c
;
...
...
@@ -138,7 +138,7 @@ static void tmp105_write(TMP105State *s)
}
}
static
int
tmp105_rx
(
i2c_s
lave
*
i2c
)
static
int
tmp105_rx
(
I2CS
lave
*
i2c
)
{
TMP105State
*
s
=
(
TMP105State
*
)
i2c
;
...
...
@@ -148,7 +148,7 @@ static int tmp105_rx(i2c_slave *i2c)
return
0xff
;
}
static
int
tmp105_tx
(
i2c_s
lave
*
i2c
,
uint8_t
data
)
static
int
tmp105_tx
(
I2CS
lave
*
i2c
,
uint8_t
data
)
{
TMP105State
*
s
=
(
TMP105State
*
)
i2c
;
...
...
@@ -163,7 +163,7 @@ static int tmp105_tx(i2c_slave *i2c, uint8_t data)
return
0
;
}
static
void
tmp105_event
(
i2c_s
lave
*
i2c
,
enum
i2c_event
event
)
static
void
tmp105_event
(
I2CS
lave
*
i2c
,
enum
i2c_event
event
)
{
TMP105State
*
s
=
(
TMP105State
*
)
i2c
;
...
...
@@ -202,7 +202,7 @@ static const VMStateDescription vmstate_tmp105 = {
}
};
static
void
tmp105_reset
(
i2c_s
lave
*
i2c
)
static
void
tmp105_reset
(
I2CS
lave
*
i2c
)
{
TMP105State
*
s
=
(
TMP105State
*
)
i2c
;
...
...
@@ -215,7 +215,7 @@ static void tmp105_reset(i2c_slave *i2c)
tmp105_interrupt_update
(
s
);
}
static
int
tmp105_init
(
i2c_s
lave
*
i2c
)
static
int
tmp105_init
(
I2CS
lave
*
i2c
)
{
TMP105State
*
s
=
FROM_I2C_SLAVE
(
TMP105State
,
i2c
);
...
...
hw/tosa.c
浏览文件 @
9e07bdf8
...
...
@@ -133,12 +133,12 @@ static int tosa_ssp_init(SSISlave *dev)
}
typedef
struct
{
i2c_s
lave
i2c
;
I2CS
lave
i2c
;
int
len
;
char
buf
[
3
];
}
TosaDACState
;
static
int
tosa_dac_send
(
i2c_s
lave
*
i2c
,
uint8_t
data
)
static
int
tosa_dac_send
(
I2CS
lave
*
i2c
,
uint8_t
data
)
{
TosaDACState
*
s
=
FROM_I2C_SLAVE
(
TosaDACState
,
i2c
);
s
->
buf
[
s
->
len
]
=
data
;
...
...
@@ -157,7 +157,7 @@ static int tosa_dac_send(i2c_slave *i2c, uint8_t data)
return
0
;
}
static
void
tosa_dac_event
(
i2c_s
lave
*
i2c
,
enum
i2c_event
event
)
static
void
tosa_dac_event
(
I2CS
lave
*
i2c
,
enum
i2c_event
event
)
{
TosaDACState
*
s
=
FROM_I2C_SLAVE
(
TosaDACState
,
i2c
);
s
->
len
=
0
;
...
...
@@ -180,13 +180,13 @@ static void tosa_dac_event(i2c_slave *i2c, enum i2c_event event)
}
}
static
int
tosa_dac_recv
(
i2c_s
lave
*
s
)
static
int
tosa_dac_recv
(
I2CS
lave
*
s
)
{
printf
(
"%s: recv not supported!!!
\n
"
,
__FUNCTION__
);
return
-
1
;
}
static
int
tosa_dac_init
(
i2c_s
lave
*
i2c
)
static
int
tosa_dac_init
(
I2CS
lave
*
i2c
)
{
/* Nothing to do. */
return
0
;
...
...
hw/twl92230.c
浏览文件 @
9e07bdf8
...
...
@@ -27,7 +27,7 @@
#define VERBOSE 1
typedef
struct
{
i2c_s
lave
i2c
;
I2CS
lave
i2c
;
int
firstbyte
;
uint8_t
reg
;
...
...
@@ -126,7 +126,7 @@ static void menelaus_rtc_hz(void *opaque)
menelaus_update
(
s
);
}
static
void
menelaus_reset
(
i2c_s
lave
*
i2c
)
static
void
menelaus_reset
(
I2CS
lave
*
i2c
)
{
MenelausState
*
s
=
(
MenelausState
*
)
i2c
;
s
->
reg
=
0x00
;
...
...
@@ -709,7 +709,7 @@ static void menelaus_write(void *opaque, uint8_t addr, uint8_t value)
}
}
static
void
menelaus_event
(
i2c_s
lave
*
i2c
,
enum
i2c_event
event
)
static
void
menelaus_event
(
I2CS
lave
*
i2c
,
enum
i2c_event
event
)
{
MenelausState
*
s
=
(
MenelausState
*
)
i2c
;
...
...
@@ -717,7 +717,7 @@ static void menelaus_event(i2c_slave *i2c, enum i2c_event event)
s
->
firstbyte
=
1
;
}
static
int
menelaus_tx
(
i2c_s
lave
*
i2c
,
uint8_t
data
)
static
int
menelaus_tx
(
I2CS
lave
*
i2c
,
uint8_t
data
)
{
MenelausState
*
s
=
(
MenelausState
*
)
i2c
;
/* Interpret register address byte */
...
...
@@ -730,7 +730,7 @@ static int menelaus_tx(i2c_slave *i2c, uint8_t data)
return
0
;
}
static
int
menelaus_rx
(
i2c_s
lave
*
i2c
)
static
int
menelaus_rx
(
I2CS
lave
*
i2c
)
{
MenelausState
*
s
=
(
MenelausState
*
)
i2c
;
...
...
@@ -842,7 +842,7 @@ static const VMStateDescription vmstate_menelaus = {
}
};
static
int
twl92230_init
(
i2c_s
lave
*
i2c
)
static
int
twl92230_init
(
I2CS
lave
*
i2c
)
{
MenelausState
*
s
=
FROM_I2C_SLAVE
(
MenelausState
,
i2c
);
...
...
hw/wm8750.c
浏览文件 @
9e07bdf8
...
...
@@ -24,7 +24,7 @@ typedef struct {
}
WMRate
;
typedef
struct
{
i2c_s
lave
i2c
;
I2CS
lave
i2c
;
uint8_t
i2c_data
[
2
];
int
i2c_len
;
QEMUSoundCard
card
;
...
...
@@ -254,7 +254,7 @@ static void wm8750_clk_update(WM8750State *s, int ext)
}
}
static
void
wm8750_reset
(
i2c_s
lave
*
i2c
)
static
void
wm8750_reset
(
I2CS
lave
*
i2c
)
{
WM8750State
*
s
=
(
WM8750State
*
)
i2c
;
s
->
rate
=
&
wm_rate_table
[
0
];
...
...
@@ -297,7 +297,7 @@ static void wm8750_reset(i2c_slave *i2c)
s
->
i2c_len
=
0
;
}
static
void
wm8750_event
(
i2c_s
lave
*
i2c
,
enum
i2c_event
event
)
static
void
wm8750_event
(
I2CS
lave
*
i2c
,
enum
i2c_event
event
)
{
WM8750State
*
s
=
(
WM8750State
*
)
i2c
;
...
...
@@ -354,7 +354,7 @@ static void wm8750_event(i2c_slave *i2c, enum i2c_event event)
#define WM8750_ROUT2V 0x29
#define WM8750_MOUTV 0x2a
static
int
wm8750_tx
(
i2c_s
lave
*
i2c
,
uint8_t
data
)
static
int
wm8750_tx
(
I2CS
lave
*
i2c
,
uint8_t
data
)
{
WM8750State
*
s
=
(
WM8750State
*
)
i2c
;
uint8_t
cmd
;
...
...
@@ -554,7 +554,7 @@ static int wm8750_tx(i2c_slave *i2c, uint8_t data)
return
0
;
}
static
int
wm8750_rx
(
i2c_s
lave
*
i2c
)
static
int
wm8750_rx
(
I2CS
lave
*
i2c
)
{
return
0x00
;
}
...
...
@@ -609,7 +609,7 @@ static const VMStateDescription vmstate_wm8750 = {
}
};
static
int
wm8750_init
(
i2c_s
lave
*
i2c
)
static
int
wm8750_init
(
I2CS
lave
*
i2c
)
{
WM8750State
*
s
=
FROM_I2C_SLAVE
(
WM8750State
,
i2c
);
...
...
@@ -620,7 +620,7 @@ static int wm8750_init(i2c_slave *i2c)
}
#if 0
static void wm8750_fini(
i2c_s
lave *i2c)
static void wm8750_fini(
I2CS
lave *i2c)
{
WM8750State *s = (WM8750State *) i2c;
wm8750_reset(&s->i2c);
...
...
hw/z2.c
浏览文件 @
9e07bdf8
...
...
@@ -190,12 +190,12 @@ static DeviceInfo zipit_lcd_info = {
};
typedef
struct
{
i2c_s
lave
i2c
;
I2CS
lave
i2c
;
int
len
;
uint8_t
buf
[
3
];
}
AER915State
;
static
int
aer915_send
(
i2c_s
lave
*
i2c
,
uint8_t
data
)
static
int
aer915_send
(
I2CS
lave
*
i2c
,
uint8_t
data
)
{
AER915State
*
s
=
FROM_I2C_SLAVE
(
AER915State
,
i2c
);
s
->
buf
[
s
->
len
]
=
data
;
...
...
@@ -213,7 +213,7 @@ static int aer915_send(i2c_slave *i2c, uint8_t data)
return
0
;
}
static
void
aer915_event
(
i2c_s
lave
*
i2c
,
enum
i2c_event
event
)
static
void
aer915_event
(
I2CS
lave
*
i2c
,
enum
i2c_event
event
)
{
AER915State
*
s
=
FROM_I2C_SLAVE
(
AER915State
,
i2c
);
switch
(
event
)
{
...
...
@@ -232,7 +232,7 @@ static void aer915_event(i2c_slave *i2c, enum i2c_event event)
}
}
static
int
aer915_recv
(
i2c_s
lave
*
slave
)
static
int
aer915_recv
(
I2CS
lave
*
slave
)
{
int
retval
=
0x00
;
AER915State
*
s
=
FROM_I2C_SLAVE
(
AER915State
,
slave
);
...
...
@@ -255,7 +255,7 @@ static int aer915_recv(i2c_slave *slave)
return
retval
;
}
static
int
aer915_init
(
i2c_s
lave
*
i2c
)
static
int
aer915_init
(
I2CS
lave
*
i2c
)
{
/* Nothing to do. */
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录