nvidia-oot: resurrect tegra_hv_comm TTY driver

Port the tegra_hv_comm driver to the OOT kernel. This driver allows an
IVC channel to be used as an emulated serial device.

Make the following changes to simplify maintaining compatibility with
different kernel versions:
- Use a generic port type instead of defining a custom one.
- Use existing conftest to determine whether platform_device.remove
  returns void.
- Add a conftest to determine whether uart_state.xmit exists.
- Use tty_port.xmit_fifo in kernels where uart_state.xmit has been
  removed.

Jira HYP-20929

Change-Id: I1bc218f591d6d741fc39ae5392a9ea95bdc3f117
Signed-off-by: Daniel Kudrow <dkudrow@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3340420
(cherry picked from commit a67e7fd330be5d6c55e35c0ce810ff5124378ae7 in embedded/7.0.3.0)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3301386
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Daniel Kudrow
2025-02-12 22:14:04 +00:00
committed by Jon Hunter
parent a81de1a2c6
commit 79cf6380ea
5 changed files with 678 additions and 0 deletions

View File

@@ -230,6 +230,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += timer_delete
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_send_xchar_has_u8_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_write_has_u8_ptr_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_set_termios_has_const_ktermios_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += uart_state_has_xmit
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufs_hba_variant_ops_has_set_dma_mask
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufs_hba_variant_ops_pwr_change_notify_has_const_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufs_hba_variant_ops_suspend_has_status_arg

View File

@@ -8810,6 +8810,22 @@ compile_test() {
compile_check_conftest "$CODE" "NV_TTY_OPERATIONS_STRUCT_SET_TERMIOS_HAS_CONST_KTERMIOS_ARG" "" "types"
;;
uart_state_has_xmit)
#
# Determine if the struct uart_state has a xmit member.
#
# Commit 1788cf6 ("tty: serial: switch from circ_buf to kfifo") in
# Linux 6.10 removed this member.
#
CODE="
#include <linux/serial_core.h>
int conftest_uart_state_has_xmit(void) {
return offsetof(struct uart_state, xmit);
}"
compile_check_conftest "$CODE" "NV_UART_STATE_HAS_XMIT" "" "types"
;;
ufs_hba_variant_ops_has_set_dma_mask)
#
# Determine if the 'struct ufs_hba_variant_ops' has a 'set_dma_mask'