Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs...
[linux-2.6-block.git] / include / linux / serial_sci.h
CommitLineData
96de1a8f
PM
1#ifndef __LINUX_SERIAL_SCI_H
2#define __LINUX_SERIAL_SCI_H
ecd95616
PM
3
4#include <linux/serial_core.h>
14baf9d7 5#include <linux/sh_dma.h>
ecd95616
PM
6
7/*
96de1a8f 8 * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts)
ecd95616
PM
9 */
10
26c92f37
PM
11enum {
12 SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */
13 SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */
14 SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */
15 SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */
16 SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */
17};
18
00b9de9c
PM
19#define SCSCR_TIE (1 << 7)
20#define SCSCR_RIE (1 << 6)
21#define SCSCR_TE (1 << 5)
22#define SCSCR_RE (1 << 4)
f43dc23d 23#define SCSCR_REIE (1 << 3) /* not supported by all parts */
00b9de9c
PM
24#define SCSCR_TOIE (1 << 2) /* not supported by all parts */
25#define SCSCR_CKE1 (1 << 1)
26#define SCSCR_CKE0 (1 << 0)
27
ecd95616
PM
28/* Offsets into the sci_port->irqs array */
29enum {
30 SCIx_ERI_IRQ,
31 SCIx_RXI_IRQ,
32 SCIx_TXI_IRQ,
33 SCIx_BRI_IRQ,
34 SCIx_NR_IRQS,
35};
36
22cc8378
PM
37#define SCIx_IRQ_MUXED(irq) \
38{ \
39 [SCIx_ERI_IRQ] = (irq), \
40 [SCIx_RXI_IRQ] = (irq), \
41 [SCIx_TXI_IRQ] = (irq), \
42 [SCIx_BRI_IRQ] = (irq), \
43}
44
73a19e4c
GL
45struct device;
46
ecd95616
PM
47/*
48 * Platform device specific platform_data struct
49 */
50struct plat_sci_port {
ecd95616
PM
51 unsigned long mapbase; /* resource base */
52 unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */
53 unsigned int type; /* SCI / SCIF / IRDA */
54 upf_t flags; /* UPF_* flags */
00b9de9c 55
26c92f37 56 unsigned int scbrr_algo_id; /* SCBRR calculation algo */
00b9de9c 57 unsigned int scscr; /* SCSCR initialization */
f43dc23d 58
73a19e4c 59 struct device *dma_dev;
f43dc23d 60
27bd1075
PM
61 unsigned int dma_slave_tx;
62 unsigned int dma_slave_rx;
ecd95616
PM
63};
64
96de1a8f 65#endif /* __LINUX_SERIAL_SCI_H */