sh_eth: fix EESIPR values for SH77{34|63}
[linux/fpc-iii.git] / drivers / tty / serial / ifx6x60.h
blob4fbddc297839d6ac5e50346ff3c035fa5498b4db
1 /****************************************************************************
3 * Driver for the IFX spi modem.
5 * Copyright (C) 2009, 2010 Intel Corp
6 * Jim Stanley <jim.stanley@intel.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21 * USA
25 *****************************************************************************/
26 #ifndef _IFX6X60_H
27 #define _IFX6X60_H
29 #define DRVNAME "ifx6x60"
30 #define TTYNAME "ttyIFX"
32 #define IFX_SPI_MAX_MINORS 1
33 #define IFX_SPI_TRANSFER_SIZE 2048
34 #define IFX_SPI_FIFO_SIZE 4096
36 #define IFX_SPI_HEADER_OVERHEAD 4
37 #define IFX_RESET_TIMEOUT msecs_to_jiffies(50)
39 /* device flags bitfield definitions */
40 #define IFX_SPI_STATE_PRESENT 0
41 #define IFX_SPI_STATE_IO_IN_PROGRESS 1
42 #define IFX_SPI_STATE_IO_READY 2
43 #define IFX_SPI_STATE_TIMER_PENDING 3
44 #define IFX_SPI_STATE_IO_AVAILABLE 4
46 /* flow control bitfields */
47 #define IFX_SPI_DCD 0
48 #define IFX_SPI_CTS 1
49 #define IFX_SPI_DSR 2
50 #define IFX_SPI_RI 3
51 #define IFX_SPI_DTR 4
52 #define IFX_SPI_RTS 5
53 #define IFX_SPI_TX_FC 6
54 #define IFX_SPI_RX_FC 7
55 #define IFX_SPI_UPDATE 8
57 #define IFX_SPI_PAYLOAD_SIZE (IFX_SPI_TRANSFER_SIZE - \
58 IFX_SPI_HEADER_OVERHEAD)
60 #define IFX_SPI_IRQ_TYPE DETECT_EDGE_RISING
61 #define IFX_SPI_GPIO_TARGET 0
62 #define IFX_SPI_GPIO0 0x105
64 #define IFX_SPI_STATUS_TIMEOUT (2000*HZ)
66 /* values for bits in power status byte */
67 #define IFX_SPI_POWER_DATA_PENDING 1
68 #define IFX_SPI_POWER_SRDY 2
70 struct ifx_spi_device {
71 /* Our SPI device */
72 struct spi_device *spi_dev;
74 /* Port specific data */
75 struct kfifo tx_fifo;
76 spinlock_t fifo_lock;
77 unsigned long signal_state;
79 /* TTY Layer logic */
80 struct tty_port tty_port;
81 struct device *tty_dev;
82 int minor;
84 /* Low level I/O work */
85 struct tasklet_struct io_work_tasklet;
86 unsigned long flags;
87 dma_addr_t rx_dma;
88 dma_addr_t tx_dma;
90 int modem; /* Modem type */
91 int use_dma; /* provide dma-able addrs in SPI msg */
92 long max_hz; /* max SPI frequency */
94 spinlock_t write_lock;
95 int write_pending;
96 spinlock_t power_lock;
97 unsigned char power_status;
99 unsigned char *rx_buffer;
100 unsigned char *tx_buffer;
101 dma_addr_t rx_bus;
102 dma_addr_t tx_bus;
103 unsigned char spi_more;
104 unsigned char spi_slave_cts;
106 struct timer_list spi_timer;
108 struct spi_message spi_msg;
109 struct spi_transfer spi_xfer;
111 struct {
112 /* gpio lines */
113 unsigned short srdy; /* slave-ready gpio */
114 unsigned short mrdy; /* master-ready gpio */
115 unsigned short reset; /* modem-reset gpio */
116 unsigned short po; /* modem-on gpio */
117 unsigned short reset_out; /* modem-in-reset gpio */
118 /* state/stats */
119 int unack_srdy_int_nb;
120 } gpio;
122 /* modem reset */
123 unsigned long mdm_reset_state;
124 #define MR_START 0
125 #define MR_INPROGRESS 1
126 #define MR_COMPLETE 2
127 wait_queue_head_t mdm_reset_wait;
128 void (*swap_buf)(unsigned char *buf, int len, void *end);
131 #endif /* _IFX6X60_H */