Skip to content

Commit 7b2d7fa

Browse files
committed
Merge tag 'iio-for-5.6b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes: Second set of new device support, features and minor fixes for IIO in the 5.6 cycle Just a small set this time. As we are very near the merge window, I've rolled a few fixes in here rather than adding noise just before release. A short delay here will do little harm. New device support * adis16480 - Add support for adis16490. After earlier rework this is simple ID plus chip info. Features * kxcjk1013 - mount matrix support. * lsm_6dsx - mount matrix support. Cleanups / minor or late breaking fixes * ad7124 - add support to ad-sigma-delta and use it in this driver to allow the the interrupt type to be IRQF_TRIGGER_LOW unlike most other devices using this framework. * adis - use delay structure now available in SPI to handle transfer delays - introduce a timeouts structure to allow support of new devices * ak8975 - drop platform data support. No one is using it and it adds complexity. - use device_get_match_data rather than open coding much the same thing. * dht11 - drop meaningless todo * at91-samad2_adc - switch to dma_request_chan * altas-sensor - add a helper function to compute number of channels. Needed for new device support that is under review. * bma400 - add a lower bound check on scale. * inv_mpu6050 - add support for temperature data in the fifos for all chips. - support an odd situation where a board supports only interrupt triggering on both edges. * st_lsm6dsx - check and handle potential error return. * st_sensors - fix some values for the LSM9DS0 which is ever so slightly different from other devices using the same whoami value. - switch over to generic functions from dt ones, avoiding need for separate ACPI support. * stm32-adc - switch to dma_request_chan - suppress an error print in deferred probe case. * stm32-dac - drop private data structure element for reset controller as only used in probe. - reflect more cleanly that the reset controller is optional whilst ensuring that if is specified any errors are caught. * stm32-dfsdm - switch to dma_request_chan - fix missing application of formatting to single conversions. - ensure the sampling rate is updated when the oversampling ratio is changed. * tag 'iio-for-5.6b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (29 commits) iio: dac: stm32-dac: better handle reset controller failures iio: dac: stm32-dac: use reset controller only at probe time dt-bindings: iio: accel: kxcjk1013: Document mount-matrix property iio: accel: kxcjk1013: Support orientation matrix iio: imu: st_lsm6dsx: add mount matrix support iio: adc: stm32-adc: don't print an error on probe deferral dt-bindings: iio: adis16480: add compatible entry for ADIS16490 iio: imu: adis16480: Add support for ADIS16490 iio: accel: bma400: prevent setting accel scale too low iio: imu/mpu6050: support dual-edge IRQ iio: imu: inv_mpu6050: add fifo temperature data support iio: magnetometer: ak8975: Convert to use device_get_match_data() iio: magnetometer: ak8975: Get rid of platform data iio: adc: ad7124: Set IRQ type to falling iio: adc: ad-sigma-delta: Allow custom IRQ flags iio: imu: adis: use new `delay` structure for SPI transfer delays iio: adc: stm32-dfsdm: adapt sampling rate to oversampling ratio iio: adc: stm32-dfsdm: fix single conversion iio: st_sensors: Make use of device properties iio: st_sensors: Drop redundant parameter from st_sensors_of_name_probe() ...
2 parents 270f104 + d344961 commit 7b2d7fa

51 files changed

Lines changed: 645 additions & 401 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ Required properties:
99
"kionix,kxtf9"
1010
- reg: i2c slave address
1111

12+
Optional properties:
13+
14+
- mount-matrix: an optional 3x3 mounting rotation matrix
15+
1216
Example:
1317

1418
kxtf9@f {
1519
compatible = "kionix,kxtf9";
1620
reg = <0x0F>;
21+
mount-matrix = "0", "1", "0",
22+
"1", "0", "0",
23+
"0", "0", "1";
1724
};

‎Documentation/devicetree/bindings/iio/imu/adi,adis16480.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Required properties for the ADIS16480:
88
* "adi,adis16480"
99
* "adi,adis16485"
1010
* "adi,adis16488"
11+
* "adi,adis16490"
1112
* "adi,adis16495-1"
1213
* "adi,adis16495-2"
1314
* "adi,adis16495-3"

‎drivers/iio/accel/adis16201.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ static const char * const adis16201_status_error_msgs[] = {
233233
[ADIS16201_DIAG_STAT_POWER_LOW_BIT] = "Power supply below 2.975V",
234234
};
235235

236+
static const struct adis_timeout adis16201_timeouts = {
237+
.reset_ms = ADIS16201_STARTUP_DELAY_MS,
238+
.sw_reset_ms = ADIS16201_STARTUP_DELAY_MS,
239+
.self_test_ms = ADIS16201_STARTUP_DELAY_MS,
240+
};
241+
236242
static const struct adis_data adis16201_data = {
237243
.read_delay = 20,
238244
.msc_ctrl_reg = ADIS16201_MSC_CTRL_REG,
@@ -241,7 +247,7 @@ static const struct adis_data adis16201_data = {
241247

242248
.self_test_mask = ADIS16201_MSC_CTRL_SELF_TEST_EN,
243249
.self_test_no_autoclear = true,
244-
.startup_delay = ADIS16201_STARTUP_DELAY_MS,
250+
.timeouts = &adis16201_timeouts,
245251

246252
.status_error_msgs = adis16201_status_error_msgs,
247253
.status_error_mask = BIT(ADIS16201_DIAG_STAT_SPI_FAIL_BIT) |

‎drivers/iio/accel/adis16209.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ static const char * const adis16209_status_error_msgs[] = {
243243
[ADIS16209_STAT_POWER_LOW_BIT] = "Power supply below 2.975V",
244244
};
245245

246+
static const struct adis_timeout adis16209_timeouts = {
247+
.reset_ms = ADIS16209_STARTUP_DELAY_MS,
248+
.self_test_ms = ADIS16209_STARTUP_DELAY_MS,
249+
.sw_reset_ms = ADIS16209_STARTUP_DELAY_MS,
250+
};
251+
246252
static const struct adis_data adis16209_data = {
247253
.read_delay = 30,
248254
.msc_ctrl_reg = ADIS16209_MSC_CTRL_REG,
@@ -251,7 +257,7 @@ static const struct adis_data adis16209_data = {
251257

252258
.self_test_mask = ADIS16209_MSC_CTRL_SELF_TEST_EN,
253259
.self_test_no_autoclear = true,
254-
.startup_delay = ADIS16209_STARTUP_DELAY_MS,
260+
.timeouts = &adis16209_timeouts,
255261

256262
.status_error_msgs = adis16209_status_error_msgs,
257263
.status_error_mask = BIT(ADIS16209_STAT_SELFTEST_FAIL_BIT) |

‎drivers/iio/accel/bma400_core.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,8 @@ static int bma400_write_raw(struct iio_dev *indio_dev,
752752
mutex_unlock(&data->mutex);
753753
return ret;
754754
case IIO_CHAN_INFO_SCALE:
755-
if (val != 0 || val2 > BMA400_SCALE_MAX)
755+
if (val != 0 ||
756+
val2 < BMA400_SCALE_MIN || val2 > BMA400_SCALE_MAX)
756757
return -EINVAL;
757758

758759
mutex_lock(&data->mutex);

‎drivers/iio/accel/kxcjk-1013.c‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ struct kxcjk1013_data {
130130
struct i2c_client *client;
131131
struct iio_trigger *dready_trig;
132132
struct iio_trigger *motion_trig;
133+
struct iio_mount_matrix orientation;
133134
struct mutex mutex;
134135
s16 buffer[8];
135136
u8 odr_bits;
@@ -983,6 +984,20 @@ static const struct iio_event_spec kxcjk1013_event = {
983984
BIT(IIO_EV_INFO_PERIOD)
984985
};
985986

987+
static const struct iio_mount_matrix *
988+
kxcjk1013_get_mount_matrix(const struct iio_dev *indio_dev,
989+
const struct iio_chan_spec *chan)
990+
{
991+
struct kxcjk1013_data *data = iio_priv(indio_dev);
992+
993+
return &data->orientation;
994+
}
995+
996+
static const struct iio_chan_spec_ext_info kxcjk1013_ext_info[] = {
997+
IIO_MOUNT_MATRIX(IIO_SHARED_BY_TYPE, kxcjk1013_get_mount_matrix),
998+
{ }
999+
};
1000+
9861001
#define KXCJK1013_CHANNEL(_axis) { \
9871002
.type = IIO_ACCEL, \
9881003
.modified = 1, \
@@ -999,6 +1014,7 @@ static const struct iio_event_spec kxcjk1013_event = {
9991014
.endianness = IIO_LE, \
10001015
}, \
10011016
.event_spec = &kxcjk1013_event, \
1017+
.ext_info = kxcjk1013_ext_info, \
10021018
.num_event_specs = 1 \
10031019
}
10041020

@@ -1267,11 +1283,18 @@ static int kxcjk1013_probe(struct i2c_client *client,
12671283
data->client = client;
12681284

12691285
pdata = dev_get_platdata(&client->dev);
1270-
if (pdata)
1286+
if (pdata) {
12711287
data->active_high_intr = pdata->active_high_intr;
1272-
else
1288+
data->orientation = pdata->orientation;
1289+
} else {
12731290
data->active_high_intr = true; /* default polarity */
12741291

1292+
ret = iio_read_mount_matrix(&client->dev, "mount-matrix",
1293+
&data->orientation);
1294+
if (ret)
1295+
return ret;
1296+
}
1297+
12751298
if (id) {
12761299
data->chipset = (enum kx_chipset)(id->driver_data);
12771300
name = id->name;

‎drivers/iio/accel/st_accel_i2c.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <linux/iio/common/st_sensors_i2c.h>
1919
#include "st_accel.h"
2020

21-
#ifdef CONFIG_OF
2221
static const struct of_device_id st_accel_of_match[] = {
2322
{
2423
/* An older compatible */
@@ -108,9 +107,6 @@ static const struct of_device_id st_accel_of_match[] = {
108107
{},
109108
};
110109
MODULE_DEVICE_TABLE(of, st_accel_of_match);
111-
#else
112-
#define st_accel_of_match NULL
113-
#endif
114110

115111
#ifdef CONFIG_ACPI
116112
static const struct acpi_device_id st_accel_acpi_match[] = {
@@ -193,7 +189,7 @@ static int st_accel_i2c_remove(struct i2c_client *client)
193189
static struct i2c_driver st_accel_driver = {
194190
.driver = {
195191
.name = "st-accel-i2c",
196-
.of_match_table = of_match_ptr(st_accel_of_match),
192+
.of_match_table = st_accel_of_match,
197193
.acpi_match_table = ACPI_PTR(st_accel_acpi_match),
198194
},
199195
.probe_new = st_accel_i2c_probe,

‎drivers/iio/accel/st_accel_spi.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <linux/iio/common/st_sensors_spi.h>
1818
#include "st_accel.h"
1919

20-
#ifdef CONFIG_OF
2120
/*
2221
* For new single-chip sensors use <device_name> as compatible string.
2322
* For old single-chip devices keep <device_name>-accel to maintain
@@ -96,9 +95,6 @@ static const struct of_device_id st_accel_of_match[] = {
9695
{}
9796
};
9897
MODULE_DEVICE_TABLE(of, st_accel_of_match);
99-
#else
100-
#define st_accel_of_match NULL
101-
#endif
10298

10399
static int st_accel_spi_probe(struct spi_device *spi)
104100
{
@@ -107,8 +103,7 @@ static int st_accel_spi_probe(struct spi_device *spi)
107103
struct iio_dev *indio_dev;
108104
int err;
109105

110-
st_sensors_of_name_probe(&spi->dev, st_accel_of_match,
111-
spi->modalias, sizeof(spi->modalias));
106+
st_sensors_dev_name_probe(&spi->dev, spi->modalias, sizeof(spi->modalias));
112107

113108
settings = st_accel_get_settings(spi->modalias);
114109
if (!settings) {
@@ -166,7 +161,7 @@ MODULE_DEVICE_TABLE(spi, st_accel_id_table);
166161
static struct spi_driver st_accel_driver = {
167162
.driver = {
168163
.name = "st-accel-spi",
169-
.of_match_table = of_match_ptr(st_accel_of_match),
164+
.of_match_table = st_accel_of_match,
170165
},
171166
.probe = st_accel_spi_probe,
172167
.remove = st_accel_spi_remove,

‎drivers/iio/adc/ad7124.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/delay.h>
1010
#include <linux/device.h>
1111
#include <linux/err.h>
12+
#include <linux/interrupt.h>
1213
#include <linux/kernel.h>
1314
#include <linux/module.h>
1415
#include <linux/regulator/consumer.h>
@@ -224,6 +225,7 @@ static const struct ad_sigma_delta_info ad7124_sigma_delta_info = {
224225
.addr_shift = 0,
225226
.read_mask = BIT(6),
226227
.data_reg = AD7124_DATA,
228+
.irq_flags = IRQF_TRIGGER_FALLING,
227229
};
228230

229231
static int ad7124_set_channel_odr(struct ad7124_state *st,

‎drivers/iio/adc/ad7780.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ static const struct ad_sigma_delta_info ad7780_sigma_delta_info = {
203203
.set_mode = ad7780_set_mode,
204204
.postprocess_sample = ad7780_postprocess_sample,
205205
.has_registers = false,
206+
.irq_flags = IRQF_TRIGGER_LOW,
206207
};
207208

208209
#define AD7780_CHANNEL(bits, wordsize) \

0 commit comments

Comments
 (0)