alistair23-linux/drivers/iio/gyro
Jonathan Cameron 26aec6e1b7 iio:gyro:mpu3050 Treat otp value as a __le64 and use FIELD_GET() to break up
Inspired by Andy Shevchenko's proposal to use get_unaligned_leXX().

The whole one time programable memory is treated as a single 64bit
little endian value.  Thus we can avoid a lot of messy handling
of fields overlapping byte boundaries by just loading and manipulating
it as an __le64 converted to a u64.  That lets us just use FIELD_GET()
and GENMASK() to extract the values desired.

Note only build tested. We need to use GENMASK_ULL and %llX formatters
to account for the larger types used in computing the various fields.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201128185156.428327-1-jic23@kernel.org
Link: https://lore.kernel.org/r/20201129184459.647538-1-jic23@kernel.org
2020-12-03 19:40:29 +00:00
..
adis16080.c iio: gyro: adis16080: Fix formatting issue 2020-09-21 18:41:37 +01:00
adis16130.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
adis16136.c iio: adis16136: Use Managed device functions 2020-09-16 19:06:08 +01:00
adis16260.c iio: adis16260: Use Managed device functions 2020-09-16 19:06:08 +01:00
adxrs290.c iio:trigger: rename try_reenable() to reenable() plus return void 2020-12-03 19:40:26 +00:00
adxrs450.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
bmg160.h
bmg160_core.c iio:trigger: rename try_reenable() to reenable() plus return void 2020-12-03 19:40:26 +00:00
bmg160_i2c.c iio: gyro: bmg160_i2c: Use vsprintf extension %pe for symbolic error name 2020-04-19 16:56:15 +01:00
bmg160_spi.c iio: gyro: bmg160_spi: Use vsprintf extension %pe for symbolic error name 2020-04-19 16:56:16 +01:00
fxas21002c.h iio: gyro: fxas21002c: Move 'fxas21002c_reg_fields' to the only file its used 2020-07-20 09:03:25 +01:00
fxas21002c_core.c iio: gyro: fxas21002c: Move 'fxas21002c_reg_fields' to the only file its used 2020-07-20 09:03:25 +01:00
fxas21002c_i2c.c
fxas21002c_spi.c
hid-sensor-gyro-3d.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
itg3200_buffer.c iio:gyro:itg3200: Fix timestamp alignment and prevent data leak. 2020-09-21 20:01:50 +01:00
itg3200_core.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
Kconfig iio: gyro: adxrs290: Add triggered buffer support 2020-09-13 10:51:23 +01:00
Makefile iio: gyro: Add driver support for ADXRS290 2020-08-22 10:53:20 +01:00
mpu3050-core.c iio:gyro:mpu3050 Treat otp value as a __le64 and use FIELD_GET() to break up 2020-12-03 19:40:29 +00:00
mpu3050-i2c.c iio: gyro: mpu3050: Use vsprintf extension %pe for symbolic error name 2020-04-19 16:56:16 +01:00
mpu3050.h
ssp_gyro_sensor.c iio: remove explicit IIO device parent assignment 2020-06-14 11:49:59 +01:00
st_gyro.h
st_gyro_buffer.c iio: Move attach/detach of the poll func to the core 2020-06-20 17:34:44 +01:00
st_gyro_core.c iio: st_sensors: Drop unneeded explicit castings 2020-03-21 10:26:21 +00:00
st_gyro_i2c.c
st_gyro_spi.c