Commit 0deb87aa authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk

into home.transmeta.com:/home/torvalds/v2.5/linux
parents eb9d0aa4 c4ab9d78
...@@ -2235,14 +2235,19 @@ struct device_class tty_devclass = { ...@@ -2235,14 +2235,19 @@ struct device_class tty_devclass = {
}; };
EXPORT_SYMBOL(tty_devclass); EXPORT_SYMBOL(tty_devclass);
static int __init tty_devclass_init(void)
{
return devclass_register(&tty_devclass);
}
postcore_initcall(tty_devclass_init);
/* /*
* Ok, now we can initialize the rest of the tty devices and can count * Ok, now we can initialize the rest of the tty devices and can count
* on memory allocations, interrupts etc.. * on memory allocations, interrupts etc..
*/ */
void __init tty_init(void) void __init tty_init(void)
{ {
devclass_register(&tty_devclass);
/* /*
* dev_tty_driver and dev_console_driver are actually magic * dev_tty_driver and dev_console_driver are actually magic
* devices which get redirected at open time. Nevertheless, * devices which get redirected at open time. Nevertheless,
......
...@@ -93,13 +93,15 @@ unsigned int share_irqs = SERIAL8250_SHARE_IRQS; ...@@ -93,13 +93,15 @@ unsigned int share_irqs = SERIAL8250_SHARE_IRQS;
#ifdef CONFIG_SERIAL_8250_MULTIPORT #ifdef CONFIG_SERIAL_8250_MULTIPORT
#define CONFIG_SERIAL_MULTIPORT 1 #define CONFIG_SERIAL_MULTIPORT 1
#endif #endif
#ifdef CONFIG_SERIAL_8250_MANY_PORTS
#define CONFIG_SERIAL_MANY_PORTS 1
#endif
/* /*
* HUB6 is always on. This will be removed once the header * HUB6 is always on. This will be removed once the header
* files have been cleaned. * files have been cleaned.
*/ */
#define CONFIG_HUB6 1 #define CONFIG_HUB6 1
#define CONFIG_SERIAL_MANY_PORTS 1
#include <asm/serial.h> #include <asm/serial.h>
...@@ -2095,6 +2097,28 @@ void serial8250_get_irq_map(unsigned int *map) ...@@ -2095,6 +2097,28 @@ void serial8250_get_irq_map(unsigned int *map)
} }
} }
/**
* serial8250_suspend_port - suspend one serial port
* @line: serial line number
*
* Suspend one serial port.
*/
void serial8250_suspend_port(int line, u32 level)
{
uart_suspend_port(&serial8250_reg, &serial8250_ports[line].port, level);
}
/**
* serial8250_resume_port - resume one serial port
* @line: serial line number
*
* Resume one serial port.
*/
void serial8250_resume_port(int line, u32 level)
{
uart_resume_port(&serial8250_reg, &serial8250_ports[line].port, level);
}
static int __init serial8250_init(void) static int __init serial8250_init(void)
{ {
int ret, i; int ret, i;
...@@ -2128,6 +2152,8 @@ module_exit(serial8250_exit); ...@@ -2128,6 +2152,8 @@ module_exit(serial8250_exit);
EXPORT_SYMBOL(register_serial); EXPORT_SYMBOL(register_serial);
EXPORT_SYMBOL(unregister_serial); EXPORT_SYMBOL(unregister_serial);
EXPORT_SYMBOL(serial8250_get_irq_map); EXPORT_SYMBOL(serial8250_get_irq_map);
EXPORT_SYMBOL(serial8250_suspend_port);
EXPORT_SYMBOL(serial8250_resume_port);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Generic 8250/16x50 serial driver $Revision: 1.90 $"); MODULE_DESCRIPTION("Generic 8250/16x50 serial driver $Revision: 1.90 $");
......
...@@ -27,6 +27,8 @@ struct serial8250_probe { ...@@ -27,6 +27,8 @@ struct serial8250_probe {
int serial8250_register_probe(struct serial8250_probe *probe); int serial8250_register_probe(struct serial8250_probe *probe);
void serial8250_unregister_probe(struct serial8250_probe *probe); void serial8250_unregister_probe(struct serial8250_probe *probe);
void serial8250_get_irq_map(unsigned int *map); void serial8250_get_irq_map(unsigned int *map);
void serial8250_suspend_port(int line, u32 level);
void serial8250_resume_port(int line, u32 level);
struct old_serial_port { struct old_serial_port {
unsigned int uart; unsigned int uart;
......
/* /*
* linux/drivers/serial/acorn.c * linux/drivers/serial/acorn.c
* *
* Copyright (C) 1996-2002 Russell King. * Copyright (C) 1996-2003 Russell King.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/tty.h>
#include <linux/serial_core.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/ioport.h> #include <linux/ioport.h>
...@@ -16,6 +18,7 @@ ...@@ -16,6 +18,7 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/io.h>
#include <asm/ecard.h> #include <asm/ecard.h>
#include <asm/string.h> #include <asm/string.h>
...@@ -24,36 +27,41 @@ ...@@ -24,36 +27,41 @@
struct serial_card_type { struct serial_card_type {
unsigned int num_ports; unsigned int num_ports;
unsigned int baud_base; unsigned int baud_base;
int type; unsigned int type;
int speed; unsigned int offset[MAX_PORTS];
int offset[MAX_PORTS];
}; };
struct serial_card_info { struct serial_card_info {
unsigned int num_ports; unsigned int num_ports;
int ports[MAX_PORTS]; int ports[MAX_PORTS];
unsigned long base[MAX_PORTS];
}; };
static inline int serial_register_onedev(unsigned long port, int irq, unsigned int baud_base) static inline int
serial_register_onedev(unsigned long baddr, void *vaddr, int irq, unsigned int baud_base)
{ {
struct serial_struct req; struct serial_struct req;
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.baud_base = baud_base; req.irq = irq;
req.irq = irq; req.flags = UPF_AUTOPROBE | UPF_RESOURCES |
req.port = port; UPF_SHARE_IRQ;
req.flags = 0; req.baud_base = baud_base;
req.io_type = UPIO_MEM;
req.iomem_base = vaddr;
req.iomem_reg_shift = 2;
req.iomap_base = baddr;
return register_serial(&req); return register_serial(&req);
} }
static int __devinit serial_card_probe(struct expansion_card *ec, const struct ecard_id *id) static int __devinit
serial_card_probe(struct expansion_card *ec, const struct ecard_id *id)
{ {
struct serial_card_info *info; struct serial_card_info *info;
struct serial_card_type *type = id->data; struct serial_card_type *type = id->data;
unsigned long cardaddr, address; unsigned long bus_addr;
int port; unsigned char *virt_addr;
unsigned int port;
info = kmalloc(sizeof(struct serial_card_info), GFP_KERNEL); info = kmalloc(sizeof(struct serial_card_info), GFP_KERNEL);
if (!info) if (!info)
...@@ -64,20 +72,19 @@ static int __devinit serial_card_probe(struct expansion_card *ec, const struct e ...@@ -64,20 +72,19 @@ static int __devinit serial_card_probe(struct expansion_card *ec, const struct e
ecard_set_drvdata(ec, info); ecard_set_drvdata(ec, info);
cardaddr = ecard_address(ec, type->type, type->speed); bus_addr = ec->resource[type->type].start;
virt_addr = ioremap(bus_addr, ec->resource[type->type].end - bus_addr + 1);
if (!virt_addr) {
kfree(info);
return -ENOMEM;
}
for (port = 0; port < info->num_ports; port ++) { for (port = 0; port < info->num_ports; port ++) {
address = cardaddr + type->offset[port]; unsigned long baddr = bus_addr + type->offset[port];
unsigned char *vaddr = virt_addr + type->offset[port];
info->ports[port] = -1;
info->base[port] = address;
if (!request_region(address, 8, "acornserial")) info->ports[port] = serial_register_onedev(baddr, vaddr,
continue; ec->irq, type->baud_base);
info->ports[port] = serial_register_onedev(address, ec->irq, type->baud_base);
if (info->ports[port] < 0)
break;
} }
return 0; return 0;
...@@ -90,12 +97,9 @@ static void __devexit serial_card_remove(struct expansion_card *ec) ...@@ -90,12 +97,9 @@ static void __devexit serial_card_remove(struct expansion_card *ec)
ecard_set_drvdata(ec, NULL); ecard_set_drvdata(ec, NULL);
for (i = 0; i < info->num_ports; i++) { for (i = 0; i < info->num_ports; i++)
if (info->ports[i] > 0) { if (info->ports[i] > 0)
unregister_serial(info->ports[i]); unregister_serial(info->ports[i]);
release_region(info->base[i], 8);
}
}
kfree(info); kfree(info);
} }
...@@ -103,17 +107,15 @@ static void __devexit serial_card_remove(struct expansion_card *ec) ...@@ -103,17 +107,15 @@ static void __devexit serial_card_remove(struct expansion_card *ec)
static struct serial_card_type atomwide_type = { static struct serial_card_type atomwide_type = {
.num_ports = 3, .num_ports = 3,
.baud_base = 7372800 / 16, .baud_base = 7372800 / 16,
.type = ECARD_IOC, .type = ECARD_RES_IOCSLOW,
.speed = ECARD_SLOW, .offset = { 0x2800, 0x2400, 0x2000 },
.offset = { 0xa00, 0x900, 0x800 },
}; };
static struct serial_card_type serport_type = { static struct serial_card_type serport_type = {
.num_ports = 2, .num_ports = 2,
.baud_base = 3686400 / 16, .baud_base = 3686400 / 16,
.type = ECARD_IOC, .type = ECARD_RES_IOCSLOW,
.speed = ECARD_SLOW, .offset = { 0x2000, 0x2020 },
.offset = { 0x800, 0x808 },
}; };
static const struct ecard_id serial_cids[] = { static const struct ecard_id serial_cids[] = {
...@@ -127,7 +129,8 @@ static struct ecard_driver serial_card_driver = { ...@@ -127,7 +129,8 @@ static struct ecard_driver serial_card_driver = {
.remove = __devexit_p(serial_card_remove), .remove = __devexit_p(serial_card_remove),
.id_table = serial_cids, .id_table = serial_cids,
.drv = { .drv = {
.name = "acornserial", .devclass = &tty_devclass,
.name = "8250_acorn",
}, },
}; };
...@@ -142,6 +145,7 @@ static void __exit serial_card_exit(void) ...@@ -142,6 +145,7 @@ static void __exit serial_card_exit(void)
} }
MODULE_AUTHOR("Russell King"); MODULE_AUTHOR("Russell King");
MODULE_DESCRIPTION("Acorn 8250-compatible serial port expansion card driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_init(serial_card_init); module_init(serial_card_init);
......
This diff is collapsed.
This diff is collapsed.
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/sysrq.h> #include <linux/sysrq.h>
#include <linux/device.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -857,12 +858,54 @@ static struct uart_driver sa1100_reg = { ...@@ -857,12 +858,54 @@ static struct uart_driver sa1100_reg = {
.cons = SA1100_CONSOLE, .cons = SA1100_CONSOLE,
}; };
static int sa1100_serial_suspend(struct device *dev, u32 state, u32 level)
{
int i;
for (i = 0; i < NR_PORTS; i++)
uart_suspend_port(&sa1100_reg, &sa1100_ports[i].port, level);
return 0;
}
static int sa1100_serial_resume(struct device *dev, u32 level)
{
int i;
for (i = 0; i < NR_PORTS; i++)
uart_resume_port(&sa1100_reg, &sa1100_ports[i].port, level);
return 0;
}
static struct device_driver sa11x0_serial_driver = {
.name = "sa11x0_serial",
.bus = &system_bus_type,
.devclass = &tty_devclass,
.suspend = sa1100_serial_suspend,
.resume = sa1100_serial_resume,
};
/*
* This "device" covers _all_ ISA 8250-compatible serial devices.
*/
static struct sys_device sa11x0_serial_devs = {
.name = "sa11x0_serial",
.id = 0,
.dev = {
.driver = &sa11x0_serial_driver,
},
};
static int __init sa1100_serial_init(void) static int __init sa1100_serial_init(void)
{ {
int ret; int ret;
printk(KERN_INFO "Serial: SA11x0 driver $Revision: 1.50 $\n"); printk(KERN_INFO "Serial: SA11x0 driver $Revision: 1.50 $\n");
driver_register(&sa11x0_serial_driver);
sys_device_register(&sa11x0_serial_devs);
sa1100_init_ports(); sa1100_init_ports();
ret = uart_register_driver(&sa1100_reg); ret = uart_register_driver(&sa1100_reg);
if (ret == 0) { if (ret == 0) {
......
...@@ -1235,6 +1235,7 @@ ...@@ -1235,6 +1235,7 @@
#define PCI_VENDOR_ID_XIRCOM 0x115d #define PCI_VENDOR_ID_XIRCOM 0x115d
#define PCI_DEVICE_ID_XIRCOM_X3201_ETH 0x0003 #define PCI_DEVICE_ID_XIRCOM_X3201_ETH 0x0003
#define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101
#define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103 #define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103
#define PCI_VENDOR_ID_RENDITION 0x1163 #define PCI_VENDOR_ID_RENDITION 0x1163
......
...@@ -208,12 +208,11 @@ struct uart_state { ...@@ -208,12 +208,11 @@ struct uart_state {
#define USF_CLOSING_WAIT_NONE (65535) #define USF_CLOSING_WAIT_NONE (65535)
int count; int count;
int pm_state;
struct uart_info *info; struct uart_info *info;
struct uart_port *port; struct uart_port *port;
#ifdef CONFIG_PM struct semaphore sem;
struct pm_dev *pm;
#endif
}; };
#define UART_XMIT_SIZE 1024 #define UART_XMIT_SIZE 1024
...@@ -224,8 +223,6 @@ struct uart_state { ...@@ -224,8 +223,6 @@ struct uart_state {
* stuff here. * stuff here.
*/ */
struct uart_info { struct uart_info {
struct uart_port *port;
struct uart_state *state;
struct tty_struct *tty; struct tty_struct *tty;
struct circ_buf xmit; struct circ_buf xmit;
unsigned int flags; unsigned int flags;
...@@ -237,7 +234,6 @@ struct uart_info { ...@@ -237,7 +234,6 @@ struct uart_info {
*/ */
#define UIF_CHECK_CD (1 << 25) #define UIF_CHECK_CD (1 << 25)
#define UIF_CTS_FLOW (1 << 26) #define UIF_CTS_FLOW (1 << 26)
#define UIF_CLOSING (1 << 27)
#define UIF_NORMAL_ACTIVE (1 << 29) #define UIF_NORMAL_ACTIVE (1 << 29)
#define UIF_INITIALIZED (1 << 31) #define UIF_INITIALIZED (1 << 31)
...@@ -307,6 +303,12 @@ int uart_register_port(struct uart_driver *reg, struct uart_port *port); ...@@ -307,6 +303,12 @@ int uart_register_port(struct uart_driver *reg, struct uart_port *port);
int uart_add_one_port(struct uart_driver *reg, struct uart_port *port); int uart_add_one_port(struct uart_driver *reg, struct uart_port *port);
int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port); int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port);
/*
* Power Management
*/
int uart_suspend_port(struct uart_driver *reg, struct uart_port *port, u32 level);
int uart_resume_port(struct uart_driver *reg, struct uart_port *port, u32 level);
#define uart_circ_empty(circ) ((circ)->head == (circ)->tail) #define uart_circ_empty(circ) ((circ)->head == (circ)->tail)
#define uart_circ_clear(circ) ((circ)->head = (circ)->tail = 0) #define uart_circ_clear(circ) ((circ)->head = (circ)->tail = 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment