diff mbox series

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

Message ID 20250325224310.8785-11-philmd@linaro.org
State New
Headers show
Series hw: Categorize few devices and add their descriptions | expand

Commit Message

Philippe Mathieu-Daudé March 25, 2025, 10:43 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/rtc/ds1338.c  | 2 ++
 hw/rtc/m41t80.c  | 2 ++
 hw/rtc/rs5c372.c | 2 ++
 3 files changed, 6 insertions(+)

Comments

BALATON Zoltan March 25, 2025, 11:23 p.m. UTC | #1
On Tue, 25 Mar 2025, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/rtc/ds1338.c  | 2 ++
> hw/rtc/m41t80.c  | 2 ++
> hw/rtc/rs5c372.c | 2 ++
> 3 files changed, 6 insertions(+)
>
> diff --git a/hw/rtc/ds1338.c b/hw/rtc/ds1338.c
> index 8dd17fdc07c..56162917c1b 100644
> --- a/hw/rtc/ds1338.c
> +++ b/hw/rtc/ds1338.c
> @@ -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[] = {
> diff --git a/hw/rtc/m41t80.c b/hw/rtc/m41t80.c
> index 96006956798..55f52d95c51 100644
> --- a/hw/rtc/m41t80.c
> +++ b/hw/rtc/m41t80.c
> @@ -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

> +    dc->desc = "ST M41T80 RTC";
>     dc->realize = m41t80_realize;
>     sc->send = m41t80_send;
>     sc->recv = m41t80_recv;
> diff --git a/hw/rtc/rs5c372.c b/hw/rtc/rs5c372.c
> index 5542f74085a..98067ad06d1 100644
> --- a/hw/rtc/rs5c372.c
> +++ b/hw/rtc/rs5c372.c
> @@ -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;
>
Bernhard Beschow March 27, 2025, 8:31 p.m. UTC | #2
Am 25. März 2025 22:43:08 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>---
> hw/rtc/ds1338.c  | 2 ++
> hw/rtc/m41t80.c  | 2 ++
> hw/rtc/rs5c372.c | 2 ++

For rs5c372:
Acked-by: Bernhard Beschow <shentey@gmail.com>

> 3 files changed, 6 insertions(+)
>
>diff --git a/hw/rtc/ds1338.c b/hw/rtc/ds1338.c
>index 8dd17fdc07c..56162917c1b 100644
>--- a/hw/rtc/ds1338.c
>+++ b/hw/rtc/ds1338.c
>@@ -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[] = {
>diff --git a/hw/rtc/m41t80.c b/hw/rtc/m41t80.c
>index 96006956798..55f52d95c51 100644
>--- a/hw/rtc/m41t80.c
>+++ b/hw/rtc/m41t80.c
>@@ -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;
>diff --git a/hw/rtc/rs5c372.c b/hw/rtc/rs5c372.c
>index 5542f74085a..98067ad06d1 100644
>--- a/hw/rtc/rs5c372.c
>+++ b/hw/rtc/rs5c372.c
>@@ -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;
diff mbox series

Patch

diff --git a/hw/rtc/ds1338.c b/hw/rtc/ds1338.c
index 8dd17fdc07c..56162917c1b 100644
--- a/hw/rtc/ds1338.c
+++ b/hw/rtc/ds1338.c
@@ -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[] = {
diff --git a/hw/rtc/m41t80.c b/hw/rtc/m41t80.c
index 96006956798..55f52d95c51 100644
--- a/hw/rtc/m41t80.c
+++ b/hw/rtc/m41t80.c
@@ -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;
diff --git a/hw/rtc/rs5c372.c b/hw/rtc/rs5c372.c
index 5542f74085a..98067ad06d1 100644
--- a/hw/rtc/rs5c372.c
+++ b/hw/rtc/rs5c372.c
@@ -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;