From: Samu Onkalo <samu.p.onkalo@nokia.com>
To: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org
Subject: [PATCH 3/3] Documentation: Documentation for ak8974 magnetometer chip driver
Date: Fri, 27 Aug 2010 14:54:43 +0300 [thread overview]
Message-ID: <1282910083-8629-4-git-send-email-samu.p.onkalo@nokia.com> (raw)
In-Reply-To: <1282910083-8629-1-git-send-email-samu.p.onkalo@nokia.com>
Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
---
Documentation/misc-devices/ak8974 | 66 +++++++++++++++++++++++++++++++++++++
1 files changed, 66 insertions(+), 0 deletions(-)
create mode 100644 Documentation/misc-devices/ak8974
diff --git a/Documentation/misc-devices/ak8974 b/Documentation/misc-devices/ak8974
new file mode 100644
index 0000000..c771f1e
--- /dev/null
+++ b/Documentation/misc-devices/ak8974
@@ -0,0 +1,66 @@
+Kernel driver ak8974
+====================
+
+Supported chips:
+Asahi Kasei ak8974
+Aichi Steel ami305
+
+
+Author: Samu P. Onkalo <samu.p.onkalo@nokia.com>
+
+
+Description
+-----------
+
+Chip is a 3 axis magnetometer sensor. It measures and reports
+magnetic field density in x, y, z axis.
+
+Driver provides interface as a misc-character device. Data is returned one
+measurement result at time as a structure of data. Measurement is triggered
+by reading the device handle. Thus measurement rate is controlled by
+the reading application. Read can be blocking or non-blocking.
+Blocking read trigs an measurement and wait until the result is ready.
+Non-blocking read trigs measurement and returns immediatelly. As soon as the
+data is available non-blocking read returns it.
+
+Driver supports regulator framework and power management.
+
+sysfs interface:
+selftest - RO - performs internal selftest procedure - output: FAIL / OK
+range - RO - data range
+chip_id - RO - information of the detected chip type
+
+misc-character device:
+----------------------
+device handle name: /dev/ak8974x
+x in the name starts counting from 0 and it is increased by one for each of the
+detected chip.
+
+Data format:
+struct ak8974_data {
+ __s16 x;
+ __s16 y;
+ __s16 z;
+ __u16 valid;
+} __attribute__((packed));
+Each read from the device returns one measurement result "struct ak8974_data"
+format. Data for each axis is in the same format as it is in the chip register.
+
+Platform data:
+
+define AK8974_NO_MAP 0
+#define AK8974_DEV_X 1
+#define AK8974_DEV_Y 2
+#define AK8974_DEV_Z 3
+#define AK8974_INV_DEV_X -1
+#define AK8974_INV_DEV_Y -2
+#define AK8974_INV_DEV_Z -3
+
+struct ak8974_platform_data {
+ s8 axis_x;
+ s8 axis_y;
+ s8 axis_z;
+};
+
+This is used to remap device orientation to so that the returned
+data is in line with the device mechanics.
--
1.6.3.3
prev parent reply other threads:[~2010-08-27 11:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-27 11:54 [PATCH 0/3] ak8974 / ami305 magnetometer driver Samu Onkalo
[not found] ` <1282910083-8629-1-git-send-email-samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2010-08-27 11:54 ` [PATCH 1/3] drivers: misc: " Samu Onkalo
[not found] ` <1282910083-8629-2-git-send-email-samu.p.onkalo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2010-08-27 12:31 ` Alan Cox
[not found] ` <20100827133109.1eb974ed-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2010-08-27 16:59 ` Onkalo Samu
[not found] ` <1282928353.2194.27.camel-Vo7XL3ix0D0UEupzmRo7jhl4MBrZKKet0E9HWUfgJXw@public.gmane.org>
2010-08-27 18:08 ` Dmitry Torokhov
2010-08-28 13:44 ` Jonathan Cameron
2010-08-27 18:53 ` Mark Brown
[not found] ` <20100827185343.GA6626-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2010-08-30 6:55 ` Onkalo Samu
2010-08-31 11:11 ` Mark Brown
2010-08-28 16:10 ` Sundar
2010-08-30 7:12 ` Onkalo Samu
2010-08-31 7:13 ` Sundar
2010-08-27 11:54 ` [PATCH 2/3] drivers: misc: ak8974 support to Kconfig and Makefile Samu Onkalo
2010-08-27 11:54 ` Samu Onkalo [this message]
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=1282910083-8629-4-git-send-email-samu.p.onkalo@nokia.com \
--to=samu.p.onkalo@nokia.com \
--cc=akpm@linux-foundation.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.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