Skip to content

hw/gpio/pca955x: Improvements around props "pin" and "led"

Markus Armbruster qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 26 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8hw/gpio/pca9552: Convert pin and led properties to class propertieshw/gpio/pca9552.c+11 -82 replies
2/8hw/gpio/pca9554: Move most code from .h to .chw/gpio/pca9554.c include/hw/gpio/pca9554.h+24 -253 replies
3/8hw/gpio/pca9554: Simplify QOM type creationhw/gpio/pca9554.c+2 -82 replies
4/8hw/gpio/pca9554: New abstract base "pca9554-base"hw/gpio/pca9554.c include/hw/gpio/pca9554.h+33 -239 replies
5/8hw/gpio/pca9554: Convert pin properties to class propertieshw/gpio/pca9554.c+8 -72 replies
6/8hw/gpio/pca955x: use QAPI enums for led and pin propertieshw/gpio/pca9552.c hw/gpio/pca9554.c qapi/machine.json+69 -713 replies
7/8hw/gpio/pca955x: Improve @qapi-type reported by qom-list etc.hw/gpio/pca9552.c hw/gpio/pca9554.c+5 -52 replies
8/8hw/gpio/pca955x: Simplify pin and led getters and settershw/gpio/pca9552.c hw/gpio/pca9554.c+25 -653 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchGlenn MilesMark Cave-Ayland
1/8R-b R-b
2/8R-b R-b
3/8R-b R-b
4/8R-b
5/8R-b R-b
6/8R-b
7/8R-b R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/8] hw/gpio/pca955x: Improvements around props "pin" and "led"

Marc-André converted properties "pin" and "led" to QAPI enums in his "qom/qdev: associate properties with QAPI schema types". I dropped this part from v8, which has since been merged in commit c5fee4d93fd. I'm now bringing it back, reworked.

PATCH 1-5 convert these properties to class properties. See commit 7674a1880890 (qom: deprecate use of instance level properties) for why.

PATCH 6 is Marc-André's "[PATCH v7 48/65] hw/gpio/pca955x: use QAPI enums for led and pin properties" with the following tweaks:

* I don't change their @type in output of qom-list, qom-list-properties, qom-list-get, because that what the merged version of his series did.

* I replaced identical QAPI enums Pca9552PinState and Pca9554PinState by a single enum GpioPinState.

PATCH 7+8 replace Marc-André's "[PATCH v7 50/65] hw/gpio/pca955x:
convert pin/led property to QAPI-aware enum". Marc-André's used object_property_add_qapi_enum() (which has since been folded into object_property_add_enum()), but to be able to use it, he had to bake the index into getter and the setter functions. He generated them with the preprocessor. My version sticks to object_class_property_add(), so we can pass the index to getter and setter via parameter @opaque. Getter and setter remain slightly more complex, but don't turn into macros (decorated with backslashes) for sixteenfold duplication.

Perhaps object_class_property_add_enum() should support passing an opaque value to getter and setter.

Based-on: <[email protected]>

Marc-André Lureau (1):
hw/gpio/pca955x: use QAPI enums for led and pin properties

Markus Armbruster (7):
hw/gpio/pca9552: Convert pin and led properties to class properties hw/gpio/pca9554: Move most code from .h to .c hw/gpio/pca9554: Simplify QOM type creation hw/gpio/pca9554: New abstract base "pca9554-base" hw/gpio/pca9554: Convert pin properties to class properties hw/gpio/pca955x: Improve @qapi-type reported by qom-list etc. hw/gpio/pca955x: Simplify pin and led getters and setters

 qapi/machine.json         |  29 ++++++++
 include/hw/gpio/pca9554.h |  26 +------
 hw/gpio/pca9552.c         | 149 +++++++++++++------------------------
 hw/gpio/pca9554.c         | 151 +++++++++++++++++++-------------------
 4 files changed, 160 insertions(+), 195 deletions(-)
Signature · 1 line
2.55.0