[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/26] hw/i2c/bitbang_i2c: Define TYPE_GPIO_I2C in public header
From: |
Peter Maydell |
Subject: |
[PULL 03/26] hw/i2c/bitbang_i2c: Define TYPE_GPIO_I2C in public header |
Date: |
Mon, 23 Jan 2023 13:35:30 +0000 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Define TYPE_GPIO_I2C in the public "hw/i2c/bitbang_i2c.h"
header and use it in hw/arm/musicpal.c.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Corey Minyard <cminyard@mvista.com>
Message-id: 20230111085016.44551-2-philmd@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/hw/i2c/bitbang_i2c.h | 2 ++
hw/arm/musicpal.c | 3 ++-
hw/i2c/bitbang_i2c.c | 1 -
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/hw/i2c/bitbang_i2c.h b/include/hw/i2c/bitbang_i2c.h
index 92334e9016a..a079e6d70f9 100644
--- a/include/hw/i2c/bitbang_i2c.h
+++ b/include/hw/i2c/bitbang_i2c.h
@@ -3,6 +3,8 @@
#include "hw/i2c/i2c.h"
+#define TYPE_GPIO_I2C "gpio_i2c"
+
typedef struct bitbang_i2c_interface bitbang_i2c_interface;
#define BITBANG_I2C_SDA 0
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
index 73e2b7e4cef..89b66606c32 100644
--- a/hw/arm/musicpal.c
+++ b/hw/arm/musicpal.c
@@ -26,6 +26,7 @@
#include "hw/block/flash.h"
#include "ui/console.h"
#include "hw/i2c/i2c.h"
+#include "hw/i2c/bitbang_i2c.h"
#include "hw/irq.h"
#include "hw/or-irq.h"
#include "hw/audio/wm8750.h"
@@ -1303,7 +1304,7 @@ static void musicpal_init(MachineState *machine)
dev = sysbus_create_simple(TYPE_MUSICPAL_GPIO, MP_GPIO_BASE,
qdev_get_gpio_in(pic, MP_GPIO_IRQ));
- i2c_dev = sysbus_create_simple("gpio_i2c", -1, NULL);
+ i2c_dev = sysbus_create_simple(TYPE_GPIO_I2C, -1, NULL);
i2c = (I2CBus *)qdev_get_child_bus(i2c_dev, "i2c");
lcd_dev = sysbus_create_simple(TYPE_MUSICPAL_LCD, MP_LCD_BASE, NULL);
diff --git a/hw/i2c/bitbang_i2c.c b/hw/i2c/bitbang_i2c.c
index e9a0612a043..ac84bf02624 100644
--- a/hw/i2c/bitbang_i2c.c
+++ b/hw/i2c/bitbang_i2c.c
@@ -162,7 +162,6 @@ void bitbang_i2c_init(bitbang_i2c_interface *s, I2CBus *bus)
/* GPIO interface. */
-#define TYPE_GPIO_I2C "gpio_i2c"
OBJECT_DECLARE_SIMPLE_TYPE(GPIOI2CState, GPIO_I2C)
struct GPIOI2CState {
--
2.34.1
- [PULL 07/26] hw/i2c/bitbang_i2c: Convert DPRINTF() to trace events, (continued)
- [PULL 07/26] hw/i2c/bitbang_i2c: Convert DPRINTF() to trace events, Peter Maydell, 2023/01/23
- [PULL 09/26] hw/i2c/versatile_i2c: Replace VersatileI2CState -> ArmSbconI2CState, Peter Maydell, 2023/01/23
- [PULL 15/26] target/arm/sme: Introduce aarch64_set_svcr(), Peter Maydell, 2023/01/23
- [PULL 11/26] hw/i2c/versatile_i2c: Use ARM_SBCON_I2C() macro, Peter Maydell, 2023/01/23
- [PULL 19/26] target/arm/sme: Unify set_pstate() SM/ZA helpers as set_svcr(), Peter Maydell, 2023/01/23
- [PULL 22/26] target/arm: Don't set EXC_RETURN.ES if Security Extension not present, Peter Maydell, 2023/01/23
- [PULL 16/26] target/arm/sme: Reset SVE state in aarch64_set_svcr(), Peter Maydell, 2023/01/23
- [PULL 21/26] target/arm: Fix in_debug path in S1_ptw_translate, Peter Maydell, 2023/01/23
- [PULL 18/26] target/arm/sme: Rebuild hflags in aarch64_set_svcr(), Peter Maydell, 2023/01/23
- [PULL 02/26] target/arm: Unify checking for M Main Extension in MRS/MSR, Peter Maydell, 2023/01/23
- [PULL 03/26] hw/i2c/bitbang_i2c: Define TYPE_GPIO_I2C in public header,
Peter Maydell <=
- [PULL 04/26] hw/i2c/bitbang_i2c: Remove unused dummy MemoryRegion, Peter Maydell, 2023/01/23
- [PULL 08/26] hw/i2c/versatile_i2c: Drop useless casts from void * to pointer, Peter Maydell, 2023/01/23
- [PULL 06/26] hw/i2c/bitbang_i2c: Trace state changes, Peter Maydell, 2023/01/23
- [PULL 10/26] hw/i2c/versatile_i2c: Replace TYPE_VERSATILE_I2C -> TYPE_ARM_SBCON_I2C, Peter Maydell, 2023/01/23
- [PULL 05/26] hw/i2c/bitbang_i2c: Change state calling bitbang_i2c_set_state() helper, Peter Maydell, 2023/01/23
- [PULL 12/26] hw/i2c/versatile_i2c: Rename versatile_i2c -> arm_sbcon_i2c, Peter Maydell, 2023/01/23
- [PULL 17/26] target/arm/sme: Reset ZA state in aarch64_set_svcr(), Peter Maydell, 2023/01/23
- [PULL 23/26] target/arm: implement DBGCLAIM registers, Peter Maydell, 2023/01/23
- [PULL 20/26] target/arm: Fix physical address resolution for MTE, Peter Maydell, 2023/01/23
- [PULL 25/26] target/arm: Reorg do_coproc_insn, Peter Maydell, 2023/01/23