File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -1167,11 +1167,12 @@ static int bu27034_read_raw(struct iio_dev *idev,
1167
1167
1168
1168
switch (mask ) {
1169
1169
case IIO_CHAN_INFO_INT_TIME :
1170
- * val = bu27034_get_int_time (data );
1171
- if (* val < 0 )
1172
- return * val ;
1170
+ * val = 0 ;
1171
+ * val2 = bu27034_get_int_time (data );
1172
+ if (* val2 < 0 )
1173
+ return * val2 ;
1173
1174
1174
- return IIO_VAL_INT ;
1175
+ return IIO_VAL_INT_PLUS_MICRO ;
1175
1176
1176
1177
case IIO_CHAN_INFO_SCALE :
1177
1178
return bu27034_get_scale (data , chan -> channel , val , val2 );
@@ -1229,7 +1230,10 @@ static int bu27034_write_raw(struct iio_dev *idev,
1229
1230
ret = bu27034_set_scale (data , chan -> channel , val , val2 );
1230
1231
break ;
1231
1232
case IIO_CHAN_INFO_INT_TIME :
1232
- ret = bu27034_try_set_int_time (data , val );
1233
+ if (!val )
1234
+ ret = bu27034_try_set_int_time (data , val2 );
1235
+ else
1236
+ ret = - EINVAL ;
1233
1237
break ;
1234
1238
default :
1235
1239
ret = - EINVAL ;
You can’t perform that action at this time.
0 commit comments