[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-10.0 11/12] hw/sensor/temp: Categorize and add description
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-10.0 11/12] hw/sensor/temp: Categorize and add description |
Date: |
Tue, 25 Mar 2025 23:43:09 +0100 |
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
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(+)
diff --git a/hw/sensor/dps310.c b/hw/sensor/dps310.c
index 6966a53248b..e1e6df6b60a 100644
--- a/hw/sensor/dps310.c
+++ b/hw/sensor/dps310.c
@@ -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 = {
diff --git a/hw/sensor/emc141x.c b/hw/sensor/emc141x.c
index 33c1bd330fd..6adb94e7ff5 100644
--- a/hw/sensor/emc141x.c
+++ b/hw/sensor/emc141x.c
@@ -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 = {
diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c
index ef2824f3e1b..6a38f2c6670 100644
--- a/hw/sensor/tmp105.c
+++ b/hw/sensor/tmp105.c
@@ -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 = {
diff --git a/hw/sensor/tmp421.c b/hw/sensor/tmp421.c
index 007f7cd018b..ba42ab328e0 100644
--- a/hw/sensor/tmp421.c
+++ b/hw/sensor/tmp421.c
@@ -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,
--
2.47.1
- [PATCH-for-10.0 08/12] hw/misc/pll: Do not expose as user-creatable, (continued)
- [PATCH-for-10.0 08/12] hw/misc/pll: Do not expose as user-creatable, Philippe Mathieu-Daudé, 2025/03/25
- [PATCH-for-10.0 06/12] hw/i2c/pca954x: Categorize and add description, Philippe Mathieu-Daudé, 2025/03/25
- [PATCH-for-10.0 10/12] hw/rtc: Categorize and add description, Philippe Mathieu-Daudé, 2025/03/25
- [PATCH-for-10.0 09/12] hw/nvram/xlnx-efuse: Do not expose as user-creatable, Philippe Mathieu-Daudé, 2025/03/25
- [PATCH-for-10.0 11/12] hw/sensor/temp: Categorize and add description,
Philippe Mathieu-Daudé <=
- [RFC PATCH-for-10.0 12/12] hw/s390x/zpci: Re-categorize as BRIDGE, Philippe Mathieu-Daudé, 2025/03/25
- Re: [PATCH-for-10.0 00/12] hw: Categorize few devices and add their descriptions, Philippe Mathieu-Daudé, 2025/03/31