Re: [PATCH v1 10/12] iio: accel: adxl313: add inactivity sensing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 18, 2025 at 11:13:19AM +0000, Lothar Rubusch wrote:
> Extend the interrupt handler to process interrupts as inactivity events.
> Add functions to set threshold and period registers for inactivity. Add
> functions to enable / disable inactivity. Extend the fake iio channel to
> deal with inactivity events on x, y and z combined with AND.

...

>  	en = false;

You see, now it becomes even useless code.

> -	if (type == ADXL313_ACTIVITY)
> +	if (type == ADXL313_ACTIVITY) {
>  		en = cmd_en && threshold;
> +	} else {
> +		ret = regmap_read(data->regmap, ADXL313_REG_TIME_INACT, &inact_time_s);
> +		if (ret)
> +			return ret;
> +
> +		en = cmd_en && threshold && inact_time_s;
> +	}

...

> +			case IIO_EV_DIR_FALLING:
> +				ret = regmap_read(data->regmap,
> +						  adxl313_act_thresh_reg[ADXL313_INACTIVITY],
> +						  &inact_threshold);
> +				if (ret)
> +					return ret;
> +				*val = inact_threshold * 15625;
> +				*val2 = 1000000;

MICRO ?

> +				return IIO_VAL_FRACTIONAL;
>  			default:
>  				return -EINVAL;
>  			}

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux