Signed-off-by: Markus Armbruster <[email protected]>
---
include/hw/gpio/pca9554.h | 25 -------------------------
hw/gpio/pca9554.c | 24 ++++++++++++++++++++++++
2 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/include/hw/gpio/pca9554.h b/include/hw/gpio/pca9554.h
index ac835371aa..1b33a8a752 100644
--- a/include/hw/gpio/pca9554.h
+++ b/include/hw/gpio/pca9554.h
@@ -8,32 +8,7 @@
#ifndef PCA9554_H
#define PCA9554_H
-#include "hw/i2c/i2c.h"
-#include "qom/object.h"
-
#define TYPE_PCA9554 "pca9554"
#define TYPE_PCA9536 "pca9536"
-typedef struct PCA9554State PCA9554State;
-DECLARE_INSTANCE_CHECKER(PCA9554State, PCA9554,
- TYPE_PCA9554)
-
-#define PCA9554_NR_REGS 4
-#define PCA9554_PIN_COUNT 8
-#define PCA9536_PIN_COUNT 4
-
-struct PCA9554State {
- /*< private >*/
- I2CSlave i2c;
- /*< public >*/
-
- uint8_t len;
- uint8_t pointer;
-
- uint8_t regs[PCA9554_NR_REGS];
- qemu_irq gpio_out[PCA9554_PIN_COUNT];
- uint8_t ext_state[PCA9554_PIN_COUNT];
- char *description; /* For debugging purpose only */
- bool hw_dir; /* Honor pin direction */
-};
#endif
diff --git a/hw/gpio/pca9554.c b/hw/gpio/pca9554.c
index 07bb00babf..e5a1932c89 100644
--- a/hw/gpio/pca9554.c
+++ b/hw/gpio/pca9554.c
@@ -13,6 +13,7 @@
#include "hw/core/qdev-properties.h"
#include "hw/gpio/pca9554.h"
#include "hw/gpio/pca9554_regs.h"
+#include "hw/i2c/i2c.h"
#include "hw/core/irq.h"
#include "migration/vmstate.h"
#include "qapi/error.h"
@@ -21,6 +22,29 @@
#include "trace.h"
#include "qom/object.h"
+typedef struct PCA9554State PCA9554State;
+DECLARE_INSTANCE_CHECKER(PCA9554State, PCA9554,
+ TYPE_PCA9554)
+
+#define PCA9554_NR_REGS 4
+#define PCA9554_PIN_COUNT 8
+#define PCA9536_PIN_COUNT 4
+
+struct PCA9554State {
+ /*< private >*/
+ I2CSlave i2c;
+ /*< public >*/
+
+ uint8_t len;
+ uint8_t pointer;
+
+ uint8_t regs[PCA9554_NR_REGS];
+ qemu_irq gpio_out[PCA9554_PIN_COUNT];
+ uint8_t ext_state[PCA9554_PIN_COUNT];
+ char *description; /* For debugging purpose only */
+ bool hw_dir; /* Honor pin direction */
+};
+
struct PCA9554Class {
/*< private >*/
I2CSlaveClass parent_class;
--
2.55.0