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

Commit 2ef9d838 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-for-3.12d' of...

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

Jonathan writes:

Fourth round of IIO new drivers, functionality and cleanups for the 3.13 cycle.

New Drivers
* cm36651 combined RGB light and proximity sensor.

Core improvements

* Some more fixes and cleanups related to buffers.  These include the second
  half of a series which went is as fixes.  The basis for delaying until the
  next merge window is that some are too invasive for this late in a cycle
  and others only effect code paths current unused in the mainline tree.
  In this case we have:
   * protecting against concurrent userspace access
   * fixing a memory leak if a device goes away
   * avoiding always reallocating the buffer whether or not it has changed
     (a bug fix, but one with no functional changes other than a small speed
     improvement.)
   * Add reference counting for buffers to ensure they hang around if open
     from userspace or in kernel when the device is forcefully removed.
   * Return -ENODEV for buffer access operations when the device has gone
     away.
   * Add proper locking for iio_update_buffers (currently we only have one
     buffer per device in mainline, but an input bridge driver is under
     development which would make this bug 'real'.)
   * Wake up anyone waiting on a buffer if the device is unregistered.  A
     subsequent read will fail, notifying userspace that the device is no
     longer there rather than having it wait possibly for ever.

* Move the iio_sw_preenable functionality into the core.  This avoids drivers
  having to 'know' about how the buffers are implemented and is called by
  almost all drivers anyway.  Those that don't call it are not harmed by it
  being called.
* New registration approach for information (i.e. sysfs attributes) about
  events.  Much more generic and now similar to how the equivalent is
  handled for channel information.  The events infrastructure had been left
  behind by other changes so this brings it back in line.
* Using the new events registration approach, add a hysterisis event_info
  element and apply this to those drivers with this property.
* A little unitialized variable bug in the generic_buffer.c example.
* Factor out the code for freeing lists of IIO Device attributes to avoid
  some repitition.

Driver cleanups
* At91 driver gains touch screen support and some related fixes.
* Follow up series of patches removing the now redundant
  iio_sw_buffer_preenable calls.
* Lots of conversions to the new event registration methods.
* Another round of hmc5843 cleanups as that driver moves towards graduating
  from staging.
* Make some SoC drivers buildable if COMPILE_TEST is used.  Follow up fixes
  for a few bits and bobs that revealed.
* Add explicit includes of linux/of.h to those drivers making us of linux/of.h
parents 1c3e56f9 43e01bed
Loading
Loading
Loading
Loading
+56 −0
Original line number Diff line number Diff line
@@ -537,6 +537,62 @@ Description:
		value is in raw device units or in processed units (as _raw
		and _input do on sysfs direct channel read attributes).

What:		/sys/.../events/in_accel_x_thresh_rising_hysteresis
What:		/sys/.../events/in_accel_x_thresh_falling_hysteresis
What:		/sys/.../events/in_accel_x_thresh_either_hysteresis
What:		/sys/.../events/in_accel_y_thresh_rising_hysteresis
What:		/sys/.../events/in_accel_y_thresh_falling_hysteresis
What:		/sys/.../events/in_accel_y_thresh_either_hysteresis
What:		/sys/.../events/in_accel_z_thresh_rising_hysteresis
What:		/sys/.../events/in_accel_z_thresh_falling_hysteresis
What:		/sys/.../events/in_accel_z_thresh_either_hysteresis
What:		/sys/.../events/in_anglvel_x_thresh_rising_hysteresis
What:		/sys/.../events/in_anglvel_x_thresh_falling_hysteresis
What:		/sys/.../events/in_anglvel_x_thresh_either_hysteresis
What:		/sys/.../events/in_anglvel_y_thresh_rising_hysteresis
What:		/sys/.../events/in_anglvel_y_thresh_falling_hysteresis
What:		/sys/.../events/in_anglvel_y_thresh_either_hysteresis
What:		/sys/.../events/in_anglvel_z_thresh_rising_hysteresis
What:		/sys/.../events/in_anglvel_z_thresh_falling_hysteresis
What:		/sys/.../events/in_anglvel_z_thresh_either_hysteresis
What:		/sys/.../events/in_magn_x_thresh_rising_hysteresis
What:		/sys/.../events/in_magn_x_thresh_falling_hysteresis
What:		/sys/.../events/in_magn_x_thresh_either_hysteresis
What:		/sys/.../events/in_magn_y_thresh_rising_hysteresis
What:		/sys/.../events/in_magn_y_thresh_falling_hysteresis
What:		/sys/.../events/in_magn_y_thresh_either_hysteresis
What:		/sys/.../events/in_magn_z_thresh_rising_hysteresis
What:		/sys/.../events/in_magn_z_thresh_falling_hysteresis
What:		/sys/.../events/in_magn_z_thresh_either_hysteresis
What:		/sys/.../events/in_voltageY_thresh_rising_hysteresis
What:		/sys/.../events/in_voltageY_thresh_falling_hysteresis
What:		/sys/.../events/in_voltageY_thresh_either_hysteresis
What:		/sys/.../events/in_tempY_thresh_rising_hysteresis
What:		/sys/.../events/in_tempY_thresh_falling_hysteresis
What:		/sys/.../events/in_tempY_thresh_either_hysteresis
What:		/sys/.../events/in_illuminance0_thresh_falling_hysteresis
what:		/sys/.../events/in_illuminance0_thresh_rising_hysteresis
what:		/sys/.../events/in_illuminance0_thresh_either_hysteresis
what:		/sys/.../events/in_proximity0_thresh_falling_hysteresis
what:		/sys/.../events/in_proximity0_thresh_rising_hysteresis
what:		/sys/.../events/in_proximity0_thresh_either_hysteresis
KernelVersion:	3.13
Contact:	linux-iio@vger.kernel.org
Description:
		Specifies the hysteresis of threshold that the device is comparing
		against for the events enabled by
		<type>Y[_name]_thresh[_(rising|falling)]_hysteresis.
		If separate attributes exist for the two directions, but
		direction is not specified for this attribute, then a single
		hysteresis value applies to both directions.
		For falling events the hysteresis is added to the _value attribute for
		this event to get the upper threshold for when the event goes back to
		normal, for rising events the hysteresis is subtracted from the _value
		attribute. E.g. if in_voltage0_raw_thresh_rising_value is set to 1200
		and in_voltage0_raw_thresh_rising_hysteresis is set to 50. The event
		will get activated once in_voltage0_raw goes above 1200 and will become
		deactived again once the value falls below 1150.

What:		/sys/.../events/in_accel_x_raw_roc_rising_value
What:		/sys/.../events/in_accel_x_raw_roc_falling_value
What:		/sys/.../events/in_accel_y_raw_roc_rising_value
+7 −1
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@ Required properties:
  - interrupts: Should contain the IRQ line for the ADC
  - atmel,adc-channels-used: Bitmask of the channels muxed and enable for this
    device
  - atmel,adc-num-channels: Number of channels available in the ADC
  - atmel,adc-startup-time: Startup Time of the ADC in microseconds as
    defined in the datasheet
  - atmel,adc-vref: Reference voltage in millivolts for the conversions
@@ -24,6 +23,13 @@ Optional properties:
		       resolution will be used.
  - atmel,adc-sleep-mode: Boolean to enable sleep mode when no conversion
  - atmel,adc-sample-hold-time: Sample and Hold Time in microseconds
  - atmel,adc-ts-wires: Number of touch screen wires. Should be 4 or 5. If this
                        value is set, then adc driver will enable touch screen
                        support.
    NOTE: when adc touch screen enabled, the adc hardware trigger will be
          disabled. Since touch screen will occupied the trigger register.
  - atmel,adc-ts-pressure-threshold: a pressure threshold for touchscreen. It
                                     make touch detect more precision.
 
Optional trigger Nodes:
  - Required properties:
+26 −0
Original line number Diff line number Diff line
* Capella CM36651 I2C Proximity and Color Light sensor

Required properties:
- compatible: must be "capella,cm36651"
- reg: the I2C address of the device
- interrupts: interrupt-specifier for the sole interrupt
	      generated by the device
- vled-supply: regulator for the IR LED. IR_LED is a part
	      of the cm36651 for proximity detection.
	      As covered in ../../regulator/regulator.txt

Example:

	i2c_cm36651: i2c-gpio {
		/* ... */

		cm36651@18 {
			compatible = "capella,cm36651";
			reg = <0x18>;
			interrupt-parent = <&gpx0>;
			interrupts = <2 0>;
			vled-supply = <&ps_als_reg>;
		};

		/* ... */
	};
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ atmel Atmel Corporation
avago	Avago Technologies
bosch	Bosch Sensortec GmbH
brcm	Broadcom Corporation
capella	Capella Microsystems, Inc
cavium	Cavium, Inc.
chrp	Common Hardware Reference Platform
cirrus	Cirrus Logic, Inc.
+34 −0
Original line number Diff line number Diff line
@@ -60,14 +60,48 @@
#define AT91_ADC_IER		0x24		/* Interrupt Enable Register */
#define AT91_ADC_IDR		0x28		/* Interrupt Disable Register */
#define AT91_ADC_IMR		0x2C		/* Interrupt Mask Register */
#define		AT91_ADC_IER_PEN	(1 << 29)
#define		AT91_ADC_IER_NOPEN	(1 << 30)
#define		AT91_ADC_IER_XRDY	(1 << 20)
#define		AT91_ADC_IER_YRDY	(1 << 21)
#define		AT91_ADC_IER_PRDY	(1 << 22)
#define		AT91_ADC_ISR_PENS	(1 << 31)

#define AT91_ADC_CHR(n)		(0x30 + ((n) * 4))	/* Channel Data Register N */
#define		AT91_ADC_DATA		(0x3ff)

#define AT91_ADC_CDR0_9X5	(0x50)			/* Channel Data Register 0 for 9X5 */

#define AT91_ADC_ACR		0x94	/* Analog Control Register */
#define		AT91_ADC_ACR_PENDETSENS	(0x3 << 0)	/* pull-up resistor */

#define AT91_ADC_TSMR		0xB0
#define		AT91_ADC_TSMR_TSMODE	(3 << 0)	/* Touch Screen Mode */
#define			AT91_ADC_TSMR_TSMODE_NONE		(0 << 0)
#define			AT91_ADC_TSMR_TSMODE_4WIRE_NO_PRESS	(1 << 0)
#define			AT91_ADC_TSMR_TSMODE_4WIRE_PRESS	(2 << 0)
#define			AT91_ADC_TSMR_TSMODE_5WIRE		(3 << 0)
#define		AT91_ADC_TSMR_TSAV	(3 << 4)	/* Averages samples */
#define			AT91_ADC_TSMR_TSAV_(x)		((x) << 4)
#define		AT91_ADC_TSMR_SCTIM	(0x0f << 16)	/* Switch closure time */
#define		AT91_ADC_TSMR_PENDBC	(0x0f << 28)	/* Pen Debounce time */
#define			AT91_ADC_TSMR_PENDBC_(x)	((x) << 28)
#define		AT91_ADC_TSMR_NOTSDMA	(1 << 22)	/* No Touchscreen DMA */
#define		AT91_ADC_TSMR_PENDET_DIS	(0 << 24)	/* Pen contact detection disable */
#define		AT91_ADC_TSMR_PENDET_ENA	(1 << 24)	/* Pen contact detection enable */

#define AT91_ADC_TSXPOSR	0xB4
#define AT91_ADC_TSYPOSR	0xB8
#define AT91_ADC_TSPRESSR	0xBC

#define AT91_ADC_TRGR_9260	AT91_ADC_MR
#define AT91_ADC_TRGR_9G45	0x08
#define AT91_ADC_TRGR_9X5	0xC0

/* Trigger Register bit field */
#define		AT91_ADC_TRGR_TRGPER	(0xffff << 16)
#define			AT91_ADC_TRGR_TRGPER_(x)	((x) << 16)
#define		AT91_ADC_TRGR_TRGMOD	(0x7 << 0)
#define			AT91_ADC_TRGR_MOD_PERIOD_TRIG	(5 << 0)

#endif
Loading