diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-22 10:30:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-22 10:30:03 -0400 |
commit | d84a2b0d6fecbb6e29875dd9dc97cdcdaa15744a (patch) | |
tree | ea756d49395ac4a08d6cdff98d74e60384a322a6 /drivers/iio | |
parent | 3f76a4ea5383ba2f9e76f9625f77ff246907a134 (diff) | |
parent | 0f33be009b89d2268e94194dc4fd01a7851b6d51 (diff) |
Merge 3.17-rc6 into staging-next.
We want the fixes in there, and it resolves a merge issue with
drivers/iio/accel/bma180.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/accel/bma180.c | 2 | ||||
-rw-r--r-- | drivers/iio/adc/ad_sigma_delta.c | 2 | ||||
-rw-r--r-- | drivers/iio/adc/at91_adc.c | 12 | ||||
-rw-r--r-- | drivers/iio/adc/xilinx-xadc-core.c | 2 | ||||
-rw-r--r-- | drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 3 | ||||
-rw-r--r-- | drivers/iio/common/st_sensors/st_sensors_trigger.c | 2 | ||||
-rw-r--r-- | drivers/iio/gyro/itg3200_buffer.c | 2 | ||||
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | 2 | ||||
-rw-r--r-- | drivers/iio/inkern.c | 2 | ||||
-rw-r--r-- | drivers/iio/magnetometer/st_magn_core.c | 52 |
10 files changed, 46 insertions, 35 deletions
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index 6ef19641457c..f081b007f7d2 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c | |||
@@ -748,7 +748,7 @@ static int bma180_probe(struct i2c_client *client, | |||
748 | data->trig->dev.parent = &client->dev; | 748 | data->trig->dev.parent = &client->dev; |
749 | data->trig->ops = &bma180_trigger_ops; | 749 | data->trig->ops = &bma180_trigger_ops; |
750 | iio_trigger_set_drvdata(data->trig, indio_dev); | 750 | iio_trigger_set_drvdata(data->trig, indio_dev); |
751 | indio_dev->trig = data->trig; | 751 | indio_dev->trig = iio_trigger_get(trig); |
752 | 752 | ||
753 | ret = iio_trigger_register(data->trig); | 753 | ret = iio_trigger_register(data->trig); |
754 | if (ret) | 754 | if (ret) |
diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c index c55b81f7f970..d10bd0c97233 100644 --- a/drivers/iio/adc/ad_sigma_delta.c +++ b/drivers/iio/adc/ad_sigma_delta.c | |||
@@ -472,7 +472,7 @@ static int ad_sd_probe_trigger(struct iio_dev *indio_dev) | |||
472 | goto error_free_irq; | 472 | goto error_free_irq; |
473 | 473 | ||
474 | /* select default trigger */ | 474 | /* select default trigger */ |
475 | indio_dev->trig = sigma_delta->trig; | 475 | indio_dev->trig = iio_trigger_get(sigma_delta->trig); |
476 | 476 | ||
477 | return 0; | 477 | return 0; |
478 | 478 | ||
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 7807e0ef5b29..ff61ae55dd3f 100644 --- a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c | |||
@@ -196,6 +196,7 @@ struct at91_adc_state { | |||
196 | bool done; | 196 | bool done; |
197 | int irq; | 197 | int irq; |
198 | u16 last_value; | 198 | u16 last_value; |
199 | int chnb; | ||
199 | struct mutex lock; | 200 | struct mutex lock; |
200 | u8 num_channels; | 201 | u8 num_channels; |
201 | void __iomem *reg_base; | 202 | void __iomem *reg_base; |
@@ -274,7 +275,7 @@ static void handle_adc_eoc_trigger(int irq, struct iio_dev *idev) | |||
274 | disable_irq_nosync(irq); | 275 | disable_irq_nosync(irq); |
275 | iio_trigger_poll(idev->trig); | 276 | iio_trigger_poll(idev->trig); |
276 | } else { | 277 | } else { |
277 | st->last_value = at91_adc_readl(st, AT91_ADC_LCDR); | 278 | st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb)); |
278 | st->done = true; | 279 | st->done = true; |
279 | wake_up_interruptible(&st->wq_data_avail); | 280 | wake_up_interruptible(&st->wq_data_avail); |
280 | } | 281 | } |
@@ -351,7 +352,7 @@ static irqreturn_t at91_adc_rl_interrupt(int irq, void *private) | |||
351 | unsigned int reg; | 352 | unsigned int reg; |
352 | 353 | ||
353 | status &= at91_adc_readl(st, AT91_ADC_IMR); | 354 | status &= at91_adc_readl(st, AT91_ADC_IMR); |
354 | if (status & st->registers->drdy_mask) | 355 | if (status & GENMASK(st->num_channels - 1, 0)) |
355 | handle_adc_eoc_trigger(irq, idev); | 356 | handle_adc_eoc_trigger(irq, idev); |
356 | 357 | ||
357 | if (status & AT91RL_ADC_IER_PEN) { | 358 | if (status & AT91RL_ADC_IER_PEN) { |
@@ -418,7 +419,7 @@ static irqreturn_t at91_adc_9x5_interrupt(int irq, void *private) | |||
418 | AT91_ADC_IER_YRDY | | 419 | AT91_ADC_IER_YRDY | |
419 | AT91_ADC_IER_PRDY; | 420 | AT91_ADC_IER_PRDY; |
420 | 421 | ||
421 | if (status & st->registers->drdy_mask) | 422 | if (status & GENMASK(st->num_channels - 1, 0)) |
422 | handle_adc_eoc_trigger(irq, idev); | 423 | handle_adc_eoc_trigger(irq, idev); |
423 | 424 | ||
424 | if (status & AT91_ADC_IER_PEN) { | 425 | if (status & AT91_ADC_IER_PEN) { |
@@ -689,9 +690,10 @@ static int at91_adc_read_raw(struct iio_dev *idev, | |||
689 | case IIO_CHAN_INFO_RAW: | 690 | case IIO_CHAN_INFO_RAW: |
690 | mutex_lock(&st->lock); | 691 | mutex_lock(&st->lock); |
691 | 692 | ||
693 | st->chnb = chan->channel; | ||
692 | at91_adc_writel(st, AT91_ADC_CHER, | 694 | at91_adc_writel(st, AT91_ADC_CHER, |
693 | AT91_ADC_CH(chan->channel)); | 695 | AT91_ADC_CH(chan->channel)); |
694 | at91_adc_writel(st, AT91_ADC_IER, st->registers->drdy_mask); | 696 | at91_adc_writel(st, AT91_ADC_IER, BIT(chan->channel)); |
695 | at91_adc_writel(st, AT91_ADC_CR, AT91_ADC_START); | 697 | at91_adc_writel(st, AT91_ADC_CR, AT91_ADC_START); |
696 | 698 | ||
697 | ret = wait_event_interruptible_timeout(st->wq_data_avail, | 699 | ret = wait_event_interruptible_timeout(st->wq_data_avail, |
@@ -708,7 +710,7 @@ static int at91_adc_read_raw(struct iio_dev *idev, | |||
708 | 710 | ||
709 | at91_adc_writel(st, AT91_ADC_CHDR, | 711 | at91_adc_writel(st, AT91_ADC_CHDR, |
710 | AT91_ADC_CH(chan->channel)); | 712 | AT91_ADC_CH(chan->channel)); |
711 | at91_adc_writel(st, AT91_ADC_IDR, st->registers->drdy_mask); | 713 | at91_adc_writel(st, AT91_ADC_IDR, BIT(chan->channel)); |
712 | 714 | ||
713 | st->last_value = 0; | 715 | st->last_value = 0; |
714 | st->done = false; | 716 | st->done = false; |
diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index 5d52a3106fac..a221f7329b79 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c | |||
@@ -1126,7 +1126,7 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, struct device_node *np, | |||
1126 | chan->address = XADC_REG_VPVN; | 1126 | chan->address = XADC_REG_VPVN; |
1127 | } else { | 1127 | } else { |
1128 | chan->scan_index = 15 + reg; | 1128 | chan->scan_index = 15 + reg; |
1129 | chan->scan_index = XADC_REG_VAUX(reg - 1); | 1129 | chan->address = XADC_REG_VAUX(reg - 1); |
1130 | } | 1130 | } |
1131 | num_channels++; | 1131 | num_channels++; |
1132 | chan++; | 1132 | chan++; |
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c index a3109a6f4d86..92068cdbf8c7 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c | |||
@@ -122,7 +122,8 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name, | |||
122 | dev_err(&indio_dev->dev, "Trigger Register Failed\n"); | 122 | dev_err(&indio_dev->dev, "Trigger Register Failed\n"); |
123 | goto error_free_trig; | 123 | goto error_free_trig; |
124 | } | 124 | } |
125 | indio_dev->trig = attrb->trigger = trig; | 125 | attrb->trigger = trig; |
126 | indio_dev->trig = iio_trigger_get(trig); | ||
126 | 127 | ||
127 | return ret; | 128 | return ret; |
128 | 129 | ||
diff --git a/drivers/iio/common/st_sensors/st_sensors_trigger.c b/drivers/iio/common/st_sensors/st_sensors_trigger.c index 8fc3a97eb266..8d8ca6f1e16a 100644 --- a/drivers/iio/common/st_sensors/st_sensors_trigger.c +++ b/drivers/iio/common/st_sensors/st_sensors_trigger.c | |||
@@ -49,7 +49,7 @@ int st_sensors_allocate_trigger(struct iio_dev *indio_dev, | |||
49 | dev_err(&indio_dev->dev, "failed to register iio trigger.\n"); | 49 | dev_err(&indio_dev->dev, "failed to register iio trigger.\n"); |
50 | goto iio_trigger_register_error; | 50 | goto iio_trigger_register_error; |
51 | } | 51 | } |
52 | indio_dev->trig = sdata->trig; | 52 | indio_dev->trig = iio_trigger_get(sdata->trig); |
53 | 53 | ||
54 | return 0; | 54 | return 0; |
55 | 55 | ||
diff --git a/drivers/iio/gyro/itg3200_buffer.c b/drivers/iio/gyro/itg3200_buffer.c index e3b3c5084070..eef50e91f17c 100644 --- a/drivers/iio/gyro/itg3200_buffer.c +++ b/drivers/iio/gyro/itg3200_buffer.c | |||
@@ -132,7 +132,7 @@ int itg3200_probe_trigger(struct iio_dev *indio_dev) | |||
132 | goto error_free_irq; | 132 | goto error_free_irq; |
133 | 133 | ||
134 | /* select default trigger */ | 134 | /* select default trigger */ |
135 | indio_dev->trig = st->trig; | 135 | indio_dev->trig = iio_trigger_get(st->trig); |
136 | 136 | ||
137 | return 0; | 137 | return 0; |
138 | 138 | ||
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c index 03b9372c1212..926fccea8de0 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | |||
@@ -135,7 +135,7 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev) | |||
135 | ret = iio_trigger_register(st->trig); | 135 | ret = iio_trigger_register(st->trig); |
136 | if (ret) | 136 | if (ret) |
137 | goto error_free_irq; | 137 | goto error_free_irq; |
138 | indio_dev->trig = st->trig; | 138 | indio_dev->trig = iio_trigger_get(st->trig); |
139 | 139 | ||
140 | return 0; | 140 | return 0; |
141 | 141 | ||
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index c7497009d60a..f0846108d006 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c | |||
@@ -178,7 +178,7 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np, | |||
178 | index = of_property_match_string(np, "io-channel-names", | 178 | index = of_property_match_string(np, "io-channel-names", |
179 | name); | 179 | name); |
180 | chan = of_iio_channel_get(np, index); | 180 | chan = of_iio_channel_get(np, index); |
181 | if (!IS_ERR(chan)) | 181 | if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) |
182 | break; | 182 | break; |
183 | else if (name && index >= 0) { | 183 | else if (name && index >= 0) { |
184 | pr_err("ERROR: could not get IIO channel %s:%s(%i)\n", | 184 | pr_err("ERROR: could not get IIO channel %s:%s(%i)\n", |
diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c index a4b64130ac2f..68cae86dbd29 100644 --- a/drivers/iio/magnetometer/st_magn_core.c +++ b/drivers/iio/magnetometer/st_magn_core.c | |||
@@ -42,7 +42,8 @@ | |||
42 | #define ST_MAGN_FS_AVL_5600MG 5600 | 42 | #define ST_MAGN_FS_AVL_5600MG 5600 |
43 | #define ST_MAGN_FS_AVL_8000MG 8000 | 43 | #define ST_MAGN_FS_AVL_8000MG 8000 |
44 | #define ST_MAGN_FS_AVL_8100MG 8100 | 44 | #define ST_MAGN_FS_AVL_8100MG 8100 |
45 | #define ST_MAGN_FS_AVL_10000MG 10000 | 45 | #define ST_MAGN_FS_AVL_12000MG 12000 |
46 | #define ST_MAGN_FS_AVL_16000MG 16000 | ||
46 | 47 | ||
47 | /* CUSTOM VALUES FOR SENSOR 1 */ | 48 | /* CUSTOM VALUES FOR SENSOR 1 */ |
48 | #define ST_MAGN_1_WAI_EXP 0x3c | 49 | #define ST_MAGN_1_WAI_EXP 0x3c |
@@ -69,20 +70,20 @@ | |||
69 | #define ST_MAGN_1_FS_AVL_4700_VAL 0x05 | 70 | #define ST_MAGN_1_FS_AVL_4700_VAL 0x05 |
70 | #define ST_MAGN_1_FS_AVL_5600_VAL 0x06 | 71 | #define ST_MAGN_1_FS_AVL_5600_VAL 0x06 |
71 | #define ST_MAGN_1_FS_AVL_8100_VAL 0x07 | 72 | #define ST_MAGN_1_FS_AVL_8100_VAL 0x07 |
72 | #define ST_MAGN_1_FS_AVL_1300_GAIN_XY 1100 | 73 | #define ST_MAGN_1_FS_AVL_1300_GAIN_XY 909 |
73 | #define ST_MAGN_1_FS_AVL_1900_GAIN_XY 855 | 74 | #define ST_MAGN_1_FS_AVL_1900_GAIN_XY 1169 |
74 | #define ST_MAGN_1_FS_AVL_2500_GAIN_XY 670 | 75 | #define ST_MAGN_1_FS_AVL_2500_GAIN_XY 1492 |
75 | #define ST_MAGN_1_FS_AVL_4000_GAIN_XY 450 | 76 | #define ST_MAGN_1_FS_AVL_4000_GAIN_XY 2222 |
76 | #define ST_MAGN_1_FS_AVL_4700_GAIN_XY 400 | 77 | #define ST_MAGN_1_FS_AVL_4700_GAIN_XY 2500 |
77 | #define ST_MAGN_1_FS_AVL_5600_GAIN_XY 330 | 78 | #define ST_MAGN_1_FS_AVL_5600_GAIN_XY 3030 |
78 | #define ST_MAGN_1_FS_AVL_8100_GAIN_XY 230 | 79 | #define ST_MAGN_1_FS_AVL_8100_GAIN_XY 4347 |
79 | #define ST_MAGN_1_FS_AVL_1300_GAIN_Z 980 | 80 | #define ST_MAGN_1_FS_AVL_1300_GAIN_Z 1020 |
80 | #define ST_MAGN_1_FS_AVL_1900_GAIN_Z 760 | 81 | #define ST_MAGN_1_FS_AVL_1900_GAIN_Z 1315 |
81 | #define ST_MAGN_1_FS_AVL_2500_GAIN_Z 600 | 82 | #define ST_MAGN_1_FS_AVL_2500_GAIN_Z 1666 |
82 | #define ST_MAGN_1_FS_AVL_4000_GAIN_Z 400 | 83 | #define ST_MAGN_1_FS_AVL_4000_GAIN_Z 2500 |
83 | #define ST_MAGN_1_FS_AVL_4700_GAIN_Z 355 | 84 | #define ST_MAGN_1_FS_AVL_4700_GAIN_Z 2816 |
84 | #define ST_MAGN_1_FS_AVL_5600_GAIN_Z 295 | 85 | #define ST_MAGN_1_FS_AVL_5600_GAIN_Z 3389 |
85 | #define ST_MAGN_1_FS_AVL_8100_GAIN_Z 205 | 86 | #define ST_MAGN_1_FS_AVL_8100_GAIN_Z 4878 |
86 | #define ST_MAGN_1_MULTIREAD_BIT false | 87 | #define ST_MAGN_1_MULTIREAD_BIT false |
87 | 88 | ||
88 | /* CUSTOM VALUES FOR SENSOR 2 */ | 89 | /* CUSTOM VALUES FOR SENSOR 2 */ |
@@ -105,10 +106,12 @@ | |||
105 | #define ST_MAGN_2_FS_MASK 0x60 | 106 | #define ST_MAGN_2_FS_MASK 0x60 |
106 | #define ST_MAGN_2_FS_AVL_4000_VAL 0x00 | 107 | #define ST_MAGN_2_FS_AVL_4000_VAL 0x00 |
107 | #define ST_MAGN_2_FS_AVL_8000_VAL 0x01 | 108 | #define ST_MAGN_2_FS_AVL_8000_VAL 0x01 |
108 | #define ST_MAGN_2_FS_AVL_10000_VAL 0x02 | 109 | #define ST_MAGN_2_FS_AVL_12000_VAL 0x02 |
109 | #define ST_MAGN_2_FS_AVL_4000_GAIN 430 | 110 | #define ST_MAGN_2_FS_AVL_16000_VAL 0x03 |
110 | #define ST_MAGN_2_FS_AVL_8000_GAIN 230 | 111 | #define ST_MAGN_2_FS_AVL_4000_GAIN 146 |
111 | #define ST_MAGN_2_FS_AVL_10000_GAIN 230 | 112 | #define ST_MAGN_2_FS_AVL_8000_GAIN 292 |
113 | #define ST_MAGN_2_FS_AVL_12000_GAIN 438 | ||
114 | #define ST_MAGN_2_FS_AVL_16000_GAIN 584 | ||
112 | #define ST_MAGN_2_MULTIREAD_BIT false | 115 | #define ST_MAGN_2_MULTIREAD_BIT false |
113 | #define ST_MAGN_2_OUT_X_L_ADDR 0x28 | 116 | #define ST_MAGN_2_OUT_X_L_ADDR 0x28 |
114 | #define ST_MAGN_2_OUT_Y_L_ADDR 0x2a | 117 | #define ST_MAGN_2_OUT_Y_L_ADDR 0x2a |
@@ -266,9 +269,14 @@ static const struct st_sensors st_magn_sensors[] = { | |||
266 | .gain = ST_MAGN_2_FS_AVL_8000_GAIN, | 269 | .gain = ST_MAGN_2_FS_AVL_8000_GAIN, |
267 | }, | 270 | }, |
268 | [2] = { | 271 | [2] = { |
269 | .num = ST_MAGN_FS_AVL_10000MG, | 272 | .num = ST_MAGN_FS_AVL_12000MG, |
270 | .value = ST_MAGN_2_FS_AVL_10000_VAL, | 273 | .value = ST_MAGN_2_FS_AVL_12000_VAL, |
271 | .gain = ST_MAGN_2_FS_AVL_10000_GAIN, | 274 | .gain = ST_MAGN_2_FS_AVL_12000_GAIN, |
275 | }, | ||
276 | [3] = { | ||
277 | .num = ST_MAGN_FS_AVL_16000MG, | ||
278 | .value = ST_MAGN_2_FS_AVL_16000_VAL, | ||
279 | .gain = ST_MAGN_2_FS_AVL_16000_GAIN, | ||
272 | }, | 280 | }, |
273 | }, | 281 | }, |
274 | }, | 282 | }, |