blob: 9fddefbec63e9353383c3ee12adf60d7361723ab [file] [log] [blame]
From a0af27886f7879e3f4c5614f6de7d7a46be19bb7 Mon Sep 17 00:00:00 2001
From: Gwendal Grignou <gwendal@chromium.org>
Date: Fri, 15 Oct 2021 17:15:40 -0700
Subject: [PATCH] Allowlist illuminance and proximity channels
Since libiio is unable to identify simple attributes as channel,
(see https://github.com/analogdevicesinc/libiio/issues/25),
add in_illuminance for iioservice to support light sensors like
acpi_als or cros_ec_light, in_proximity for cros_ec_proxy.
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
local.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/local.c b/local.c
index e909520..73e501f 100644
--- a/local.c
+++ b/local.c
@@ -1139,6 +1139,11 @@ static bool is_channel(const char *attr, bool strict)
char *ptr = NULL;
if (!strncmp(attr, "in_timestamp_", sizeof("in_timestamp_") - 1))
return true;
+ if (!strncmp(attr, "in_illuminance_", sizeof("in_illuminance_") - 1))
+ return true;
+ if (!strncmp(attr, "in_proximity_", sizeof("in_proximity_") - 1))
+ return true;
+
if (!strncmp(attr, "in_", 3))
ptr = strchr(attr + 3, '_');
else if (!strncmp(attr, "out_", 4))
--
2.33.0.1079.g6e70778dc9-goog