Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ccca155 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-for-v4.2a' of...

Merge tag 'iio-for-v4.2a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First round of new drivers, functionality and cleanups for the 4.2 cycle

New drivers / device support
* st sensors driver, lsm303dlh magnetometer support.
* ltr501 - support ltr301 and ltr559 chips.

New functionality
* IIO_CHAN_INFO_CALIBEMISSIVITY for thermopile sensors.
* kxcjk1013 - make driver operational with external trigger.
* Add iio targets to the tools Makefile.

Cleanups
* st sensors - more helpful error message if device id wrong or irq request
  fails, explicitly make the Block Data Update optional rather
  than relying on writes to address 0 not doing anything, make interrupt
  support optional (Not always wired, and not all devices actually have
  an interrupt line.)
* kxcjk-1013 white space additions for readability, add the KXCJ9000 ACPI
  id as seen in the wild.
* sx9500 - GPIO reset support, refactor the GPIO interrupt code, add power
  management, optimize power usage by powering down when possible, rename
  the gpio interrupt pin to be more useful, trivial return path simplification,
  trivial formatting fixes.
* isl29018 -  move towards ABI compliance with a view to moving this driver
  out of staging, add some brackets to ensure code works as expected.  Note
  there is no actual bug as the condition being tested is always true
  (with current devices).
* ltr501 - add regmap support to get caching etc for later patches,
  fix a parameter sanity check that always fails (bug introduced
  earlier in this series), ACPI enumeration support,
  interrupt rate control support, interrupt support in general and
  integration time control support, code alignment cleanups.
* mma9553 - a number of little cleanups following a review from Hartmut
  after I'd already applied the original driver patch.
* tmp006 - prefix some defines with TMP006 for consistency.
* tsl4531 - cleanup some wrong prefixes, presumably from copy and paste.
* mlx90614 - check for errors in read values, add power management,
  add emissivity setting, add device tree binding documentation,
  fix a duplicate const warning.
* ti_am335x_adc - refactor the DT parsing into a separate function.
parents 7192a5dd 1038a687
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1364,3 +1364,14 @@ Description:
		hwfifo_watermak_min but not equal to any of the values in this
		list, the driver will chose an appropriate value for the
		hardware fifo watermark level.

What:		/sys/bus/iio/devices/iio:deviceX/in_temp_calibemissivity
What:		/sys/bus/iio/devices/iio:deviceX/in_tempX_calibemissivity
What:		/sys/bus/iio/devices/iio:deviceX/in_temp_object_calibemissivity
What:		/sys/bus/iio/devices/iio:deviceX/in_tempX_object_calibemissivity
KernelVersion:	4.1
Contact:	linux-iio@vger.kernel.org
Description:
		The emissivity ratio of the surface in the field of view of the
		contactless temperature sensor.  Emissivity varies from 0 to 1,
		with 1 being the emissivity of a black body.
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ Gyroscopes:
- st,lsm330-gyro

Magnetometers:
- st,lsm303dlh-magn
- st,lsm303dlhc-magn
- st,lsm303dlm-magn
- st,lis3mdl-magn
+24 −0
Original line number Diff line number Diff line
* Melexis MLX90614 contactless IR temperature sensor

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

Required properties:

  - compatible: should be "melexis,mlx90614"
  - reg: the I2C address of the sensor

Optional properties:

  - wakeup-gpios: device tree identifier of the GPIO connected to the SDA line
      to hold low in order to wake up the device.  In normal operation, the
      GPIO is set as input and will not interfere in I2C communication.  There
      is no need for a GPIO driving the SCL line.  If no GPIO is given, power
      management is disabled.

Example:

mlx90614@5a {
	compatible = "melexis,mlx90614";
	reg = <0x5a>;
	wakeup-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
};
+1 −0
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ lltc Linear Technology Corporation
marvell	Marvell Technology Group Ltd.
maxim	Maxim Integrated Products
mediatek	MediaTek Inc.
melexis	Melexis N.V.
merrii	Merrii Technology Co., Ltd.
micrel	Micrel Inc.
microchip	Microchip Technology Inc.
+27 −15
Original line number Diff line number Diff line
@@ -875,15 +875,18 @@ static int kxcjk1013_write_event_config(struct iio_dev *indio_dev,
	return 0;
}

static int kxcjk1013_validate_trigger(struct iio_dev *indio_dev,
				      struct iio_trigger *trig)
static int kxcjk1013_buffer_preenable(struct iio_dev *indio_dev)
{
	struct kxcjk1013_data *data = iio_priv(indio_dev);

	if (data->dready_trig != trig && data->motion_trig != trig)
		return -EINVAL;
	return kxcjk1013_set_power_state(data, true);
}

	return 0;
static int kxcjk1013_buffer_postdisable(struct iio_dev *indio_dev)
{
	struct kxcjk1013_data *data = iio_priv(indio_dev);

	return kxcjk1013_set_power_state(data, false);
}

static IIO_CONST_ATTR_SAMP_FREQ_AVAIL(
@@ -935,6 +938,13 @@ static const struct iio_chan_spec kxcjk1013_channels[] = {
	IIO_CHAN_SOFT_TIMESTAMP(3),
};

static const struct iio_buffer_setup_ops kxcjk1013_buffer_setup_ops = {
	.preenable		= kxcjk1013_buffer_preenable,
	.postenable		= iio_triggered_buffer_postenable,
	.postdisable		= kxcjk1013_buffer_postdisable,
	.predisable		= iio_triggered_buffer_predisable,
};

static const struct iio_info kxcjk1013_info = {
	.attrs			= &kxcjk1013_attrs_group,
	.read_raw		= kxcjk1013_read_raw,
@@ -943,7 +953,6 @@ static const struct iio_info kxcjk1013_info = {
	.write_event_value	= kxcjk1013_write_event,
	.write_event_config	= kxcjk1013_write_event_config,
	.read_event_config	= kxcjk1013_read_event_config,
	.validate_trigger	= kxcjk1013_validate_trigger,
	.driver_module		= THIS_MODULE,
};

@@ -1147,8 +1156,10 @@ static const char *kxcjk1013_match_acpi_device(struct device *dev,
	id = acpi_match_device(dev->driver->acpi_match_table, dev);
	if (!id)
		return NULL;

	if (strcmp(id->id, "SMO8500") == 0)
		*is_smo8500_device = true;

	*chipset = (enum kx_chipset)id->driver_data;

	return dev_name(dev);
@@ -1163,6 +1174,7 @@ static int kxcjk1013_gpio_probe(struct i2c_client *client,

	if (!client)
		return -EINVAL;

	if (data->is_smo8500_device)
		return -ENOTSUPP;

@@ -1276,17 +1288,16 @@ static int kxcjk1013_probe(struct i2c_client *client,
			data->motion_trig = NULL;
			goto err_trigger_unregister;
		}
	}

	ret = iio_triggered_buffer_setup(indio_dev,
					 &iio_pollfunc_store_time,
					 kxcjk1013_trigger_handler,
						NULL);
					 &kxcjk1013_buffer_setup_ops);
	if (ret < 0) {
			dev_err(&client->dev,
					"iio triggered buffer setup failed\n");
		dev_err(&client->dev, "iio triggered buffer setup failed\n");
		goto err_trigger_unregister;
	}
	}

	ret = iio_device_register(indio_dev);
	if (ret < 0) {
@@ -1418,6 +1429,7 @@ static const struct dev_pm_ops kxcjk1013_pm_ops = {
static const struct acpi_device_id kx_acpi_match[] = {
	{"KXCJ1013", KXCJK1013},
	{"KXCJ1008", KXCJ91008},
	{"KXCJ9000", KXCJ91008},
	{"KXTJ1009", KXTJ21009},
	{"SMO8500",  KXCJ91008},
	{ },
Loading