Re: [PATCH] iio: st_sensors: make scale channels also shared by type

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

 



On Mon, 30 Mar 2020 16:59:20 +0200
Gaëtan André <rvlander@xxxxxxxxxxxxxx> wrote:

> Scale channels are available by axis. For example for accelerometers,
> in_accel_x_scale, in_accel_y_scale and in_accel_z_scale are available.
> 
> However, they should be shared by type as documented in
> Documentation/ABI/testing/sysfs-bus-iio.
> 
> For each sensor (acceleros, gyros and magnetos) only one value is specified
> for all the axes.
> 
> Existing, by axis, entries are preserved in order to to leave the old ABI
> untouched.
Hi Gaëtan,

Thanks for this.  Whilst I agree the ideal ABI would be to have just the
shared version userspace should cope with the current version anyway as
it would be the right option if for example the scale of x and y are controlled
by one register field and z by another (this used to be common for accelerometers)

Any userspace software using this will have to assign a precedence to the
two files that result and the most likely option is more specific first meaning
the shared version is unused.

Hence I'd argue we aren't broke (just non ideal) and adding the additional
interface just confuses matters.  Hence I would rather leave things how they
currently are.  Do we have some userspace that is broken by this being less
than ideal?

Thanks

Jonathan

> 
> Signed-off-by: Gaëtan André <rvlander@xxxxxxxxxxxxxx>
> ---
>  include/linux/iio/common/st_sensors.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
> index 33e939977444..f31e309f0fd1 100644
> --- a/include/linux/iio/common/st_sensors.h
> +++ b/include/linux/iio/common/st_sensors.h
> @@ -52,6 +52,7 @@
>  	.type = device_type, \
>  	.modified = mod, \
>  	.info_mask_separate = mask, \
> +	.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
>  	.info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \
>  	.scan_index = index, \
>  	.channel2 = ch2, \
> 
> base-commit: b723e9431b77976b83efb90178dfcada3405321c





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux