summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Barnaś <mb@semihalf.com>2021-10-28 13:36:24 +0200
committerCommit Bot <commit-bot@chromium.org>2021-11-05 17:31:36 +0000
commit3c7051cd6849e7d505145535055ba4089f3c73b2 (patch)
treee819d66292993fee04eccfd9a810595dad73da4f
parentfd5893081bc7acef9ffc9e908305881ab7d1fc54 (diff)
downloadchrome-ec-3c7051cd6849e7d505145535055ba4089f3c73b2.tar.gz
ioex: add error message if driver doesn't support get_port
If support for ioex get_port was enabled and driver doesn't support it, there will be a compilation error. The get_port function is required for zephyr ioex implementation. BRANCH=main BUG=b:202701452 TEST=enable any driver that doesn't support get_port function and check if compilation fails with corresponding message Change-Id: I3f5c6d2eae95b8a63c6655595dd1e658bfd0c8da Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262094 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--driver/ioexpander/ccgxxf.c4
-rw-r--r--driver/ioexpander/ioexpander_nct38xx.c4
-rw-r--r--driver/ioexpander/it8801.c4
-rw-r--r--driver/ioexpander/pca9675.c4
-rw-r--r--driver/ioexpander/pcal6408.c4
5 files changed, 20 insertions, 0 deletions
diff --git a/driver/ioexpander/ccgxxf.c b/driver/ioexpander/ccgxxf.c
index ac079d7b2f..347a2c7587 100644
--- a/driver/ioexpander/ccgxxf.c
+++ b/driver/ioexpander/ccgxxf.c
@@ -14,6 +14,10 @@
#define CPRINTS(format, args...) cprints(CC_GPIO, format, ## args)
+#ifdef CONFIG_IO_EXPANDER_SUPPORT_GET_PORT
+#error "This driver doesn't support get_port function"
+#endif
+
static inline int ccgxxf_read8(int ioex, int reg, int *data)
{
return i2c_read8(ioex_config[ioex].i2c_host_port,
diff --git a/driver/ioexpander/ioexpander_nct38xx.c b/driver/ioexpander/ioexpander_nct38xx.c
index 8c87a33d24..6d30e4ecc3 100644
--- a/driver/ioexpander/ioexpander_nct38xx.c
+++ b/driver/ioexpander/ioexpander_nct38xx.c
@@ -16,6 +16,10 @@
#define CPRINTF(format, args...) cprintf(CC_GPIO, format, ## args)
#define CPRINTS(format, args...) cprints(CC_GPIO, format, ## args)
+#ifdef CONFIG_IO_EXPANDER_SUPPORT_GET_PORT
+#error "This driver doesn't support get_port function"
+#endif
+
/*
* Store the GPIO_ALERT_MASK_0/1 and chip ID registers locally. In this way,
* we don't have to read it via I2C transaction everytime.
diff --git a/driver/ioexpander/it8801.c b/driver/ioexpander/it8801.c
index b7f6d41774..9bb6ca4487 100644
--- a/driver/ioexpander/it8801.c
+++ b/driver/ioexpander/it8801.c
@@ -19,6 +19,10 @@
#define CPRINTS(format, args...) cprints(CC_KEYSCAN, format, ## args)
+#ifdef CONFIG_IO_EXPANDER_SUPPORT_GET_PORT
+#error "This driver doesn't support get_port function"
+#endif
+
static int it8801_ioex_set_level(int ioex, int port, int mask, int value);
static void it8801_ioex_event_handler(void);
DECLARE_DEFERRED(it8801_ioex_event_handler);
diff --git a/driver/ioexpander/pca9675.c b/driver/ioexpander/pca9675.c
index 3fe3bfa0c4..2bef06d19e 100644
--- a/driver/ioexpander/pca9675.c
+++ b/driver/ioexpander/pca9675.c
@@ -9,6 +9,10 @@
#include "ioexpander.h"
#include "pca9675.h"
+#ifdef CONFIG_IO_EXPANDER_SUPPORT_GET_PORT
+#error "This driver doesn't support get_port function"
+#endif
+
struct pca9675_ioexpander {
/* I/O port direction (1 = input, 0 = output) */
uint16_t io_direction;
diff --git a/driver/ioexpander/pcal6408.c b/driver/ioexpander/pcal6408.c
index 287e0506d0..46de96b595 100644
--- a/driver/ioexpander/pcal6408.c
+++ b/driver/ioexpander/pcal6408.c
@@ -15,6 +15,10 @@
#define CPRINTF(format, args...) cprintf(CC_GPIO, format, ## args)
#define CPRINTS(format, args...) cprints(CC_GPIO, format, ## args)
+#ifdef CONFIG_IO_EXPANDER_SUPPORT_GET_PORT
+#error "This driver doesn't support get_port function"
+#endif
+
/*
* Store interrupt mask registers locally. In this way,
* we don't have to read it via i2c transaction every time.