diff options
author | Svyatoslav Ryhel <clamor95@gmail.com> | 2023-04-25 10:57:20 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-05-02 21:23:34 +0300 |
commit | 5f650fa6ad5d31ef5d8c332be0991bd730f552d4 (patch) | |
tree | f7a025df4780504e25cbc6931fd4a780850061a5 /drivers/extcon | |
parent | 021e303492ccfdf58425bedb13c1621367cc5cc7 (diff) | |
download | u-boot-5f650fa6ad5d31ef5d8c332be0991bd730f552d4.tar.xz |
dm: extcon: add an uclass for extcon
Add a new simple uclass for extcon. Currently all setup is done
in the probe. Uclass struct and ops are empty for now.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/extcon')
-rw-r--r-- | drivers/extcon/Kconfig | 15 | ||||
-rw-r--r-- | drivers/extcon/Makefile | 5 | ||||
-rw-r--r-- | drivers/extcon/extcon-uclass.c | 16 |
3 files changed, 36 insertions, 0 deletions
diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig new file mode 100644 index 0000000000..8a50250d21 --- /dev/null +++ b/drivers/extcon/Kconfig @@ -0,0 +1,15 @@ +menu "Extcon Support" + +config EXTCON + bool "External Connector Class (extcon) support" + depends on DM + help + Say Y here to enable external connector class (extcon) support. + This allows monitoring external connectors and supports external + connectors with multiple states; i.e., an extcon that may have + multiple cables attached. For example, an external connector + of a device may be used to connect an HDMI cable and a AC adaptor, + and to host USB ports. Many of 30-pin connectors including PDMI + are also good examples. + +endmenu diff --git a/drivers/extcon/Makefile b/drivers/extcon/Makefile new file mode 100644 index 0000000000..2510e91c07 --- /dev/null +++ b/drivers/extcon/Makefile @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2023 Svyatoslav Ryhel <clamor95@gmail.com> + +obj-$(CONFIG_EXTCON) += extcon-uclass.o diff --git a/drivers/extcon/extcon-uclass.c b/drivers/extcon/extcon-uclass.c new file mode 100644 index 0000000000..9dd22b5762 --- /dev/null +++ b/drivers/extcon/extcon-uclass.c @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2023 Svyatoslav Ryhel <clamor95@gmail.com> + */ + +#define LOG_CATEGORY UCLASS_EXTCON + +#include <common.h> +#include <extcon.h> +#include <dm.h> + +UCLASS_DRIVER(extcon) = { + .id = UCLASS_EXTCON, + .name = "extcon", + .per_device_plat_auto = sizeof(struct extcon_uc_plat), +}; |