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
a01cdc10
Commit
a01cdc10
authored
Jun 08, 2011
by
Paul Mundt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serial: sh-sci: Tidy up ioread/write wrappers, kill off unused SCI helper.
Signed-off-by:
Paul Mundt
<
lethal@linux-sh.org
>
parent
ab7cfb55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
26 deletions
+9
-26
drivers/tty/serial/sh-sci.h
drivers/tty/serial/sh-sci.h
+9
-26
No files found.
drivers/tty/serial/sh-sci.h
View file @
a01cdc10
...
...
@@ -181,32 +181,25 @@
#define SCI_MAJOR 204
#define SCI_MINOR_START 8
#define SCI_IN(size, offset) \
if ((size) == 8) { \
return ioread8(port->membase + (offset)); \
} else { \
return ioread16(port->membase + (offset)); \
}
#define SCI_OUT(size, offset, value) \
if ((size) == 8) { \
iowrite8(value, port->membase + (offset)); \
} else if ((size) == 16) { \
iowrite16(value, port->membase + (offset)); \
}
#define SCI_IN(size, offset) \
ioread##size(port->membase + (offset))
#define SCI_OUT(size, offset, value) \
iowrite##size(value, port->membase + (offset))
#define CPU_SCIx_FNS(name, sci_offset, sci_size, scif_offset, scif_size)\
static inline unsigned int sci_##name##_in(struct uart_port *port) \
{ \
if (port->type == PORT_SCIF || port->type == PORT_SCIFB) { \
SCI_IN(scif_size, scif_offset)
\
return SCI_IN(scif_size, scif_offset);
\
} else {
/* PORT_SCI or PORT_SCIFA */
\
SCI_IN(sci_size, sci_offset);
\
return SCI_IN(sci_size, sci_offset);
\
} \
} \
static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
{ \
if (port->type == PORT_SCIF || port->type == PORT_SCIFB) { \
SCI_OUT(scif_size, scif_offset, value) \
SCI_OUT(scif_size, scif_offset, value)
;
\
} else {
/* PORT_SCI or PORT_SCIFA */
\
SCI_OUT(sci_size, sci_offset, value); \
} \
...
...
@@ -215,23 +208,13 @@
#define CPU_SCIF_FNS(name, scif_offset, scif_size) \
static inline unsigned int sci_##name##_in(struct uart_port *port) \
{ \
SCI_IN(scif_size, scif_offset);
\
return SCI_IN(scif_size, scif_offset);
\
} \
static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
{ \
SCI_OUT(scif_size, scif_offset, value); \
}
#define CPU_SCI_FNS(name, sci_offset, sci_size) \
static inline unsigned int sci_##name##_in(struct uart_port* port) \
{ \
SCI_IN(sci_size, sci_offset); \
} \
static inline void sci_##name##_out(struct uart_port* port, unsigned int value) \
{ \
SCI_OUT(sci_size, sci_offset, value); \
}
#if defined(CONFIG_CPU_SH3) || \
defined(CONFIG_ARCH_SH73A0) || \
defined(CONFIG_ARCH_SH7367) || \
...
...
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