/* * Configuration: * share_irqs: Whether we pass IRQF_SHARED to request_irq(). * This option is unsafe when used on edge-triggered interrupts. * skip_txen_test: Force skip of txen test at init time.
*/ unsignedint share_irqs = SERIAL8250_SHARE_IRQS; unsignedint skip_txen_test;
/* * SERIAL_PORT_DFNS tells us about built-in ports that have no * standard enumeration mechanism. Platforms that can find all * serial ports via mechanisms like ACPI or PCI need not supply it.
*/ #ifndef SERIAL_PORT_DFNS #define SERIAL_PORT_DFNS #endif
staticconststruct old_serial_port old_serial_port[] = {
SERIAL_PORT_DFNS /* defined in asm/serial.h */
};
staticvoid __init __serial8250_isa_init_ports(void)
{ int i, irqflag = 0;
if (nr_uarts > UART_NR)
nr_uarts = UART_NR;
/* * Set up initial ISA ports based on nr_uart module param, or else * default to CONFIG_SERIAL_8250_RUNTIME_UARTS. Note that we do not * need to increase nr_uarts when setting up the initial ISA ports.
*/ for (i = 0; i < nr_uarts; i++)
serial8250_setup_port(i);
/* chain base port ops to support Remote Supervisor Adapter */
univ8250_port_ops = *univ8250_port_base_ops;
univ8250_rsa_support(&univ8250_port_ops);
if (share_irqs)
irqflag = IRQF_SHARED;
for (i = 0; i < ARRAY_SIZE(old_serial_port) && i < nr_uarts; i++) { struct uart_8250_port *up = serial8250_get_port(i); struct uart_port *port = &up->port;
/* * Register a set of serial devices attached to a platform device. * The list is terminated with a zero flags entry, which means we expect * all entries to have at least UPF_BOOT_AUTOCONF set.
*/ staticint serial8250_probe(struct platform_device *pdev)
{ struct device *dev = &pdev->dev; struct plat_serial8250_port *p;
p = dev_get_platdata(dev); if (p) return serial8250_probe_platform(pdev, p);
/* * Probe platform UART devices defined using standard hardware * discovery mechanism like ACPI or DT. Support only ACPI based * serial device for now.
*/ if (has_acpi_companion(dev)) return serial8250_probe_acpi(pdev);
return 0;
}
/* * Remove serial ports registered against a platform device.
*/ staticvoid serial8250_remove(struct platform_device *dev)
{ int i;
for (i = 0; i < nr_uarts; i++) { struct uart_8250_port *up = serial8250_get_port(i);
if (up->port.dev == &dev->dev)
serial8250_unregister_port(i);
}
}
staticint serial8250_suspend(struct platform_device *dev, pm_message_t state)
{ int i;
for (i = 0; i < UART_NR; i++) { struct uart_8250_port *up = serial8250_get_port(i);
/* * This "device" covers _all_ ISA 8250-compatible serial devices listed * in the table in include/asm/serial.h.
*/ struct platform_device *serial8250_isa_devs;
/* * This tells serial8250_unregister_port() not to re-register * the ports (thereby making serial8250_isa_driver permanently * in use).
*/
serial8250_isa_devs = NULL;
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Generic 8250/16x50 serial platform driver");
module_param_hw(share_irqs, uint, other, 0644);
MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices (unsafe)");
module_param(nr_uarts, uint, 0644);
MODULE_PARM_DESC(nr_uarts, "Maximum number of UARTs supported. (1-" __MODULE_STRING(CONFIG_SERIAL_8250_NR_UARTS) ")");
module_param(skip_txen_test, uint, 0644);
MODULE_PARM_DESC(skip_txen_test, "Skip checking for the TXEN bug at init time");
MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
#ifdef CONFIG_SERIAL_8250_DEPRECATED_OPTIONS #ifndef MODULE /* * This module was renamed to 8250_core in 3.7. Keep the old "8250" name * working as well for the module options so we don't break people. We * need to keep the names identical and the convenient macros will happily * refuse to let us do that by failing the build with redefinition errors * of global variables. So we stick them inside a dummy function to avoid * those conflicts. The options still get parsed, and the redefined * MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive. * * This is hacky. I'm sorry.
*/ staticvoid __used s8250_options(void)
{ #undef MODULE_PARAM_PREFIX #define MODULE_PARAM_PREFIX "8250_core."
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.