]> git.baikalelectronics.ru Git - kernel.git/commit
iio: accel: sca3300: Add inclination channels
authorLI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
Sun, 29 May 2022 06:18:53 +0000 (06:18 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 14 Jun 2022 10:53:09 +0000 (11:53 +0100)
commit2c7934b1607123f0cdd748c8ac3ad7e113c5b5e8
tree29df34684aa2de2ba15191e5c38b9ff3b0f7f60b
parenta02ab235c4919adccca68d97f05efc84445df6bb
iio: accel: sca3300: Add inclination channels

Different from SCA3300, SCL3300 can output inclination angles.
Angles are formed from acceleration with following equations:
ANG_X = atan2(accx , sqrt(pow(accy , 2) + pow(accz , 2)))
ANG_Y = atan2(accy , sqrt(pow(accx , 2) + pow(accz , 2)))
ANG_Z = atan2(accz , sqrt(pow(accx , 2) + pow(accy , 2)))

The commit adds the output of the raw value, scale
and scale_available of angles.

New interfaces:
  in_incli_scale
  in_incli_scale_available
  in_incli_x_raw
  in_incli_y_raw
  in_incli_z_raw
Data converted by application of scale to degrees.

Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Link: https://lore.kernel.org/r/20220529061853.3044893-6-Qing-wu.Li@leica-geosystems.com.cn
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/sca3300.c