summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/hi8435.c
AgeCommit message (Collapse)AuthorFilesLines
2017-08-22iio:adc: drop assign iio_info.driver_module and iio_trigger_ops.ownerJonathan Cameron1-1/+0
The equivalent of both of these are now done via macro magic when the relevant register calls are made. The actual structure elements will shortly go away. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-06-03Revert "iio: hi8435: cleanup reset gpio"Jonathan Cameron1-7/+5
This reverts commit 61305664a542f874283f74bf0b27ddb31f5045d7. This commit was applied prematurely and will break some existing situations where the signal is inverted as part of voltage level conversions. Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-06-03iio: hi8435: remote ampersands from hi8435_info definitionNikita Yushchenko1-4/+4
C syntax allows apersands when initializing structures fields with function pointers, but in Linux sources ampersands are normally not used in thix context. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-20iio: hi8435: cleanup reset gpioNikita Yushchenko1-5/+7
Reset GPIO is active low. Currently driver uses gpiod_set_value(1) to clean reset, which depends on device tree to contain GPIO_ACTIVE_HIGH - that does not match reality. This fixes driver to use _raw version of gpiod_set_value() to enforce active-low semantics despite of what's written in device tree. Allowing device tree to override that only opens possibility for errors and does not add any value. Additionally, use _cansleep version to make things work with i2c-gpio and other sleeping gpio drivers. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-20iio: hi8435: make in_voltage_sensing_mode_available visibleNikita Yushchenko1-0/+1
Possible values of sensing_mode are encoded with strings and actual strings used are not obvious. Provide a hint by enabling in_voltage_sensing_mode_available attribute. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-20iio: hi8435: avoid garbage event at first enableNikita Yushchenko1-2/+13
Currently, driver generates events for channels if new reading differs from previous one. This "previous value" is initialized to zero, which results into event if value is constant-one. Fix that by initializing "previous value" by reading at event enable time. This provides reliable sequence for userspace: - enable event, - AFTER THAT read current value, - AFTER THAT each event will correspond to change. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-20iio: hi8435: add raw accessNikita Yushchenko1-0/+22
With current event-only driver, it is not possible for user space application to know current senses if they don't change since application starts. Address that by adding raw access to channels. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-03iio: adc: add missing of_node references to iio_devMatt Ranostay1-0/+1
Adding missing indio_dev->dev.of_node references to allow iio consumers to access the device channels. Signed-off-by: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-06-30iio:core: timestamping clock selection supportGregor Boirie1-1/+1
Adds a new per-device sysfs attribute "current_timestamp_clock" to allow userspace to select a particular POSIX clock for buffered samples and events timestamping. Following clocks, as listed in clock_gettime(2), are supported: CLOCK_REALTIME, CLOCK_MONOTONIC, CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME and CLOCK_TAI. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Acked-by: Sanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-09-23iio: adc: hi8435: Holt HI-8435 threshold detectorVladimir Barinov1-0/+534
Add Holt threshold detector driver for HI-8435 chip Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>