hw/i2c: pca954x: enable vmstate
PATCH 1/1 hw/i2c: pca954x: enable vmstate
From: Patrick Venture <[email protected]>
Add missing vmstate support.
Signed-off-by Patrick Venture <[email protected]>
--- hw/i2c/i2c_mux_pca954x.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
hw/i2c/i2c_mux_pca954x.c +14 -0
@@ -22,6 +22,7 @@#include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/sysbus.h" +#include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" #include "qemu/queue.h"
@@ -211,6 +212,18 @@ static void pca954x_init(Object *obj) } } +static const VMStateDescription pca954x_vmstate = { + .name =TYPE_PCA954X , + .version_id =0 , + .minimum_version_id =0 , + .fields = (VMStateField []) { +VMSTATE_SMBUS_DEVICE (parent, Pca954xState), +VMSTATE_UINT8 (control, Pca954xState), +VMSTATE_BOOL_ARRAY (enabled, Pca954xState,PCA9548_CHANNEL_COUNT ), +VMSTATE_END_OF_LIST () + } +}; +static const Property pca954x_props[] = {DEFINE_PROP_STRING ("name" , Pca954xState, name), };
@@ -228,6 +241,7 @@ static void pca954x_class_init(ObjectClass *klass, const void *data) dc->desc ="Pca954x i2c-mux" ; dc->realize = pca954x_realize; + dc->vmsd = &pca954x_vmstate; k->write_data = pca954x_write_data; k->receive_byte = pca954x_read_byte;
Signature · 1 line
2.51.0.384.g4c02a37b29-goog
On Tue, Sep 16, 2025 at 9:59 AM Stevie Alvarez <[email protected]> wrote:
+ CC Corey Minyard for I2C maintainers.
Quoted 52 lines
From: Patrick Venture <[email protected]>
Add missing vmstate support.
Signed-off-by Patrick Venture <[email protected]>--- hw/i2c/i2c_mux_pca954x.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)hw/i2c/i2c_mux_pca954x.c +14
-1@@ -22,6 +22,7 @@#include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/sysbus.h" +#include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" #include "qemu/queue.h" @@ -211,6 +212,18 @@ static void pca954x_init(Object *obj) } } +static const VMStateDescription pca954x_vmstate = { + .name =TYPE_PCA954X , + .version_id =0 , + .minimum_version_id =0 , + .fields = (VMStateField []) { +VMSTATE_SMBUS_DEVICE (parent, Pca954xState), +VMSTATE_UINT8 (control, Pca954xState), +VMSTATE_BOOL_ARRAY (enabled, Pca954xState,PCA9548_CHANNEL_COUNT ), +VMSTATE_END_OF_LIST () + } +}; +static const Property pca954x_props[] = {DEFINE_PROP_STRING ("name" , Pca954xState, name), };@@ -228,6 +241,7 @@ static void pca954x_class_init(ObjectClass *klass, const void *data) dc->desc ="Pca954x i2c-mux" ; dc->realize = pca954x_realize; + dc->vmsd = &pca954x_vmstate; k->write_data = pca954x_write_data; k->receive_byte = pca954x_read_byte; --2.51.0.384.g4c02a37b29-goog
On Tue, Sep 16, 2025 at 9:59 AM Stevie Alvarez <[email protected]> wrote:
+ CC Corey Minyard for I2C maintainers.
Quoted 52 lines
From: Patrick Venture <[email protected]>
Add missing vmstate support.
Signed-off-by Patrick Venture <[email protected]>--- hw/i2c/i2c_mux_pca954x.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)hw/i2c/i2c_mux_pca954x.c +14
-1@@ -22,6 +22,7 @@#include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/sysbus.h" +#include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" #include "qemu/queue.h" @@ -211,6 +212,18 @@ static void pca954x_init(Object *obj) } } +static const VMStateDescription pca954x_vmstate = { + .name =TYPE_PCA954X , + .version_id =0 , + .minimum_version_id =0 , + .fields = (VMStateField []) { +VMSTATE_SMBUS_DEVICE (parent, Pca954xState), +VMSTATE_UINT8 (control, Pca954xState), +VMSTATE_BOOL_ARRAY (enabled, Pca954xState,PCA9548_CHANNEL_COUNT ), +VMSTATE_END_OF_LIST () + } +}; +static const Property pca954x_props[] = {DEFINE_PROP_STRING ("name" , Pca954xState, name), };@@ -228,6 +241,7 @@ static void pca954x_class_init(ObjectClass *klass, const void *data) dc->desc ="Pca954x i2c-mux" ; dc->realize = pca954x_realize; + dc->vmsd = &pca954x_vmstate; k->write_data = pca954x_write_data; k->receive_byte = pca954x_read_byte; --2.51.0.384.g4c02a37b29-goog