mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 19:13:03 -04:00
serial: core: add uart_iotype_mmio/io helper functions
To help simplify code that check on the io type mode of the port. Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://patch.msgid.link/20260521-tty-upio-v3-2-bf74567994a0@dimonoff.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3d406299d8
commit
6e85378a38
@@ -1963,6 +1963,34 @@ static const char *uart_type(struct uart_port *port)
|
||||
return str;
|
||||
}
|
||||
|
||||
bool uart_iotype_mmio(enum uart_iotype iotype)
|
||||
{
|
||||
switch (iotype) {
|
||||
case UPIO_MEM:
|
||||
case UPIO_MEM32:
|
||||
case UPIO_AU:
|
||||
case UPIO_TSI:
|
||||
case UPIO_MEM32BE:
|
||||
case UPIO_MEM16:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(uart_iotype_mmio);
|
||||
|
||||
bool uart_iotype_io(enum uart_iotype iotype)
|
||||
{
|
||||
switch (iotype) {
|
||||
case UPIO_PORT:
|
||||
case UPIO_HUB6:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(uart_iotype_io);
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
|
||||
static void uart_line_info(struct seq_file *m, struct uart_state *state)
|
||||
|
||||
@@ -1338,4 +1338,8 @@ static inline int uart_handle_break(struct uart_port *port)
|
||||
!((cflag) & CLOCAL))
|
||||
|
||||
int uart_get_rs485_mode(struct uart_port *port);
|
||||
|
||||
bool uart_iotype_mmio(enum uart_iotype iotype);
|
||||
bool uart_iotype_io(enum uart_iotype iotype);
|
||||
|
||||
#endif /* LINUX_SERIAL_CORE_H */
|
||||
|
||||
Reference in New Issue
Block a user