From ce33039eead3761cca7a69c28d11510510526880 Mon Sep 17 00:00:00 2001 From: Prafull Suryawanshi Date: Tue, 24 Dec 2024 06:20:15 +0000 Subject: [PATCH] tegra-cec: make tegra-cec as loadable module. This change makes tegra-cec driver as loadable module and adds uapi tegra_cec.h file for IOCTL interface. Verification: Verified on orin-slt with basic cec tx-rx data with TV. bug 4954851 Change-Id: Id3ca696429b2897aa9d80604a365f3221c94a770 Signed-off-by: Prafull Suryawanshi Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3273953 Reviewed-by: Bitan Biswas GVS: buildbot_gerritrpt --- drivers/misc/tegra-cec/tegra_cec.c | 6 ++++++ include/uapi/misc/tegra_cec.h | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 include/uapi/misc/tegra_cec.h diff --git a/drivers/misc/tegra-cec/tegra_cec.c b/drivers/misc/tegra-cec/tegra_cec.c index 1d43e185..685b3407 100644 --- a/drivers/misc/tegra-cec/tegra_cec.c +++ b/drivers/misc/tegra-cec/tegra_cec.c @@ -818,3 +818,9 @@ static struct platform_driver tegra_cec_driver = { .resume = tegra_cec_resume, #endif }; + +module_platform_driver(tegra_cec_driver); + +MODULE_DESCRIPTION("Tegra CEC Driver"); +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Prafull Suryawanshi "); \ No newline at end of file diff --git a/include/uapi/misc/tegra_cec.h b/include/uapi/misc/tegra_cec.h new file mode 100644 index 00000000..fe2386a5 --- /dev/null +++ b/include/uapi/misc/tegra_cec.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * SPDX-FileCopyrightText: Copyright (c) 2012-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + */ + +#ifndef __UAPI_TEGRA_CEC_H +#define __UAPI_TEGRA_CEC_H + +#define TEGRA_CEC_IOC_MAGIC 'C' + +#define TEGRA_CEC_IOCTL_ERROR_RECOVERY _IO(TEGRA_CEC_IOC_MAGIC, 1) +#define TEGRA_CEC_IOCTL_DUMP_REGISTERS _IO(TEGRA_CEC_IOC_MAGIC, 2) +#define TEGRA_CEC_IOCTL_SET_RX_SNOOP _IO(TEGRA_CEC_IOC_MAGIC, 3) +#define TEGRA_CEC_IOCTL_GET_RX_SNOOP _IO(TEGRA_CEC_IOC_MAGIC, 4) +#define TEGRA_CEC_IOCTL_GET_POST_RECOVERY _IO(TEGRA_CEC_IOC_MAGIC, 5) + +#endif /* __UAPI_TEGRA_CEC_H */