aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorVianney le Clément de Saint-Marcq <vianney.leclement@essensium.com>2015-03-24 11:54:14 -0400
committerJonathan Cameron <jic23@kernel.org>2015-03-29 11:17:11 -0400
commit209c00691938c4b3d58142b05ca6f50b8971e521 (patch)
treeca271dca9ca121cef59c823f0f9f6d0c3ba0c53c /drivers/iio
parent3bbec9773389112330954a6a64422eaa78d546c1 (diff)
iio: mlx90614: Add symbols for accessible registers
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> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/temperature/mlx90614.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/mlx90614.c
index e2c6f1a0d27f..a2e3aa6aa39d 100644
--- a/drivers/iio/temperature/mlx90614.c
+++ b/drivers/iio/temperature/mlx90614.c
@@ -20,11 +20,35 @@
20 20
21#include <linux/iio/iio.h> 21#include <linux/iio/iio.h>
22 22
23#define MLX90614_OP_RAM 0x00 23#define MLX90614_OP_RAM 0x00
24#define MLX90614_OP_EEPROM 0x20
25#define MLX90614_OP_SLEEP 0xff
24 26
25/* RAM offsets with 16-bit data, MSB first */ 27/* RAM offsets with 16-bit data, MSB first */
28#define MLX90614_RAW1 (MLX90614_OP_RAM | 0x04) /* raw data IR channel 1 */
29#define MLX90614_RAW2 (MLX90614_OP_RAM | 0x05) /* raw data IR channel 2 */
26#define MLX90614_TA (MLX90614_OP_RAM | 0x06) /* ambient temperature */ 30#define MLX90614_TA (MLX90614_OP_RAM | 0x06) /* ambient temperature */
27#define MLX90614_TOBJ1 (MLX90614_OP_RAM | 0x07) /* object 1 temperature */ 31#define MLX90614_TOBJ1 (MLX90614_OP_RAM | 0x07) /* object 1 temperature */
32#define MLX90614_TOBJ2 (MLX90614_OP_RAM | 0x08) /* object 2 temperature */
33
34/* EEPROM offsets with 16-bit data, MSB first */
35#define MLX90614_EMISSIVITY (MLX90614_OP_EEPROM | 0x04) /* emissivity correction coefficient */
36#define MLX90614_CONFIG (MLX90614_OP_EEPROM | 0x05) /* configuration register */
37
38/* Control bits in configuration register */
39#define MLX90614_CONFIG_IIR_SHIFT 0 /* IIR coefficient */
40#define MLX90614_CONFIG_IIR_MASK (0x7 << MLX90614_CONFIG_IIR_SHIFT)
41#define MLX90614_CONFIG_DUAL_SHIFT 6 /* single (0) or dual (1) IR sensor */
42#define MLX90614_CONFIG_DUAL_MASK (1 << MLX90614_CONFIG_DUAL_SHIFT)
43#define MLX90614_CONFIG_FIR_SHIFT 8 /* FIR coefficient */
44#define MLX90614_CONFIG_FIR_MASK (0x7 << MLX90614_CONFIG_FIR_SHIFT)
45#define MLX90614_CONFIG_GAIN_SHIFT 11 /* gain */
46#define MLX90614_CONFIG_GAIN_MASK (0x7 << MLX90614_CONFIG_GAIN_SHIFT)
47
48/* Timings (in ms) */
49#define MLX90614_TIMING_EEPROM 20 /* time for EEPROM write/erase to complete */
50#define MLX90614_TIMING_WAKEUP 34 /* time to hold SDA low for wake-up */
51#define MLX90614_TIMING_STARTUP 250 /* time before first data after wake-up */
28 52
29struct mlx90614_data { 53struct mlx90614_data {
30 struct i2c_client *client; 54 struct i2c_client *client;