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

Commit 040bf7d6 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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

Merge tag 'iio-for-3.17d' 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.17 cycle

New functionality
* A new modifier to indicate that a rotation is relative to either
  true or magnetic north.  This is to be used by some magnetometers
  that provide data in this way.
* hid magnetometer now supports output rotations from various variants on
  North
* HMC5843 driver converted to regmap and reworked to allow easy support
  of other similar devices.  Support for HMC5983 added via both i2c and SPI.
* Rework of Exynos driver to simplify extension to support more devices.
* Addition of support for the Exynos3250 ADC (which requires an additional
  clock)  Support for quite a few more devices on its way.

Cleanups
* ad7997 - a number of cleanups and tweaks to how the events are controlled
  to make it more intuitive.
* kxcjk - cleanups and minor fixes for this new driver.
parents 16fae052 e6ca2d84
Loading
Loading
Loading
Loading
+82 −0
Original line number Diff line number Diff line
@@ -260,6 +260,10 @@ What: /sys/bus/iio/devices/iio:deviceX/in_magn_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_magn_x_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_magn_y_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_magn_z_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_rot_from_north_magnetic_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_rot_from_north_true_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_rot_from_north_magnetic_tilt_comp_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_rot_from_north_true_tilt_comp_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_pressureY_scale
What:		/sys/bus/iio/devices/iio:deviceX/in_pressure_scale
KernelVersion:	2.6.35
@@ -447,6 +451,14 @@ What: /sys/.../iio:deviceX/events/in_magn_y_thresh_rising_en
What:		/sys/.../iio:deviceX/events/in_magn_y_thresh_falling_en
What:		/sys/.../iio:deviceX/events/in_magn_z_thresh_rising_en
What:		/sys/.../iio:deviceX/events/in_magn_z_thresh_falling_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_magnetic_thresh_rising_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_magnetic_thresh_falling_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_true_thresh_rising_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_true_thresh_falling_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_magnetic_tilt_comp_thresh_rising_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_magnetic_tilt_comp_thresh_falling_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_true_tilt_comp_thresh_rising_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_true_tilt_comp_thresh_falling_en
What:		/sys/.../iio:deviceX/events/in_voltageY_supply_thresh_rising_en
What:		/sys/.../iio:deviceX/events/in_voltageY_supply_thresh_falling_en
What:		/sys/.../iio:deviceX/events/in_voltageY_thresh_rising_en
@@ -492,6 +504,14 @@ What: /sys/.../iio:deviceX/events/in_magn_y_roc_rising_en
What:		/sys/.../iio:deviceX/events/in_magn_y_roc_falling_en
What:		/sys/.../iio:deviceX/events/in_magn_z_roc_rising_en
What:		/sys/.../iio:deviceX/events/in_magn_z_roc_falling_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_magnetic_roc_rising_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_magnetic_roc_falling_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_true_roc_rising_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_true_roc_falling_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_magnetic_tilt_comp_roc_rising_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_magnetic_tilt_comp_roc_falling_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_true_tilt_comp_roc_rising_en
What:		/sys/.../iio:deviceX/events/in_rot_from_north_true_tilt_comp_roc_falling_en
What:		/sys/.../iio:deviceX/events/in_voltageY_supply_roc_rising_en
What:		/sys/.../iio:deviceX/events/in_voltageY_supply_roc_falling_en
What:		/sys/.../iio:deviceX/events/in_voltageY_roc_rising_en
@@ -538,6 +558,14 @@ What: /sys/.../events/in_magn_y_raw_thresh_rising_value
What:		/sys/.../events/in_magn_y_raw_thresh_falling_value
What:		/sys/.../events/in_magn_z_raw_thresh_rising_value
What:		/sys/.../events/in_magn_z_raw_thresh_falling_value
What:		/sys/.../events/in_rot_from_north_magnetic_raw_thresh_rising_value
What:		/sys/.../events/in_rot_from_north_magnetic_raw_thresh_falling_value
What:		/sys/.../events/in_rot_from_north_true_raw_thresh_rising_value
What:		/sys/.../events/in_rot_from_north_true_raw_thresh_falling_value
What:		/sys/.../events/in_rot_from_north_magnetic_tilt_comp_raw_thresh_rising_value
What:		/sys/.../events/in_rot_from_north_magnetic_tilt_comp_raw_thresh_falling_value
What:		/sys/.../events/in_rot_from_north_true_tilt_comp_raw_thresh_rising_value
What:		/sys/.../events/in_rot_from_north_true_tilt_comp_raw_thresh_falling_value
What:		/sys/.../events/in_voltageY_supply_raw_thresh_rising_value
What:		/sys/.../events/in_voltageY_supply_raw_thresh_falling_value
What:		/sys/.../events/in_voltageY_raw_thresh_rising_value
@@ -588,6 +616,18 @@ 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_rot_from_north_magnetic_thresh_rising_hysteresis
What:		/sys/.../events/in_rot_from_north_magnetic_thresh_falling_hysteresis
What:		/sys/.../events/in_rot_from_north_magnetic_thresh_either_hysteresis
What:		/sys/.../events/in_rot_from_north_true_thresh_rising_hysteresis
What:		/sys/.../events/in_rot_from_north_true_thresh_falling_hysteresis
What:		/sys/.../events/in_rot_from_north_true_thresh_either_hysteresis
What:		/sys/.../events/in_rot_from_north_magnetic_tilt_comp_thresh_rising_hysteresis
What:		/sys/.../events/in_rot_from_north_magnetic_tilt_comp_thresh_falling_hysteresis
What:		/sys/.../events/in_rot_from_north_magnetic_tilt_comp_thresh_either_hysteresis
What:		/sys/.../events/in_rot_from_north_true_tilt_comp_thresh_rising_hysteresis
What:		/sys/.../events/in_rot_from_north_true_tilt_comp_thresh_falling_hysteresis
What:		/sys/.../events/in_rot_from_north_true_tilt_comp_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
@@ -635,6 +675,14 @@ What: /sys/.../events/in_magn_y_raw_roc_rising_value
What:		/sys/.../events/in_magn_y_raw_roc_falling_value
What:		/sys/.../events/in_magn_z_raw_roc_rising_value
What:		/sys/.../events/in_magn_z_raw_roc_falling_value
What:		/sys/.../events/in_rot_from_north_magnetic_raw_roc_rising_value
What:		/sys/.../events/in_rot_from_north_magnetic_raw_roc_falling_value
What:		/sys/.../events/in_rot_from_north_true_raw_roc_rising_value
What:		/sys/.../events/in_rot_from_north_true_raw_roc_falling_value
What:		/sys/.../events/in_rot_from_north_magnetic_tilt_comp_raw_roc_rising_value
What:		/sys/.../events/in_rot_from_north_magnetic_tilt_comp_raw_roc_falling_value
What:		/sys/.../events/in_rot_from_north_true_tilt_comp_raw_roc_rising_value
What:		/sys/.../events/in_rot_from_north_true_tilt_comp_raw_roc_falling_value
What:		/sys/.../events/in_voltageY_supply_raw_roc_rising_value
What:		/sys/.../events/in_voltageY_supply_raw_roc_falling_value
What:		/sys/.../events/in_voltageY_raw_roc_rising_value
@@ -690,6 +738,22 @@ What: /sys/.../events/in_magn_z_thresh_rising_period
What:		/sys/.../events/in_magn_z_thresh_falling_period
What:		/sys/.../events/in_magn_z_roc_rising_period
What:		/sys/.../events/in_magn_z_roc_falling_period
What:		/sys/.../events/in_rot_from_north_magnetic_thresh_rising_period
What:		/sys/.../events/in_rot_from_north_magnetic_thresh_falling_period
What:		/sys/.../events/in_rot_from_north_magnetic_roc_rising_period
What:		/sys/.../events/in_rot_from_north_magnetic_roc_falling_period
What:		/sys/.../events/in_rot_from_north_true_thresh_rising_period
What:		/sys/.../events/in_rot_from_north_true_thresh_falling_period
What:		/sys/.../events/in_rot_from_north_true_roc_rising_period
What:		/sys/.../events/in_rot_from_north_true_roc_falling_period
What:		/sys/.../events/in_rot_from_north_magnetic_tilt_comp_thresh_rising_period
What:		/sys/.../events/in_rot_from_north_magnetic_tilt_comp_thresh_falling_period
What:		/sys/.../events/in_rot_from_north_magnetic_tilt_comp_roc_rising_period
What:		/sys/.../events/in_rot_from_north_magnetic_tilt_comp_roc_falling_period
What:		/sys/.../events/in_rot_from_north_true_tilt_comp_thresh_rising_period
What:		/sys/.../events/in_rot_from_north_true_tilt_comp_thresh_falling_period
What:		/sys/.../events/in_rot_from_north_true_tilt_comp_roc_rising_period
What:		/sys/.../events/in_rot_from_north_true_tilt_comp_roc_falling_period
What:		/sys/.../events/in_voltageY_supply_thresh_rising_period
What:		/sys/.../events/in_voltageY_supply_thresh_falling_period
What:		/sys/.../events/in_voltageY_supply_roc_rising_period
@@ -787,6 +851,10 @@ What: /sys/.../iio:deviceX/scan_elements/in_anglvel_z_en
What:		/sys/.../iio:deviceX/scan_elements/in_magn_x_en
What:		/sys/.../iio:deviceX/scan_elements/in_magn_y_en
What:		/sys/.../iio:deviceX/scan_elements/in_magn_z_en
What:		/sys/.../iio:deviceX/scan_elements/in_rot_from_north_magnetic_en
What:		/sys/.../iio:deviceX/scan_elements/in_rot_from_north_true_en
What:		/sys/.../iio:deviceX/scan_elements/in_rot_from_north_magnetic_tilt_comp_en
What:		/sys/.../iio:deviceX/scan_elements/in_rot_from_north_true_tilt_comp_en
What:		/sys/.../iio:deviceX/scan_elements/in_timestamp_en
What:		/sys/.../iio:deviceX/scan_elements/in_voltageY_supply_en
What:		/sys/.../iio:deviceX/scan_elements/in_voltageY_en
@@ -853,6 +921,10 @@ What: /sys/.../iio:deviceX/scan_elements/in_anglvel_z_index
What:		/sys/.../iio:deviceX/scan_elements/in_magn_x_index
What:		/sys/.../iio:deviceX/scan_elements/in_magn_y_index
What:		/sys/.../iio:deviceX/scan_elements/in_magn_z_index
What:		/sys/.../iio:deviceX/scan_elements/in_rot_from_north_magnetic_index
What:		/sys/.../iio:deviceX/scan_elements/in_rot_from_north_true_index
What:		/sys/.../iio:deviceX/scan_elements/in_rot_from_north_magnetic_tilt_comp_index
What:		/sys/.../iio:deviceX/scan_elements/in_rot_from_north_true_tilt_comp_index
What:		/sys/.../iio:deviceX/scan_elements/in_incli_x_index
What:		/sys/.../iio:deviceX/scan_elements/in_incli_y_index
What:		/sys/.../iio:deviceX/scan_elements/in_timestamp_index
@@ -946,3 +1018,13 @@ Description:
		x y z w. Here x, y, and z component represents the axis about
		which a rotation will occur and w component represents the
		amount of rotation.

What:		/sys/bus/iio/devices/iio:deviceX/in_rot_from_north_magnetic_tilt_comp_raw
What:		/sys/bus/iio/devices/iio:deviceX/in_rot_from_north_true_tilt_comp_raw
What:		/sys/bus/iio/devices/iio:deviceX/in_rot_from_north_magnetic_raw
What:		/sys/bus/iio/devices/iio:deviceX/in_rot_from_north_true_raw
KernelVersion:	3.15
Contact:	linux-iio@vger.kernel.org
Description:
		Raw value of rotation from true/magnetic north measured with
		or without compensation from tilt sensors.
+23 −2
Original line number Diff line number Diff line
@@ -14,14 +14,21 @@ Required properties:
				for exynos4412/5250 controllers.
			Must be "samsung,exynos-adc-v2" for
				future controllers.
			Must be "samsung,exynos3250-adc" for
				controllers compatible with ADC of Exynos3250.
- reg:			Contains ADC register address range (base address and
			length) and the address of the phy enable register.
- interrupts: 		Contains the interrupt information for the timer. The
			format is being dependent on which interrupt controller
			the Samsung device uses.
- #io-channel-cells = <1>; As ADC has multiple outputs
- clocks		From common clock binding: handle to adc clock.
- clock-names		From common clock binding: Shall be "adc".
- clocks		From common clock bindings: handles to clocks specified
			in "clock-names" property, in the same order.
- clock-names		From common clock bindings: list of clock input names
			used by ADC block:
			- "adc" : ADC bus clock
			- "sclk" : ADC special clock (only for Exynos3250 and
				   compatible ADC block)
- vdd-supply		VDD input supply.

Note: child nodes can be added for auto probing from device tree.
@@ -41,6 +48,20 @@ adc: adc@12D10000 {
	vdd-supply = <&buck5_reg>;
};

Example: adding device info in dtsi file for Exynos3250 with additional sclk

adc: adc@126C0000 {
	compatible = "samsung,exynos3250-adc", "samsung,exynos-adc-v2;
	reg = <0x126C0000 0x100>, <0x10020718 0x4>;
	interrupts = <0 137 0>;
	#io-channel-cells = <1>;
	io-channel-ranges;

	clocks = <&cmu CLK_TSADC>, <&cmu CLK_SCLK_TSADC>;
	clock-names = "adc", "sclk";

	vdd-supply = <&buck5_reg>;
};

Example: Adding child nodes in dts file

+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ Required properties:
  Other models which are supported with driver are:
	"honeywell,hmc5883"
	"honeywell,hmc5883l"
	"honeywell,hmc5983"
  - reg : the I2C address of the magnetometer - typically 0x1e

Optional properties:
+3 −2
Original line number Diff line number Diff line
@@ -261,10 +261,11 @@
		};

		adc: adc@126C0000 {
			compatible = "samsung,exynos-adc-v3";
			compatible = "samsung,exynos3250-adc",
				     "samsung,exynos-adc-v2";
			reg = <0x126C0000 0x100>, <0x10020718 0x4>;
			interrupts = <0 137 0>;
			clock-names = "adc", "sclk_tsadc";
			clock-names = "adc", "sclk";
			clocks = <&cmu CLK_TSADC>, <&cmu CLK_SCLK_TSADC>;
			#io-channel-cells = <1>;
			io-channel-ranges;
+19 −19
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ static const struct {
	int val2;
	int odr_bits;
} samp_freq_table[] = { {0, 781000, 0x08}, {1, 563000, 0x09},
			{3, 125000, 0x0A}, {6, 25000, 0x0B}, {12, 5000, 0},
			{3, 125000, 0x0A}, {6, 250000, 0x0B}, {12, 500000, 0},
			{25, 0, 0x01}, {50, 0, 0x02}, {100, 0, 0x03},
			{200, 0, 0x04}, {400, 0, 0x05}, {800, 0, 0x06},
			{1600, 0, 0x07} };
@@ -138,19 +138,6 @@ static int kxcjk1013_set_mode(struct kxcjk1013_data *data,
	return 0;
}

static int kxcjk1013_chip_ack_intr(struct kxcjk1013_data *data)
{
	int ret;

	ret = i2c_smbus_read_byte_data(data->client, KXCJK1013_REG_INT_REL);
	if (ret < 0) {
		dev_err(&data->client->dev, "Error writing reg_int_rel\n");
		return ret;
	}

	return ret;
}

static int kxcjk1013_chip_init(struct kxcjk1013_data *data)
{
	int ret;
@@ -466,7 +453,7 @@ static const struct attribute_group kxcjk1013_attrs_group = {
		.realbits = 12,						\
		.storagebits = 16,					\
		.shift = 4,						\
		.endianness = IIO_LE,					\
		.endianness = IIO_CPU,					\
	},								\
}

@@ -498,15 +485,11 @@ static irqreturn_t kxcjk1013_trigger_handler(int irq, void *p)
			 indio_dev->masklength) {
		ret = kxcjk1013_get_acc_reg(data, bit);
		if (ret < 0) {
			kxcjk1013_chip_ack_intr(data);
			mutex_unlock(&data->mutex);
			goto err;
		}
		data->buffer[i++] = ret;
	}

	kxcjk1013_chip_ack_intr(data);

	mutex_unlock(&data->mutex);

	iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
@@ -517,6 +500,21 @@ static irqreturn_t kxcjk1013_trigger_handler(int irq, void *p)
	return IRQ_HANDLED;
}

static int kxcjk1013_trig_try_reen(struct iio_trigger *trig)
{
	struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
	struct kxcjk1013_data *data = iio_priv(indio_dev);
	int ret;

	ret = i2c_smbus_read_byte_data(data->client, KXCJK1013_REG_INT_REL);
	if (ret < 0) {
		dev_err(&data->client->dev, "Error reading reg_int_rel\n");
		return ret;
	}

	return 0;
}

static int kxcjk1013_data_rdy_trigger_set_state(struct iio_trigger *trig,
						bool state)
{
@@ -543,6 +541,7 @@ static int kxcjk1013_data_rdy_trigger_set_state(struct iio_trigger *trig,

static const struct iio_trigger_ops kxcjk1013_trigger_ops = {
	.set_trigger_state = kxcjk1013_data_rdy_trigger_set_state,
	.try_reenable = kxcjk1013_trig_try_reen,
	.owner = THIS_MODULE,
};

@@ -645,6 +644,7 @@ static int kxcjk1013_probe(struct i2c_client *client,
		iio_trigger_set_drvdata(trig, indio_dev);
		data->trig = trig;
		indio_dev->trig = trig;
		iio_trigger_get(indio_dev->trig);

		ret = iio_trigger_register(trig);
		if (ret)
Loading