Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261903
b: refs/heads/master
c: a01cdc1
h: refs/heads/master
i:
  261901: a503779
  261899: 8ac8a9f
  261895: 3261c12
  261887: 96e7d18
v: v3
  • Loading branch information
Paul Mundt committed Jun 8, 2011
1 parent 44b944e commit dc1e0e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab7cfb5548d22604fafeaaa95950be2f97869f1e
refs/heads/master: a01cdc10689f5d252530d14474528ea785ecfde4
35 changes: 9 additions & 26 deletions trunk/drivers/tty/serial/sh-sci.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
} \
Expand All @@ -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) || \
Expand Down

0 comments on commit dc1e0e3

Please sign in to comment.