@@ -2617,6 +2617,7 @@ F: hw/acpi/ich9*.c
F: hw/i2c/smbus_ich9.c
F: hw/isa/lpc_ich9.c
F: include/hw/acpi/ich9*.h
+F: include/hw/i2c/ich9_smbus.h
F: include/hw/southbridge/ich9.h
PIIX4 South Bridge (i82371AB)
new file mode 100644
@@ -0,0 +1,25 @@
+/*
+ * QEMU ICH9 SMBus emulation
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#ifndef HW_I2C_ICH9_SMBUS_H
+#define HW_I2C_ICH9_SMBUS_H
+
+#include "qom/object.h"
+#include "hw/pci/pci_device.h"
+#include "hw/i2c/pm_smbus.h"
+
+#define TYPE_ICH9_SMB_DEVICE "ICH9-SMB"
+
+OBJECT_DECLARE_SIMPLE_TYPE(ICH9SMBState, ICH9_SMB_DEVICE)
+
+struct ICH9SMBState {
+ PCIDevice dev;
+
+ bool irq_enabled;
+
+ PMSMBus smb;
+};
+
+#endif
similarity index 95%
rename from hw/i2c/smbus_ich9.c
rename to hw/i2c/ich9_smbus.c
@@ -1,5 +1,5 @@
/*
- * ACPI implementation
+ * QEMU ICH9 SMBus emulation
*
* Copyright (c) 2006 Fabrice Bellard
* Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp>
@@ -22,8 +22,7 @@
#include "qemu/osdep.h"
#include "qemu/range.h"
-#include "hw/i2c/pm_smbus.h"
-#include "hw/pci/pci.h"
+#include "hw/i2c/ich9_smbus.h"
#include "migration/vmstate.h"
#include "qemu/module.h"
@@ -31,16 +30,6 @@
#include "qom/object.h"
#include "hw/acpi/acpi_aml_interface.h"
-OBJECT_DECLARE_SIMPLE_TYPE(ICH9SMBState, ICH9_SMB_DEVICE)
-
-struct ICH9SMBState {
- PCIDevice dev;
-
- bool irq_enabled;
-
- PMSMBus smb;
-};
-
static bool ich9_vmstate_need_smbus(void *opaque, int version_id)
{
return pm_smbus_vmstate_needed();
@@ -2,7 +2,7 @@ i2c_ss = ss.source_set()
i2c_ss.add(when: 'CONFIG_I2C', if_true: files('core.c'))
i2c_ss.add(when: 'CONFIG_SMBUS', if_true: files('smbus_slave.c', 'smbus_master.c'))
i2c_ss.add(when: 'CONFIG_ACPI_SMBUS', if_true: files('pm_smbus.c'))
-i2c_ss.add(when: 'CONFIG_ACPI_ICH9', if_true: files('smbus_ich9.c'))
+i2c_ss.add(when: 'CONFIG_ACPI_ICH9', if_true: files('ich9_smbus.c'))
i2c_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files('aspeed_i2c.c'))
i2c_ss.add(when: 'CONFIG_BITBANG_I2C', if_true: files('bitbang_i2c.c'))
i2c_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210_i2c.c'))
Expose TYPE_ICH9_SMB_DEVICE to the new "hw/i2c/ich9_smbus.h" header. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- MAINTAINERS | 1 + include/hw/i2c/ich9_smbus.h | 25 +++++++++++++++++++++++++ hw/i2c/{smbus_ich9.c => ich9_smbus.c} | 15 ++------------- hw/i2c/meson.build | 2 +- 4 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 include/hw/i2c/ich9_smbus.h rename hw/i2c/{smbus_ich9.c => ich9_smbus.c} (95%)