Skip to contentSkip to conversation

hw: Categorize few devices and add their descriptions

PATCH In review Philippe Mathieu-Daudé 5 participants 31 messages Mar 25, 2025 – Mar 31, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover hw: Categorize few devices and add their descriptions

Few devices are user-creatable but miss a description, and sometimes are not categorized (or mis-categorized).

Some, being qdev and not sysbus, are automatically user-creatable, but are part of SoC.

Fix that.

Philippe Mathieu-Daudé (12):
hw/audio/wm8750: Categorize and add description hw/block/m25p80: Categorize and add description hw/display/dm163: Add description hw/dma/i82374: Categorize and add description hw/gpio/pca9552: Categorize and add description hw/i2c/pca954x: Categorize and add description hw/misc/axp2xx: Categorize and add description hw/misc/pll: Do not expose as user-creatable hw/nvram/xlnx-efuse: Do not expose as user-creatable hw/rtc: Categorize and add description hw/sensor/temp: Categorize and add description hw/s390x/zpci: Re-categorize as BRIDGE

 hw/audio/wm8750.c        | 2 ++
 hw/block/m25p80.c        | 2 ++
 hw/display/dm163.c       | 2 +-
 hw/dma/i82374.c          | 2 ++
 hw/gpio/pca9552.c        | 2 ++
 hw/i2c/i2c_mux_pca954x.c | 8 +++++++-
 hw/misc/axp2xx.c         | 5 +++++
 hw/misc/bcm2835_cprman.c | 8 ++++++++
 hw/misc/npcm_clk.c       | 6 ++++++
 hw/misc/stm32l4x5_rcc.c  | 4 ++++
 hw/nvram/xlnx-efuse.c    | 2 ++
 hw/rtc/ds1338.c          | 2 ++
 hw/rtc/m41t80.c          | 2 ++
 hw/rtc/rs5c372.c         | 2 ++
 hw/s390x/s390-pci-bus.c  | 2 +-
 hw/sensor/dps310.c       | 2 ++
 hw/sensor/emc141x.c      | 6 ++++++
 hw/sensor/tmp105.c       | 2 ++
 hw/sensor/tmp421.c       | 4 ++++
 19 files changed, 62 insertions(+), 3 deletions(-)
Signature · 1 line
2.47.1
#1 lore raw

PATCH 1/12 hw/audio/wm8750: Categorize and add description

---
 hw/audio/wm8750.c | 2 ++
 1 file changed, 2 insertions(+)
hw/audio/wm8750.c +2 -0
index 8d381dbc658..6c1bb20fb75 100644
@@ -721,6 +721,8 @@ static void wm8750_class_init(ObjectClass *klass, void *data)
     sc->send = wm8750_tx;
     dc->vmsd = &vmstate_wm8750;
     device_class_set_props(dc, wm8750_properties);
+    set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
+    dc->desc = "WM8750 Stereo CODEC";
 }
 
 static const TypeInfo wm8750_info = {
Signature · 1 line
2.47.1
Reviewed-by on v1 1/12
#2 lore raw

Re: [PATCH-for-10.0 01/12] hw/audio/wm8750: Categorize and add description

Quoted 10 lines · Philippe Mathieu-Daudé
---
  hw/audio/wm8750.c | 2 ++
  1 file changed, 2 insertions(+)
hw/audio/wm8750.c +0 -0
index 8d381dbc658..6c1bb20fb75 100644

hw/audio/wm8750.c static void wm8750_class_init(ObjectClass *klass, void *data) · line 728

Quoted 8 lines
hw/audio/wm8750.c +2 -0
@@ -721,6 +721,8 @@ static void wm8750_class_init(ObjectClass *klass, void *data)
      sc->send = wm8750_tx;
      dc->vmsd = &vmstate_wm8750;
      device_class_set_props(dc, wm8750_properties);
+    set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
+    dc->desc = "WM8750 Stereo CODEC";
  }
 
  static const TypeInfo wm8750_info = {
#3 lore raw

Re: [PATCH-for-10.0 01/12] hw/audio/wm8750: Categorize and add description

Quoted 6 lines · Thomas Huth
Quoted 5 lines · Philippe Mathieu-Daudé

---
  hw/audio/wm8750.c | 2 ++

  1 file changed, 2 insertions(+)
Quoted 15 lines

hw/audio/wm8750.c static void wm8750_class_init(ObjectClass *klass, void · line 728

Quoted 13 lines
hw/audio/wm8750.c +2 -0
index 8d381dbc658..6c1bb20fb75 100644
@@ -721,6 +721,8 @@ static void wm8750_class_init(ObjectClass *klass, void 
 *data)
       sc->send = wm8750_tx;
       dc->vmsd = &vmstate_wm8750;
       device_class_set_props(dc, wm8750_properties);
+    set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
+    dc->desc = "WM8750 Stereo CODEC";
   }
   static const TypeInfo wm8750_info = {

Looking at this twice, I think the patch is not OK in its current shape: The wm8750 device now shows up twice in the output of "-device help", once in the "Sound" category and once in the "Misc" category (inherited from I2C device). That's somewhat ugly. I guess you'd need to remove the MISC bit here to clean that up?

Thomas

#4 lore raw

Re: [PATCH-for-10.0 01/12] hw/audio/wm8750: Categorize and add description

Quoted 23 lines · Thomas Huth
Quoted 6 lines · Thomas Huth
Quoted 5 lines · Philippe Mathieu-Daudé

---
  hw/audio/wm8750.c | 2 ++

  1 file changed, 2 insertions(+)
Quoted 15 lines

hw/audio/wm8750.c static void wm8750_class_init(ObjectClass *klass, void · line 728

Quoted 13 lines
hw/audio/wm8750.c +2 -0
index 8d381dbc658..6c1bb20fb75 100644
@@ -721,6 +721,8 @@ static void wm8750_class_init(ObjectClass *klass, void 
 *data)
       sc->send = wm8750_tx;
       dc->vmsd = &vmstate_wm8750;
       device_class_set_props(dc, wm8750_properties);
+    set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
+    dc->desc = "WM8750 Stereo CODEC";
   }
   static const TypeInfo wm8750_info = {
Quoted 1 line

Looking at this twice, I think the patch is not OK in its current shape: The wm8750 device now shows up twice in the output of "-device help", once in the "Sound" category and once in the "Misc" category (inherited from I2C device). That's somewhat ugly. I guess you'd need to remove the MISC bit here to clean that up?

Maybe we could add an i2c category for those devices? But in this case it fits in multiple categories.

Regards,
BALATON Zoltan

#5 lore raw

Re: [PATCH-for-10.0 01/12] hw/audio/wm8750: Categorize and add description

Quoted 24 lines · BALATON Zoltan
Quoted 23 lines · Thomas Huth
Quoted 21 lines · Thomas Huth
Quoted 10 lines · Philippe Mathieu-Daudé

---
  hw/audio/wm8750.c | 2 ++

  1 file changed, 2 insertions(+)
hw/audio/wm8750.c +0 -0
index 8d381dbc658..6c1bb20fb75 100644

hw/audio/wm8750.c static void wm8750_class_init(ObjectClass *klass, · line 728

Quoted 8 lines
hw/audio/wm8750.c +2 -0
@@ -721,6 +721,8 @@ static void wm8750_class_init(ObjectClass *klass, 
 void *data)
       sc->send = wm8750_tx;
       dc->vmsd = &vmstate_wm8750;
       device_class_set_props(dc, wm8750_properties);
+    set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
+    dc->desc = "WM8750 Stereo CODEC";
   }
   static const TypeInfo wm8750_info = {
Quoted 3 lines
Quoted 1 line

Looking at this twice, I think the patch is not OK in its current shape: The wm8750 device now shows up twice in the output of "-device help", once in the "Sound" category and once in the "Misc" category (inherited from I2C device). That's somewhat ugly. I guess you'd need to remove the MISC bit here to clean that up?

Maybe we could add an i2c category for those devices? But in this case it fits in multiple categories.

I think we should aim for the most specific category only. For example, we also have things like "usb-mouse" or "usb-tablet", but these only show up in the "input" category, and not in the "USB device" category.

By the way, it's somewhat weird that we have a USB category, but not a PCI or I2C category ... maybe we should rather get rid of that USB category and classify the HCDs as "controller/bridges" like we do it for the PCI host controllers?

Thomas

#6 lore raw

PATCH 2/12 hw/block/m25p80: Categorize and add description

In reply to Philippe Mathieu-Daudé
---
 hw/block/m25p80.c | 2 ++
 1 file changed, 2 insertions(+)
hw/block/m25p80.c +2 -0
index b84c6afb327..0887c103e4f 100644
@@ -1870,7 +1870,9 @@ static void m25p80_class_init(ObjectClass *klass, void *data)
     dc->vmsd = &vmstate_m25p80;
     device_class_set_props(dc, m25p80_properties);
     device_class_set_legacy_reset(dc, m25p80_reset);
+    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
     mc->pi = data;
+    dc->desc = "Serial Flash";
 }
 
 static const TypeInfo m25p80_info = {
Signature · 1 line
2.47.1
Reviewed-by on v1 2/12
#7 lore raw

Re: [PATCH-for-10.0 02/12] hw/block/m25p80: Categorize and add description

Quoted 10 lines · Philippe Mathieu-Daudé
---
  hw/block/m25p80.c | 2 ++
  1 file changed, 2 insertions(+)
hw/block/m25p80.c +0 -0
index b84c6afb327..0887c103e4f 100644

hw/block/m25p80.c static void m25p80_class_init(ObjectClass *klass, void *data) · line 1878

Quoted 9 lines
hw/block/m25p80.c +2 -0
@@ -1870,7 +1870,9 @@ static void m25p80_class_init(ObjectClass *klass, void *data)
      dc->vmsd = &vmstate_m25p80;
      device_class_set_props(dc, m25p80_properties);
      device_class_set_legacy_reset(dc, m25p80_reset);
+    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
      mc->pi = data;
+    dc->desc = "Serial Flash";
  }
 
  static const TypeInfo m25p80_info = {
#8 lore raw

PATCH 3/12 hw/display/dm163: Add description

In reply to Philippe Mathieu-Daudé
---
 hw/display/dm163.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/dm163.c +1 -1
index 75a91f62bd3..f6f0ec0c632 100644
@@ -330,7 +330,7 @@ static void dm163_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
     ResettableClass *rc = RESETTABLE_CLASS(klass);
 
-    dc->desc = "DM163";
+    dc->desc = "DM163 8x3-channel constant current LED driver";
     dc->vmsd = &vmstate_dm163;
     dc->realize = dm163_realize;
     rc->phases.hold = dm163_reset_hold;
Signature · 1 line
2.47.1
Reviewed-by on v1 3/12
#9 lore raw

Re: [PATCH-for-10.0 03/12] hw/display/dm163: Add description

Quoted 10 lines · Philippe Mathieu-Daudé
---
  hw/display/dm163.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/dm163.c +0 -0
index 75a91f62bd3..f6f0ec0c632 100644

hw/display/dm163.c static void dm163_class_init(ObjectClass *klass, void *data) · line 336

Quoted 8 lines
hw/display/dm163.c +1 -1
@@ -330,7 +330,7 @@ static void dm163_class_init(ObjectClass *klass, void *data)
      DeviceClass *dc = DEVICE_CLASS(klass);
      ResettableClass *rc = RESETTABLE_CLASS(klass);
 
-    dc->desc = "DM163";
+    dc->desc = "DM163 8x3-channel constant current LED driver";
      dc->vmsd = &vmstate_dm163;
      dc->realize = dm163_realize;
      rc->phases.hold = dm163_reset_hold;
#10 lore raw

PATCH 4/12 hw/dma/i82374: Categorize and add description

In reply to Philippe Mathieu-Daudé
---
 hw/dma/i82374.c | 2 ++
 1 file changed, 2 insertions(+)
hw/dma/i82374.c +2 -0
index 9652d47adcd..0bf69ef399b 100644
@@ -150,6 +150,8 @@ static void i82374_class_init(ObjectClass *klass, void *data)
     dc->realize = i82374_realize;
     dc->vmsd = &vmstate_i82374;
     device_class_set_props(dc, i82374_properties);
+    dc->desc = "Intel 82374 DMA controller";
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo i82374_info = {
Signature · 1 line
2.47.1
Reviewed-by on v1 4/12
#11 lore raw

Re: [PATCH-for-10.0 04/12] hw/dma/i82374: Categorize and add description

Quoted 10 lines · Philippe Mathieu-Daudé
---
  hw/dma/i82374.c | 2 ++
  1 file changed, 2 insertions(+)
hw/dma/i82374.c +0 -0
index 9652d47adcd..0bf69ef399b 100644

hw/dma/i82374.c static void i82374_class_init(ObjectClass *klass, void *data) · line 157

Quoted 8 lines
hw/dma/i82374.c +2 -0
@@ -150,6 +150,8 @@ static void i82374_class_init(ObjectClass *klass, void *data)
      dc->realize = i82374_realize;
      dc->vmsd = &vmstate_i82374;
      device_class_set_props(dc, i82374_properties);
+    dc->desc = "Intel 82374 DMA controller";
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
  }
 
  static const TypeInfo i82374_info = {
#12 lore raw

PATCH 5/12 hw/gpio/pca9552: Categorize and add description

In reply to Philippe Mathieu-Daudé
---
 hw/gpio/pca9552.c | 2 ++
 1 file changed, 2 insertions(+)
hw/gpio/pca9552.c +2 -0
index 1ac0cf6c464..b152872f6c6 100644
@@ -459,6 +459,8 @@ static void pca9552_class_init(ObjectClass *oc, void *data)
     DeviceClass *dc = DEVICE_CLASS(oc);
     PCA955xClass *pc = PCA955X_CLASS(oc);
 
+    dc->desc = "PCA9552 LED blinker";
+    set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
     device_class_set_legacy_reset(dc, pca9552_reset);
     dc->vmsd = &pca9552_vmstate;
     pc->max_reg = PCA9552_LS3;
Signature · 1 line
2.47.1
#13 lore raw

Re: [PATCH-for-10.0 05/12] hw/gpio/pca9552: Categorize and add description

Quoted 10 lines · Philippe Mathieu-Daudé
---
  hw/gpio/pca9552.c | 2 ++
  1 file changed, 2 insertions(+)
hw/gpio/pca9552.c +0 -0
index 1ac0cf6c464..b152872f6c6 100644

hw/gpio/pca9552.c static void pca9552_class_init(ObjectClass *oc, void *data) · line 466

Quoted 8 lines
hw/gpio/pca9552.c +2 -0
@@ -459,6 +459,8 @@ static void pca9552_class_init(ObjectClass *oc, void *data)
      DeviceClass *dc = DEVICE_CLASS(oc);
      PCA955xClass *pc = PCA955X_CLASS(oc);
 
+    dc->desc = "PCA9552 LED blinker";
+    set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
      device_class_set_legacy_reset(dc, pca9552_reset);
      dc->vmsd = &pca9552_vmstate;
      pc->max_reg = PCA9552_LS3;

I2C device - same problem as in patch 1 : Unset MISC category here?

Thomas

#14 lore raw

PATCH 6/12 hw/i2c/pca954x: Categorize and add description

In reply to Philippe Mathieu-Daudé
---
 hw/i2c/i2c_mux_pca954x.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
hw/i2c/i2c_mux_pca954x.c +7 -1
index 779cc4e66ed..100b8d86093 100644
@@ -175,12 +175,18 @@ I2CBus *pca954x_i2c_get_bus(I2CSlave *mux, uint8_t channel)
 static void pca9546_class_init(ObjectClass *klass, void *data)
 {
     Pca954xClass *s = PCA954X_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->desc = "PCA9546 I2C multiplexer";
     s->nchans = PCA9546_CHANNEL_COUNT;
 }
 
 static void pca9548_class_init(ObjectClass *klass, void *data)
 {
     Pca954xClass *s = PCA954X_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->desc = "PCA9548 I2C multiplexer";
     s->nchans = PCA9548_CHANNEL_COUNT;
 }
 
@@ -226,13 +232,13 @@ static void pca954x_class_init(ObjectClass *klass, void *data)
 
     rc->phases.enter = pca954x_enter_reset;
 
-    dc->desc = "Pca954x i2c-mux";
     dc->realize = pca954x_realize;
 
     k->write_data = pca954x_write_data;
     k->receive_byte = pca954x_read_byte;
 
     device_class_set_props(dc, pca954x_props);
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
 static const TypeInfo pca954x_info[] = {
Signature · 1 line
2.47.1
Acked-by on v1 6/12
#15 lore raw

Re: [PATCH-for-10.0 06/12] hw/i2c/pca954x: Categorize and add description

Quoted 4 lines · Philippe Mathieu-Daudé
---
 hw/i2c/i2c_mux_pca954x.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Looks ok to me.

Quoted 43 lines
hw/i2c/i2c_mux_pca954x.c +7 -1
index 779cc4e66ed..100b8d86093 100644
@@ -175,12 +175,18 @@ I2CBus *pca954x_i2c_get_bus(I2CSlave *mux, uint8_t channel)
 static void pca9546_class_init(ObjectClass *klass, void *data)
 {
     Pca954xClass *s = PCA954X_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->desc = "PCA9546 I2C multiplexer";
     s->nchans = PCA9546_CHANNEL_COUNT;
 }
 
 static void pca9548_class_init(ObjectClass *klass, void *data)
 {
     Pca954xClass *s = PCA954X_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->desc = "PCA9548 I2C multiplexer";
     s->nchans = PCA9548_CHANNEL_COUNT;
 }
 
@@ -226,13 +232,13 @@ static void pca954x_class_init(ObjectClass *klass, void *data)
 
     rc->phases.enter = pca954x_enter_reset;
 
-    dc->desc = "Pca954x i2c-mux";
     dc->realize = pca954x_realize;
 
     k->write_data = pca954x_write_data;
     k->receive_byte = pca954x_read_byte;
 
     device_class_set_props(dc, pca954x_props);
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
 static const TypeInfo pca954x_info[] = {
Signature · 1 line
2.47.1
#16 lore raw

Re: [PATCH-for-10.0 06/12] hw/i2c/pca954x: Categorize and add description

In reply to Philippe Mathieu-Daudé
Quoted 30 lines · Philippe Mathieu-Daudé
---
  hw/i2c/i2c_mux_pca954x.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
hw/i2c/i2c_mux_pca954x.c +6 -0
index 779cc4e66ed..100b8d86093 100644
@@ -175,12 +175,18 @@ I2CBus *pca954x_i2c_get_bus(I2CSlave *mux, uint8_t channel)
  static void pca9546_class_init(ObjectClass *klass, void *data)
  {
      Pca954xClass *s = PCA954X_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->desc = "PCA9546 I2C multiplexer";
      s->nchans = PCA9546_CHANNEL_COUNT;
  }
 
  static void pca9548_class_init(ObjectClass *klass, void *data)
  {
      Pca954xClass *s = PCA954X_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->desc = "PCA9548 I2C multiplexer";
      s->nchans = PCA9548_CHANNEL_COUNT;
  }
 
@@ -226,13 +232,13 @@ static void pca954x_class_init(ObjectClass *klass, void *data)
 

hw/i2c/i2c_mux_pca954x.c static void pca954x_class_init(ObjectClass *klass, void *data) · line 241

Quoted 10 lines
hw/i2c/i2c_mux_pca954x.c +1 -1
      rc->phases.enter = pca954x_enter_reset;
 
-    dc->desc = "Pca954x i2c-mux";
      dc->realize = pca954x_realize;
 
      k->write_data = pca954x_write_data;
      k->receive_byte = pca954x_read_byte;
 
      device_class_set_props(dc, pca954x_props);
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);

Clear DEVICE_CATEGORY_MISC ?

Thomas

#17 lore raw

PATCH 7/12 hw/misc/axp2xx: Categorize and add description

In reply to Philippe Mathieu-Daudé
---
 hw/misc/axp2xx.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/misc/axp2xx.c +5 -0
index af646878cd2..747af430479 100644
@@ -232,6 +232,7 @@ static void axp2xx_class_init(ObjectClass *oc, void *data)
     ResettableClass *rc = RESETTABLE_CLASS(oc);
 
     rc->phases.enter = axp2xx_reset_enter;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     dc->vmsd = &vmstate_axp2xx;
     isc->event = axp2xx_event;
     isc->recv = axp2xx_rx;
@@ -250,7 +251,9 @@ static const TypeInfo axp2xx_info = {
 static void axp209_class_init(ObjectClass *oc, void *data)
 {
     AXP2xxClass *sc = AXP2XX_CLASS(oc);
+    DeviceClass *dc = DEVICE_CLASS(oc);
 
+    dc->desc = "AXP209 power system management";
     sc->reset_enter = axp209_reset_enter;
 }
 
@@ -263,7 +266,9 @@ static const TypeInfo axp209_info = {
 static void axp221_class_init(ObjectClass *oc, void *data)
 {
     AXP2xxClass *sc = AXP2XX_CLASS(oc);
+    DeviceClass *dc = DEVICE_CLASS(oc);
 
+    dc->desc = "AXP221 power system management";
     sc->reset_enter = axp221_reset_enter;
 }
 
Signature · 1 line
2.47.1
#18 lore raw

Re: [PATCH-for-10.0 07/12] hw/misc/axp2xx: Categorize and add description

Quoted 10 lines · Philippe Mathieu-Daudé
---
  hw/misc/axp2xx.c | 5 +++++
  1 file changed, 5 insertions(+)
hw/misc/axp2xx.c +0 -0
index af646878cd2..747af430479 100644

hw/misc/axp2xx.c static void axp2xx_class_init(ObjectClass *oc, void *data) · line 235

Quoted 4 lines
hw/misc/axp2xx.c +1 -0
@@ -232,6 +232,7 @@ static void axp2xx_class_init(ObjectClass *oc, void *data)
      ResettableClass *rc = RESETTABLE_CLASS(oc);
 
      rc->phases.enter = axp2xx_reset_enter;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);

That should not be necessary - since I2C devices are in the MISC category by default.

Thomas

Quoted 23 lines
hw/misc/axp2xx.c +4 -0
      dc->vmsd = &vmstate_axp2xx;
      isc->event = axp2xx_event;
      isc->recv = axp2xx_rx;
@@ -250,7 +251,9 @@ static const TypeInfo axp2xx_info = {
  static void axp209_class_init(ObjectClass *oc, void *data)
  {
      AXP2xxClass *sc = AXP2XX_CLASS(oc);
+    DeviceClass *dc = DEVICE_CLASS(oc);
 
+    dc->desc = "AXP209 power system management";
      sc->reset_enter = axp209_reset_enter;
  }
 
@@ -263,7 +266,9 @@ static const TypeInfo axp209_info = {
  static void axp221_class_init(ObjectClass *oc, void *data)
  {
      AXP2xxClass *sc = AXP2XX_CLASS(oc);
+    DeviceClass *dc = DEVICE_CLASS(oc);
 
+    dc->desc = "AXP221 power system management";
      sc->reset_enter = axp221_reset_enter;
  }
 
#19 lore raw

PATCH 8/12 hw/misc/pll: Do not expose as user-creatable

In reply to Philippe Mathieu-Daudé

All these devices are part of SoC components and can not be created manually.

---
 hw/misc/bcm2835_cprman.c | 8 ++++++++
 hw/misc/npcm_clk.c       | 6 ++++++
 hw/misc/stm32l4x5_rcc.c  | 4 ++++
 3 files changed, 18 insertions(+)
hw/misc/bcm2835_cprman.c +8 -0
index aa14cd931f5..0c4d4b7de50 100644
@@ -137,6 +137,8 @@ static void pll_class_init(ObjectClass *klass, void *data)
 
     device_class_set_legacy_reset(dc, pll_reset);
     dc->vmsd = &pll_vmstate;
+    /* Reason: Part of BCM2835CprmanState component */
+    dc->user_creatable = false;
 }
 
 static const TypeInfo cprman_pll_info = {
@@ -241,6 +243,8 @@ static void pll_channel_class_init(ObjectClass *klass, void *data)
 
     device_class_set_legacy_reset(dc, pll_channel_reset);
     dc->vmsd = &pll_channel_vmstate;
+    /* Reason: Part of BCM2835CprmanState component */
+    dc->user_creatable = false;
 }
 
 static const TypeInfo cprman_pll_channel_info = {
@@ -362,6 +366,8 @@ static void clock_mux_class_init(ObjectClass *klass, void *data)
 
     device_class_set_legacy_reset(dc, clock_mux_reset);
     dc->vmsd = &clock_mux_vmstate;
+    /* Reason: Part of BCM2835CprmanState component */
+    dc->user_creatable = false;
 }
 
 static const TypeInfo cprman_clock_mux_info = {
@@ -416,6 +422,8 @@ static void dsi0hsck_mux_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
 
     dc->vmsd = &dsi0hsck_mux_vmstate;
+    /* Reason: Part of BCM2835CprmanState component */
+    dc->user_creatable = false;
 }
 
 static const TypeInfo cprman_dsi0hsck_mux_info = {
hw/misc/npcm_clk.c +6 -0
index 0e85974cf96..b6a893ffb22 100644
@@ -1108,6 +1108,8 @@ static void npcm7xx_clk_pll_class_init(ObjectClass *klass, void *data)
 
     dc->desc = "NPCM7xx Clock PLL Module";
     dc->vmsd = &vmstate_npcm7xx_clk_pll;
+    /* Reason: Part of NPCMCLKState component */
+    dc->user_creatable = false;
 }
 
 static void npcm7xx_clk_sel_class_init(ObjectClass *klass, void *data)
@@ -1116,6 +1118,8 @@ static void npcm7xx_clk_sel_class_init(ObjectClass *klass, void *data)
 
     dc->desc = "NPCM7xx Clock SEL Module";
     dc->vmsd = &vmstate_npcm7xx_clk_sel;
+    /* Reason: Part of NPCMCLKState component */
+    dc->user_creatable = false;
 }
 
 static void npcm7xx_clk_divider_class_init(ObjectClass *klass, void *data)
@@ -1124,6 +1128,8 @@ static void npcm7xx_clk_divider_class_init(ObjectClass *klass, void *data)
 
     dc->desc = "NPCM7xx Clock Divider Module";
     dc->vmsd = &vmstate_npcm7xx_clk_divider;
+    /* Reason: Part of NPCMCLKState component */
+    dc->user_creatable = false;
 }
 
 static void npcm_clk_class_init(ObjectClass *klass, void *data)
hw/misc/stm32l4x5_rcc.c +4 -0
index fd8466dff34..158b743cae7 100644
@@ -150,6 +150,8 @@ static void clock_mux_class_init(ObjectClass *klass, void *data)
     rc->phases.hold = clock_mux_reset_hold;
     rc->phases.exit = clock_mux_reset_exit;
     dc->vmsd = &clock_mux_vmstate;
+    /* Reason: Part of Stm32l4x5RccState component */
+    dc->user_creatable = false;
 }
 
 static void clock_mux_set_enable(RccClockMuxState *mux, bool enabled)
@@ -302,6 +304,8 @@ static void pll_class_init(ObjectClass *klass, void *data)
     rc->phases.hold = pll_reset_hold;
     rc->phases.exit = pll_reset_exit;
     dc->vmsd = &pll_vmstate;
+    /* Reason: Part of Stm32l4x5RccState component */
+    dc->user_creatable = false;
 }
 
 static void pll_set_vco_multiplier(RccPllState *pll, uint32_t vco_multiplier)
Signature · 1 line
2.47.1
Reviewed-by on v1 8/12
#20 lore raw

Re: [PATCH-for-10.0 08/12] hw/misc/pll: Do not expose as user-creatable

Quoted 9 lines · Philippe Mathieu-Daudé

All these devices are part of SoC components and can not be created manually.

---
  hw/misc/bcm2835_cprman.c | 8 ++++++++
  hw/misc/npcm_clk.c       | 6 ++++++
  hw/misc/stm32l4x5_rcc.c  | 4 ++++
  3 files changed, 18 insertions(+)
#21 lore raw

PATCH 9/12 hw/nvram/xlnx-efuse: Do not expose as user-creatable

In reply to Philippe Mathieu-Daudé

This device is part of SoC components thus can not be created manually.

---
 hw/nvram/xlnx-efuse.c | 2 ++
 1 file changed, 2 insertions(+)
hw/nvram/xlnx-efuse.c +2 -0
index 29e7dd539ec..176e88fcd17 100644
@@ -280,6 +280,8 @@ static void efuse_class_init(ObjectClass *klass, void *data)
 
     dc->realize = efuse_realize;
     device_class_set_props(dc, efuse_properties);
+    /* Reason: Part of Xilinx SoC */
+    dc->user_creatable = false;
 }
 
 static const TypeInfo efuse_info = {
Signature · 1 line
2.47.1
Reviewed-by on v1 9/12
#22 lore raw

Re: [PATCH-for-10.0 09/12] hw/nvram/xlnx-efuse: Do not expose as user-creatable

Quoted 13 lines · Philippe Mathieu-Daudé

This device is part of SoC components thus can not be created manually.

---
  hw/nvram/xlnx-efuse.c | 2 ++
  1 file changed, 2 insertions(+)
hw/nvram/xlnx-efuse.c +0 -0
index 29e7dd539ec..176e88fcd17 100644

hw/nvram/xlnx-efuse.c static void efuse_class_init(ObjectClass *klass, void *data) · line 287

Quoted 8 lines
hw/nvram/xlnx-efuse.c +2 -0
@@ -280,6 +280,8 @@ static void efuse_class_init(ObjectClass *klass, void *data)
 
      dc->realize = efuse_realize;
      device_class_set_props(dc, efuse_properties);
+    /* Reason: Part of Xilinx SoC */
+    dc->user_creatable = false;
  }
 
  static const TypeInfo efuse_info = {
#23 lore raw

PATCH 10/12 hw/rtc: Categorize and add description

In reply to Philippe Mathieu-Daudé
---
 hw/rtc/ds1338.c  | 2 ++
 hw/rtc/m41t80.c  | 2 ++
 hw/rtc/rs5c372.c | 2 ++
 3 files changed, 6 insertions(+)
hw/rtc/ds1338.c +2 -0
index 8dd17fdc07c..56162917c1b 100644
@@ -230,6 +230,8 @@ static void ds1338_class_init(ObjectClass *klass, void *data)
     k->send = ds1338_send;
     device_class_set_legacy_reset(dc, ds1338_reset);
     dc->vmsd = &vmstate_ds1338;
+    dc->desc = "Maxim DS1338 RTC";
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo ds1338_types[] = {
hw/rtc/m41t80.c +2 -0
index 96006956798..55f52d95c51 100644
@@ -99,6 +99,8 @@ static void m41t80_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
     I2CSlaveClass *sc = I2C_SLAVE_CLASS(klass);
 
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    dc->desc = "ST M41T80 RTC";
     dc->realize = m41t80_realize;
     sc->send = m41t80_send;
     sc->recv = m41t80_recv;
hw/rtc/rs5c372.c +2 -0
index 5542f74085a..98067ad06d1 100644
@@ -216,6 +216,8 @@ static void rs5c372_class_init(ObjectClass *klass, void *data)
     I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
     ResettableClass *rc = RESETTABLE_CLASS(klass);
 
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    dc->desc = "Ricoh RS5C372 RTC";
     k->event = rs5c372_event;
     k->recv = rs5c372_recv;
     k->send = rs5c372_send;
Signature · 1 line
2.47.1
#24 lore raw

Re: [PATCH-for-10.0 10/12] hw/rtc: Categorize and add description

Quoted 25 lines · Philippe Mathieu-Daudé

---

hw/rtc/ds1338.c  | 2 ++
hw/rtc/m41t80.c  | 2 ++
hw/rtc/rs5c372.c | 2 ++
3 files changed, 6 insertions(+)
hw/rtc/ds1338.c +2 -0
index 8dd17fdc07c..56162917c1b 100644
@@ -230,6 +230,8 @@ static void ds1338_class_init(ObjectClass *klass, void *data)
    k->send = ds1338_send;
    device_class_set_legacy_reset(dc, ds1338_reset);
    dc->vmsd = &vmstate_ds1338;
+    dc->desc = "Maxim DS1338 RTC";
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo ds1338_types[] = {
hw/rtc/m41t80.c +0 -0
index 96006956798..55f52d95c51 100644

hw/rtc/m41t80.c static void m41t80_class_init(ObjectClass *klass, void *data) · line 102

Quoted 4 lines
hw/rtc/m41t80.c +1 -0
@@ -99,6 +99,8 @@ static void m41t80_class_init(ObjectClass *klass, void *data)
    DeviceClass *dc = DEVICE_CLASS(klass);
    I2CSlaveClass *sc = I2C_SLAVE_CLASS(klass);
 
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);

This set_bit() is not needed for i2c devices, i2c_slave_class_init() sets that already.

Regards,
BALATON Zoltan

Quoted 18 lines
hw/rtc/m41t80.c +1 -0
+    dc->desc = "ST M41T80 RTC";
    dc->realize = m41t80_realize;
    sc->send = m41t80_send;
    sc->recv = m41t80_recv;
hw/rtc/rs5c372.c +2 -0
index 5542f74085a..98067ad06d1 100644
@@ -216,6 +216,8 @@ static void rs5c372_class_init(ObjectClass *klass, void *data)
    I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
    ResettableClass *rc = RESETTABLE_CLASS(klass);
 
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    dc->desc = "Ricoh RS5C372 RTC";
    k->event = rs5c372_event;
    k->recv = rs5c372_recv;
    k->send = rs5c372_send;
Acked-by on v1 10/12
#25 lore raw

Re: [PATCH-for-10.0 10/12] hw/rtc: Categorize and add description

In reply to Philippe Mathieu-Daudé

Am 25. März 2025 22:43:08 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 5 lines

---

hw/rtc/ds1338.c  | 2 ++
hw/rtc/m41t80.c  | 2 ++
hw/rtc/rs5c372.c | 2 ++

For rs5c372:

Quoted 41 lines
3 files changed, 6 insertions(+)
hw/rtc/ds1338.c +2 -0
index 8dd17fdc07c..56162917c1b 100644
@@ -230,6 +230,8 @@ static void ds1338_class_init(ObjectClass *klass, void *data)
    k->send = ds1338_send;
    device_class_set_legacy_reset(dc, ds1338_reset);
    dc->vmsd = &vmstate_ds1338;
+    dc->desc = "Maxim DS1338 RTC";
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo ds1338_types[] = {
hw/rtc/m41t80.c +2 -0
index 96006956798..55f52d95c51 100644
@@ -99,6 +99,8 @@ static void m41t80_class_init(ObjectClass *klass, void *data)
    DeviceClass *dc = DEVICE_CLASS(klass);
    I2CSlaveClass *sc = I2C_SLAVE_CLASS(klass);
 
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    dc->desc = "ST M41T80 RTC";
    dc->realize = m41t80_realize;
    sc->send = m41t80_send;
    sc->recv = m41t80_recv;
hw/rtc/rs5c372.c +2 -0
index 5542f74085a..98067ad06d1 100644
@@ -216,6 +216,8 @@ static void rs5c372_class_init(ObjectClass *klass, void *data)
    I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
    ResettableClass *rc = RESETTABLE_CLASS(klass);
 
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    dc->desc = "Ricoh RS5C372 RTC";
    k->event = rs5c372_event;
    k->recv = rs5c372_recv;
    k->send = rs5c372_send;
#26 lore raw

PATCH 11/12 hw/sensor/temp: Categorize and add description

In reply to Philippe Mathieu-Daudé
---
 hw/sensor/dps310.c  | 2 ++
 hw/sensor/emc141x.c | 6 ++++++
 hw/sensor/tmp105.c  | 2 ++
 hw/sensor/tmp421.c  | 4 ++++
 4 files changed, 14 insertions(+)
hw/sensor/dps310.c +2 -0
index 6966a53248b..e1e6df6b60a 100644
@@ -207,6 +207,8 @@ static void dps310_class_init(ObjectClass *klass, void *data)
     k->send = dps310_tx;
     device_class_set_legacy_reset(dc, dps310_reset);
     dc->vmsd = &vmstate_dps310;
+    dc->desc = "Infineon DPS310 temperature and humidity sensor";
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo dps310_info = {
hw/sensor/emc141x.c +6 -0
index 33c1bd330fd..6adb94e7ff5 100644
@@ -280,19 +280,25 @@ static void emc141x_class_init(ObjectClass *klass, const void *data)
 static void emc1413_class_init(ObjectClass *klass, void *data)
 {
     EMC141XClass *ec = EMC141X_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
     emc141x_class_init(klass, data);
     ec->model = EMC1413_DEVICE_ID;
     ec->sensors_count = 3;
+    dc->desc = "SMSC EMC1413 temperature sensor";
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static void emc1414_class_init(ObjectClass *klass, void *data)
 {
     EMC141XClass *ec = EMC141X_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
     emc141x_class_init(klass, data);
     ec->model = EMC1414_DEVICE_ID;
     ec->sensors_count = 4;
+    dc->desc = "SMSC EMC1414 temperature sensor";
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo emc141x_info = {
hw/sensor/tmp105.c +2 -0
index ef2824f3e1b..6a38f2c6670 100644
@@ -323,6 +323,8 @@ static void tmp105_class_init(ObjectClass *klass, void *data)
     k->recv = tmp105_rx;
     k->send = tmp105_tx;
     dc->vmsd = &vmstate_tmp105;
+    dc->desc = "TI TMP105 temperature sensor";
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo tmp105_info = {
hw/sensor/tmp421.c +4 -0
index 007f7cd018b..ba42ab328e0 100644
@@ -342,6 +342,7 @@ static void tmp421_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
     I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
     TMP421Class *sc = TMP421_CLASS(klass);
+    g_autofree char *name_up = NULL;
 
     dc->realize = tmp421_realize;
     k->event = tmp421_event;
@@ -349,6 +350,9 @@ static void tmp421_class_init(ObjectClass *klass, void *data)
     k->send = tmp421_tx;
     dc->vmsd = &vmstate_tmp421;
     sc->dev = (DeviceInfo *) data;
+    name_up = g_ascii_strup(sc->dev->name, -1);
+    dc->desc = g_strconcat("TI ", name_up, " temperature sensor", NULL);
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 
     object_class_property_add(klass, "temperature0", "int",
                               tmp421_get_temperature,
Signature · 1 line
2.47.1
#27 lore raw

Re: [PATCH-for-10.0 11/12] hw/sensor/temp: Categorize and add description

Quoted 13 lines · Philippe Mathieu-Daudé
---
  hw/sensor/dps310.c  | 2 ++
  hw/sensor/emc141x.c | 6 ++++++
  hw/sensor/tmp105.c  | 2 ++
  hw/sensor/tmp421.c  | 4 ++++
  4 files changed, 14 insertions(+)
hw/sensor/dps310.c +0 -0
index 6966a53248b..e1e6df6b60a 100644

hw/sensor/dps310.c static void dps310_class_init(ObjectClass *klass, void *data) · line 211

Quoted 5 lines
hw/sensor/dps310.c +2 -0
@@ -207,6 +207,8 @@ static void dps310_class_init(ObjectClass *klass, void *data)
      k->send = dps310_tx;
      device_class_set_legacy_reset(dc, dps310_reset);
      dc->vmsd = &vmstate_dps310;
+    dc->desc = "Infineon DPS310 temperature and humidity sensor";
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);

Not necessary - I2C device again.

Thomas

#28 lore raw

RFC 12/12 hw/s390x/zpci: Re-categorize as BRIDGE

In reply to Philippe Mathieu-Daudé

A 'zpci' device encapsulate a PCI device to be usable by System/Z. Categorize it as bridge.

---
 hw/s390x/s390-pci-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/s390-pci-bus.c +1 -1
index 2591ee49c11..dbfe24f6eca 100644
@@ -1562,7 +1562,7 @@ static void s390_pci_device_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
 
     dc->desc = "zpci device";
-    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
     device_class_set_legacy_reset(dc, s390_pci_device_reset);
     dc->bus_type = TYPE_S390_PCI_BUS;
     dc->realize = s390_pci_device_realize;
Signature · 1 line
2.47.1
#29 lore raw

Re: [RFC PATCH-for-10.0 12/12] hw/s390x/zpci: Re-categorize as BRIDGE

Quoted 13 lines · Philippe Mathieu-Daudé

A 'zpci' device encapsulate a PCI device to be usable by System/Z. Categorize it as bridge.

---
  hw/s390x/s390-pci-bus.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/s390-pci-bus.c +0 -0
index 2591ee49c11..dbfe24f6eca 100644

hw/s390x/s390-pci-bus.c static void s390_pci_device_class_init(ObjectClass *klass, void *data) · line 1565

Quoted 5 lines
hw/s390x/s390-pci-bus.c +1 -1
@@ -1562,7 +1562,7 @@ static void s390_pci_device_class_init(ObjectClass *klass, void *data)
      DeviceClass *dc = DEVICE_CLASS(klass);
 
      dc->desc = "zpci device";
-    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);

It's not really a bridge (in the sense of a PCI bridge) ... I think it's maybe better to keep it in the MISC category to avoid confusion.

Thomas

#30 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 8 lines · Philippe Mathieu-Daudé

Philippe Mathieu-Daudé (12):

hw/block/m25p80: Categorize and add description hw/display/dm163: Add description hw/dma/i82374: Categorize and add description

hw/misc/pll: Do not expose as user-creatable hw/nvram/xlnx-efuse: Do not expose as user-creatable

Patches 2-4 and 8-9 queued.