Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
90a2f98b
Commit
90a2f98b
authored
Mar 11, 2003
by
Russell King
Committed by
Linus Torvalds
Mar 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SERIAL] Add PCI serial power management support.
parent
1ae23b0d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
1 deletion
+79
-1
drivers/serial/8250.c
drivers/serial/8250.c
+27
-1
drivers/serial/8250.h
drivers/serial/8250.h
+2
-0
drivers/serial/8250_pci.c
drivers/serial/8250_pci.c
+50
-0
No files found.
drivers/serial/8250.c
View file @
90a2f98b
...
...
@@ -93,13 +93,15 @@ unsigned int share_irqs = SERIAL8250_SHARE_IRQS;
#ifdef CONFIG_SERIAL_8250_MULTIPORT
#define CONFIG_SERIAL_MULTIPORT 1
#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
* files have been cleaned.
*/
#define CONFIG_HUB6 1
#define CONFIG_SERIAL_MANY_PORTS 1
#include <asm/serial.h>
...
...
@@ -2094,6 +2096,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
)
{
int
ret
,
i
;
...
...
@@ -2127,6 +2151,8 @@ module_exit(serial8250_exit);
EXPORT_SYMBOL
(
register_serial
);
EXPORT_SYMBOL
(
unregister_serial
);
EXPORT_SYMBOL
(
serial8250_get_irq_map
);
EXPORT_SYMBOL
(
serial8250_suspend_port
);
EXPORT_SYMBOL
(
serial8250_resume_port
);
MODULE_LICENSE
(
"GPL"
);
MODULE_DESCRIPTION
(
"Generic 8250/16x50 serial driver $Revision: 1.90 $"
);
...
...
drivers/serial/8250.h
View file @
90a2f98b
...
...
@@ -27,6 +27,8 @@ struct serial8250_probe {
int
serial8250_register_probe
(
struct
serial8250_probe
*
probe
);
void
serial8250_unregister_probe
(
struct
serial8250_probe
*
probe
);
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
{
unsigned
int
uart
;
...
...
drivers/serial/8250_pci.c
View file @
90a2f98b
...
...
@@ -1592,6 +1592,53 @@ static void __devexit pciserial_remove_one(struct pci_dev *dev)
}
}
static
int
pciserial_save_state_one
(
struct
pci_dev
*
dev
,
u32
state
)
{
struct
serial_private
*
priv
=
pci_get_drvdata
(
dev
);
if
(
priv
)
{
int
i
;
for
(
i
=
0
;
i
<
priv
->
nr
;
i
++
)
serial8250_suspend_port
(
priv
->
line
[
i
],
SUSPEND_SAVE_STATE
);
}
return
0
;
}
static
int
pciserial_suspend_one
(
struct
pci_dev
*
dev
,
u32
state
)
{
struct
serial_private
*
priv
=
pci_get_drvdata
(
dev
);
if
(
priv
)
{
int
i
;
for
(
i
=
0
;
i
<
priv
->
nr
;
i
++
)
serial8250_suspend_port
(
priv
->
line
[
i
],
SUSPEND_POWER_DOWN
);
}
return
0
;
}
static
int
pciserial_resume_one
(
struct
pci_dev
*
dev
)
{
struct
serial_private
*
priv
=
pci_get_drvdata
(
dev
);
if
(
priv
)
{
int
i
;
/*
* Ensure that the board is correctly configured.
*/
if
(
priv
->
quirk
->
init
)
priv
->
quirk
->
init
(
dev
);
for
(
i
=
0
;
i
<
priv
->
nr
;
i
++
)
{
serial8250_resume_port
(
priv
->
line
[
i
],
RESUME_POWER_ON
);
serial8250_resume_port
(
priv
->
line
[
i
],
RESUME_RESTORE_STATE
);
}
}
return
0
;
}
static
struct
pci_device_id
serial_pci_tbl
[]
__devinitdata
=
{
{
PCI_VENDOR_ID_V3
,
PCI_DEVICE_ID_V3_V960
,
PCI_SUBVENDOR_ID_CONNECT_TECH
,
...
...
@@ -1986,6 +2033,9 @@ static struct pci_driver serial_pci_driver = {
.
name
=
"serial"
,
.
probe
=
pciserial_init_one
,
.
remove
=
__devexit_p
(
pciserial_remove_one
),
.
save_state
=
pciserial_save_state_one
,
.
suspend
=
pciserial_suspend_one
,
.
resume
=
pciserial_resume_one
,
.
id_table
=
serial_pci_tbl
,
.
driver
=
{
.
devclass
=
&
tty_devclass
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment