File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,16 @@ static int mpu3050_read_raw(struct iio_dev *indio_dev,
272
272
case IIO_CHAN_INFO_OFFSET :
273
273
switch (chan -> type ) {
274
274
case IIO_TEMP :
275
- /* The temperature scaling is (x+23000)/280 Celsius */
275
+ /*
276
+ * The temperature scaling is (x+23000)/280 Celsius
277
+ * for the "best fit straight line" temperature range
278
+ * of -30C..85C. The 23000 includes room temperature
279
+ * offset of +35C, 280 is the precision scale and x is
280
+ * the 16-bit signed integer reported by hardware.
281
+ *
282
+ * Temperature value itself represents temperature of
283
+ * the sensor die.
284
+ */
276
285
* val = 23000 ;
277
286
return IIO_VAL_INT ;
278
287
default :
@@ -329,7 +338,7 @@ static int mpu3050_read_raw(struct iio_dev *indio_dev,
329
338
goto out_read_raw_unlock ;
330
339
}
331
340
332
- * val = be16_to_cpu (raw_val );
341
+ * val = ( s16 ) be16_to_cpu (raw_val );
333
342
ret = IIO_VAL_INT ;
334
343
335
344
goto out_read_raw_unlock ;
You can’t perform that action at this time.
0 commit comments