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

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

Jonathan writes:

Second set of new functionality for IIO in the 3.13 cycle - with bug fixes for first set.

This is a small, mainly to get a couple of compile bug related fixes into
the tree ASAP.

New device support:
1) Add ad5446 dac support to the ad5641 driver.

New functionality and cleanups:
1) Optional power supply regulators for the st pressure sensors drivers using
the new optional regulator interface.
2) Bit of tidying up of naming in the sysfs trigger.

Bug fixes from the previous series:
1) Missing select IIO_BUFFER for ti_am335x_adc
2) Drop a bonus bracket in iio-trig-bfin-timmer

+60 -9
+1
drivers/iio/adc/Kconfig
··· 177 177 config TI_AM335X_ADC 178 178 tristate "TI's AM335X ADC driver" 179 179 depends on MFD_TI_AM335X_TSCADC 180 + select IIO_BUFFER 180 181 select IIO_KFIFO_BUF 181 182 help 182 183 Say yes here to build support for Texas Instruments ADC
+1 -1
drivers/iio/dac/Kconfig
··· 57 57 Say yes here to build support for Analog Devices AD5300, AD5301, AD5310, 58 58 AD5311, AD5320, AD5321, AD5444, AD5446, AD5450, AD5451, AD5452, AD5453, 59 59 AD5512A, AD5541A, AD5542A, AD5543, AD5553, AD5601, AD5602, AD5611, AD5612, 60 - AD5620, AD5621, AD5622, AD5640, AD5660, AD5662 DACs. 60 + AD5620, AD5621, AD5622, AD5640, AD5641, AD5660, AD5662 DACs. 61 61 62 62 To compile this driver as a module, choose M here: the 63 63 module will be called ad5446.
+6
drivers/iio/dac/ad5446.c
··· 330 330 ID_AD5601, 331 331 ID_AD5611, 332 332 ID_AD5621, 333 + ID_AD5641, 333 334 ID_AD5620_2500, 334 335 ID_AD5620_1250, 335 336 ID_AD5640_2500, ··· 393 392 .channel = AD5446_CHANNEL_POWERDOWN(12, 16, 2), 394 393 .write = ad5446_write, 395 394 }, 395 + [ID_AD5641] = { 396 + .channel = AD5446_CHANNEL_POWERDOWN(14, 16, 0), 397 + .write = ad5446_write, 398 + }, 396 399 [ID_AD5620_2500] = { 397 400 .channel = AD5446_CHANNEL_POWERDOWN(12, 16, 2), 398 401 .int_vref_mv = 2500, ··· 451 446 {"ad5601", ID_AD5601}, 452 447 {"ad5611", ID_AD5611}, 453 448 {"ad5621", ID_AD5621}, 449 + {"ad5641", ID_AD5641}, 454 450 {"ad5620-2500", ID_AD5620_2500}, /* AD5620/40/60: */ 455 451 {"ad5620-1250", ID_AD5620_1250}, /* part numbers may look differently */ 456 452 {"ad5640-2500", ID_AD5640_2500},
+39
drivers/iio/pressure/st_pressure_core.c
··· 23 23 #include <linux/iio/sysfs.h> 24 24 #include <linux/iio/trigger.h> 25 25 #include <linux/iio/buffer.h> 26 + #include <linux/regulator/consumer.h> 26 27 #include <asm/unaligned.h> 27 28 28 29 #include <linux/iio/common/st_sensors.h> ··· 314 313 #define ST_PRESS_TRIGGER_OPS NULL 315 314 #endif 316 315 316 + static void st_press_power_enable(struct iio_dev *indio_dev) 317 + { 318 + struct st_sensor_data *pdata = iio_priv(indio_dev); 319 + int err; 320 + 321 + /* Regulators not mandatory, but if requested we should enable them. */ 322 + pdata->vdd = devm_regulator_get_optional(&indio_dev->dev, "vdd"); 323 + if (!IS_ERR(pdata->vdd)) { 324 + err = regulator_enable(pdata->vdd); 325 + if (err != 0) 326 + dev_warn(&indio_dev->dev, 327 + "Failed to enable specified Vdd supply\n"); 328 + } 329 + 330 + pdata->vdd_io = devm_regulator_get_optional(&indio_dev->dev, "vddio"); 331 + if (!IS_ERR(pdata->vdd_io)) { 332 + err = regulator_enable(pdata->vdd_io); 333 + if (err != 0) 334 + dev_warn(&indio_dev->dev, 335 + "Failed to enable specified Vdd_IO supply\n"); 336 + } 337 + } 338 + 339 + static void st_press_power_disable(struct iio_dev *indio_dev) 340 + { 341 + struct st_sensor_data *pdata = iio_priv(indio_dev); 342 + 343 + if (!IS_ERR(pdata->vdd)) 344 + regulator_disable(pdata->vdd); 345 + 346 + if (!IS_ERR(pdata->vdd_io)) 347 + regulator_disable(pdata->vdd_io); 348 + } 349 + 317 350 int st_press_common_probe(struct iio_dev *indio_dev, 318 351 struct st_sensors_platform_data *plat_data) 319 352 { ··· 357 322 358 323 indio_dev->modes = INDIO_DIRECT_MODE; 359 324 indio_dev->info = &press_info; 325 + 326 + st_press_power_enable(indio_dev); 360 327 361 328 err = st_sensors_check_device_support(indio_dev, 362 329 ARRAY_SIZE(st_press_sensors), ··· 416 379 void st_press_common_remove(struct iio_dev *indio_dev) 417 380 { 418 381 struct st_sensor_data *pdata = iio_priv(indio_dev); 382 + 383 + st_press_power_disable(indio_dev); 419 384 420 385 iio_device_unregister(indio_dev); 421 386 if (pdata->get_irq_data_ready(indio_dev) > 0)
+7 -7
drivers/iio/trigger/iio-trig-sysfs.c
··· 23 23 }; 24 24 25 25 static LIST_HEAD(iio_sysfs_trig_list); 26 - static DEFINE_MUTEX(iio_syfs_trig_list_mut); 26 + static DEFINE_MUTEX(iio_sysfs_trig_list_mut); 27 27 28 28 static int iio_sysfs_trigger_probe(int id); 29 29 static ssize_t iio_sysfs_trig_add(struct device *dev, ··· 135 135 struct iio_sysfs_trig *t; 136 136 int ret; 137 137 bool foundit = false; 138 - mutex_lock(&iio_syfs_trig_list_mut); 138 + mutex_lock(&iio_sysfs_trig_list_mut); 139 139 list_for_each_entry(t, &iio_sysfs_trig_list, l) 140 140 if (id == t->id) { 141 141 foundit = true; ··· 169 169 goto out2; 170 170 list_add(&t->l, &iio_sysfs_trig_list); 171 171 __module_get(THIS_MODULE); 172 - mutex_unlock(&iio_syfs_trig_list_mut); 172 + mutex_unlock(&iio_sysfs_trig_list_mut); 173 173 return 0; 174 174 175 175 out2: ··· 177 177 free_t: 178 178 kfree(t); 179 179 out1: 180 - mutex_unlock(&iio_syfs_trig_list_mut); 180 + mutex_unlock(&iio_sysfs_trig_list_mut); 181 181 return ret; 182 182 } 183 183 ··· 185 185 { 186 186 bool foundit = false; 187 187 struct iio_sysfs_trig *t; 188 - mutex_lock(&iio_syfs_trig_list_mut); 188 + mutex_lock(&iio_sysfs_trig_list_mut); 189 189 list_for_each_entry(t, &iio_sysfs_trig_list, l) 190 190 if (id == t->id) { 191 191 foundit = true; 192 192 break; 193 193 } 194 194 if (!foundit) { 195 - mutex_unlock(&iio_syfs_trig_list_mut); 195 + mutex_unlock(&iio_sysfs_trig_list_mut); 196 196 return -EINVAL; 197 197 } 198 198 ··· 202 202 list_del(&t->l); 203 203 kfree(t); 204 204 module_put(THIS_MODULE); 205 - mutex_unlock(&iio_syfs_trig_list_mut); 205 + mutex_unlock(&iio_sysfs_trig_list_mut); 206 206 return 0; 207 207 } 208 208
+1 -1
drivers/staging/iio/trigger/iio-trig-bfin-timer.c
··· 91 91 if (ret) 92 92 return ret; 93 93 94 - if (val > 100000) { 94 + if (val > 100000) 95 95 return -EINVAL; 96 96 97 97 enabled = get_enabled_gptimers() & st->t->bit;
+5
include/linux/iio/common/st_sensors.h
··· 16 16 #include <linux/irqreturn.h> 17 17 #include <linux/iio/trigger.h> 18 18 #include <linux/bitops.h> 19 + #include <linux/regulator/consumer.h> 19 20 20 21 #include <linux/platform_data/st_sensors_pdata.h> 21 22 ··· 202 201 * @trig: The trigger in use by the core driver. 203 202 * @sensor: Pointer to the current sensor struct in use. 204 203 * @current_fullscale: Maximum range of measure by the sensor. 204 + * @vdd: Pointer to sensor's Vdd power supply 205 + * @vdd_io: Pointer to sensor's Vdd-IO power supply 205 206 * @enabled: Status of the sensor (false->off, true->on). 206 207 * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread. 207 208 * @buffer_data: Data used by buffer part. ··· 219 216 struct iio_trigger *trig; 220 217 struct st_sensors *sensor; 221 218 struct st_sensor_fullscale_avl *current_fullscale; 219 + struct regulator *vdd; 220 + struct regulator *vdd_io; 222 221 223 222 bool enabled; 224 223 bool multiread_bit;