]> Pileus Git - ~andy/linux/blob - drivers/staging/ipack/devices/ipoctal.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
[~andy/linux] / drivers / staging / ipack / devices / ipoctal.h
1 /**
2  * ipoctal.h
3  *
4  * driver for the IPOCTAL boards
5  * Copyright (c) 2009 Nicolas Serafini, EIC2 SA
6  * Copyright (c) 2010,2011 Samuel Iglesias Gonsalvez <siglesia@cern.ch>, CERN
7  * Copyright (c) 2012 Samuel Iglesias Gonsalvez <siglesias@igalia.com>, Igalia
8  *
9  * This program is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU General Public License as published by the Free
11  * Software Foundation; version 2 of the License.
12  */
13
14 #ifndef _IPOCTAL_H
15 #define _IPOCTAL_H_
16
17 #define NR_CHANNELS             8
18 #define IPOCTAL_MAX_BOARDS      16
19 #define MAX_DEVICES             (NR_CHANNELS * IPOCTAL_MAX_BOARDS)
20 #define RELEVANT_IFLAG(iflag) ((iflag) & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
21
22 /**
23  * enum uart_parity_e - UART supported parity.
24  */
25 enum uart_parity_e {
26         UART_NONE  = 0,
27         UART_ODD   = 1,
28         UART_EVEN  = 2,
29 };
30
31 /**
32  * enum uart_error - UART error type
33  *
34  */
35 enum uart_error {
36         UART_NOERROR = 0,      /* No error during transmission */
37         UART_TIMEOUT = 1 << 0, /* Timeout error */
38         UART_OVERRUN = 1 << 1, /* Overrun error */
39         UART_PARITY  = 1 << 2, /* Parity error */
40         UART_FRAMING = 1 << 3, /* Framing error */
41         UART_BREAK   = 1 << 4, /* Received break */
42 };
43
44 /**
45  * struct ipoctal_config - Serial configuration
46  *
47  * @baud: Baud rate
48  * @stop_bits: Stop bits (1 or 2)
49  * @bits_per_char: data size in bits
50  * @parity
51  * @flow_control: Flow control management (RTS/CTS) (0 disabled, 1 enabled)
52  */
53 struct ipoctal_config {
54         unsigned int baud;
55         unsigned int stop_bits;
56         unsigned int bits_per_char;
57         unsigned short parity;
58         unsigned int flow_control;
59 };
60
61 /**
62  * struct ipoctal_stats -- Stats since last reset
63  *
64  * @tx: Number of transmitted bytes
65  * @rx: Number of received bytes
66  * @overrun: Number of overrun errors
67  * @parity_err: Number of parity errors
68  * @framing_err: Number of framing errors
69  * @rcv_break: Number of break received
70  */
71 struct ipoctal_stats {
72         unsigned long tx;
73         unsigned long rx;
74         unsigned long overrun_err;
75         unsigned long parity_err;
76         unsigned long framing_err;
77         unsigned long rcv_break;
78 };
79
80 #endif /* _IPOCTAL_H_ */