aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSvyatoslav Ryhel <clamor95@gmail.com>2023-04-25 10:57:21 +0300
committerTom Rini <trini@konsulko.com>2023-05-02 14:23:58 -0400
commit8b215e10fe585907be8b6a0babad2923f6cf4da2 (patch)
tree8b49a7d57a378831964589d015f57b242a7feeb2 /drivers
parent5f650fa6ad5d31ef5d8c332be0991bd730f552d4 (diff)
downloadu-boot-8b215e10fe585907be8b6a0babad2923f6cf4da2.zip
u-boot-8b215e10fe585907be8b6a0babad2923f6cf4da2.tar.gz
u-boot-8b215e10fe585907be8b6a0babad2923f6cf4da2.tar.bz2
test: Add tests for the extcon
Provide tests to the simple extcon device. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/extcon/Kconfig7
-rw-r--r--drivers/extcon/Makefile1
-rw-r--r--drivers/extcon/extcon-sandbox.c17
3 files changed, 25 insertions, 0 deletions
diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig
index 8a50250..6fd3d2b 100644
--- a/drivers/extcon/Kconfig
+++ b/drivers/extcon/Kconfig
@@ -12,4 +12,11 @@ config EXTCON
and to host USB ports. Many of 30-pin connectors including PDMI
are also good examples.
+config EXTCON_SANDBOX
+ bool "Sandbox extcon"
+ depends on EXTCON
+ help
+ Enable extcon support for sandbox. This is an emulation of a real
+ extcon. Currectly all configuration is done in the probe.
+
endmenu
diff --git a/drivers/extcon/Makefile b/drivers/extcon/Makefile
index 2510e91..c4223d9 100644
--- a/drivers/extcon/Makefile
+++ b/drivers/extcon/Makefile
@@ -3,3 +3,4 @@
# Copyright (C) 2023 Svyatoslav Ryhel <clamor95@gmail.com>
obj-$(CONFIG_EXTCON) += extcon-uclass.o
+obj-$(CONFIG_EXTCON_SANDBOX) += extcon-sandbox.o
diff --git a/drivers/extcon/extcon-sandbox.c b/drivers/extcon/extcon-sandbox.c
new file mode 100644
index 0000000..ab6a6c1
--- /dev/null
+++ b/drivers/extcon/extcon-sandbox.c
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2022 Svyatoslav Ryhel <clamor95@gmail.com>
+ */
+
+#include <dm.h>
+
+static const struct udevice_id sandbox_extcon_ids[] = {
+ { .compatible = "sandbox,extcon" },
+ { /* sentinel */ }
+};
+
+U_BOOT_DRIVER(extcon_sandbox) = {
+ .name = "extcon_sandbox",
+ .id = UCLASS_EXTCON,
+ .of_match = sandbox_extcon_ids,
+};