Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'staging-3.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging / IIO fixes from Greg KH:
"Here are some IIO and Staging driver fixes for 3.17-rc6. They are all
pretty simple, and resolve reported issues"

* tag 'staging-3.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging: vt6655: buffer overflow in ioctl
iio:magnetometer: bugfix magnetometers gain values
iio: adc: at91: don't use the last converted data register
iio: adc: xilinx-xadc: assign auxiliary channels address correctly
iio: meter: ade7758: Fix indio_dev->trig assignment
iio: inv_mpu6050: Fix indio_dev->trig assignment
iio: gyro: itg3200: Fix indio_dev->trig assignment
iio: st_sensors: Fix indio_dev->trig assignment
iio: hid_sensor_hub: Fix indio_dev->trig assignment
iio: adc: ad_sigma_delta: Fix indio_dev->trig assignment
iio: accel: bma180: Fix indio_dev->trig assignment
iio:trigger: modify return value for iio_trigger_get
iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name

+53 -37
+1 -1
drivers/iio/accel/bma180.c
··· 571 571 trig->ops = &bma180_trigger_ops; 572 572 iio_trigger_set_drvdata(trig, indio_dev); 573 573 data->trig = trig; 574 - indio_dev->trig = trig; 574 + indio_dev->trig = iio_trigger_get(trig); 575 575 576 576 ret = iio_trigger_register(trig); 577 577 if (ret)
+1 -1
drivers/iio/adc/ad_sigma_delta.c
··· 472 472 goto error_free_irq; 473 473 474 474 /* select default trigger */ 475 - indio_dev->trig = sigma_delta->trig; 475 + indio_dev->trig = iio_trigger_get(sigma_delta->trig); 476 476 477 477 return 0; 478 478
+7 -5
drivers/iio/adc/at91_adc.c
··· 196 196 bool done; 197 197 int irq; 198 198 u16 last_value; 199 + int chnb; 199 200 struct mutex lock; 200 201 u8 num_channels; 201 202 void __iomem *reg_base; ··· 275 274 disable_irq_nosync(irq); 276 275 iio_trigger_poll(idev->trig); 277 276 } else { 278 - st->last_value = at91_adc_readl(st, AT91_ADC_LCDR); 277 + st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb)); 279 278 st->done = true; 280 279 wake_up_interruptible(&st->wq_data_avail); 281 280 } ··· 352 351 unsigned int reg; 353 352 354 353 status &= at91_adc_readl(st, AT91_ADC_IMR); 355 - if (status & st->registers->drdy_mask) 354 + if (status & GENMASK(st->num_channels - 1, 0)) 356 355 handle_adc_eoc_trigger(irq, idev); 357 356 358 357 if (status & AT91RL_ADC_IER_PEN) { ··· 419 418 AT91_ADC_IER_YRDY | 420 419 AT91_ADC_IER_PRDY; 421 420 422 - if (status & st->registers->drdy_mask) 421 + if (status & GENMASK(st->num_channels - 1, 0)) 423 422 handle_adc_eoc_trigger(irq, idev); 424 423 425 424 if (status & AT91_ADC_IER_PEN) { ··· 690 689 case IIO_CHAN_INFO_RAW: 691 690 mutex_lock(&st->lock); 692 691 692 + st->chnb = chan->channel; 693 693 at91_adc_writel(st, AT91_ADC_CHER, 694 694 AT91_ADC_CH(chan->channel)); 695 - at91_adc_writel(st, AT91_ADC_IER, st->registers->drdy_mask); 695 + at91_adc_writel(st, AT91_ADC_IER, BIT(chan->channel)); 696 696 at91_adc_writel(st, AT91_ADC_CR, AT91_ADC_START); 697 697 698 698 ret = wait_event_interruptible_timeout(st->wq_data_avail, ··· 710 708 711 709 at91_adc_writel(st, AT91_ADC_CHDR, 712 710 AT91_ADC_CH(chan->channel)); 713 - at91_adc_writel(st, AT91_ADC_IDR, st->registers->drdy_mask); 711 + at91_adc_writel(st, AT91_ADC_IDR, BIT(chan->channel)); 714 712 715 713 st->last_value = 0; 716 714 st->done = false;
+1 -1
drivers/iio/adc/xilinx-xadc-core.c
··· 1126 1126 chan->address = XADC_REG_VPVN; 1127 1127 } else { 1128 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 1131 num_channels++; 1132 1132 chan++;
+2 -1
drivers/iio/common/hid-sensors/hid-sensor-trigger.c
··· 122 122 dev_err(&indio_dev->dev, "Trigger Register Failed\n"); 123 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 128 return ret; 128 129
+1 -1
drivers/iio/common/st_sensors/st_sensors_trigger.c
··· 49 49 dev_err(&indio_dev->dev, "failed to register iio trigger.\n"); 50 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 54 return 0; 55 55
+1 -1
drivers/iio/gyro/itg3200_buffer.c
··· 132 132 goto error_free_irq; 133 133 134 134 /* select default trigger */ 135 - indio_dev->trig = st->trig; 135 + indio_dev->trig = iio_trigger_get(st->trig); 136 136 137 137 return 0; 138 138
+1 -1
drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
··· 135 135 ret = iio_trigger_register(st->trig); 136 136 if (ret) 137 137 goto error_free_irq; 138 - indio_dev->trig = st->trig; 138 + indio_dev->trig = iio_trigger_get(st->trig); 139 139 140 140 return 0; 141 141
+1 -1
drivers/iio/inkern.c
··· 178 178 index = of_property_match_string(np, "io-channel-names", 179 179 name); 180 180 chan = of_iio_channel_get(np, index); 181 - if (!IS_ERR(chan)) 181 + if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) 182 182 break; 183 183 else if (name && index >= 0) { 184 184 pr_err("ERROR: could not get IIO channel %s:%s(%i)\n",
+30 -22
drivers/iio/magnetometer/st_magn_core.c
··· 42 42 #define ST_MAGN_FS_AVL_5600MG 5600 43 43 #define ST_MAGN_FS_AVL_8000MG 8000 44 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 48 /* CUSTOM VALUES FOR SENSOR 1 */ 48 49 #define ST_MAGN_1_WAI_EXP 0x3c ··· 70 69 #define ST_MAGN_1_FS_AVL_4700_VAL 0x05 71 70 #define ST_MAGN_1_FS_AVL_5600_VAL 0x06 72 71 #define ST_MAGN_1_FS_AVL_8100_VAL 0x07 73 - #define ST_MAGN_1_FS_AVL_1300_GAIN_XY 1100 74 - #define ST_MAGN_1_FS_AVL_1900_GAIN_XY 855 75 - #define ST_MAGN_1_FS_AVL_2500_GAIN_XY 670 76 - #define ST_MAGN_1_FS_AVL_4000_GAIN_XY 450 77 - #define ST_MAGN_1_FS_AVL_4700_GAIN_XY 400 78 - #define ST_MAGN_1_FS_AVL_5600_GAIN_XY 330 79 - #define ST_MAGN_1_FS_AVL_8100_GAIN_XY 230 80 - #define ST_MAGN_1_FS_AVL_1300_GAIN_Z 980 81 - #define ST_MAGN_1_FS_AVL_1900_GAIN_Z 760 82 - #define ST_MAGN_1_FS_AVL_2500_GAIN_Z 600 83 - #define ST_MAGN_1_FS_AVL_4000_GAIN_Z 400 84 - #define ST_MAGN_1_FS_AVL_4700_GAIN_Z 355 85 - #define ST_MAGN_1_FS_AVL_5600_GAIN_Z 295 86 - #define ST_MAGN_1_FS_AVL_8100_GAIN_Z 205 72 + #define ST_MAGN_1_FS_AVL_1300_GAIN_XY 909 73 + #define ST_MAGN_1_FS_AVL_1900_GAIN_XY 1169 74 + #define ST_MAGN_1_FS_AVL_2500_GAIN_XY 1492 75 + #define ST_MAGN_1_FS_AVL_4000_GAIN_XY 2222 76 + #define ST_MAGN_1_FS_AVL_4700_GAIN_XY 2500 77 + #define ST_MAGN_1_FS_AVL_5600_GAIN_XY 3030 78 + #define ST_MAGN_1_FS_AVL_8100_GAIN_XY 4347 79 + #define ST_MAGN_1_FS_AVL_1300_GAIN_Z 1020 80 + #define ST_MAGN_1_FS_AVL_1900_GAIN_Z 1315 81 + #define ST_MAGN_1_FS_AVL_2500_GAIN_Z 1666 82 + #define ST_MAGN_1_FS_AVL_4000_GAIN_Z 2500 83 + #define ST_MAGN_1_FS_AVL_4700_GAIN_Z 2816 84 + #define ST_MAGN_1_FS_AVL_5600_GAIN_Z 3389 85 + #define ST_MAGN_1_FS_AVL_8100_GAIN_Z 4878 87 86 #define ST_MAGN_1_MULTIREAD_BIT false 88 87 89 88 /* CUSTOM VALUES FOR SENSOR 2 */ ··· 106 105 #define ST_MAGN_2_FS_MASK 0x60 107 106 #define ST_MAGN_2_FS_AVL_4000_VAL 0x00 108 107 #define ST_MAGN_2_FS_AVL_8000_VAL 0x01 109 - #define ST_MAGN_2_FS_AVL_10000_VAL 0x02 110 - #define ST_MAGN_2_FS_AVL_4000_GAIN 430 111 - #define ST_MAGN_2_FS_AVL_8000_GAIN 230 112 - #define ST_MAGN_2_FS_AVL_10000_GAIN 230 108 + #define ST_MAGN_2_FS_AVL_12000_VAL 0x02 109 + #define ST_MAGN_2_FS_AVL_16000_VAL 0x03 110 + #define ST_MAGN_2_FS_AVL_4000_GAIN 146 111 + #define ST_MAGN_2_FS_AVL_8000_GAIN 292 112 + #define ST_MAGN_2_FS_AVL_12000_GAIN 438 113 + #define ST_MAGN_2_FS_AVL_16000_GAIN 584 113 114 #define ST_MAGN_2_MULTIREAD_BIT false 114 115 #define ST_MAGN_2_OUT_X_L_ADDR 0x28 115 116 #define ST_MAGN_2_OUT_Y_L_ADDR 0x2a ··· 269 266 .gain = ST_MAGN_2_FS_AVL_8000_GAIN, 270 267 }, 271 268 [2] = { 272 - .num = ST_MAGN_FS_AVL_10000MG, 273 - .value = ST_MAGN_2_FS_AVL_10000_VAL, 274 - .gain = ST_MAGN_2_FS_AVL_10000_GAIN, 269 + .num = ST_MAGN_FS_AVL_12000MG, 270 + .value = ST_MAGN_2_FS_AVL_12000_VAL, 271 + .gain = ST_MAGN_2_FS_AVL_12000_GAIN, 272 + }, 273 + [3] = { 274 + .num = ST_MAGN_FS_AVL_16000MG, 275 + .value = ST_MAGN_2_FS_AVL_16000_VAL, 276 + .gain = ST_MAGN_2_FS_AVL_16000_GAIN, 275 277 }, 276 278 }, 277 279 },
+1 -1
drivers/staging/iio/meter/ade7758_trigger.c
··· 85 85 ret = iio_trigger_register(st->trig); 86 86 87 87 /* select default trigger */ 88 - indio_dev->trig = st->trig; 88 + indio_dev->trig = iio_trigger_get(st->trig); 89 89 if (ret) 90 90 goto error_free_irq; 91 91
+3
drivers/staging/vt6655/hostap.c
··· 350 350 { 351 351 PSMgmtObject pMgmt = pDevice->pMgmt; 352 352 353 + if (param->u.generic_elem.len > sizeof(pMgmt->abyWPAIE)) 354 + return -EINVAL; 355 + 353 356 memcpy(pMgmt->abyWPAIE, 354 357 param->u.generic_elem.data, 355 358 param->u.generic_elem.len
+3 -1
include/linux/iio/trigger.h
··· 84 84 put_device(&trig->dev); 85 85 } 86 86 87 - static inline void iio_trigger_get(struct iio_trigger *trig) 87 + static inline struct iio_trigger *iio_trigger_get(struct iio_trigger *trig) 88 88 { 89 89 get_device(&trig->dev); 90 90 __module_get(trig->ops->owner); 91 + 92 + return trig; 91 93 } 92 94 93 95 /**