File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 20
20
#include <linux/pm_runtime.h>
21
21
#include <linux/regulator/consumer.h>
22
22
#include <linux/regmap.h>
23
+ #include <linux/units.h>
23
24
24
25
#include <linux/iio/buffer.h>
25
26
#include <linux/iio/events.h>
@@ -434,8 +435,16 @@ static int fxls8962af_read_raw(struct iio_dev *indio_dev,
434
435
* val = FXLS8962AF_TEMP_CENTER_VAL ;
435
436
return IIO_VAL_INT ;
436
437
case IIO_CHAN_INFO_SCALE :
437
- * val = 0 ;
438
- return fxls8962af_read_full_scale (data , val2 );
438
+ switch (chan -> type ) {
439
+ case IIO_TEMP :
440
+ * val = MILLIDEGREE_PER_DEGREE ;
441
+ return IIO_VAL_INT ;
442
+ case IIO_ACCEL :
443
+ * val = 0 ;
444
+ return fxls8962af_read_full_scale (data , val2 );
445
+ default :
446
+ return - EINVAL ;
447
+ }
439
448
case IIO_CHAN_INFO_SAMP_FREQ :
440
449
return fxls8962af_read_samp_freq (data , val , val2 );
441
450
default :
@@ -734,6 +743,7 @@ static const struct iio_event_spec fxls8962af_event[] = {
734
743
.type = IIO_TEMP, \
735
744
.address = FXLS8962AF_TEMP_OUT, \
736
745
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
746
+ BIT(IIO_CHAN_INFO_SCALE) | \
737
747
BIT(IIO_CHAN_INFO_OFFSET),\
738
748
.scan_index = -1, \
739
749
.scan_type = { \
You can’t perform that action at this time.
0 commit comments