public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: "Barnabás Czémán" <barnabas.czeman@mainlining.org>
To: Jonathan Cameron <jic23@kernel.org>,
	 Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	 Jonathan Albrieux <jonathan.albrieux@gmail.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, linux@mainlining.org,
	"Barnabás Czémán" <barnabas.czeman@mainlining.org>,
	"Danila Tikhonov" <danila@jiaxyga.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>
Subject: [PATCH v3 0/4] Add support for AK09918
Date: Fri, 09 Aug 2024 22:25:38 +0200	[thread overview]
Message-ID: <20240809-ak09918-v3-0-6b036db4d5ec@mainlining.org> (raw)

Add support for AK09918 which is register and scaling compatible with
AK09912.

It was tested in Xiaomi Redmi 5 Plus (vince).

magnetometer@c {
  compatible = "asahi-kasei,ak09918", "asahi-kasei,ak09912";
  reg = <0x0c>;
  vdd-supply = <&pm8953_l6>;
  mount-matrix = "1", "0", "0",
                 "0", "1", "0",
                 "0", "0", "1";
};

Add a fix for data reading according to datasheet [1] (9.4.3.2.) 
ST2 register have to be read out after read measurment data as third step
because ST2 will realasing the lock on the measurment data. Without it
the next reading will fail.

[1] https://www.akm.com/content/dam/documents/products/electronic-compass/ak09918c/ak09918c-en-datasheet.pdf

Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org>
---
Changes in v3:
- Relax failure on unknown device id
for support more register compatible variants.
- Change to fallback compatible.
- Make ST2 to be always read after measuremnt read.
- Reword fix commit with more explanation.
- Link to v2: https://lore.kernel.org/r/20240806-ak09918-v2-0-c300da66c198@mainlining.org

Changes in v2:
- Remove unnecessary ak09918 compatbile.
- Link to v1: https://lore.kernel.org/r/20240805-ak09918-v1-0-70837eebd7d8@mainlining.org

---
Barnabás Czémán (2):
      iio: magnetometer: ak8975: Relax failure on unknown id
      iio: magnetometer: ak8975: Fix reading for ak099xx sensors

Danila Tikhonov (2):
      dt-bindings: iio: imu: magnetometer: Add ak09118
      iio: magnetometer: ak8975: Add AK09118 support

 .../iio/magnetometer/asahi-kasei,ak8975.yaml       |  3 +
 drivers/iio/magnetometer/Kconfig                   |  2 +-
 drivers/iio/magnetometer/ak8975.c                  | 73 ++++++++++++++++------
 3 files changed, 57 insertions(+), 21 deletions(-)
---
base-commit: 61c01d2e181adfba02fe09764f9fca1de2be0dbe
change-id: 20240805-ak09918-4a6cfef91c32

Best regards,
-- 
Barnabás Czémán <barnabas.czeman@mainlining.org>


             reply	other threads:[~2024-08-09 20:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09 20:25 Barnabás Czémán [this message]
2024-08-09 20:25 ` [PATCH v3 1/4] iio: magnetometer: ak8975: Relax failure on unknown id Barnabás Czémán
2024-08-09 20:25 ` [PATCH v3 2/4] iio: magnetometer: ak8975: Fix reading for ak099xx sensors Barnabás Czémán
2024-08-17 12:26   ` Jonathan Cameron
2024-08-17 12:58     ` barnabas.czeman
2024-08-09 20:25 ` [PATCH v3 3/4] dt-bindings: iio: imu: magnetometer: Add ak09118 Barnabás Czémán
2024-08-10 12:15   ` Krzysztof Kozlowski
2024-08-11 18:28     ` barnabas.czeman
2024-08-12  6:17       ` Krzysztof Kozlowski
2024-08-17 12:32         ` Jonathan Cameron
2024-08-17 12:46   ` Jonathan Cameron
2024-08-09 20:25 ` [PATCH v3 4/4] iio: magnetometer: ak8975: Add AK09118 support Barnabás Czémán

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240809-ak09918-v3-0-6b036db4d5ec@mainlining.org \
    --to=barnabas.czeman@mainlining.org \
    --cc=conor+dt@kernel.org \
    --cc=danila@jiaxyga.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=jonathan.albrieux@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@mainlining.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox