Revision aa941b94 hw/max7310.c

b/hw/max7310.c
143 143
    }
144 144
}
145 145

  
146
static void max7310_save(QEMUFile *f, void *opaque)
147
{
148
    struct max7310_s *s = (struct max7310_s *) opaque;
149

  
150
    qemu_put_be32(f, s->i2c_command_byte);
151
    qemu_put_be32(f, s->len);
152

  
153
    qemu_put_8s(f, &s->level);
154
    qemu_put_8s(f, &s->direction);
155
    qemu_put_8s(f, &s->polarity);
156
    qemu_put_8s(f, &s->status);
157
    qemu_put_8s(f, &s->command);
158

  
159
    i2c_slave_save(f, &s->i2c);
160
}
161

  
162
static int max7310_load(QEMUFile *f, void *opaque, int version_id)
163
{
164
    struct max7310_s *s = (struct max7310_s *) opaque;
165

  
166
    s->i2c_command_byte = qemu_get_be32(f);
167
    s->len = qemu_get_be32(f);
168

  
169
    qemu_get_8s(f, &s->level);
170
    qemu_get_8s(f, &s->direction);
171
    qemu_get_8s(f, &s->polarity);
172
    qemu_get_8s(f, &s->status);
173
    qemu_get_8s(f, &s->command);
174

  
175
    i2c_slave_load(f, &s->i2c);
176
    return 0;
177
}
178

  
179
static int max7310_iid = 0;
180

  
146 181
static void max7310_gpio_set(void *opaque, int line, int level)
147 182
{
148 183
    struct max7310_s *s = (struct max7310_s *) opaque;
......
169 204

  
170 205
    max7310_reset(&s->i2c);
171 206

  
207
    register_savevm("max7310", max7310_iid ++, 0,
208
                    max7310_save, max7310_load, s);
209

  
172 210
    return &s->i2c;
173 211
}
174 212

  

Also available in: Unified diff