linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] iio: mlx90614, take 2
@ 2014-05-02 15:57 Peter Meerwald
  2014-05-02 15:57 ` [PATCH 1/3] iio: Add TEMP_AMBIENT and TEMP_OBJECT channel modifiers Peter Meerwald
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Peter Meerwald @ 2014-05-02 15:57 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23

adding ABI documentation for object and ambient

Peter Meerwald (3):
  iio: Add TEMP_AMBIENT and TEMP_OBJECT channel modifiers
  iio: Add ABI documentation for object and ambient modifiers
  iio: Add Melexis mlx90614 contact-less infrared temperature sensor
    driver

 Documentation/ABI/testing/sysfs-bus-iio |   7 +-
 drivers/iio/industrialio-core.c         |   2 +
 drivers/iio/temperature/Kconfig         |  10 +++
 drivers/iio/temperature/Makefile        |   1 +
 drivers/iio/temperature/mlx90614.c      | 150 ++++++++++++++++++++++++++++++++
 include/linux/iio/types.h               |   2 +
 6 files changed, 170 insertions(+), 2 deletions(-)
 create mode 100644 drivers/iio/temperature/mlx90614.c

-- 
1.9.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] iio: Add TEMP_AMBIENT and TEMP_OBJECT channel modifiers
  2014-05-02 15:57 [PATCH 0/3] iio: mlx90614, take 2 Peter Meerwald
@ 2014-05-02 15:57 ` Peter Meerwald
  2014-05-03 10:39   ` Jonathan Cameron
  2014-05-02 15:57 ` [PATCH 2/3] iio: Add ABI documentation for object and ambient modifiers Peter Meerwald
  2014-05-02 15:57 ` [PATCH 3/3] iio: Add Melexis mlx90614 contact-less infrared temperature sensor driver Peter Meerwald
  2 siblings, 1 reply; 7+ messages in thread
From: Peter Meerwald @ 2014-05-02 15:57 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, Peter Meerwald

useful for contactless temperature sensors to distinguish
between the ambient temperature and the temperature of the object

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
 drivers/iio/industrialio-core.c | 2 ++
 include/linux/iio/types.h       | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index de8b1c2..4b1f375 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -85,6 +85,8 @@ static const char * const iio_modifier_names[] = {
 	[IIO_MOD_LIGHT_GREEN] = "green",
 	[IIO_MOD_LIGHT_BLUE] = "blue",
 	[IIO_MOD_QUATERNION] = "quaternion",
+	[IIO_MOD_TEMP_AMBIENT] = "ambient",
+	[IIO_MOD_TEMP_OBJECT] = "object",
 };
 
 /* relies on pairs of these shared then separate */
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
index 4fdab2e..d480631 100644
--- a/include/linux/iio/types.h
+++ b/include/linux/iio/types.h
@@ -54,6 +54,8 @@ enum iio_modifier {
 	IIO_MOD_LIGHT_GREEN,
 	IIO_MOD_LIGHT_BLUE,
 	IIO_MOD_QUATERNION,
+	IIO_MOD_TEMP_AMBIENT,
+	IIO_MOD_TEMP_OBJECT,
 };
 
 enum iio_event_type {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] iio: Add ABI documentation for object and ambient modifiers
  2014-05-02 15:57 [PATCH 0/3] iio: mlx90614, take 2 Peter Meerwald
  2014-05-02 15:57 ` [PATCH 1/3] iio: Add TEMP_AMBIENT and TEMP_OBJECT channel modifiers Peter Meerwald
@ 2014-05-02 15:57 ` Peter Meerwald
  2014-05-03 10:39   ` Jonathan Cameron
  2014-05-02 15:57 ` [PATCH 3/3] iio: Add Melexis mlx90614 contact-less infrared temperature sensor driver Peter Meerwald
  2 siblings, 1 reply; 7+ messages in thread
From: Peter Meerwald @ 2014-05-02 15:57 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, Peter Meerwald

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
 Documentation/ABI/testing/sysfs-bus-iio | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index 6b74691..ca3d3b7 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -114,14 +114,17 @@ What:		/sys/bus/iio/devices/iio:deviceX/in_temp_raw
 What:		/sys/bus/iio/devices/iio:deviceX/in_tempX_raw
 What:		/sys/bus/iio/devices/iio:deviceX/in_temp_x_raw
 What:		/sys/bus/iio/devices/iio:deviceX/in_temp_y_raw
-What:		/sys/bus/iio/devices/iio:deviceX/in_temp_z_raw
+What:		/sys/bus/iio/devices/iio:deviceX/in_temp_ambient_raw
+What:		/sys/bus/iio/devices/iio:deviceX/in_temp_object_raw
 KernelVersion:	2.6.35
 Contact:	linux-iio@vger.kernel.org
 Description:
 		Raw (unscaled no bias removal etc.) temperature measurement.
 		If an axis is specified it generally means that the temperature
 		sensor is associated with one part of a compound device (e.g.
-		a gyroscope axis). Units after application of scale and offset
+		a gyroscope axis). The ambient and object modifiers distinguish
+		between ambient (reference) and distant temperature for contact-
+		less measurements. Units after application of scale and offset
 		are milli degrees Celsius.
 
 What:		/sys/bus/iio/devices/iio:deviceX/in_tempX_input
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] iio: Add Melexis mlx90614 contact-less infrared temperature sensor driver
  2014-05-02 15:57 [PATCH 0/3] iio: mlx90614, take 2 Peter Meerwald
  2014-05-02 15:57 ` [PATCH 1/3] iio: Add TEMP_AMBIENT and TEMP_OBJECT channel modifiers Peter Meerwald
  2014-05-02 15:57 ` [PATCH 2/3] iio: Add ABI documentation for object and ambient modifiers Peter Meerwald
@ 2014-05-02 15:57 ` Peter Meerwald
  2014-05-03 10:38   ` Jonathan Cameron
  2 siblings, 1 reply; 7+ messages in thread
From: Peter Meerwald @ 2014-05-02 15:57 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, Peter Meerwald

I2C-controlled sensor measures ambient and object temperatuer

see
http://www.melexis.com/Infrared-Thermometer-Sensors/Infrared-Thermometer-Sensors/MLX90614-615.aspx

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
 drivers/iio/temperature/Kconfig    |  10 +++
 drivers/iio/temperature/Makefile   |   1 +
 drivers/iio/temperature/mlx90614.c | 150 +++++++++++++++++++++++++++++++++++++
 3 files changed, 161 insertions(+)
 create mode 100644 drivers/iio/temperature/mlx90614.c

diff --git a/drivers/iio/temperature/Kconfig b/drivers/iio/temperature/Kconfig
index 372f8fb..21feaa4 100644
--- a/drivers/iio/temperature/Kconfig
+++ b/drivers/iio/temperature/Kconfig
@@ -3,6 +3,16 @@
 #
 menu "Temperature sensors"
 
+config MLX90614
+	tristate "MLX90614 contact-less infrared sensor"
+	depends on I2C
+	help
+	  If you say yes here you get support for the Melexis
+	  MLX90614 contact-less infrared sensor connected with I2C.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called mlx90614.
+
 config TMP006
 	tristate "TMP006 infrared thermopile sensor"
 	depends on I2C
diff --git a/drivers/iio/temperature/Makefile b/drivers/iio/temperature/Makefile
index 24d7b60..40710a8 100644
--- a/drivers/iio/temperature/Makefile
+++ b/drivers/iio/temperature/Makefile
@@ -2,4 +2,5 @@
 # Makefile for industrial I/O temperature drivers
 #
 
+obj-$(CONFIG_MLX90614) += mlx90614.o
 obj-$(CONFIG_TMP006) += tmp006.o
diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/mlx90614.c
new file mode 100644
index 0000000..c8b6ac8
--- /dev/null
+++ b/drivers/iio/temperature/mlx90614.c
@@ -0,0 +1,150 @@
+/*
+ * mlx90614.c - Support for Melexis MLX90614 contactless IR temperature sensor
+ *
+ * Copyright (c) 2014 Peter Meerwald <pmeerw@pmeerw.net>
+ *
+ * This file is subject to the terms and conditions of version 2 of
+ * the GNU General Public License.  See the file COPYING in the main
+ * directory of this archive for more details.
+ *
+ * Driver for the Melexis MLX90614 I2C 16-bit IR thermopile sensor
+ *
+ * (7-bit I2C slave address 0x5a, 100KHz bus speed only!)
+ *
+ * TODO: sleep mode, configuration EEPROM
+ */
+
+#include <linux/err.h>
+#include <linux/i2c.h>
+#include <linux/module.h>
+
+#include <linux/iio/iio.h>
+
+#define MLX90614_OP_RAM 0x00
+
+/* RAM offsets with 16-bit data, MSB first */
+#define MLX90614_TA 0x06 /* ambient temperature */
+#define MLX90614_TOBJ1 0x07 /* object temperature */
+
+struct mlx90614_data {
+	struct i2c_client *client;
+};
+
+static int mlx90614_read_raw(struct iio_dev *indio_dev,
+			    struct iio_chan_spec const *channel, int *val,
+			    int *val2, long mask)
+{
+	struct mlx90614_data *data = iio_priv(indio_dev);
+	s32 ret;
+
+	switch (mask) {
+	case IIO_CHAN_INFO_RAW: /* 0.02K / LSB */
+		switch (channel->channel2) {
+		case IIO_MOD_TEMP_AMBIENT:
+			ret = i2c_smbus_read_word_data(data->client,
+			    MLX90614_OP_RAM | MLX90614_TA);
+			if (ret < 0)
+				return ret;
+			break;
+		case IIO_MOD_TEMP_OBJECT:
+			ret = i2c_smbus_read_word_data(data->client,
+			    MLX90614_OP_RAM | MLX90614_TOBJ1);
+			if (ret < 0)
+				return ret;
+			break;
+		default:
+			return -EINVAL;
+		}
+		*val = ret;
+		return IIO_VAL_INT;
+	case IIO_CHAN_INFO_OFFSET:
+		*val = 13657;
+		*val2 = 500000;
+		return IIO_VAL_INT_PLUS_MICRO;
+	case IIO_CHAN_INFO_SCALE:
+		*val = 20;
+		return IIO_VAL_INT;
+	default:
+		return -EINVAL;
+	}
+}
+
+static const struct iio_chan_spec mlx90614_channels[] = {
+	{
+		.type = IIO_TEMP,
+		.modified = 1,
+		.channel2 = IIO_MOD_TEMP_AMBIENT,
+		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
+		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |
+		    BIT(IIO_CHAN_INFO_SCALE),
+	},
+	{
+		.type = IIO_TEMP,
+		.modified = 1,
+		.channel2 = IIO_MOD_TEMP_OBJECT,
+		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
+		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |
+		    BIT(IIO_CHAN_INFO_SCALE),
+	},
+};
+
+static const struct iio_info mlx90614_info = {
+	.read_raw = mlx90614_read_raw,
+	.driver_module = THIS_MODULE,
+};
+
+static int mlx90614_probe(struct i2c_client *client,
+			 const struct i2c_device_id *id)
+{
+	struct iio_dev *indio_dev;
+	struct mlx90614_data *data;
+
+	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA))
+		return -ENODEV;
+
+	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
+	if (!indio_dev)
+		return -ENOMEM;
+
+	data = iio_priv(indio_dev);
+	i2c_set_clientdata(client, indio_dev);
+	data->client = client;
+
+	indio_dev->dev.parent = &client->dev;
+	indio_dev->name = id->name;
+	indio_dev->modes = INDIO_DIRECT_MODE;
+	indio_dev->info = &mlx90614_info;
+
+	indio_dev->channels = mlx90614_channels;
+	indio_dev->num_channels = ARRAY_SIZE(mlx90614_channels);
+
+	return iio_device_register(indio_dev);
+}
+
+static int mlx90614_remove(struct i2c_client *client)
+{
+	iio_device_unregister(i2c_get_clientdata(client));
+
+	return 0;
+}
+
+static const struct i2c_device_id mlx90614_id[] = {
+	{ "mlx90614", 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, mlx90614_id);
+
+static struct i2c_driver mlx90614_driver = {
+	.driver = {
+		.name	= "mlx90614",
+		.owner	= THIS_MODULE,
+	},
+	.probe = mlx90614_probe,
+	.remove = mlx90614_remove,
+	.id_table = mlx90614_id,
+};
+module_i2c_driver(mlx90614_driver);
+
+MODULE_AUTHOR("Peter Meerwald <pmeerw@pmeerw.net>");
+MODULE_DESCRIPTION("Melexis MLX90614 contactless IR temperature sensor driver");
+MODULE_LICENSE("GPL");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] iio: Add Melexis mlx90614 contact-less infrared temperature sensor driver
  2014-05-02 15:57 ` [PATCH 3/3] iio: Add Melexis mlx90614 contact-less infrared temperature sensor driver Peter Meerwald
@ 2014-05-03 10:38   ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2014-05-03 10:38 UTC (permalink / raw)
  To: Peter Meerwald, linux-iio

On 02/05/14 16:57, Peter Meerwald wrote:
> I2C-controlled sensor measures ambient and object temperatuer
>
> see
> http://www.melexis.com/Infrared-Thermometer-Sensors/Infrared-Thermometer-Sensors/MLX90614-615.aspx
>
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Another nice short excelent driver.

Applied to the togreg branch of iio.git initially pushed out as testing
for the autobuilders to play.

J
> ---
>   drivers/iio/temperature/Kconfig    |  10 +++
>   drivers/iio/temperature/Makefile   |   1 +
>   drivers/iio/temperature/mlx90614.c | 150 +++++++++++++++++++++++++++++++++++++
>   3 files changed, 161 insertions(+)
>   create mode 100644 drivers/iio/temperature/mlx90614.c
>
> diff --git a/drivers/iio/temperature/Kconfig b/drivers/iio/temperature/Kconfig
> index 372f8fb..21feaa4 100644
> --- a/drivers/iio/temperature/Kconfig
> +++ b/drivers/iio/temperature/Kconfig
> @@ -3,6 +3,16 @@
>   #
>   menu "Temperature sensors"
>
> +config MLX90614
> +	tristate "MLX90614 contact-less infrared sensor"
> +	depends on I2C
> +	help
> +	  If you say yes here you get support for the Melexis
> +	  MLX90614 contact-less infrared sensor connected with I2C.
> +
> +	  This driver can also be built as a module. If so, the module will
> +	  be called mlx90614.
> +
>   config TMP006
>   	tristate "TMP006 infrared thermopile sensor"
>   	depends on I2C
> diff --git a/drivers/iio/temperature/Makefile b/drivers/iio/temperature/Makefile
> index 24d7b60..40710a8 100644
> --- a/drivers/iio/temperature/Makefile
> +++ b/drivers/iio/temperature/Makefile
> @@ -2,4 +2,5 @@
>   # Makefile for industrial I/O temperature drivers
>   #
>
> +obj-$(CONFIG_MLX90614) += mlx90614.o
>   obj-$(CONFIG_TMP006) += tmp006.o
> diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/mlx90614.c
> new file mode 100644
> index 0000000..c8b6ac8
> --- /dev/null
> +++ b/drivers/iio/temperature/mlx90614.c
> @@ -0,0 +1,150 @@
> +/*
> + * mlx90614.c - Support for Melexis MLX90614 contactless IR temperature sensor
> + *
> + * Copyright (c) 2014 Peter Meerwald <pmeerw@pmeerw.net>
> + *
> + * This file is subject to the terms and conditions of version 2 of
> + * the GNU General Public License.  See the file COPYING in the main
> + * directory of this archive for more details.
> + *
> + * Driver for the Melexis MLX90614 I2C 16-bit IR thermopile sensor
> + *
> + * (7-bit I2C slave address 0x5a, 100KHz bus speed only!)
> + *
> + * TODO: sleep mode, configuration EEPROM
> + */
> +
> +#include <linux/err.h>
> +#include <linux/i2c.h>
> +#include <linux/module.h>
> +
> +#include <linux/iio/iio.h>
> +
> +#define MLX90614_OP_RAM 0x00
> +
> +/* RAM offsets with 16-bit data, MSB first */
> +#define MLX90614_TA 0x06 /* ambient temperature */
> +#define MLX90614_TOBJ1 0x07 /* object temperature */
> +
> +struct mlx90614_data {
> +	struct i2c_client *client;
> +};
> +
> +static int mlx90614_read_raw(struct iio_dev *indio_dev,
> +			    struct iio_chan_spec const *channel, int *val,
> +			    int *val2, long mask)
> +{
> +	struct mlx90614_data *data = iio_priv(indio_dev);
> +	s32 ret;
> +
> +	switch (mask) {
> +	case IIO_CHAN_INFO_RAW: /* 0.02K / LSB */
> +		switch (channel->channel2) {
> +		case IIO_MOD_TEMP_AMBIENT:
> +			ret = i2c_smbus_read_word_data(data->client,
> +			    MLX90614_OP_RAM | MLX90614_TA);
> +			if (ret < 0)
> +				return ret;
> +			break;
> +		case IIO_MOD_TEMP_OBJECT:
> +			ret = i2c_smbus_read_word_data(data->client,
> +			    MLX90614_OP_RAM | MLX90614_TOBJ1);
> +			if (ret < 0)
> +				return ret;
> +			break;
> +		default:
> +			return -EINVAL;
> +		}
> +		*val = ret;
> +		return IIO_VAL_INT;
> +	case IIO_CHAN_INFO_OFFSET:
> +		*val = 13657;
> +		*val2 = 500000;
> +		return IIO_VAL_INT_PLUS_MICRO;
> +	case IIO_CHAN_INFO_SCALE:
> +		*val = 20;
> +		return IIO_VAL_INT;
> +	default:
> +		return -EINVAL;
> +	}
> +}
> +
> +static const struct iio_chan_spec mlx90614_channels[] = {
> +	{
> +		.type = IIO_TEMP,
> +		.modified = 1,
> +		.channel2 = IIO_MOD_TEMP_AMBIENT,
> +		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
> +		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |
> +		    BIT(IIO_CHAN_INFO_SCALE),
> +	},
> +	{
> +		.type = IIO_TEMP,
> +		.modified = 1,
> +		.channel2 = IIO_MOD_TEMP_OBJECT,
> +		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
> +		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |
> +		    BIT(IIO_CHAN_INFO_SCALE),
> +	},
> +};
> +
> +static const struct iio_info mlx90614_info = {
> +	.read_raw = mlx90614_read_raw,
> +	.driver_module = THIS_MODULE,
> +};
> +
> +static int mlx90614_probe(struct i2c_client *client,
> +			 const struct i2c_device_id *id)
> +{
> +	struct iio_dev *indio_dev;
> +	struct mlx90614_data *data;
> +
> +	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA))
> +		return -ENODEV;
> +
> +	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
> +	if (!indio_dev)
> +		return -ENOMEM;
> +
> +	data = iio_priv(indio_dev);
> +	i2c_set_clientdata(client, indio_dev);
> +	data->client = client;
> +
> +	indio_dev->dev.parent = &client->dev;
> +	indio_dev->name = id->name;
> +	indio_dev->modes = INDIO_DIRECT_MODE;
> +	indio_dev->info = &mlx90614_info;
> +
> +	indio_dev->channels = mlx90614_channels;
> +	indio_dev->num_channels = ARRAY_SIZE(mlx90614_channels);
> +
> +	return iio_device_register(indio_dev);
> +}
> +
> +static int mlx90614_remove(struct i2c_client *client)
> +{
> +	iio_device_unregister(i2c_get_clientdata(client));
> +
> +	return 0;
> +}
> +
> +static const struct i2c_device_id mlx90614_id[] = {
> +	{ "mlx90614", 0 },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(i2c, mlx90614_id);
> +
> +static struct i2c_driver mlx90614_driver = {
> +	.driver = {
> +		.name	= "mlx90614",
> +		.owner	= THIS_MODULE,
> +	},
> +	.probe = mlx90614_probe,
> +	.remove = mlx90614_remove,
> +	.id_table = mlx90614_id,
> +};
> +module_i2c_driver(mlx90614_driver);
> +
> +MODULE_AUTHOR("Peter Meerwald <pmeerw@pmeerw.net>");
> +MODULE_DESCRIPTION("Melexis MLX90614 contactless IR temperature sensor driver");
> +MODULE_LICENSE("GPL");
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] iio: Add ABI documentation for object and ambient modifiers
  2014-05-02 15:57 ` [PATCH 2/3] iio: Add ABI documentation for object and ambient modifiers Peter Meerwald
@ 2014-05-03 10:39   ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2014-05-03 10:39 UTC (permalink / raw)
  To: Peter Meerwald, linux-iio

On 02/05/14 16:57, Peter Meerwald wrote:
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Applied to the togreg branch of iio.git

Thanks,

> ---
>   Documentation/ABI/testing/sysfs-bus-iio | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 6b74691..ca3d3b7 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -114,14 +114,17 @@ What:		/sys/bus/iio/devices/iio:deviceX/in_temp_raw
>   What:		/sys/bus/iio/devices/iio:deviceX/in_tempX_raw
>   What:		/sys/bus/iio/devices/iio:deviceX/in_temp_x_raw
>   What:		/sys/bus/iio/devices/iio:deviceX/in_temp_y_raw
> -What:		/sys/bus/iio/devices/iio:deviceX/in_temp_z_raw
> +What:		/sys/bus/iio/devices/iio:deviceX/in_temp_ambient_raw
> +What:		/sys/bus/iio/devices/iio:deviceX/in_temp_object_raw
>   KernelVersion:	2.6.35
>   Contact:	linux-iio@vger.kernel.org
>   Description:
>   		Raw (unscaled no bias removal etc.) temperature measurement.
>   		If an axis is specified it generally means that the temperature
>   		sensor is associated with one part of a compound device (e.g.
> -		a gyroscope axis). Units after application of scale and offset
> +		a gyroscope axis). The ambient and object modifiers distinguish
> +		between ambient (reference) and distant temperature for contact-
> +		less measurements. Units after application of scale and offset
>   		are milli degrees Celsius.
>
>   What:		/sys/bus/iio/devices/iio:deviceX/in_tempX_input
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] iio: Add TEMP_AMBIENT and TEMP_OBJECT channel modifiers
  2014-05-02 15:57 ` [PATCH 1/3] iio: Add TEMP_AMBIENT and TEMP_OBJECT channel modifiers Peter Meerwald
@ 2014-05-03 10:39   ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2014-05-03 10:39 UTC (permalink / raw)
  To: Peter Meerwald, linux-iio

On 02/05/14 16:57, Peter Meerwald wrote:
> useful for contactless temperature sensors to distinguish
> between the ambient temperature and the temperature of the object
>
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Applied to the togreg branch of iio.git

Thanks
> ---
>   drivers/iio/industrialio-core.c | 2 ++
>   include/linux/iio/types.h       | 2 ++
>   2 files changed, 4 insertions(+)
>
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index de8b1c2..4b1f375 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -85,6 +85,8 @@ static const char * const iio_modifier_names[] = {
>   	[IIO_MOD_LIGHT_GREEN] = "green",
>   	[IIO_MOD_LIGHT_BLUE] = "blue",
>   	[IIO_MOD_QUATERNION] = "quaternion",
> +	[IIO_MOD_TEMP_AMBIENT] = "ambient",
> +	[IIO_MOD_TEMP_OBJECT] = "object",
>   };
>
>   /* relies on pairs of these shared then separate */
> diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
> index 4fdab2e..d480631 100644
> --- a/include/linux/iio/types.h
> +++ b/include/linux/iio/types.h
> @@ -54,6 +54,8 @@ enum iio_modifier {
>   	IIO_MOD_LIGHT_GREEN,
>   	IIO_MOD_LIGHT_BLUE,
>   	IIO_MOD_QUATERNION,
> +	IIO_MOD_TEMP_AMBIENT,
> +	IIO_MOD_TEMP_OBJECT,
>   };
>
>   enum iio_event_type {
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-05-03 10:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-02 15:57 [PATCH 0/3] iio: mlx90614, take 2 Peter Meerwald
2014-05-02 15:57 ` [PATCH 1/3] iio: Add TEMP_AMBIENT and TEMP_OBJECT channel modifiers Peter Meerwald
2014-05-03 10:39   ` Jonathan Cameron
2014-05-02 15:57 ` [PATCH 2/3] iio: Add ABI documentation for object and ambient modifiers Peter Meerwald
2014-05-03 10:39   ` Jonathan Cameron
2014-05-02 15:57 ` [PATCH 3/3] iio: Add Melexis mlx90614 contact-less infrared temperature sensor driver Peter Meerwald
2014-05-03 10:38   ` Jonathan Cameron

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).