[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH 2/2] i2c: Move the bus class to i2c.h
From: |
minyard |
Subject: |
[Qemu-arm] [PATCH 2/2] i2c: Move the bus class to i2c.h |
Date: |
Mon, 19 Feb 2018 09:20:06 -0600 |
From: Corey Minyard <address@hidden>
Some devices need access to it.
Signed-off-by: Corey Minyard <address@hidden>
---
hw/i2c/core.c | 17 -----------------
include/hw/i2c/i2c.h | 17 +++++++++++++++++
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/hw/i2c/core.c b/hw/i2c/core.c
index 9a54b61..cfccefc 100644
--- a/hw/i2c/core.c
+++ b/hw/i2c/core.c
@@ -10,30 +10,13 @@
#include "qemu/osdep.h"
#include "hw/i2c/i2c.h"
-typedef struct I2CNode I2CNode;
-
-struct I2CNode {
- I2CSlave *elt;
- QLIST_ENTRY(I2CNode) next;
-};
-
#define I2C_BROADCAST 0x00
-struct I2CBus {
- BusState qbus;
- QLIST_HEAD(, I2CNode) current_devs;
- uint8_t saved_address;
- bool broadcast;
-};
-
static Property i2c_props[] = {
DEFINE_PROP_UINT8("address", struct I2CSlave, address, 0),
DEFINE_PROP_END_OF_LIST(),
};
-#define TYPE_I2C_BUS "i2c-bus"
-#define I2C_BUS(obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS)
-
static const TypeInfo i2c_bus_info = {
.name = TYPE_I2C_BUS,
.parent = TYPE_BUS,
diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h
index 8fd449f..d727379 100644
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -56,6 +56,23 @@ struct I2CSlave {
uint8_t address;
};
+#define TYPE_I2C_BUS "i2c-bus"
+#define I2C_BUS(obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS)
+
+typedef struct I2CNode I2CNode;
+
+struct I2CNode {
+ I2CSlave *elt;
+ QLIST_ENTRY(I2CNode) next;
+};
+
+struct I2CBus {
+ BusState qbus;
+ QLIST_HEAD(, I2CNode) current_devs;
+ uint8_t saved_address;
+ bool broadcast;
+};
+
I2CBus *i2c_init_bus(DeviceState *parent, const char *name);
void i2c_set_slave_address(I2CSlave *dev, uint8_t address);
int i2c_bus_busy(I2CBus *bus);
--
2.7.4
- Re: [Qemu-arm] [PATCH 2/3] hw/sii9022: Add support for Silicon Image SII9022, (continued)
Re: [Qemu-arm] [PATCH 2/3] hw/sii9022: Add support for Silicon Image SII9022, Peter Maydell, 2018/02/22
[Qemu-arm] [PATCH 3/3] arm/vexpress: Add proper display connector emulation, Linus Walleij, 2018/02/17
- Re: [Qemu-arm] [Qemu-devel] [PATCH 3/3] arm/vexpress: Add proper display connector emulation, Philippe Mathieu-Daudé, 2018/02/17
- Re: [Qemu-arm] [Qemu-devel] [PATCH 3/3] arm/vexpress: Add proper display connector emulation, Linus Walleij, 2018/02/19
- Re: [Qemu-arm] [Qemu-devel] [PATCH 3/3] arm/vexpress: Add proper display connector emulation, Corey Minyard, 2018/02/19
- [Qemu-arm] [PATCH 0/2] Move the bus class to i2c.h, minyard, 2018/02/19
- [Qemu-arm] [PATCH 2/2] i2c: Move the bus class to i2c.h,
minyard <=
- Re: [Qemu-arm] [Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h, Peter Maydell, 2018/02/19
- Re: [Qemu-arm] [Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h, Corey Minyard, 2018/02/20
- Re: [Qemu-arm] [Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h, Linus Walleij, 2018/02/22
- Re: [Qemu-arm] [Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h, Peter Maydell, 2018/02/22
- Re: [Qemu-arm] [Qemu-devel] [PATCH 2/2] i2c: Move the bus class to i2c.h, Linus Walleij, 2018/02/22
Re: [Qemu-arm] [PATCH 2/2] i2c: Move the bus class to i2c.h, Linus Walleij, 2018/02/22
[Qemu-arm] [PATCH 1/2] i2c: Fix some brace style issues, minyard, 2018/02/19
Re: [Qemu-arm] [Qemu-devel] [PATCH 1/2] i2c: Fix some brace style issues, Peter Maydell, 2018/02/19
Re: [Qemu-arm] [PATCH 1/2] i2c: Fix some brace style issues, Linus Walleij, 2018/02/22
Re: [Qemu-arm] [PATCH 1/3] hw/i2c-ddc: Do not fail writes, Peter Maydell, 2018/02/22