Skip to content

Commit c73314e

Browse files
mothacehejic23
authored andcommitted
iio: Add channel for Phase
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>
1 parent cd570e6 commit c73314e

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

Documentation/ABI/testing/sysfs-bus-iio

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,3 +1675,10 @@ KernelVersion: 4.12
16751675
Contact: linux-iio@vger.kernel.org
16761676
Description:
16771677
Raw counter device counters direction for channel Y.
1678+
1679+
What: /sys/bus/iio/devices/iio:deviceX/in_phaseY_raw
1680+
KernelVersion: 4.18
1681+
Contact: linux-iio@vger.kernel.org
1682+
Description:
1683+
Raw (unscaled) phase difference reading from channel Y
1684+
that can be processed to radians.

drivers/iio/industrialio-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static const char * const iio_chan_type_name_spec[] = {
8686
[IIO_INDEX] = "index",
8787
[IIO_GRAVITY] = "gravity",
8888
[IIO_POSITIONRELATIVE] = "positionrelative",
89+
[IIO_PHASE] = "phase",
8990
};
9091

9192
static const char * const iio_modifier_names[] = {

include/uapi/linux/iio/types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ enum iio_chan_type {
4545
IIO_INDEX,
4646
IIO_GRAVITY,
4747
IIO_POSITIONRELATIVE,
48+
IIO_PHASE,
4849
};
4950

5051
enum iio_modifier {

tools/iio/iio_event_monitor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ static const char * const iio_chan_type_name_spec[] = {
5959
[IIO_UVINDEX] = "uvindex",
6060
[IIO_GRAVITY] = "gravity",
6161
[IIO_POSITIONRELATIVE] = "positionrelative",
62+
[IIO_PHASE] = "phase",
6263
};
6364

6465
static const char * const iio_ev_type_text[] = {
@@ -153,6 +154,7 @@ static bool event_is_known(struct iio_event_data *event)
153154
case IIO_UVINDEX:
154155
case IIO_GRAVITY:
155156
case IIO_POSITIONRELATIVE:
157+
case IIO_PHASE:
156158
break;
157159
default:
158160
return false;

0 commit comments

Comments
 (0)