]> git.proxmox.com Git - mirror_qemu.git/commitdiff
i2c: Move bitbang_i2c.h to include/hw/i2c/
authorBALATON Zoltan <balaton@eik.bme.hu>
Thu, 20 Jun 2019 10:55:23 +0000 (12:55 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 28 Jun 2019 08:49:36 +0000 (10:49 +0200)
The bitbang i2c implementation is also useful for other device models
such as DDC in display controllers. Move the header to include/hw/i2c/
to allow it to be used from other device models and adjust users of
this include. This also reverts commit 2b4c1125ac which is no longer
needed.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Message-id: 5d1fe4db846ab9be4b77ddb0d43cc74cd200a003.1561028123.git.balaton@eik.bme.hu
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/i2c/bitbang_i2c.c
hw/i2c/bitbang_i2c.h [deleted file]
hw/i2c/ppc4xx_i2c.c
hw/i2c/versatile_i2c.c
include/hw/i2c/bitbang_i2c.h [new file with mode: 0644]
include/hw/i2c/i2c.h
include/hw/i2c/ppc4xx_i2c.h

index 5dfc72d9d7b72e97400939a4d136415a3dd5b73d..3cb0509b0200b1fb57750deeea01bb1ee0151a35 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
-#include "bitbang_i2c.h"
+#include "hw/i2c/bitbang_i2c.h"
 #include "hw/sysbus.h"
 #include "qemu/module.h"
 
diff --git a/hw/i2c/bitbang_i2c.h b/hw/i2c/bitbang_i2c.h
deleted file mode 100644 (file)
index 9443021..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef BITBANG_I2C_H
-#define BITBANG_I2C_H
-
-#include "hw/i2c/i2c.h"
-
-#define BITBANG_I2C_SDA 0
-#define BITBANG_I2C_SCL 1
-
-bitbang_i2c_interface *bitbang_i2c_init(I2CBus *bus);
-int bitbang_i2c_set(bitbang_i2c_interface *i2c, int line, int level);
-
-#endif
index d606d3dbeb816ba58f3fee3d824a8a1dff7762cd..5fb4f86c38f15a340e26ca3ee40a274e340d945f 100644 (file)
@@ -30,7 +30,6 @@
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/i2c/ppc4xx_i2c.h"
-#include "bitbang_i2c.h"
 
 #define PPC4xx_I2C_MEM_SIZE 18
 
index e07be9890c8a2d4d5653ea1d7dd9dcb2a17b7f50..24b6e36b6d52ebb10099f11d63285117d5c25327 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
-#include "bitbang_i2c.h"
+#include "hw/i2c/bitbang_i2c.h"
 #include "qemu/log.h"
 #include "qemu/module.h"
 
diff --git a/include/hw/i2c/bitbang_i2c.h b/include/hw/i2c/bitbang_i2c.h
new file mode 100644 (file)
index 0000000..3a7126d
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef BITBANG_I2C_H
+#define BITBANG_I2C_H
+
+#include "hw/i2c/i2c.h"
+
+typedef struct bitbang_i2c_interface bitbang_i2c_interface;
+
+#define BITBANG_I2C_SDA 0
+#define BITBANG_I2C_SCL 1
+
+bitbang_i2c_interface *bitbang_i2c_init(I2CBus *bus);
+int bitbang_i2c_set(bitbang_i2c_interface *i2c, int line, int level);
+
+#endif
index 8e236f7bb4287838dd6f32c3549973fbe784afa2..75c5bd638bb986528c65e237ec2661c0091d799d 100644 (file)
@@ -81,8 +81,6 @@ uint8_t i2c_recv(I2CBus *bus);
 
 DeviceState *i2c_create_slave(I2CBus *bus, const char *name, uint8_t addr);
 
-typedef struct bitbang_i2c_interface bitbang_i2c_interface;
-
 /* lm832x.c */
 void lm832x_key_event(DeviceState *dev, int key, int state);
 
index aa2a2bf9dec2b7efd58c11436b570f28d329293d..8437bf070b8bbc7dfba324ab0c53db6b91af0d21 100644 (file)
@@ -28,7 +28,7 @@
 #define PPC4XX_I2C_H
 
 #include "hw/sysbus.h"
-#include "hw/i2c/i2c.h"
+#include "hw/i2c/bitbang_i2c.h"
 
 #define TYPE_PPC4xx_I2C "ppc4xx-i2c"
 #define PPC4xx_I2C(obj) OBJECT_CHECK(PPC4xxI2CState, (obj), TYPE_PPC4xx_I2C)