OSDN Git Service

staging: iio: cdc: ad7746: Break up use of chan->address and use FIELD_PREP etc
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 26 Jun 2022 12:29:29 +0000 (13:29 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 15 Aug 2022 21:30:00 +0000 (22:30 +0100)
commit9eee2fc4a670d70ded6cc88c42d760338ce96918
tree09624652f2b762cc327d0cbaec07315c1d4943b7
parentb1f567bde7e12e7671d8b0015ad3cbff8f3a8d3b
staging: iio: cdc: ad7746: Break up use of chan->address and use FIELD_PREP etc

Instead of encoding several different fields into chan->address use
an indirection to a separate per channel structure where the various
fields can be expressed in a more readable form.  This also allows
the register values to be constructed at runtime using FIELD_PREP().

Drop the now redundant _SHIFT macros.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220626122938.582107-9-jic23@kernel.org
drivers/staging/iio/cdc/ad7746.c