diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-02 00:31:55 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-02 00:31:55 (GMT) |
commit | ec3c13e4ac3ebeed01acc24ffba7cb1704804e07 (patch) | |
tree | 9d70554f317bc4dc7687d5c1c6eb5c36a95bea03 /drivers/staging/iio/trigger | |
parent | 3e66848a3249105fe4973b0550b5b6cd42240168 (diff) | |
parent | ac65ca682e84cff77e36ad0d71862b33b4be5f9e (diff) | |
download | linux-ec3c13e4ac3ebeed01acc24ffba7cb1704804e07.tar.xz |
Merge tag 'iio-for-4.6c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Third set of IIO new device support, features and cleanups for the 4.6 cycle.
Good to see several new contributors in this set - and more generally a
number of new 'faces' over this whole cycle.
Staging movements
* hmc5843
- out of staging.
* periodic RTC trigger
- driver dropped. This is an ancient driver (brings back some memories ;)
that was always somewhat of a bodge. Originally there was a driver that
never went into mainline that supported large numbers of periodict timers
on the PXA270 via this route. Discussions to have a generic periodic
timer subsystem never went anywhere. At the time RTC periodic
interrupts were real - now they are emulated using high resolution
timers so with the HRT driver this has become pointless.
New device support
* mpu6050 driver
- Add support for the mpu6500.
* TI tpl0102 potentiometer
- new driver.
* Vybrid SoC DAC
- new driver. The ADC on this SoC has been supported for a while, this
adds a separate driver for the DAC.
New Features
* hmc5844
- Attributes to configure the bias current (typically part of a self test)
This could be done before via a somewhat obscure custom interface.
This at least makes it easy to tell what is going on.
- Document all custom attributes.
* mpu6050
- Add support for calibration offset control and readback.
* ms5611
- power regulator support. This is always one that gets added the
first time someone has a board that needs it. Here it was needed,
hence it was added.
Cleanups / minor fixes
* tree wide
- clean up all the myriad different return values in response to a
failure of i2c_check_functionality. After discussions everyone seemed
happy wiht -EOPNOTSUPP which seems to describe the situation well.
I encouraged a tree wide cleanup to set a good example in future for
this.
* core
- Typos in the iio_event_spec documentation in iio.h
* afe4403
- select REGMAP_SPI to avoid dependency issues
- mark suspend/resume as __maybe_unused to avoid warnings
* afe4404
- mark suspend/resume as __maybe_unused to avoid warnings
* atlas-ph-sensor
- switch the regmap cache type from linear to rbtree to gain reading of
registers on initial startup. It's not immediately obvious, but
regmap flat is meant for high performances cases so doesn't read these
registers.
- use regmap_bulk_read in one case where it was using
i2c_smbus_read_i2c_block_data directly (unlike everything else that was
through regmap).
* ina2xx
- stype cleanups (lots of them!)
* isl29018
- Get the struct device back from regmap rather than storing another
copy of it in the private data. This cleanup makes sense in a number
of other drivers so patches may well follow.
* mpu6050
- style cleanups (lots of them!)
- improved return value handling
- use usleep_range to avoid the usual issues with very short msleeps.
- add some missing documentation.
* ms5611
- use the probed device name for the device rather than the driver name.
- select IIO_BUFFER to avoid dependency issues
* palmas
- drop IRQF_EARLY_RESUME as no longer needed after genirq changes.
Diffstat (limited to 'drivers/staging/iio/trigger')
-rw-r--r-- | drivers/staging/iio/trigger/Kconfig | 10 | ||||
-rw-r--r-- | drivers/staging/iio/trigger/Makefile | 1 | ||||
-rw-r--r-- | drivers/staging/iio/trigger/iio-trig-periodic-rtc.c | 216 |
3 files changed, 0 insertions, 227 deletions
diff --git a/drivers/staging/iio/trigger/Kconfig b/drivers/staging/iio/trigger/Kconfig index 710a2f3..0b01d24 100644 --- a/drivers/staging/iio/trigger/Kconfig +++ b/drivers/staging/iio/trigger/Kconfig @@ -5,16 +5,6 @@ comment "Triggers - standalone" if IIO_TRIGGER -config IIO_PERIODIC_RTC_TRIGGER - tristate "Periodic RTC triggers" - depends on RTC_CLASS - help - Provides support for using periodic capable real time - clocks as IIO triggers. - - To compile this driver as a module, choose M here: the - module will be called iio-trig-periodic-rtc. - config IIO_BFIN_TMR_TRIGGER tristate "Blackfin TIMER trigger" depends on BLACKFIN diff --git a/drivers/staging/iio/trigger/Makefile b/drivers/staging/iio/trigger/Makefile index 238481b..1300a21 100644 --- a/drivers/staging/iio/trigger/Makefile +++ b/drivers/staging/iio/trigger/Makefile @@ -2,5 +2,4 @@ # Makefile for triggers not associated with iio-devices # -obj-$(CONFIG_IIO_PERIODIC_RTC_TRIGGER) += iio-trig-periodic-rtc.o obj-$(CONFIG_IIO_BFIN_TMR_TRIGGER) += iio-trig-bfin-timer.o diff --git a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c deleted file mode 100644 index 00d1393..0000000 --- a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c +++ /dev/null @@ -1,216 +0,0 @@ -/* The industrial I/O periodic RTC trigger driver - * - * Copyright (c) 2008 Jonathan Cameron - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. - * - * This is a heavily rewritten version of the periodic timer system in - * earlier version of industrialio. It supplies the same functionality - * but via a trigger rather than a specific periodic timer system. - */ - -#include <linux/platform_device.h> -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/slab.h> -#include <linux/rtc.h> -#include <linux/iio/iio.h> -#include <linux/iio/trigger.h> - -static LIST_HEAD(iio_prtc_trigger_list); -static DEFINE_MUTEX(iio_prtc_trigger_list_lock); - -struct iio_prtc_trigger_info { - struct rtc_device *rtc; - unsigned int frequency; - struct rtc_task task; - bool state; -}; - -static int iio_trig_periodic_rtc_set_state(struct iio_trigger *trig, bool state) -{ - struct iio_prtc_trigger_info *trig_info = iio_trigger_get_drvdata(trig); - int ret; - - if (trig_info->frequency == 0 && state) - return -EINVAL; - dev_dbg(&trig_info->rtc->dev, "trigger frequency is %u\n", - trig_info->frequency); - ret = rtc_irq_set_state(trig_info->rtc, &trig_info->task, state); - if (!ret) - trig_info->state = state; - - return ret; -} - -static ssize_t iio_trig_periodic_read_freq(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - struct iio_trigger *trig = to_iio_trigger(dev); - struct iio_prtc_trigger_info *trig_info = iio_trigger_get_drvdata(trig); - - return sprintf(buf, "%u\n", trig_info->frequency); -} - -static ssize_t iio_trig_periodic_write_freq(struct device *dev, - struct device_attribute *attr, - const char *buf, - size_t len) -{ - struct iio_trigger *trig = to_iio_trigger(dev); - struct iio_prtc_trigger_info *trig_info = iio_trigger_get_drvdata(trig); - unsigned int val; - int ret; - - ret = kstrtouint(buf, 10, &val); - if (ret) - goto error_ret; - - if (val > 0) { - ret = rtc_irq_set_freq(trig_info->rtc, &trig_info->task, val); - if (ret == 0 && trig_info->state && trig_info->frequency == 0) - ret = rtc_irq_set_state(trig_info->rtc, - &trig_info->task, 1); - } else { - ret = rtc_irq_set_state(trig_info->rtc, &trig_info->task, 0); - } - if (ret) - goto error_ret; - - trig_info->frequency = val; - - return len; - -error_ret: - return ret; -} - -static DEVICE_ATTR(frequency, S_IRUGO | S_IWUSR, - iio_trig_periodic_read_freq, - iio_trig_periodic_write_freq); - -static struct attribute *iio_trig_prtc_attrs[] = { - &dev_attr_frequency.attr, - NULL, -}; - -static const struct attribute_group iio_trig_prtc_attr_group = { - .attrs = iio_trig_prtc_attrs, -}; - -static const struct attribute_group *iio_trig_prtc_attr_groups[] = { - &iio_trig_prtc_attr_group, - NULL -}; - -static void iio_prtc_trigger_poll(void *private_data) -{ - iio_trigger_poll(private_data); -} - -static const struct iio_trigger_ops iio_prtc_trigger_ops = { - .owner = THIS_MODULE, - .set_trigger_state = &iio_trig_periodic_rtc_set_state, -}; - -static int iio_trig_periodic_rtc_probe(struct platform_device *dev) -{ - char **pdata = dev->dev.platform_data; - struct iio_prtc_trigger_info *trig_info; - struct iio_trigger *trig, *trig2; - - int i, ret; - - for (i = 0;; i++) { - if (!pdata[i]) - break; - trig = iio_trigger_alloc("periodic%s", pdata[i]); - if (!trig) { - ret = -ENOMEM; - goto error_free_completed_registrations; - } - list_add(&trig->alloc_list, &iio_prtc_trigger_list); - - trig_info = kzalloc(sizeof(*trig_info), GFP_KERNEL); - if (!trig_info) { - ret = -ENOMEM; - goto error_put_trigger_and_remove_from_list; - } - iio_trigger_set_drvdata(trig, trig_info); - trig->ops = &iio_prtc_trigger_ops; - /* RTC access */ - trig_info->rtc = rtc_class_open(pdata[i]); - if (!trig_info->rtc) { - ret = -EINVAL; - goto error_free_trig_info; - } - trig_info->task.func = iio_prtc_trigger_poll; - trig_info->task.private_data = trig; - ret = rtc_irq_register(trig_info->rtc, &trig_info->task); - if (ret) - goto error_close_rtc; - trig->dev.groups = iio_trig_prtc_attr_groups; - ret = iio_trigger_register(trig); - if (ret) - goto error_unregister_rtc_irq; - } - return 0; -error_unregister_rtc_irq: - rtc_irq_unregister(trig_info->rtc, &trig_info->task); -error_close_rtc: - rtc_class_close(trig_info->rtc); -error_free_trig_info: - kfree(trig_info); -error_put_trigger_and_remove_from_list: - list_del(&trig->alloc_list); - iio_trigger_put(trig); -error_free_completed_registrations: - list_for_each_entry_safe(trig, - trig2, - &iio_prtc_trigger_list, - alloc_list) { - trig_info = iio_trigger_get_drvdata(trig); - rtc_irq_unregister(trig_info->rtc, &trig_info->task); - rtc_class_close(trig_info->rtc); - kfree(trig_info); - iio_trigger_unregister(trig); - } - return ret; -} - -static int iio_trig_periodic_rtc_remove(struct platform_device *dev) -{ - struct iio_trigger *trig, *trig2; - struct iio_prtc_trigger_info *trig_info; - - mutex_lock(&iio_prtc_trigger_list_lock); - list_for_each_entry_safe(trig, - trig2, - &iio_prtc_trigger_list, - alloc_list) { - trig_info = iio_trigger_get_drvdata(trig); - rtc_irq_unregister(trig_info->rtc, &trig_info->task); - rtc_class_close(trig_info->rtc); - kfree(trig_info); - iio_trigger_unregister(trig); - } - mutex_unlock(&iio_prtc_trigger_list_lock); - return 0; -} - -static struct platform_driver iio_trig_periodic_rtc_driver = { - .probe = iio_trig_periodic_rtc_probe, - .remove = iio_trig_periodic_rtc_remove, - .driver = { - .name = "iio_prtc_trigger", - }, -}; - -module_platform_driver(iio_trig_periodic_rtc_driver); - -MODULE_AUTHOR("Jonathan Cameron <jic23@kernel.org>"); -MODULE_DESCRIPTION("Periodic realtime clock trigger for the iio subsystem"); -MODULE_LICENSE("GPL v2"); |