|
|
Subscribe / Log in / New account

iio: accel: kxcjk-1013: Add support for KX023-1025

From:  Stephan Gerhold <stephan-AT-gerhold.net>
To:  Jonathan Cameron <jic23-AT-kernel.org>
Subject:  [PATCH 0/3] iio: accel: kxcjk-1013: Add support for KX023-1025
Date:  Tue, 11 May 2021 11:54:06 +0200
Message-ID:  <20210511095409.9290-1-stephan@gerhold.net>
Cc:  Lars-Peter Clausen <lars-AT-metafoo.de>, Rob Herring <robh+dt-AT-kernel.org>, Robert Yang <decatf-AT-gmail.com>, linux-iio-AT-vger.kernel.org, devicetree-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, Michał Mirosław <mirq-linux-AT-rere.qmqm.pl>, Srinivas Pandruvada <srinivas.pandruvada-AT-linux.intel.com>, ~postmarketos/upstreaming-AT-lists.sr.ht, Hans de Goede <hdegoede-AT-redhat.com>, Stephan Gerhold <stephan-AT-gerhold.net>
Archive-link:  Article

KX023-1025 [1] is another accelerometer from Kionix that has lots
of additional functionality compared to KXCJK-1013. It combines the
motion interrupt functionality from KXCJK with the tap detection
from KXTF9, plus a lot more other functionality.

This patch set does not add support for any of the extra functionality,
but makes basic functionality work with the existing kxcjk-1013 driver.

At first, the register map for the KX023-1025 seems quite different
from the other accelerometers supported by the kxcjk-1013.
However, it turns out that at least most of the register bits
still mean the same for KX023-1025.

This patch set refactors the kxcjk-1013 driver a little bit
to get the register addresses from a chip-specific struct.
The register bits can be re-used for all the different chips.

The KX023-1025 is used in several smartphones from Huawei.
I tested these changes on a Huawei Ascend G7, someone else reported
they also work fine on the Huawei Honor 5X (codename "kiwi").

[1]: https://kionixfs.azureedge.net/en/datasheet/KX023-1025%20...

Stephan Gerhold (3):
  dt-bindings: iio: kionix,kxcjk1013: Document kionix,kx023-1025
  iio: accel: kxcjk-1013: Refactor configuration registers into struct
  iio: accel: kxcjk-1013: Add support for KX023-1025

 .../bindings/iio/accel/kionix,kxcjk1013.yaml  |   1 +
 drivers/iio/accel/kxcjk-1013.c                | 217 ++++++++++++++----
 2 files changed, 176 insertions(+), 42 deletions(-)

-- 
2.31.1



Copyright © 2021, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds