diff options
| author | Jonathan Cameron <[email protected]> | 2020-11-29 18:44:59 +0000 |
|---|---|---|
| committer | Jonathan Cameron <[email protected]> | 2020-12-03 19:40:29 +0000 |
| commit | 26aec6e1b714f954b22bc7ad3239b6c0e917c90f (patch) | |
| tree | 98b2d72174f32338501443248458403e64ede7d8 /tools/perf/scripts/python | |
| parent | 1e405bc2512f80a903ddd6ba8740cee885238d7f (diff) | |
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 <[email protected]>
Tested-by: Linus Walleij <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: Linus Walleij <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions