]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
iio: Add channel for Phase
authorMathieu Othacehe <m.othacehe@gmail.com>
Fri, 20 Jul 2018 17:34:25 +0000 (19:34 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Jul 2018 14:28:14 +0000 (15:28 +0100)
Add new channel type support for phase.

This channel may be used by Time-of-flight sensors to express the
phase difference between emitted and received signals. Those sensor
will then use the phase shift of return signals to approximate the
distance to objects.

Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Documentation/ABI/testing/sysfs-bus-iio
drivers/iio/industrialio-core.c
include/uapi/linux/iio/types.h
tools/iio/iio_event_monitor.c

index c7353030670a7ab65541cfb93855139b58224ad7..c9cfa833cf472da4c8c12f791a0467c13b0ac5b4 100644 (file)
@@ -1675,3 +1675,10 @@ KernelVersion:   4.12
 Contact:       linux-iio@vger.kernel.org
 Description:
                Raw counter device counters direction for channel Y.
+
+What:          /sys/bus/iio/devices/iio:deviceX/in_phaseY_raw
+KernelVersion: 4.18
+Contact:       linux-iio@vger.kernel.org
+Description:
+               Raw (unscaled) phase difference reading from channel Y
+               that can be processed to radians.
\ No newline at end of file
index ed1b3ebade946567f72b296cc920c52b9878c079..a16ad5a4ab0cbe4637955bc19267fbafd35c1950 100644 (file)
@@ -86,6 +86,7 @@ static const char * const iio_chan_type_name_spec[] = {
        [IIO_INDEX] = "index",
        [IIO_GRAVITY]  = "gravity",
        [IIO_POSITIONRELATIVE]  = "positionrelative",
+       [IIO_PHASE] = "phase",
 };
 
 static const char * const iio_modifier_names[] = {
index 033c7d28924eeea5659ab41490224c24745cf0f9..e4df3cc268db1fc7ea2a83db64d2c5070d98c349 100644 (file)
@@ -45,6 +45,7 @@ enum iio_chan_type {
        IIO_INDEX,
        IIO_GRAVITY,
        IIO_POSITIONRELATIVE,
+       IIO_PHASE,
 };
 
 enum iio_modifier {
index 148f69dfae756f21efb38fca81843d511577067f..f478f5558720c75588c4786b239084b798ea5133 100644 (file)
@@ -59,6 +59,7 @@ static const char * const iio_chan_type_name_spec[] = {
        [IIO_UVINDEX] = "uvindex",
        [IIO_GRAVITY] = "gravity",
        [IIO_POSITIONRELATIVE] = "positionrelative",
+       [IIO_PHASE] = "phase",
 };
 
 static const char * const iio_ev_type_text[] = {
@@ -153,6 +154,7 @@ static bool event_is_known(struct iio_event_data *event)
        case IIO_UVINDEX:
        case IIO_GRAVITY:
        case IIO_POSITIONRELATIVE:
+       case IIO_PHASE:
                break;
        default:
                return false;