@@ -201,10 +201,19 @@ static int smbus_i2c_send(I2CSlave *s, uint8_t data)
return 0;
}
+static void smbus_device_hold_reset(Object *obj)
+{
+ SMBusDevice *dev = SMBUS_DEVICE(obj);
+ dev->mode = SMBUS_IDLE;
+ dev->data_len = 0;
+}
+
static void smbus_device_class_init(ObjectClass *klass, void *data)
{
I2CSlaveClass *sc = I2C_SLAVE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
+ rc->phases.hold = smbus_device_hold_reset;
sc->event = smbus_i2c_event;
sc->recv = smbus_i2c_recv;
sc->send = smbus_i2c_send;