Re: [PATCH] hwmon: ina2xx: allow to change the averaging rate at run-time

From: Bartosz Golaszewski
Date: Wed Jan 07 2015 - 10:41:41 EST


2015-01-07 14:22 GMT+01:00 Guenter Roeck <linux@xxxxxxxxxxxx>:
> I think I know what to do here. Can you look into the ina209 driver ?
> It uses update_interval and calculates the number of samples to use from it.
> The ina226 datasheet suggests that we can do the same, combined with the
> conversion time configuration. We would have to use the default conversion
> time of 1.1ms for that to make sense, but that is what it is today,
> so it would be ok. This way we are in line with the ABI and can still
> configure the number of averages.
>

Just to make sure I understood you correctly: I should add
update_interval attribute instead of avg_rate, accept the desired
interval (as time) instead of the number of averages and - already
having the conversion time hardcoded to 1.1 ms - calculate the
averaging rate? Isn't this an overkill for what we're trying to
implement? I know it's for the sake of staying uniform with already
existing interface of ina209 but on the other hand these devices
aren't quite the same.

Bart
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/