linux/drivers/tty/serial/8250/8250_platform.c

// SPDX-License-Identifier: GPL-2.0+
/*
 *  Universal/legacy platform driver for 8250/16550-type serial ports
 *
 *  Supports:
 *	      ISA-compatible 8250/16550 ports
 *	      ACPI 8250/16550 ports
 *	      PNP 8250/16550 ports
 *	      "serial8250" platform devices
 */
#include <linux/acpi.h>
#include <linux/array_size.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/once.h>
#include <linux/platform_device.h>

#include <linux/serial_8250.h>

#ifdef CONFIG_SPARC
#include <linux/sunserialcore.h>
#endif

#include "8250.h"

/*
 * 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.
 */
unsigned int share_irqs =;
unsigned int skip_txen_test;

unsigned int nr_uarts =;

#include <asm/serial.h>

/*
 * 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

static const struct old_serial_port old_serial_port[] =;

serial8250_isa_config_fn serial8250_isa_config;
void serial8250_set_isa_configurator(serial8250_isa_config_fn v)
{}
EXPORT_SYMBOL();

static void __init __serial8250_isa_init_ports(void)
{}

void __init serial8250_isa_init_ports(void)
{}

/*
 * Generic 16550A platform devices
 */
static int serial8250_probe_acpi(struct platform_device *pdev)
{}

static int serial8250_probe_platform(struct platform_device *dev, struct plat_serial8250_port *p)
{}

/*
 * 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.
 */
static int serial8250_probe(struct platform_device *pdev)
{}

/*
 * Remove serial ports registered against a platform device.
 */
static void serial8250_remove(struct platform_device *dev)
{}

static int serial8250_suspend(struct platform_device *dev, pm_message_t state)
{}

static int serial8250_resume(struct platform_device *dev)
{}

static const struct acpi_device_id acpi_platform_serial_table[] =;
MODULE_DEVICE_TABLE(acpi, acpi_platform_serial_table);

static struct platform_driver serial8250_isa_driver =;

/*
 * This "device" covers _all_ ISA 8250-compatible serial devices listed
 * in the table in include/asm/serial.h.
 */
struct platform_device *serial8250_isa_devs;

static int __init serial8250_init(void)
{}
module_init();

static void __exit serial8250_exit(void)
{}
module_exit(serial8250_exit);

MODULE_LICENSE();
MODULE_DESCRIPTION();

module_param_hw(share_irqs, uint, other, 0644);
MODULE_PARM_DESC();

module_param(nr_uarts, uint, 0644);
MODULE_PARM_DESC();

module_param(skip_txen_test, uint, 0644);
MODULE_PARM_DESC();

MODULE_ALIAS_CHARDEV_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.
 */
static void __used s8250_options(void)
{}
#else
MODULE_ALIAS("8250_core");
#endif
#endif