@samitouri / QOSamiQemu / commits / ee7042b317

hw/gpio: pca9552: declare pca9555 device as an alias of pca9535 device

PCA9555 HW is mostly identical to PCA9535. PCA9555 HW features pull-up resistors that are not available on PCA9535. Pull-up are not handled by current PCA955x implementation and PCA9535 already initializes input as Hi-Z. Signed-off-by: Emmanuel Blot <emmanuel.blot@free.fr> Reviewed-by: Glenn Miles <milesg@linux.ibm.com> Link: https://lore.kernel.org/qemu-devel/20260709-catalina-upgrade-v1-5-814575bc076b@free.fr Signed-off-by: Cédric Le Goater <clg@redhat.com>

Emmanuel Blot committed Jul 9, 2026 at 17:23 UTC ee7042b317d9854d7ed221682ced4dba945dea04
2 files changed +8 -2
hw/gpio/pca9552.c
+7 -2
@@ -523,7 +523,7 @@ static void pca9552_class_init(ObjectClass *oc, const void *data)
523 pc->has_led_support = true;
524 }
525
526 -static void pca9535_class_init(ObjectClass *oc, const void *data)
526 +static void pca95x5_class_init(ObjectClass *oc, const void *data)
527 {
528 DeviceClass *dc = DEVICE_CLASS(oc);
529 PCA955xClass *pc = PCA955X_CLASS(oc);
@@ -553,7 +553,12 @@ static const TypeInfo pca955x_types[] = {
553 {
554 .name = TYPE_PCA9535,
555 .parent = TYPE_PCA955X,
556 - .class_init = pca9535_class_init,
556 + .class_init = pca95x5_class_init,
557 + },
558 + {
559 + .name = TYPE_PCA9555,
560 + .parent = TYPE_PCA955X,
561 + .class_init = pca95x5_class_init,
562 }
563 };
564
include/hw/gpio/pca9552.h
+1
@@ -13,5 +13,6 @@
13 #define TYPE_PCA955X "pca955x"
14 #define TYPE_PCA9552 "pca9552"
15 #define TYPE_PCA9535 "pca9535"
16 +#define TYPE_PCA9555 "pca9555"
17
18 #endif