Skip to contentSkip to conversation

Move some things out of hw/misc

PATCH In review [email protected] 4 participants 9 messages May 19, 2021

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

cover Move some things out of hw/misc

hw/misc has collected a few things that could be moved elsewhere.

Move two ADC devices into the adc directory.

Create a sensor directory and move the sensors into it. There's only a few for now, but the people driving the BMC work are going to be adding many more, and it would really clutter up hw/misc. This is the main reason for the patch set.

I was unable to run the tests to completion, but I think I ran the ones that matter. The end of master fails the BIOS tests for i386, at least, and it hangs the test run. I backed out these changes and double-checked.

-corey

#1 lore raw

PATCH 1/3 adc: Move the zynq-xadc file to the adc directories

From: Corey Minyard <[email protected]>

It's an ADC, put it where it belongs.

Cc Edgar E. Iglesias <[email protected]>
Cc Alistair Francis <[email protected]>
Cc Peter Maydell <[email protected]>
---
 MAINTAINERS                          | 6 ++++--
 hw/adc/meson.build                   | 1 +
 hw/{misc => adc}/zynq-xadc.c         | 2 +-
 hw/arm/xilinx_zynq.c                 | 2 +-
 hw/misc/meson.build                  | 2 +-
 include/hw/{misc => adc}/zynq-xadc.h | 0
 6 files changed, 8 insertions(+), 5 deletions(-)
 rename hw/{misc => adc}/zynq-xadc.c (99%)
 rename include/hw/{misc => adc}/zynq-xadc.h (100%)
MAINTAINERS +4 -2
index eab178aeee..6cb3b15f97 100644
@@ -913,8 +913,10 @@ L: [email protected]
 S: Maintained
 F: hw/*/xilinx_*
 F: hw/*/cadence_*
-F: hw/misc/zynq*
-F: include/hw/misc/zynq*
+F: hw/misc/zynq_slcr.c
+F: hw/adc/zynq-xadc.c
+F: include/hw/misc/zynq_slcr.h
+F: include/hw/adc/zynq-xadc.h
 X: hw/ssi/xilinx_*
 
 Xilinx ZynqMP and Versal
hw/adc/meson.build +1 -0
index 6ddee23813..3d397b4ea1 100644
@@ -1,2 +1,3 @@
 softmmu_ss.add(when: 'CONFIG_STM32F2XX_ADC', if_true: files('stm32f2xx_adc.c'))
 softmmu_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_adc.c'))
+softmmu_ss.add(when: 'CONFIG_ZYNQ', if_true: files('zynq-xadc.c'))
\ No newline at end of file
hw/adc/zynq-xadc.c renamed from hw/misc/zynq-xadc.c +1 -1
similarity index 99%
rename from hw/misc/zynq-xadc.c
rename to hw/adc/zynq-xadc.c
index 7b1972ce06..cfc7bab065 100644
@@ -15,7 +15,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/irq.h"
-#include "hw/misc/zynq-xadc.h"
+#include "hw/adc/zynq-xadc.h"
 #include "migration/vmstate.h"
 #include "qemu/timer.h"
 #include "qemu/log.h"
hw/arm/xilinx_zynq.c +1 -1
index 81af32dc42..245af81bbb 100644
@@ -26,7 +26,7 @@
 #include "hw/boards.h"
 #include "hw/block/flash.h"
 #include "hw/loader.h"
-#include "hw/misc/zynq-xadc.h"
+#include "hw/adc/zynq-xadc.h"
 #include "hw/ssi/ssi.h"
 #include "hw/usb/chipidea.h"
 #include "qemu/error-report.h"
hw/misc/meson.build +1 -1
index 66e1648533..508fce50c7 100644
@@ -84,7 +84,7 @@ softmmu_ss.add(when: 'CONFIG_RASPI', if_true: files(
   'bcm2835_cprman.c',
 ))
 softmmu_ss.add(when: 'CONFIG_SLAVIO', if_true: files('slavio_misc.c'))
-softmmu_ss.add(when: 'CONFIG_ZYNQ', if_true: files('zynq_slcr.c', 'zynq-xadc.c'))
+softmmu_ss.add(when: 'CONFIG_ZYNQ', if_true: files('zynq_slcr.c'))
 softmmu_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal-xramc.c'))
 softmmu_ss.add(when: 'CONFIG_STM32F2XX_SYSCFG', if_true: files('stm32f2xx_syscfg.c'))
 softmmu_ss.add(when: 'CONFIG_STM32F4XX_SYSCFG', if_true: files('stm32f4xx_syscfg.c'))
include/hw/adc/zynq-xadc.h renamed from include/hw/misc/zynq-xadc.h +0 -0
similarity index 100%
rename from include/hw/misc/zynq-xadc.h
rename to include/hw/adc/zynq-xadc.h
Signature · 1 line
2.25.1
Tested-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] adc: Move the zynq-xadc file to the adc directories

Quoted 9 lines · On 5/19/21 2:03 AM, [email protected] wrote:

From: Corey Minyard <[email protected]>

It's an ADC, put it where it belongs.

Cc Edgar E. Iglesias <[email protected]>
Cc Alistair Francis <[email protected]>
Cc Peter Maydell <[email protected]>
Quoted 10 lines
---
 MAINTAINERS                          | 6 ++++--
 hw/adc/meson.build                   | 1 +
 hw/{misc => adc}/zynq-xadc.c         | 2 +-
 hw/arm/xilinx_zynq.c                 | 2 +-
 hw/misc/meson.build                  | 2 +-
 include/hw/{misc => adc}/zynq-xadc.h | 0
 6 files changed, 8 insertions(+), 5 deletions(-)
 rename hw/{misc => adc}/zynq-xadc.c (99%)
 rename include/hw/{misc => adc}/zynq-xadc.h (100%)
Reviewed-by on v1 1/3
#3 lore raw

Re: [PATCH 1/3] adc: Move the zynq-xadc file to the adc directories

In reply to [email protected]
Quoted 9 lines · On 5/19/21 2:03 AM, [email protected] wrote:

From: Corey Minyard <[email protected]>

It's an ADC, put it where it belongs.

Cc Edgar E. Iglesias <[email protected]>
Cc Alistair Francis <[email protected]>
Cc Peter Maydell <[email protected]>
Quoted 10 lines
---
 MAINTAINERS                          | 6 ++++--
 hw/adc/meson.build                   | 1 +
 hw/{misc => adc}/zynq-xadc.c         | 2 +-
 hw/arm/xilinx_zynq.c                 | 2 +-
 hw/misc/meson.build                  | 2 +-
 include/hw/{misc => adc}/zynq-xadc.h | 0
 6 files changed, 8 insertions(+), 5 deletions(-)
 rename hw/{misc => adc}/zynq-xadc.c (99%)
 rename include/hw/{misc => adc}/zynq-xadc.h (100%)
Reviewed-by
#4 lore raw

Re: [PATCH 1/3] adc: Move the zynq-xadc file to the adc directories

Quoted 21 lines · Philippe Mathieu-Daudé
Quoted 9 lines · On 5/19/21 2:03 AM, [email protected] wrote:

From: Corey Minyard <[email protected]>

It's an ADC, put it where it belongs.

Cc Edgar E. Iglesias <[email protected]>
Cc Alistair Francis <[email protected]>
Cc Peter Maydell <[email protected]>
Quoted 10 lines
---
 MAINTAINERS                          | 6 ++++--
 hw/adc/meson.build                   | 1 +
 hw/{misc => adc}/zynq-xadc.c         | 2 +-
 hw/arm/xilinx_zynq.c                 | 2 +-
 hw/misc/meson.build                  | 2 +-
 include/hw/{misc => adc}/zynq-xadc.h | 0
 6 files changed, 8 insertions(+), 5 deletions(-)
 rename hw/{misc => adc}/zynq-xadc.c (99%)
 rename include/hw/{misc => adc}/zynq-xadc.h (100%)
Quoted 2 lines

Cheers,
Edgar

#5 lore raw

PATCH 2/3 adc: Move the max111x driver to the adc directory

In reply to [email protected]

From: Corey Minyard <[email protected]>

It's an adc, put it where it belongs.

Cc Andrzej Zaborowski <[email protected]>
Cc Peter Maydell <[email protected]>
---
 MAINTAINERS                        | 4 ++--
 hw/adc/Kconfig                     | 3 +++
 hw/{misc => adc}/max111x.c         | 2 +-
 hw/adc/meson.build                 | 3 ++-
 hw/arm/spitz.c                     | 2 +-
 hw/misc/Kconfig                    | 3 ---
 hw/misc/meson.build                | 1 -
 include/hw/{misc => adc}/max111x.h | 0
 8 files changed, 9 insertions(+), 9 deletions(-)
 rename hw/{misc => adc}/max111x.c (99%)
 rename include/hw/{misc => adc}/max111x.h (100%)
MAINTAINERS +2 -2
index 6cb3b15f97..4fbedc7c11 100644
@@ -834,8 +834,8 @@ F: hw/display/tc6393xb.c
 F: hw/gpio/max7310.c
 F: hw/gpio/zaurus.c
 F: hw/misc/mst_fpga.c
-F: hw/misc/max111x.c
-F: include/hw/misc/max111x.h
+F: hw/adc/max111x.c
+F: include/hw/adc/max111x.h
 F: include/hw/arm/pxa.h
 F: include/hw/arm/sharpsl.h
 F: include/hw/display/tc6393xb.h
hw/adc/Kconfig +3 -0
index 25d2229fb8..a825bd3d34 100644
@@ -1,2 +1,5 @@
 config STM32F2XX_ADC
     bool
+
+config MAX111X
+    bool
hw/adc/max111x.c renamed from hw/misc/max111x.c +1 -1
similarity index 99%
rename from hw/misc/max111x.c
rename to hw/adc/max111x.c
index 1b3234a519..e8bf4cccd4 100644
@@ -11,7 +11,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "hw/misc/max111x.h"
+#include "hw/adc/max111x.h"
 #include "hw/irq.h"
 #include "migration/vmstate.h"
 #include "qemu/module.h"
hw/adc/meson.build +2 -1
index 3d397b4ea1..ac4f093fea 100644
@@ -1,3 +1,4 @@
 softmmu_ss.add(when: 'CONFIG_STM32F2XX_ADC', if_true: files('stm32f2xx_adc.c'))
 softmmu_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_adc.c'))
-softmmu_ss.add(when: 'CONFIG_ZYNQ', if_true: files('zynq-xadc.c'))
\ No newline at end of file
+softmmu_ss.add(when: 'CONFIG_ZYNQ', if_true: files('zynq-xadc.c'))
+softmmu_ss.add(when: 'CONFIG_MAX111X', if_true: files('max111x.c'))
hw/arm/spitz.c +1 -1
index b45a929cbd..0e2626125e 100644
@@ -30,7 +30,7 @@
 #include "audio/audio.h"
 #include "hw/boards.h"
 #include "hw/sysbus.h"
-#include "hw/misc/max111x.h"
+#include "hw/adc/max111x.h"
 #include "migration/vmstate.h"
 #include "exec/address-spaces.h"
 #include "cpu.h"
hw/misc/Kconfig +0 -3
index c71ed25820..996d45aff5 100644
@@ -11,9 +11,6 @@ config ARMSSE_MHU
 config ARMSSE_CPU_PWRCTRL
     bool
 
-config MAX111X
-    bool
-
 config TMP105
     bool
     depends on I2C
hw/misc/meson.build +0 -1
index 508fce50c7..b0a8ee8994 100644
@@ -3,7 +3,6 @@ softmmu_ss.add(when: 'CONFIG_EDU', if_true: files('edu.c'))
 softmmu_ss.add(when: 'CONFIG_FW_CFG_DMA', if_true: files('vmcoreinfo.c'))
 softmmu_ss.add(when: 'CONFIG_ISA_DEBUG', if_true: files('debugexit.c'))
 softmmu_ss.add(when: 'CONFIG_ISA_TESTDEV', if_true: files('pc-testdev.c'))
-softmmu_ss.add(when: 'CONFIG_MAX111X', if_true: files('max111x.c'))
 softmmu_ss.add(when: 'CONFIG_PCA9552', if_true: files('pca9552.c'))
 softmmu_ss.add(when: 'CONFIG_PCI_TESTDEV', if_true: files('pci-testdev.c'))
 softmmu_ss.add(when: 'CONFIG_SGA', if_true: files('sga.c'))
include/hw/adc/max111x.h renamed from include/hw/misc/max111x.h +0 -0
similarity index 100%
rename from include/hw/misc/max111x.h
rename to include/hw/adc/max111x.h
Signature · 1 line
2.25.1
Reviewed-by Tested-by on v1 2/3
#6 lore raw

Re: [PATCH 2/3] adc: Move the max111x driver to the adc directory

Quoted 8 lines · On 5/19/21 2:03 AM, [email protected] wrote:

From: Corey Minyard <[email protected]>

It's an adc, put it where it belongs.

Cc Andrzej Zaborowski <[email protected]>
Cc Peter Maydell <[email protected]>
Quoted 12 lines
---
 MAINTAINERS                        | 4 ++--
 hw/adc/Kconfig                     | 3 +++
 hw/{misc => adc}/max111x.c         | 2 +-
 hw/adc/meson.build                 | 3 ++-
 hw/arm/spitz.c                     | 2 +-
 hw/misc/Kconfig                    | 3 ---
 hw/misc/meson.build                | 1 -
 include/hw/{misc => adc}/max111x.h | 0
 8 files changed, 9 insertions(+), 9 deletions(-)
 rename hw/{misc => adc}/max111x.c (99%)
 rename include/hw/{misc => adc}/max111x.h (100%)
#7 lore raw

PATCH 3/3 sensor: Move hardware sensors from misc to a sensor directory

In reply to [email protected]

From: Corey Minyard <[email protected]>

Lots of this are expected to be coming in, create a directory for them.

Also move the tmp105.h file into the include directory where it should be.

Cc Cédric Le Goater <[email protected]>
Cc Peter Maydell <[email protected]>
Cc Andrew Jeffery <[email protected]>
Cc Joel Stanley <[email protected]>
Cc Andrzej Zaborowski <[email protected]>
---
 hw/Kconfig                                 |  1 +
 hw/arm/aspeed.c                            |  2 +-
 hw/arm/nseries.c                           |  2 +-
 hw/meson.build                             |  1 +
 hw/misc/Kconfig                            | 12 ------------
 hw/misc/meson.build                        |  3 ---
 hw/sensor/Kconfig                          | 11 +++++++++++
 hw/{misc => sensor}/emc141x.c              |  2 +-
 hw/sensor/meson.build                      |  3 +++
 hw/{misc => sensor}/tmp105.c               |  2 +-
 hw/{misc => sensor}/tmp421.c               |  0
 include/hw/{misc => sensor}/emc141x_regs.h |  0
 {hw/misc => include/hw/sensor}/tmp105.h    |  2 +-
 include/hw/{misc => sensor}/tmp105_regs.h  |  0
 tests/qtest/emc141x-test.c                 |  2 +-
 tests/qtest/npcm7xx_smbus-test.c           |  2 +-
 tests/qtest/tmp105-test.c                  |  2 +-
 17 files changed, 24 insertions(+), 23 deletions(-)
 create mode 100644 hw/sensor/Kconfig
 rename hw/{misc => sensor}/emc141x.c (99%)
 create mode 100644 hw/sensor/meson.build
 rename hw/{misc => sensor}/tmp105.c (99%)
 rename hw/{misc => sensor}/tmp421.c (100%)
 rename include/hw/{misc => sensor}/emc141x_regs.h (100%)
 rename {hw/misc => include/hw/sensor}/tmp105.h (97%)
 rename include/hw/{misc => sensor}/tmp105_regs.h (100%)
hw/Kconfig +1 -0
index 805860f564..8cb7664d70 100644
@@ -32,6 +32,7 @@ source remote/Kconfig
 source rtc/Kconfig
 source scsi/Kconfig
 source sd/Kconfig
+source sensor/Kconfig
 source smbios/Kconfig
 source ssi/Kconfig
 source timer/Kconfig
hw/arm/aspeed.c +1 -1
index 3fe6c55744..272b17f999 100644
@@ -16,7 +16,7 @@
 #include "hw/arm/aspeed_soc.h"
 #include "hw/i2c/smbus_eeprom.h"
 #include "hw/misc/pca9552.h"
-#include "hw/misc/tmp105.h"
+#include "hw/sensor/tmp105.h"
 #include "hw/misc/led.h"
 #include "hw/qdev-properties.h"
 #include "sysemu/block-backend.h"
hw/arm/nseries.c +1 -1
index 0aefa5d0f3..a10d8f53b5 100644
@@ -36,7 +36,7 @@
 #include "hw/display/blizzard.h"
 #include "hw/input/tsc2xxx.h"
 #include "hw/misc/cbus.h"
-#include "hw/misc/tmp105.h"
+#include "hw/sensor/tmp105.h"
 #include "hw/qdev-properties.h"
 #include "hw/block/flash.h"
 #include "hw/hw.h"
hw/meson.build +1 -0
index ba0601e36e..b3366c888e 100644
@@ -31,6 +31,7 @@ subdir('rdma')
 subdir('rtc')
 subdir('scsi')
 subdir('sd')
+subdir('sensor')
 subdir('smbios')
 subdir('ssi')
 subdir('timer')
hw/misc/Kconfig +0 -12
index 996d45aff5..507058d8bf 100644
@@ -11,18 +11,6 @@ config ARMSSE_MHU
 config ARMSSE_CPU_PWRCTRL
     bool
 
-config TMP105
-    bool
-    depends on I2C
-
-config TMP421
-    bool
-    depends on I2C
-
-config EMC141X
-    bool
-    depends on I2C
-
 config ISA_DEBUG
     bool
     depends on ISA_BUS
hw/misc/meson.build +0 -3
index b0a8ee8994..046c7e0c72 100644
@@ -6,9 +6,6 @@ softmmu_ss.add(when: 'CONFIG_ISA_TESTDEV', if_true: files('pc-testdev.c'))
 softmmu_ss.add(when: 'CONFIG_PCA9552', if_true: files('pca9552.c'))
 softmmu_ss.add(when: 'CONFIG_PCI_TESTDEV', if_true: files('pci-testdev.c'))
 softmmu_ss.add(when: 'CONFIG_SGA', if_true: files('sga.c'))
-softmmu_ss.add(when: 'CONFIG_TMP105', if_true: files('tmp105.c'))
-softmmu_ss.add(when: 'CONFIG_TMP421', if_true: files('tmp421.c'))
-softmmu_ss.add(when: 'CONFIG_EMC141X', if_true: files('emc141x.c'))
 softmmu_ss.add(when: 'CONFIG_UNIMP', if_true: files('unimp.c'))
 softmmu_ss.add(when: 'CONFIG_EMPTY_SLOT', if_true: files('empty_slot.c'))
 softmmu_ss.add(when: 'CONFIG_LED', if_true: files('led.c'))
hw/sensor/Kconfig new file +11 -0
new file mode 100644
index 0000000000..097cb8f11e
@@ -0,0 +1,11 @@
+config TMP105
+    bool
+    depends on I2C
+
+config TMP421
+    bool
+    depends on I2C
+
+config EMC141X
+    bool
+    depends on I2C
hw/sensor/emc141x.c renamed from hw/misc/emc141x.c +1 -1
similarity index 99%
rename from hw/misc/emc141x.c
rename to hw/sensor/emc141x.c
index f7c53d48a4..7ce8f4e979 100644
@@ -25,7 +25,7 @@
 #include "qapi/visitor.h"
 #include "qemu/module.h"
 #include "qom/object.h"
-#include "hw/misc/emc141x_regs.h"
+#include "hw/sensor/emc141x_regs.h"
 
 #define SENSORS_COUNT_MAX    4
 
hw/sensor/meson.build new file +3 -0
new file mode 100644
index 0000000000..9e0f3ab1fd
@@ -0,0 +1,3 @@
+softmmu_ss.add(when: 'CONFIG_TMP105', if_true: files('tmp105.c'))
+softmmu_ss.add(when: 'CONFIG_TMP421', if_true: files('tmp421.c'))
+softmmu_ss.add(when: 'CONFIG_EMC141X', if_true: files('emc141x.c'))
hw/sensor/tmp105.c renamed from hw/misc/tmp105.c +1 -1
similarity index 99%
rename from hw/misc/tmp105.c
rename to hw/sensor/tmp105.c
index d299d9b21b..2056449489 100644
@@ -22,7 +22,7 @@
 #include "hw/i2c/i2c.h"
 #include "hw/irq.h"
 #include "migration/vmstate.h"
-#include "tmp105.h"
+#include "hw/sensor/tmp105.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
 #include "qemu/module.h"
hw/sensor/tmp421.c renamed from hw/misc/tmp421.c +0 -0
similarity index 100%
rename from hw/misc/tmp421.c
rename to hw/sensor/tmp421.c
include/hw/sensor/emc141x_regs.h renamed from include/hw/misc/emc141x_regs.h +0 -0
similarity index 100%
rename from include/hw/misc/emc141x_regs.h
rename to include/hw/sensor/emc141x_regs.h
include/hw/sensor/tmp105.h renamed from hw/misc/tmp105.h +1 -1
similarity index 97%
rename from hw/misc/tmp105.h
rename to include/hw/sensor/tmp105.h
index 7c97071ad7..244e2989fe 100644
@@ -15,7 +15,7 @@
 #define QEMU_TMP105_H
 
 #include "hw/i2c/i2c.h"
-#include "hw/misc/tmp105_regs.h"
+#include "hw/sensor/tmp105_regs.h"
 #include "qom/object.h"
 
 #define TYPE_TMP105 "tmp105"
include/hw/sensor/tmp105_regs.h renamed from include/hw/misc/tmp105_regs.h +0 -0
similarity index 100%
rename from include/hw/misc/tmp105_regs.h
rename to include/hw/sensor/tmp105_regs.h
tests/qtest/emc141x-test.c +1 -1
index 714058806a..8c86694091 100644
@@ -11,7 +11,7 @@
 #include "libqos/qgraph.h"
 #include "libqos/i2c.h"
 #include "qapi/qmp/qdict.h"
-#include "hw/misc/emc141x_regs.h"
+#include "hw/sensor/emc141x_regs.h"
 
 #define EMC1414_TEST_ID   "emc1414-test"
 
tests/qtest/npcm7xx_smbus-test.c +1 -1
index 4f9f493872..6b3038ac59 100644
@@ -18,7 +18,7 @@
 #include "qemu/bitops.h"
 #include "libqos/i2c.h"
 #include "libqos/libqtest.h"
-#include "hw/misc/tmp105_regs.h"
+#include "hw/sensor/tmp105_regs.h"
 
 #define NR_SMBUS_DEVICES    16
 #define SMBUS_ADDR(x)       (0xf0080000 + 0x1000 * (x))
tests/qtest/tmp105-test.c +1 -1
index f930a96b83..3678646df5 100644
@@ -13,7 +13,7 @@
 #include "libqos/qgraph.h"
 #include "libqos/i2c.h"
 #include "qapi/qmp/qdict.h"
-#include "hw/misc/tmp105_regs.h"
+#include "hw/sensor/tmp105_regs.h"
 
 #define TMP105_TEST_ID   "tmp105-test"
 #define TMP105_TEST_ADDR 0x49
Signature · 1 line
2.25.1
Acked-by on v1 3/3
#8 lore raw

Re: [PATCH 3/3] sensor: Move hardware sensors from misc to a sensor directory

Quoted 7 lines · On 5/19/21 2:03 AM, [email protected] wrote:

From: Corey Minyard <[email protected]>

Lots of this are expected to be coming in, create a directory for them.

Also move the tmp105.h file into the include directory where it should be.

Quoted 7 lines
Cc Cédric Le Goater <[email protected]>
Cc Peter Maydell <[email protected]>
Cc Andrew Jeffery <[email protected]>
Cc Joel Stanley <[email protected]>
Cc Andrzej Zaborowski <[email protected]>

Thanks,

C.

Quoted 241 lines
---
 hw/Kconfig                                 |  1 +
 hw/arm/aspeed.c                            |  2 +-
 hw/arm/nseries.c                           |  2 +-
 hw/meson.build                             |  1 +
 hw/misc/Kconfig                            | 12 ------------
 hw/misc/meson.build                        |  3 ---
 hw/sensor/Kconfig                          | 11 +++++++++++
 hw/{misc => sensor}/emc141x.c              |  2 +-
 hw/sensor/meson.build                      |  3 +++
 hw/{misc => sensor}/tmp105.c               |  2 +-
 hw/{misc => sensor}/tmp421.c               |  0
 include/hw/{misc => sensor}/emc141x_regs.h |  0
 {hw/misc => include/hw/sensor}/tmp105.h    |  2 +-
 include/hw/{misc => sensor}/tmp105_regs.h  |  0
 tests/qtest/emc141x-test.c                 |  2 +-
 tests/qtest/npcm7xx_smbus-test.c           |  2 +-
 tests/qtest/tmp105-test.c                  |  2 +-
 17 files changed, 24 insertions(+), 23 deletions(-)
 create mode 100644 hw/sensor/Kconfig
 rename hw/{misc => sensor}/emc141x.c (99%)
 create mode 100644 hw/sensor/meson.build
 rename hw/{misc => sensor}/tmp105.c (99%)
 rename hw/{misc => sensor}/tmp421.c (100%)
 rename include/hw/{misc => sensor}/emc141x_regs.h (100%)
 rename {hw/misc => include/hw/sensor}/tmp105.h (97%)
 rename include/hw/{misc => sensor}/tmp105_regs.h (100%)
hw/Kconfig +1 -0
index 805860f564..8cb7664d70 100644
@@ -32,6 +32,7 @@ source remote/Kconfig
 source rtc/Kconfig
 source scsi/Kconfig
 source sd/Kconfig
+source sensor/Kconfig
 source smbios/Kconfig
 source ssi/Kconfig
 source timer/Kconfig
hw/arm/aspeed.c +1 -1
index 3fe6c55744..272b17f999 100644
@@ -16,7 +16,7 @@
 #include "hw/arm/aspeed_soc.h"
 #include "hw/i2c/smbus_eeprom.h"
 #include "hw/misc/pca9552.h"
-#include "hw/misc/tmp105.h"
+#include "hw/sensor/tmp105.h"
 #include "hw/misc/led.h"
 #include "hw/qdev-properties.h"
 #include "sysemu/block-backend.h"
hw/arm/nseries.c +1 -1
index 0aefa5d0f3..a10d8f53b5 100644
@@ -36,7 +36,7 @@
 #include "hw/display/blizzard.h"
 #include "hw/input/tsc2xxx.h"
 #include "hw/misc/cbus.h"
-#include "hw/misc/tmp105.h"
+#include "hw/sensor/tmp105.h"
 #include "hw/qdev-properties.h"
 #include "hw/block/flash.h"
 #include "hw/hw.h"
hw/meson.build +1 -0
index ba0601e36e..b3366c888e 100644
@@ -31,6 +31,7 @@ subdir('rdma')
 subdir('rtc')
 subdir('scsi')
 subdir('sd')
+subdir('sensor')
 subdir('smbios')
 subdir('ssi')
 subdir('timer')
hw/misc/Kconfig +0 -12
index 996d45aff5..507058d8bf 100644
@@ -11,18 +11,6 @@ config ARMSSE_MHU
 config ARMSSE_CPU_PWRCTRL
     bool
 
-config TMP105
-    bool
-    depends on I2C
-
-config TMP421
-    bool
-    depends on I2C
-
-config EMC141X
-    bool
-    depends on I2C
-
 config ISA_DEBUG
     bool
     depends on ISA_BUS
hw/misc/meson.build +0 -3
index b0a8ee8994..046c7e0c72 100644
@@ -6,9 +6,6 @@ softmmu_ss.add(when: 'CONFIG_ISA_TESTDEV', if_true: files('pc-testdev.c'))
 softmmu_ss.add(when: 'CONFIG_PCA9552', if_true: files('pca9552.c'))
 softmmu_ss.add(when: 'CONFIG_PCI_TESTDEV', if_true: files('pci-testdev.c'))
 softmmu_ss.add(when: 'CONFIG_SGA', if_true: files('sga.c'))
-softmmu_ss.add(when: 'CONFIG_TMP105', if_true: files('tmp105.c'))
-softmmu_ss.add(when: 'CONFIG_TMP421', if_true: files('tmp421.c'))
-softmmu_ss.add(when: 'CONFIG_EMC141X', if_true: files('emc141x.c'))
 softmmu_ss.add(when: 'CONFIG_UNIMP', if_true: files('unimp.c'))
 softmmu_ss.add(when: 'CONFIG_EMPTY_SLOT', if_true: files('empty_slot.c'))
 softmmu_ss.add(when: 'CONFIG_LED', if_true: files('led.c'))
hw/sensor/Kconfig new file +11 -0
new file mode 100644
index 0000000000..097cb8f11e
@@ -0,0 +1,11 @@
+config TMP105
+    bool
+    depends on I2C
+
+config TMP421
+    bool
+    depends on I2C
+
+config EMC141X
+    bool
+    depends on I2C
hw/sensor/emc141x.c renamed from hw/misc/emc141x.c +1 -1
similarity index 99%
rename from hw/misc/emc141x.c
rename to hw/sensor/emc141x.c
index f7c53d48a4..7ce8f4e979 100644
@@ -25,7 +25,7 @@
 #include "qapi/visitor.h"
 #include "qemu/module.h"
 #include "qom/object.h"
-#include "hw/misc/emc141x_regs.h"
+#include "hw/sensor/emc141x_regs.h"
 
 #define SENSORS_COUNT_MAX    4
 
hw/sensor/meson.build new file +3 -0
new file mode 100644
index 0000000000..9e0f3ab1fd
@@ -0,0 +1,3 @@
+softmmu_ss.add(when: 'CONFIG_TMP105', if_true: files('tmp105.c'))
+softmmu_ss.add(when: 'CONFIG_TMP421', if_true: files('tmp421.c'))
+softmmu_ss.add(when: 'CONFIG_EMC141X', if_true: files('emc141x.c'))
hw/sensor/tmp105.c renamed from hw/misc/tmp105.c +1 -1
similarity index 99%
rename from hw/misc/tmp105.c
rename to hw/sensor/tmp105.c
index d299d9b21b..2056449489 100644
@@ -22,7 +22,7 @@
 #include "hw/i2c/i2c.h"
 #include "hw/irq.h"
 #include "migration/vmstate.h"
-#include "tmp105.h"
+#include "hw/sensor/tmp105.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
 #include "qemu/module.h"
hw/sensor/tmp421.c renamed from hw/misc/tmp421.c +0 -0
similarity index 100%
rename from hw/misc/tmp421.c
rename to hw/sensor/tmp421.c
include/hw/sensor/emc141x_regs.h renamed from include/hw/misc/emc141x_regs.h +0 -0
similarity index 100%
rename from include/hw/misc/emc141x_regs.h
rename to include/hw/sensor/emc141x_regs.h
include/hw/sensor/tmp105.h renamed from hw/misc/tmp105.h +1 -1
similarity index 97%
rename from hw/misc/tmp105.h
rename to include/hw/sensor/tmp105.h
index 7c97071ad7..244e2989fe 100644
@@ -15,7 +15,7 @@
 #define QEMU_TMP105_H
 
 #include "hw/i2c/i2c.h"
-#include "hw/misc/tmp105_regs.h"
+#include "hw/sensor/tmp105_regs.h"
 #include "qom/object.h"
 
 #define TYPE_TMP105 "tmp105"
include/hw/sensor/tmp105_regs.h renamed from include/hw/misc/tmp105_regs.h +0 -0
similarity index 100%
rename from include/hw/misc/tmp105_regs.h
rename to include/hw/sensor/tmp105_regs.h
tests/qtest/emc141x-test.c +1 -1
index 714058806a..8c86694091 100644
@@ -11,7 +11,7 @@
 #include "libqos/qgraph.h"
 #include "libqos/i2c.h"
 #include "qapi/qmp/qdict.h"
-#include "hw/misc/emc141x_regs.h"
+#include "hw/sensor/emc141x_regs.h"
 
 #define EMC1414_TEST_ID   "emc1414-test"
 
tests/qtest/npcm7xx_smbus-test.c +1 -1
index 4f9f493872..6b3038ac59 100644
@@ -18,7 +18,7 @@
 #include "qemu/bitops.h"
 #include "libqos/i2c.h"
 #include "libqos/libqtest.h"
-#include "hw/misc/tmp105_regs.h"
+#include "hw/sensor/tmp105_regs.h"
 
 #define NR_SMBUS_DEVICES    16
 #define SMBUS_ADDR(x)       (0xf0080000 + 0x1000 * (x))
tests/qtest/tmp105-test.c +1 -1
index f930a96b83..3678646df5 100644
@@ -13,7 +13,7 @@
 #include "libqos/qgraph.h"
 #include "libqos/i2c.h"
 #include "qapi/qmp/qdict.h"
-#include "hw/misc/tmp105_regs.h"
+#include "hw/sensor/tmp105_regs.h"
 
 #define TMP105_TEST_ID   "tmp105-test"
 #define TMP105_TEST_ADDR 0x49