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

Commit 3ffdea3f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-for-3.13a' of...

Merge tag 'iio-for-3.13a' 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 IIO in the 3.13 cycle

A number of new drivers and some new functionality + a lot of cleanups
all over IIO.

New Core Elements

1) New INT_TIME info_mask element for integration time, which may have
   different effects on measurement noise and similar, than an amplifier
   and hence is different from existing SCALE.  Already existed in some
   drivers as a custom attribute.

2) Introduce a iio_push_buffers_with_timestamp helper to cover the common
   case of filling the last 64 bits of data to be passed to the buffer with
   a timestamp.  Applied to lots of drivers. Cuts down on repeated code and
   moves a slightly fiddly bit of logic into a single location.

3) Introduce info_mask_[shared_by_dir/shared_by_all] elements to allow support
   of elements such as sampling_frequency which is typically shared by all
   input channels on a device.  This reduces code and makes these controls
   available from in kernel consumers of IIO devices.

New drivers

1) MCP3422/3/4 ADC

2) TSL4531 ambient light sensor

3) TCS3472/5 color light sensor

4) GP2AP020A00F ambient light / proximity sensor

5) LPS001WP support added to ST pressure sensor driver.

New driver functionality

1) ti_am335x_adc Add buffered sampling support.
   This device has a hardware fifo that is fed directly into an IIO kfifo
   buffer based on a watershed interrupt.  Note this will act as an example
   of how to handle this increasingly common type of device.
   The only previous example - sca3000 - take a less than optimal approach
   which is largely why it is still in staging.
   A couple of little cleanups for that new functionality followed later.

Core cleanups:

1) MAINTAINERS - Sachin actually brought my email address up to date because
   I said I'd do it and never got around to it :)

2) Assign buffer list elements as single element lists to simplify the
   iio_buffer_is_active logic.

3) wake_up_interruptible_poll instead of wake_up_interruptible to only wake
   up threads waiting for poll notifications.

4) Add O_CLOEXEC flag to anon_inode_get_fd call for IIO event interface.

5) Change iio_push_to_buffers to take a void * pointer so as to avoid some
   annoying and unnecessary type casts.

6) iio_compute_scan_bytes incorrectly took a long rather than unsigned long.

7) Various minor tidy ups.

Driver cleanups (in no particular order)

1) Another set of devm_ allocations patches from Sachin Kamat.

2) tsl2x7x - 0 to NULL cleanup.

3) hmc5843 - fix missing > in MODULE_AUTHOR

4) Set of strict_strto* to kstrto* conversions.

5) mxs-lradc - fix ordering of resource removal to match creation

6) mxs-lradc - add MODULE_ALIAS

7) adc7606 - drop a work pending test duplicated in core functions.

8) hmc5843 - devm_ allocation patch

9) Series of redundant breaks removed.

10) ad2s1200 - pr_err -> dev_err

11) adjd_s311 - use INT_TIME

12)  ST sensors - large set of cleanups from Lee Jones and removed restriction
    to using only triggers provided by the st_sensors themselves from
    Dennis Ciocca.

13) dummy and tmp006 provide sampling_frequency via info_mask_shared_by_all.

14) tcs3472 - fix incorrect buffer size and wrong device pointer used in
    suspend / resume functions.

15) max1363 - use defaults for buffer setup ops as provided by the triggered
    buffer helpers as they are the same as were specified in max1363 driver.

16) Trivial tidy ups in a number of other drivers.
parents 9076b09e 074b6a8d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -811,3 +811,14 @@ Description:
		Writing '1' stores the current device configuration into
		on-chip EEPROM. After power-up or chip reset the device will
		automatically load the saved configuration.

What:		/sys/.../iio:deviceX/in_intensity_red_integration_time
What:		/sys/.../iio:deviceX/in_intensity_green_integration_time
What:		/sys/.../iio:deviceX/in_intensity_blue_integration_time
What:		/sys/.../iio:deviceX/in_intensity_clear_integration_time
What:		/sys/.../iio:deviceX/in_illuminance_integration_time
KernelVersion:	3.12
Contact:	linux-iio@vger.kernel.org
Description:
		This attribute is used to get/set the integration time in
		seconds.
+21 −0
Original line number Diff line number Diff line
* Sharp GP2AP020A00F I2C Proximity/ALS sensor

The proximity detector sensor requires power supply
for its built-in led. It is also defined by this binding.

Required properties:

  - compatible : should be "sharp,gp2ap020a00f"
  - reg : the I2C slave address of the light sensor
  - interrupts : interrupt specifier for the sole interrupt generated
		 by the device
  - vled-supply : VLED power supply, as covered in ../regulator/regulator.txt

Example:

gp2ap020a00f@39 {
	compatible = "sharp,gp2ap020a00f";
	reg = <0x39>;
	interrupts = <2 0>;
	vled-supply = <...>;
};
+2 −2
Original line number Diff line number Diff line
@@ -4195,7 +4195,7 @@ S: Maintained
F:	drivers/media/rc/iguanair.c

IIO SUBSYSTEM AND DRIVERS
M:	Jonathan Cameron <jic23@cam.ac.uk>
M:	Jonathan Cameron <jic23@kernel.org>
L:	linux-iio@vger.kernel.org
S:	Maintained
F:	drivers/iio/
@@ -7947,7 +7947,7 @@ S: Maintained
F:	drivers/staging/media/go7007/

STAGING - INDUSTRIAL IO
M:	Jonathan Cameron <jic23@cam.ac.uk>
M:	Jonathan Cameron <jic23@kernel.org>
L:	linux-iio@vger.kernel.org
S:	Odd Fixes
F:	drivers/staging/iio/
+2 −5
Original line number Diff line number Diff line
@@ -471,13 +471,10 @@ static irqreturn_t bma180_trigger_handler(int irq, void *p)
	struct iio_poll_func *pf = p;
	struct iio_dev *indio_dev = pf->indio_dev;
	struct bma180_data *data = iio_priv(indio_dev);
	int64_t time_ns = iio_get_time_ns();
	int bit, ret, i = 0;

	mutex_lock(&data->mutex);
	if (indio_dev->scan_timestamp) {
		ret = indio_dev->scan_bytes / sizeof(s64) - 1;
		((s64 *)data->buff)[ret] = iio_get_time_ns();
	}

	for_each_set_bit(bit, indio_dev->buffer->scan_mask,
			 indio_dev->masklength) {
@@ -490,7 +487,7 @@ static irqreturn_t bma180_trigger_handler(int irq, void *p)
	}
	mutex_unlock(&data->mutex);

	iio_push_to_buffers(indio_dev, (u8 *)data->buff);
	iio_push_to_buffers_with_timestamp(indio_dev, data->buff, time_ns);
err:
	iio_trigger_notify_done(indio_dev->trig);

+4 −3
Original line number Diff line number Diff line
@@ -182,10 +182,11 @@ static const struct iio_info accel_3d_info = {
};

/* Function to push data to buffer */
static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
static void hid_sensor_push_data(struct iio_dev *indio_dev, const void *data,
	int len)
{
	dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
	iio_push_to_buffers(indio_dev, (u8 *)data);
	iio_push_to_buffers(indio_dev, data);
}

/* Callback handler to send event after all samples are received and captured */
@@ -200,7 +201,7 @@ static int accel_3d_proc_event(struct hid_sensor_hub_device *hsdev,
				accel_state->common_attributes.data_ready);
	if (accel_state->common_attributes.data_ready)
		hid_sensor_push_data(indio_dev,
				(u8 *)accel_state->accel_val,
				accel_state->accel_val,
				sizeof(accel_state->accel_val));

	return 0;
Loading