]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/arm/aspeed: Rename and export create_pca9554() as aspeed_create_pca9554()
authorJamin Lin <jamin_lin@aspeedtech.com>
Tue, 4 Nov 2025 03:12:42 +0000 (11:12 +0800)
committerCédric Le Goater <clg@redhat.com>
Tue, 4 Nov 2025 08:27:58 +0000 (09:27 +0100)
The helper function create_pca9554() has been renamed to
aspeed_create_pca9554() and made globally available.

Previously, the function was declared static inside aspeed.c, restricting
its visibility to that file. As more Aspeed machine implementations
require PCA9554 I2C expander setup, it makes sense to rename it with the
aspeed_ prefix and export its declaration in aspeed.h for shared use.

No functional changes.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251104031325.146374-5-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/arm/aspeed.c
include/hw/arm/aspeed.h

index c6f272d9865d3ed0b569ef146c33ecd1d8a10376..59416eb5ae6c48f1e95f8b1b44bc90c22c93fbd8 100644 (file)
@@ -543,7 +543,7 @@ void aspeed_create_pca9552(AspeedSoCState *soc, int bus_id, int addr)
                             TYPE_PCA9552, addr);
 }
 
-static I2CSlave *create_pca9554(AspeedSoCState *soc, int bus_id, int addr)
+I2CSlave *aspeed_create_pca9554(AspeedSoCState *soc, int bus_id, int addr)
 {
     return i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, bus_id),
                             TYPE_PCA9554, addr);
@@ -1142,7 +1142,7 @@ static void gb200nvl_bmc_i2c_init(AspeedMachineState *bmc)
     }
 
     /* Bus 5 Expander */
-    create_pca9554(soc, 4, 0x21);
+    aspeed_create_pca9554(soc, 4, 0x21);
 
     /* Mux I2c Expanders */
     i2c_slave_create_simple(i2c[5], "pca9546", 0x71);
@@ -1153,12 +1153,12 @@ static void gb200nvl_bmc_i2c_init(AspeedMachineState *bmc)
     i2c_slave_create_simple(i2c[5], "pca9546", 0x77);
 
     /* Bus 10 */
-    dev = DEVICE(create_pca9554(soc, 9, 0x20));
+    dev = DEVICE(aspeed_create_pca9554(soc, 9, 0x20));
 
     /* Set FPGA_READY */
     object_property_set_str(OBJECT(dev), "pin1", "high", &error_fatal);
 
-    create_pca9554(soc, 9, 0x21);
+    aspeed_create_pca9554(soc, 9, 0x21);
     at24c_eeprom_init(i2c[9], 0x50, 64 * KiB);
     at24c_eeprom_init(i2c[9], 0x51, 64 * KiB);
 
index 9b765295d90617d054b7088a98cc43af6f49ee12..16b24e68870a31db25a50a64abb0d949847be60e 100644 (file)
@@ -80,4 +80,18 @@ void aspeed_machine_class_init_cpus_defaults(MachineClass *mc);
  */
 void aspeed_create_pca9552(AspeedSoCState *soc, int bus_id, int addr);
 
+/*
+ * aspeed_create_pca9554:
+ * @soc: pointer to the #AspeedSoCState.
+ * @bus_id: the I2C bus index to attach the device.
+ * @addr: the I2C address of the PCA9554 device.
+ *
+ * Create and attach a PCA9554 I/O expander to the specified I2C bus
+ * of the given Aspeed SoC. The device is created via
+ * i2c_slave_create_simple() and returned as an #I2CSlave pointer.
+ *
+ * Returns: a pointer to the newly created #I2CSlave instance.
+ */
+I2CSlave *aspeed_create_pca9554(AspeedSoCState *soc, int bus_id, int addr);
+
 #endif