iio: accel: kxcjk-1013: Refactor configuration registers into struct
authorStephan Gerhold <stephan@gerhold.net>
Tue, 11 May 2021 14:24:01 +0000 (16:24 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 May 2021 12:54:25 +0000 (13:54 +0100)
commitae4467f6884ea16f6338295e9951eae3544aac87
treeb4aea7e34758d327a2a817b8b5f30c672cbc6c65
parent52d8e7f864283da43de0996f13f68ff4c187b547
iio: accel: kxcjk-1013: Refactor configuration registers into struct

Most Kionix accelerometers seem to use fairly consistent register bits,
but the register addresses are not necessarily the same. This is already
partially the case for the KXTF9 (added in commit 1540d0106bcb
("iio: accel: kxcjk1013: add support for KXTF9")), which has some
registers at different addresses.

However, it's even much worse for the KX023-1025. All register bits
used by the kxcjk-1013 driver seem to be fully compatible with KX023,
but it has most registers at totally different addresses.

In preparation to add support for KX023-1025, move the fixed register
addresses into a struct so we can change them for KX023 more easily.

Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/kxcjk-1013.c