Compatible strings are not available on ACPI based systems. This patch adds
support to use DSDT information read from platform BIOS instead for probing
st pressure sensors.
Signed-off-by: Shrirang Bagul <email address hidden>
Signed-off-by: Jonathan Cameron <email address hidden>
(cherry picked from commit 9d317724cfeb9b64acf57028183e307bea39e4e6)
(source: git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git)
Signed-off-by: Shrirang Bagul <email address hidden>
Signed-off-by: Tim Gardner <email address hidden>
Signed-off-by: Luis Henriques <email address hidden>
Using realbits as i2c/spi read len, when that value is not byte aligned
(e.g 12 bits), lead to skip msb part of out data registers.
Fix this taking into account scan_type.shift in addition to
scan_type.realbits as read length:
read_len = DIV_ROUND_UP(realbits + shift, 8)
This fix has been tested on 8, 12, 16, 24 bit sensors
Fixes: e7385de5291e ("iio:st_sensors: align on storagebits boundaries")
Signed-off-by: Lorenzo Bianconi <email address hidden>
Cc: <email address hidden>
Signed-off-by: Jonathan Cameron <email address hidden>
(backported from commit fd60b8949f4e85be2b9f364ab9c898c408664518)
(source: git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git)
Signed-off-by: Shrirang Bagul <email address hidden>
Acked-by: Tim Gardner <email address hidden>
Signed-off-by: Luis Henriques <email address hidden>
0bf5510...
by
Lorenzo Bianconi <email address hidden>
We have #defines for all the individual sensor registers and
value/mask pairs #defined at the top of the file and used at
exactly one spot.
This is usually good if the #defines give a meaning to the
opaque magic numbers.
However in this case, the semantic meaning is inherent in the
name of the C99-addressable fields, and that means duplication
of information, and only makes the code hard to maintain since
you every time have to add a new #define AND update the site
where it is to be used.
Get rid of the #defines and just open code the values into the
appropriate struct elements. Make sure to explicitly address
the .hz and .value fields in the st_sensor_odr_avl struct
so that the meaning of all values is clear.
This patch is purely syntactic should have no semantic effect.
Cc: Lorenzo Bianconi <email address hidden>
Signed-off-by: Linus Walleij <email address hidden>
Acked-by: Lorenzo Bianconi <email address hidden>
Signed-off-by: Jonathan Cameron <email address hidden>
(cherry picked from commit 9049531c91b4ed7948d7c8bf6e945f5da56fc501)
Signed-off-by: Shrirang Bagul <email address hidden>
Acked-by: Tim Gardner <email address hidden>
Signed-off-by: Luis Henriques <email address hidden>