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 22
22
#include <linux/property.h>
23
23
#include <linux/regulator/consumer.h>
24
24
#include <linux/regmap.h>
25
+ #include <linux/units.h>
25
26
26
27
#include <linux/iio/buffer.h>
27
28
#include <linux/iio/events.h>
@@ -436,8 +437,16 @@ static int fxls8962af_read_raw(struct iio_dev *indio_dev,
436
437
* val = FXLS8962AF_TEMP_CENTER_VAL ;
437
438
return IIO_VAL_INT ;
438
439
case IIO_CHAN_INFO_SCALE :
439
- * val = 0 ;
440
- return fxls8962af_read_full_scale (data , val2 );
440
+ switch (chan -> type ) {
441
+ case IIO_TEMP :
442
+ * val = MILLIDEGREE_PER_DEGREE ;
443
+ return IIO_VAL_INT ;
444
+ case IIO_ACCEL :
445
+ * val = 0 ;
446
+ return fxls8962af_read_full_scale (data , val2 );
447
+ default :
448
+ return - EINVAL ;
449
+ }
441
450
case IIO_CHAN_INFO_SAMP_FREQ :
442
451
return fxls8962af_read_samp_freq (data , val , val2 );
443
452
default :
@@ -736,6 +745,7 @@ static const struct iio_event_spec fxls8962af_event[] = {
736
745
.type = IIO_TEMP, \
737
746
.address = FXLS8962AF_TEMP_OUT, \
738
747
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
748
+ BIT(IIO_CHAN_INFO_SCALE) | \
739
749
BIT(IIO_CHAN_INFO_OFFSET),\
740
750
.scan_index = -1, \
741
751
.scan_type = { \
You can’t perform that action at this time.
0 commit comments