Revision aa941b94 hw/ads7846.c

b/hw/ads7846.c
104 104
    if (s->pressure == !buttons_state) {
105 105
        s->pressure = !!buttons_state;
106 106

  
107
         ads7846_int_update(s);
107
        ads7846_int_update(s);
108 108
    }
109 109
}
110 110

  
111
static void ads7846_save(QEMUFile *f, void *opaque)
112
{
113
    struct ads7846_state_s *s = (struct ads7846_state_s *) opaque;
114
    int i;
115

  
116
    for (i = 0; i < 8; i ++)
117
        qemu_put_be32(f, s->input[i]);
118
    qemu_put_be32(f, s->noise);
119
    qemu_put_be32(f, s->cycle);
120
    qemu_put_be32(f, s->output);
121
}
122

  
123
static int ads7846_load(QEMUFile *f, void *opaque, int version_id)
124
{
125
    struct ads7846_state_s *s = (struct ads7846_state_s *) opaque;
126
    int i;
127

  
128
    for (i = 0; i < 8; i ++)
129
        s->input[i] = qemu_get_be32(f);
130
    s->noise = qemu_get_be32(f);
131
    s->cycle = qemu_get_be32(f);
132
    s->output = qemu_get_be32(f);
133

  
134
    s->pressure = 0;
135
    ads7846_int_update(s);
136

  
137
    return 0;
138
}
139

  
140
static int ads7846_iid = 0;
141

  
111 142
struct ads7846_state_s *ads7846_init(qemu_irq penirq)
112 143
{
113 144
    struct ads7846_state_s *s;
......
127 158
                    "QEMU ADS7846-driven Touchscreen");
128 159

  
129 160
    ads7846_int_update(s);
161

  
162
    register_savevm("ads7846", ads7846_iid ++, 0,
163
                    ads7846_save, ads7846_load, s);
164

  
130 165
    return s;
131 166
}

Also available in: Unified diff