Re: [Qemu-devel] [PATCH] tmp105: read temperature in milli-celsius

2014-03-24 Thread Paolo Bonzini
Il 17/02/2014 13:08, Andreas Färber ha scritto: Am 17.02.2014 11:57, schrieb Paolo Bonzini: Right now, the temperature property must be written in milli-celsius, but it reads back the value in 8.8 fixed point. Fix this by letting the property read back the original value (possibly rounded). Al

Re: [Qemu-devel] [PATCH] tmp105: read temperature in milli-celsius

2014-02-17 Thread Paolo Bonzini
> > @@ -78,7 +80,7 @@ static void tmp105_set_temperature(Object *obj, Visitor > > *v, void *opaque, > > return; > > } > > > > -s->temperature = ((int16_t) (temp * 0x800 / 128000)) << 4; > > +s->temperature = (int16_t) (temp * 256 / 1000); > > Did you check whether those ma

Re: [Qemu-devel] [PATCH] tmp105: read temperature in milli-celsius

2014-02-17 Thread Andreas Färber
Am 17.02.2014 11:57, schrieb Paolo Bonzini: > Right now, the temperature property must be written in milli-celsius, but it > reads back the value in 8.8 fixed point. Fix this by letting the property > read back the original value (possibly rounded). Also simplify the code that > does the conversi

[Qemu-devel] [PATCH] tmp105: read temperature in milli-celsius

2014-02-17 Thread Paolo Bonzini
Right now, the temperature property must be written in milli-celsius, but it reads back the value in 8.8 fixed point. Fix this by letting the property read back the original value (possibly rounded). Also simplify the code that does the conversion. Before: (QEMU) qom-set path=/machine/perip