From: Miles Glenn <milesg@linux.ibm.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com, qemu-ppc@nongnu.org,
qemu-arm@nongnu.org, mark.caveayland@nutanix.com
Subject: Re: [PATCH 1/8] hw/gpio/pca9552: Convert pin and led properties to class properties
Date: Fri, 06 Nov 2026 14:17:41 -0600 [thread overview]
Message-ID: <c6fcfb91f1afe9b2f3dde478567e25fa74ebc99e.camel@linux.ibm.com> (raw)
In-Reply-To: <20261106110440.3552588-2-armbru@redhat.com>
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Thanks,
Glenn
On Fri, 2026-11-06 at 12:04 +0100, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> hw/gpio/pca9552.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c
> index 90ccf5170e..65a718ef31 100644
> --- a/hw/gpio/pca9552.c
> +++ b/hw/gpio/pca9552.c
> @@ -557,10 +557,8 @@ static void pca9535_reset_hold(Object *obj, ResetType type)
> s->len = 0;
> }
>
> -static void pca955x_initfn(Object *obj)
> +static void pca955x_pin_init(PCA955xClass *k)
> {
> - PCA955xClass *k = PCA955X_GET_CLASS(obj);
> -
> assert(k->pin_count <= PCA955X_PIN_COUNT_MAX);
> for (int ix = 0; ix < k->pin_count; ix++) {
> char *name;
> @@ -568,13 +566,17 @@ static void pca955x_initfn(Object *obj)
> if (k->has_led_support) {
> /* LED variant: expose the LED selector state as led%d. */
> name = g_strdup_printf("led%d", ix);
> - object_property_add(obj, name, "str", &str_type_info,
> - pca955x_get_led, pca955x_set_led, NULL, NULL);
> + object_class_property_add(OBJECT_CLASS(k), name,
> + "str", &str_type_info,
> + pca955x_get_led, pca955x_set_led,
> + NULL, NULL);
> } else {
> /* GPIO variant: expose the pin logic level as pin%d. */
> name = g_strdup_printf("pin%d", ix);
> - object_property_add(obj, name, "str", &str_type_info,
> - pca955x_get_pin, pca955x_set_pin, NULL, NULL);
> + object_class_property_add(OBJECT_CLASS(k), name,
> + "str", &str_type_info,
> + pca955x_get_pin, pca955x_set_pin,
> + NULL, NULL);
> }
> g_free(name);
> }
> @@ -640,6 +642,7 @@ static void pca9552_class_init(ObjectClass *oc, const void *data)
> pc->max_reg = PCA9552_LS3;
> pc->pin_count = 16;
> pc->has_led_support = true;
> + pca955x_pin_init(pc);
> }
>
> static void pca95x5_class_init(ObjectClass *oc, const void *data)
> @@ -653,13 +656,13 @@ static void pca95x5_class_init(ObjectClass *oc, const void *data)
> pc->max_reg = PCA9535_CONFIG1;
> pc->pin_count = 16;
> pc->has_led_support = false;
> + pca955x_pin_init(pc);
> }
>
> static const TypeInfo pca955x_types[] = {
> {
> .name = TYPE_PCA955X,
> .parent = TYPE_I2C_SLAVE,
> - .instance_init = pca955x_initfn,
> .instance_size = sizeof(PCA955xState),
> .class_init = pca955x_class_init,
> .class_size = sizeof(PCA955xClass),
next prev parent reply other threads:[~2026-11-06 20:18 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 11:04 [PATCH 0/8] hw/gpio/pca955x: Improvements around props "pin" and "led" Markus Armbruster
2026-11-06 11:04 ` [PATCH 1/8] hw/gpio/pca9552: Convert pin and led properties to class properties Markus Armbruster
2026-11-06 20:17 ` Miles Glenn [this message]
2026-11-09 8:51 ` Mark Cave-Ayland
2026-11-06 11:04 ` [PATCH 2/8] hw/gpio/pca9554: Move most code from .h to .c Markus Armbruster
2026-11-06 20:18 ` Miles Glenn
2026-11-09 8:55 ` Mark Cave-Ayland
2026-11-09 9:40 ` Markus Armbruster
2026-11-06 11:04 ` [PATCH 3/8] hw/gpio/pca9554: Simplify QOM type creation Markus Armbruster
2026-11-06 20:19 ` Miles Glenn
2026-11-09 8:56 ` Mark Cave-Ayland
2026-11-06 11:04 ` [PATCH 4/8] hw/gpio/pca9554: New abstract base "pca9554-base" Markus Armbruster
2026-11-06 20:19 ` Miles Glenn
2026-11-09 9:02 ` Mark Cave-Ayland
2026-11-09 10:17 ` Mark Cave-Ayland
2026-11-09 11:56 ` Markus Armbruster
2026-11-09 14:20 ` Mark Cave-Ayland
2026-11-09 14:44 ` Markus Armbruster
2026-11-09 10:24 ` Markus Armbruster
2026-11-09 13:52 ` BALATON Zoltan
2026-11-09 14:17 ` Markus Armbruster
2026-11-06 11:04 ` [PATCH 5/8] hw/gpio/pca9554: Convert pin properties to class properties Markus Armbruster
2026-11-06 20:20 ` Miles Glenn
2026-11-09 9:03 ` Mark Cave-Ayland
2026-11-06 11:04 ` [PATCH 6/8] hw/gpio/pca955x: use QAPI enums for led and pin properties Markus Armbruster
2026-11-06 20:20 ` Miles Glenn
2026-11-09 9:05 ` Mark Cave-Ayland
2026-11-09 10:20 ` Markus Armbruster
2026-11-06 11:04 ` [PATCH 7/8] hw/gpio/pca955x: Improve @qapi-type reported by qom-list etc Markus Armbruster
2026-11-06 20:21 ` Miles Glenn
2026-11-09 9:06 ` Mark Cave-Ayland
2026-11-06 11:04 ` [PATCH 8/8] hw/gpio/pca955x: Simplify pin and led getters and setters Markus Armbruster
2026-11-06 20:21 ` Miles Glenn
2026-11-09 9:09 ` Mark Cave-Ayland
2026-11-09 10:19 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c6fcfb91f1afe9b2f3dde478567e25fa74ebc99e.camel@linux.ibm.com \
--to=milesg@linux.ibm.com \
--cc=armbru@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mark.caveayland@nutanix.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.