linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Vianney le Clément de Saint-Marcq" <vianney.leclement@essensium.com>
To: linux-iio@vger.kernel.org
Cc: "Vianney le Clément de Saint-Marcq"
	<vianney.leclement@essensium.com>,
	"Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be>
Subject: [PATCH v2 2/7] iio: mlx90614: Add symbols for accessible registers
Date: Tue, 24 Mar 2015 16:54:14 +0100	[thread overview]
Message-ID: <1427212459-31585-3-git-send-email-vianney.leclement@essensium.com> (raw)
In-Reply-To: <1427212459-31585-1-git-send-email-vianney.leclement@essensium.com>

Add symbols for all accessible RAM and EEPROM registers, as well as the
sleep command and timings defined in the datasheet.

Signed-off-by: Vianney le Clément de Saint-Marcq <vianney.leclement@essensium.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 drivers/iio/temperature/mlx90614.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/mlx90614.c
index e2c6f1a..a2e3aa6 100644
--- a/drivers/iio/temperature/mlx90614.c
+++ b/drivers/iio/temperature/mlx90614.c
@@ -20,11 +20,35 @@
 
 #include <linux/iio/iio.h>
 
-#define MLX90614_OP_RAM 0x00
+#define MLX90614_OP_RAM		0x00
+#define MLX90614_OP_EEPROM	0x20
+#define MLX90614_OP_SLEEP	0xff
 
 /* RAM offsets with 16-bit data, MSB first */
+#define MLX90614_RAW1	(MLX90614_OP_RAM | 0x04) /* raw data IR channel 1 */
+#define MLX90614_RAW2	(MLX90614_OP_RAM | 0x05) /* raw data IR channel 2 */
 #define MLX90614_TA	(MLX90614_OP_RAM | 0x06) /* ambient temperature */
 #define MLX90614_TOBJ1	(MLX90614_OP_RAM | 0x07) /* object 1 temperature */
+#define MLX90614_TOBJ2	(MLX90614_OP_RAM | 0x08) /* object 2 temperature */
+
+/* EEPROM offsets with 16-bit data, MSB first */
+#define MLX90614_EMISSIVITY	(MLX90614_OP_EEPROM | 0x04) /* emissivity correction coefficient */
+#define MLX90614_CONFIG		(MLX90614_OP_EEPROM | 0x05) /* configuration register */
+
+/* Control bits in configuration register */
+#define MLX90614_CONFIG_IIR_SHIFT 0 /* IIR coefficient */
+#define MLX90614_CONFIG_IIR_MASK (0x7 << MLX90614_CONFIG_IIR_SHIFT)
+#define MLX90614_CONFIG_DUAL_SHIFT 6 /* single (0) or dual (1) IR sensor */
+#define MLX90614_CONFIG_DUAL_MASK (1 << MLX90614_CONFIG_DUAL_SHIFT)
+#define MLX90614_CONFIG_FIR_SHIFT 8 /* FIR coefficient */
+#define MLX90614_CONFIG_FIR_MASK (0x7 << MLX90614_CONFIG_FIR_SHIFT)
+#define MLX90614_CONFIG_GAIN_SHIFT 11 /* gain */
+#define MLX90614_CONFIG_GAIN_MASK (0x7 << MLX90614_CONFIG_GAIN_SHIFT)
+
+/* Timings (in ms) */
+#define MLX90614_TIMING_EEPROM 20 /* time for EEPROM write/erase to complete */
+#define MLX90614_TIMING_WAKEUP 34 /* time to hold SDA low for wake-up */
+#define MLX90614_TIMING_STARTUP 250 /* time before first data after wake-up */
 
 struct mlx90614_data {
 	struct i2c_client *client;
-- 
2.3.3


  parent reply	other threads:[~2015-03-24 15:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 15:54 [PATCH v2 0/7] iio: mlx90614 enhancements Vianney le Clément de Saint-Marcq
2015-03-24 15:54 ` [PATCH v2 1/7] iio: mlx90614: Refactor register symbols Vianney le Clément de Saint-Marcq
2015-03-28 12:40   ` Jonathan Cameron
2015-03-24 15:54 ` Vianney le Clément de Saint-Marcq [this message]
2015-03-24 15:54 ` [PATCH v2 3/7] iio: mlx90614: Support devices with dual IR sensor Vianney le Clément de Saint-Marcq
2015-03-28 12:44   ` Jonathan Cameron
2015-03-24 15:54 ` [PATCH v2 4/7] iio: core: Introduce IIO_CHAN_INFO_EMISSIVITY Vianney le Clément de Saint-Marcq
2015-03-24 16:02   ` Lars-Peter Clausen
2015-03-28 12:45     ` Jonathan Cameron
2015-03-24 15:54 ` [PATCH v2 5/7] iio: mlx90614: Add emissivity setting Vianney le Clément de Saint-Marcq
2015-03-28 12:46   ` Jonathan Cameron
2015-03-24 15:54 ` [PATCH v2 6/7] iio: mlx90614: Add power management Vianney le Clément de Saint-Marcq
2015-03-28 12:54   ` Jonathan Cameron
2015-03-24 15:54 ` [PATCH v2 7/7] iio: mlx90614: Check for errors in read values Vianney le Clément de Saint-Marcq
2015-03-28 13:43   ` Jonathan Cameron

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=1427212459-31585-3-git-send-email-vianney.leclement@essensium.com \
    --to=vianney.leclement@essensium.com \
    --cc=arnout@mind.be \
    --cc=linux-iio@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;
as well as URLs for NNTP newsgroup(s).