Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
max310x.c File Reference
#include <linux/module.h>
#include <linux/device.h>
#include <linux/serial_core.h>
#include <linux/serial.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/regmap.h>
#include <linux/gpio.h>
#include <linux/spi/spi.h>
#include <linux/platform_data/max310x.h>

Go to the source code of this file.

Data Structures

struct  max310x_port
 

Macros

#define MAX310X_MAJOR   204
 
#define MAX310X_MINOR   209
 
#define MAX310X_RHR_REG   (0x00) /* RX FIFO */
 
#define MAX310X_THR_REG   (0x00) /* TX FIFO */
 
#define MAX310X_IRQEN_REG   (0x01) /* IRQ enable */
 
#define MAX310X_IRQSTS_REG   (0x02) /* IRQ status */
 
#define MAX310X_LSR_IRQEN_REG   (0x03) /* LSR IRQ enable */
 
#define MAX310X_LSR_IRQSTS_REG   (0x04) /* LSR IRQ status */
 
#define MAX310X_SPCHR_IRQEN_REG   (0x05) /* Special char IRQ enable */
 
#define MAX310X_SPCHR_IRQSTS_REG   (0x06) /* Special char IRQ status */
 
#define MAX310X_STS_IRQEN_REG   (0x07) /* Status IRQ enable */
 
#define MAX310X_STS_IRQSTS_REG   (0x08) /* Status IRQ status */
 
#define MAX310X_MODE1_REG   (0x09) /* MODE1 */
 
#define MAX310X_MODE2_REG   (0x0a) /* MODE2 */
 
#define MAX310X_LCR_REG   (0x0b) /* LCR */
 
#define MAX310X_RXTO_REG   (0x0c) /* RX timeout */
 
#define MAX310X_HDPIXDELAY_REG   (0x0d) /* Auto transceiver delays */
 
#define MAX310X_IRDA_REG   (0x0e) /* IRDA settings */
 
#define MAX310X_FLOWLVL_REG   (0x0f) /* Flow control levels */
 
#define MAX310X_FIFOTRIGLVL_REG   (0x10) /* FIFO IRQ trigger levels */
 
#define MAX310X_TXFIFOLVL_REG   (0x11) /* TX FIFO level */
 
#define MAX310X_RXFIFOLVL_REG   (0x12) /* RX FIFO level */
 
#define MAX310X_FLOWCTRL_REG   (0x13) /* Flow control */
 
#define MAX310X_XON1_REG   (0x14) /* XON1 character */
 
#define MAX310X_XON2_REG   (0x15) /* XON2 character */
 
#define MAX310X_XOFF1_REG   (0x16) /* XOFF1 character */
 
#define MAX310X_XOFF2_REG   (0x17) /* XOFF2 character */
 
#define MAX310X_GPIOCFG_REG   (0x18) /* GPIO config */
 
#define MAX310X_GPIODATA_REG   (0x19) /* GPIO data */
 
#define MAX310X_PLLCFG_REG   (0x1a) /* PLL config */
 
#define MAX310X_BRGCFG_REG   (0x1b) /* Baud rate generator conf */
 
#define MAX310X_BRGDIVLSB_REG   (0x1c) /* Baud rate divisor LSB */
 
#define MAX310X_BRGDIVMSB_REG   (0x1d) /* Baud rate divisor MSB */
 
#define MAX310X_CLKSRC_REG   (0x1e) /* Clock source */
 
#define MAX3107_REVID_REG   (0x1f) /* Revision identification */
 
#define MAX310X_IRQ_LSR_BIT   (1 << 0) /* LSR interrupt */
 
#define MAX310X_IRQ_SPCHR_BIT   (1 << 1) /* Special char interrupt */
 
#define MAX310X_IRQ_STS_BIT   (1 << 2) /* Status interrupt */
 
#define MAX310X_IRQ_RXFIFO_BIT   (1 << 3) /* RX FIFO interrupt */
 
#define MAX310X_IRQ_TXFIFO_BIT   (1 << 4) /* TX FIFO interrupt */
 
#define MAX310X_IRQ_TXEMPTY_BIT   (1 << 5) /* TX FIFO empty interrupt */
 
#define MAX310X_IRQ_RXEMPTY_BIT   (1 << 6) /* RX FIFO empty interrupt */
 
#define MAX310X_IRQ_CTS_BIT   (1 << 7) /* CTS interrupt */
 
#define MAX310X_LSR_RXTO_BIT   (1 << 0) /* RX timeout */
 
#define MAX310X_LSR_RXOVR_BIT   (1 << 1) /* RX overrun */
 
#define MAX310X_LSR_RXPAR_BIT   (1 << 2) /* RX parity error */
 
#define MAX310X_LSR_FRERR_BIT   (1 << 3) /* Frame error */
 
#define MAX310X_LSR_RXBRK_BIT   (1 << 4) /* RX break */
 
#define MAX310X_LSR_RXNOISE_BIT   (1 << 5) /* RX noise */
 
#define MAX310X_LSR_CTS_BIT   (1 << 7) /* CTS pin state */
 
#define MAX310X_SPCHR_XON1_BIT   (1 << 0) /* XON1 character */
 
#define MAX310X_SPCHR_XON2_BIT   (1 << 1) /* XON2 character */
 
#define MAX310X_SPCHR_XOFF1_BIT   (1 << 2) /* XOFF1 character */
 
#define MAX310X_SPCHR_XOFF2_BIT   (1 << 3) /* XOFF2 character */
 
#define MAX310X_SPCHR_BREAK_BIT   (1 << 4) /* RX break */
 
#define MAX310X_SPCHR_MULTIDROP_BIT   (1 << 5) /* 9-bit multidrop addr char */
 
#define MAX310X_STS_GPIO0_BIT   (1 << 0) /* GPIO 0 interrupt */
 
#define MAX310X_STS_GPIO1_BIT   (1 << 1) /* GPIO 1 interrupt */
 
#define MAX310X_STS_GPIO2_BIT   (1 << 2) /* GPIO 2 interrupt */
 
#define MAX310X_STS_GPIO3_BIT   (1 << 3) /* GPIO 3 interrupt */
 
#define MAX310X_STS_CLKREADY_BIT   (1 << 5) /* Clock ready */
 
#define MAX310X_STS_SLEEP_BIT   (1 << 6) /* Sleep interrupt */
 
#define MAX310X_MODE1_RXDIS_BIT   (1 << 0) /* RX disable */
 
#define MAX310X_MODE1_TXDIS_BIT   (1 << 1) /* TX disable */
 
#define MAX310X_MODE1_TXHIZ_BIT   (1 << 2) /* TX pin three-state */
 
#define MAX310X_MODE1_RTSHIZ_BIT   (1 << 3) /* RTS pin three-state */
 
#define MAX310X_MODE1_TRNSCVCTRL_BIT   (1 << 4) /* Transceiver ctrl enable */
 
#define MAX310X_MODE1_FORCESLEEP_BIT   (1 << 5) /* Force sleep mode */
 
#define MAX310X_MODE1_AUTOSLEEP_BIT   (1 << 6) /* Auto sleep enable */
 
#define MAX310X_MODE1_IRQSEL_BIT   (1 << 7) /* IRQ pin enable */
 
#define MAX310X_MODE2_RST_BIT   (1 << 0) /* Chip reset */
 
#define MAX310X_MODE2_FIFORST_BIT   (1 << 1) /* FIFO reset */
 
#define MAX310X_MODE2_RXTRIGINV_BIT   (1 << 2) /* RX FIFO INT invert */
 
#define MAX310X_MODE2_RXEMPTINV_BIT   (1 << 3) /* RX FIFO empty INT invert */
 
#define MAX310X_MODE2_SPCHR_BIT   (1 << 4) /* Special chr detect enable */
 
#define MAX310X_MODE2_LOOPBACK_BIT   (1 << 5) /* Internal loopback enable */
 
#define MAX310X_MODE2_MULTIDROP_BIT   (1 << 6) /* 9-bit multidrop enable */
 
#define MAX310X_MODE2_ECHOSUPR_BIT   (1 << 7) /* ECHO suppression enable */
 
#define MAX310X_LCR_LENGTH0_BIT   (1 << 0) /* Word length bit 0 */
 
#define MAX310X_LCR_LENGTH1_BIT
 
#define MAX310X_LCR_STOPLEN_BIT
 
#define MAX310X_LCR_PARITY_BIT   (1 << 3) /* Parity bit enable */
 
#define MAX310X_LCR_EVENPARITY_BIT   (1 << 4) /* Even parity bit enable */
 
#define MAX310X_LCR_FORCEPARITY_BIT   (1 << 5) /* 9-bit multidrop parity */
 
#define MAX310X_LCR_TXBREAK_BIT   (1 << 6) /* TX break enable */
 
#define MAX310X_LCR_RTS_BIT   (1 << 7) /* RTS pin control */
 
#define MAX310X_LCR_WORD_LEN_5   (0x00)
 
#define MAX310X_LCR_WORD_LEN_6   (0x01)
 
#define MAX310X_LCR_WORD_LEN_7   (0x02)
 
#define MAX310X_LCR_WORD_LEN_8   (0x03)
 
#define MAX310X_IRDA_IRDAEN_BIT   (1 << 0) /* IRDA mode enable */
 
#define MAX310X_IRDA_SIR_BIT   (1 << 1) /* SIR mode enable */
 
#define MAX310X_IRDA_SHORTIR_BIT   (1 << 2) /* Short SIR mode enable */
 
#define MAX310X_IRDA_MIR_BIT   (1 << 3) /* MIR mode enable */
 
#define MAX310X_IRDA_RXINV_BIT   (1 << 4) /* RX logic inversion enable */
 
#define MAX310X_IRDA_TXINV_BIT   (1 << 5) /* TX logic inversion enable */
 
#define MAX310X_FLOWLVL_HALT_MASK   (0x000f) /* Flow control halt level */
 
#define MAX310X_FLOWLVL_RES_MASK   (0x00f0) /* Flow control resume level */
 
#define MAX310X_FLOWLVL_HALT(words)   ((words / 8) & 0x0f)
 
#define MAX310X_FLOWLVL_RES(words)   (((words / 8) & 0x0f) << 4)
 
#define MAX310X_FIFOTRIGLVL_TX_MASK   (0x0f) /* TX FIFO trigger level */
 
#define MAX310X_FIFOTRIGLVL_RX_MASK   (0xf0) /* RX FIFO trigger level */
 
#define MAX310X_FIFOTRIGLVL_TX(words)   ((words / 8) & 0x0f)
 
#define MAX310X_FIFOTRIGLVL_RX(words)   (((words / 8) & 0x0f) << 4)
 
#define MAX310X_FLOWCTRL_AUTORTS_BIT   (1 << 0) /* Auto RTS flow ctrl enable */
 
#define MAX310X_FLOWCTRL_AUTOCTS_BIT   (1 << 1) /* Auto CTS flow ctrl enable */
 
#define MAX310X_FLOWCTRL_GPIADDR_BIT
 
#define MAX310X_FLOWCTRL_SWFLOWEN_BIT   (1 << 3) /* Auto SW flow ctrl enable */
 
#define MAX310X_FLOWCTRL_SWFLOW0_BIT   (1 << 4) /* SWFLOW bit 0 */
 
#define MAX310X_FLOWCTRL_SWFLOW1_BIT
 
#define MAX310X_FLOWCTRL_SWFLOW2_BIT   (1 << 6) /* SWFLOW bit 2 */
 
#define MAX310X_FLOWCTRL_SWFLOW3_BIT
 
#define MAX310X_GPIOCFG_GP0OUT_BIT   (1 << 0) /* GPIO 0 output enable */
 
#define MAX310X_GPIOCFG_GP1OUT_BIT   (1 << 1) /* GPIO 1 output enable */
 
#define MAX310X_GPIOCFG_GP2OUT_BIT   (1 << 2) /* GPIO 2 output enable */
 
#define MAX310X_GPIOCFG_GP3OUT_BIT   (1 << 3) /* GPIO 3 output enable */
 
#define MAX310X_GPIOCFG_GP0OD_BIT   (1 << 4) /* GPIO 0 open-drain enable */
 
#define MAX310X_GPIOCFG_GP1OD_BIT   (1 << 5) /* GPIO 1 open-drain enable */
 
#define MAX310X_GPIOCFG_GP2OD_BIT   (1 << 6) /* GPIO 2 open-drain enable */
 
#define MAX310X_GPIOCFG_GP3OD_BIT   (1 << 7) /* GPIO 3 open-drain enable */
 
#define MAX310X_GPIODATA_GP0OUT_BIT   (1 << 0) /* GPIO 0 output value */
 
#define MAX310X_GPIODATA_GP1OUT_BIT   (1 << 1) /* GPIO 1 output value */
 
#define MAX310X_GPIODATA_GP2OUT_BIT   (1 << 2) /* GPIO 2 output value */
 
#define MAX310X_GPIODATA_GP3OUT_BIT   (1 << 3) /* GPIO 3 output value */
 
#define MAX310X_GPIODATA_GP0IN_BIT   (1 << 4) /* GPIO 0 input value */
 
#define MAX310X_GPIODATA_GP1IN_BIT   (1 << 5) /* GPIO 1 input value */
 
#define MAX310X_GPIODATA_GP2IN_BIT   (1 << 6) /* GPIO 2 input value */
 
#define MAX310X_GPIODATA_GP3IN_BIT   (1 << 7) /* GPIO 3 input value */
 
#define MAX310X_PLLCFG_PREDIV_MASK   (0x3f) /* PLL predivision value */
 
#define MAX310X_PLLCFG_PLLFACTOR_MASK   (0xc0) /* PLL multiplication factor */
 
#define MAX310X_BRGCFG_2XMODE_BIT   (1 << 4) /* Double baud rate */
 
#define MAX310X_BRGCFG_4XMODE_BIT   (1 << 5) /* Quadruple baud rate */
 
#define MAX310X_CLKSRC_CRYST_BIT   (1 << 1) /* Crystal osc enable */
 
#define MAX310X_CLKSRC_PLL_BIT   (1 << 2) /* PLL enable */
 
#define MAX310X_CLKSRC_PLLBYP_BIT   (1 << 3) /* PLL bypass */
 
#define MAX310X_CLKSRC_EXTCLK_BIT   (1 << 4) /* External clock enable */
 
#define MAX310X_CLKSRC_CLK2RTS_BIT   (1 << 7) /* Baud clk to RTS pin */
 
#define MAX310X_FIFO_SIZE   (128)
 
#define MAX3107_REV_ID   (0xa0)
 
#define MAX3107_REV_MASK   (0xfe)
 
#define MAX310X_IRQ_TX
 
#define MAX310X_IRQ_RX
 

Enumerations

enum  { MAX310X_TYPE_MAX3107 = 3107, MAX310X_TYPE_MAX3108 = 3108 }
 

Functions

 MODULE_DEVICE_TABLE (spi, max310x_id_table)
 
 module_spi_driver (max310x_driver)
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_AUTHOR ("Alexander Shiyan <[email protected]>")
 
 MODULE_DESCRIPTION ("MAX310X serial driver")
 

Macro Definition Documentation

#define MAX3107_REV_ID   (0xa0)

Definition at line 207 of file max310x.c.

#define MAX3107_REV_MASK   (0xfe)

Definition at line 208 of file max310x.c.

#define MAX3107_REVID_REG   (0x1f) /* Revision identification */

Definition at line 67 of file max310x.c.

#define MAX310X_BRGCFG_2XMODE_BIT   (1 << 4) /* Double baud rate */

Definition at line 193 of file max310x.c.

#define MAX310X_BRGCFG_4XMODE_BIT   (1 << 5) /* Quadruple baud rate */

Definition at line 194 of file max310x.c.

#define MAX310X_BRGCFG_REG   (0x1b) /* Baud rate generator conf */

Definition at line 62 of file max310x.c.

#define MAX310X_BRGDIVLSB_REG   (0x1c) /* Baud rate divisor LSB */

Definition at line 63 of file max310x.c.

#define MAX310X_BRGDIVMSB_REG   (0x1d) /* Baud rate divisor MSB */

Definition at line 64 of file max310x.c.

#define MAX310X_CLKSRC_CLK2RTS_BIT   (1 << 7) /* Baud clk to RTS pin */

Definition at line 201 of file max310x.c.

#define MAX310X_CLKSRC_CRYST_BIT   (1 << 1) /* Crystal osc enable */

Definition at line 197 of file max310x.c.

#define MAX310X_CLKSRC_EXTCLK_BIT   (1 << 4) /* External clock enable */

Definition at line 200 of file max310x.c.

#define MAX310X_CLKSRC_PLL_BIT   (1 << 2) /* PLL enable */

Definition at line 198 of file max310x.c.

#define MAX310X_CLKSRC_PLLBYP_BIT   (1 << 3) /* PLL bypass */

Definition at line 199 of file max310x.c.

#define MAX310X_CLKSRC_REG   (0x1e) /* Clock source */

Definition at line 65 of file max310x.c.

#define MAX310X_FIFO_SIZE   (128)

Definition at line 204 of file max310x.c.

#define MAX310X_FIFOTRIGLVL_REG   (0x10) /* FIFO IRQ trigger levels */

Definition at line 51 of file max310x.c.

#define MAX310X_FIFOTRIGLVL_RX (   words)    (((words / 8) & 0x0f) << 4)

Definition at line 156 of file max310x.c.

#define MAX310X_FIFOTRIGLVL_RX_MASK   (0xf0) /* RX FIFO trigger level */

Definition at line 154 of file max310x.c.

#define MAX310X_FIFOTRIGLVL_TX (   words)    ((words / 8) & 0x0f)

Definition at line 155 of file max310x.c.

#define MAX310X_FIFOTRIGLVL_TX_MASK   (0x0f) /* TX FIFO trigger level */

Definition at line 153 of file max310x.c.

#define MAX310X_FLOWCTRL_AUTOCTS_BIT   (1 << 1) /* Auto CTS flow ctrl enable */

Definition at line 160 of file max310x.c.

#define MAX310X_FLOWCTRL_AUTORTS_BIT   (1 << 0) /* Auto RTS flow ctrl enable */

Definition at line 159 of file max310x.c.

#define MAX310X_FLOWCTRL_GPIADDR_BIT
Value:
(1 << 2) /* Enables that GPIO inputs
* are used in conjunction with
* XOFF2 for definition of
* special character */

Definition at line 161 of file max310x.c.

#define MAX310X_FLOWCTRL_REG   (0x13) /* Flow control */

Definition at line 54 of file max310x.c.

#define MAX310X_FLOWCTRL_SWFLOW0_BIT   (1 << 4) /* SWFLOW bit 0 */

Definition at line 163 of file max310x.c.

#define MAX310X_FLOWCTRL_SWFLOW1_BIT
Value:
(1 << 5) /* SWFLOW bit 1
*
* SWFLOW bits 1 & 0 table:
* 00 -> no transmitter flow
* control
* 01 -> receiver compares
* XON2 and XOFF2
* and controls
* transmitter
* 10 -> receiver compares
* XON1 and XOFF1
* and controls
* transmitter
* 11 -> receiver compares
* XON1, XON2, XOFF1 and
* XOFF2 and controls
* transmitter
*/

Definition at line 164 of file max310x.c.

#define MAX310X_FLOWCTRL_SWFLOW2_BIT   (1 << 6) /* SWFLOW bit 2 */

Definition at line 165 of file max310x.c.

#define MAX310X_FLOWCTRL_SWFLOW3_BIT
Value:
(1 << 7) /* SWFLOW bit 3
*
* SWFLOW bits 3 & 2 table:
* 00 -> no received flow
* control
* 01 -> transmitter generates
* XON2 and XOFF2
* 10 -> transmitter generates
* XON1 and XOFF1
* 11 -> transmitter generates
* XON1, XON2, XOFF1 and
* XOFF2
*/

Definition at line 166 of file max310x.c.

#define MAX310X_FLOWCTRL_SWFLOWEN_BIT   (1 << 3) /* Auto SW flow ctrl enable */

Definition at line 162 of file max310x.c.

#define MAX310X_FLOWLVL_HALT (   words)    ((words / 8) & 0x0f)

Definition at line 149 of file max310x.c.

#define MAX310X_FLOWLVL_HALT_MASK   (0x000f) /* Flow control halt level */

Definition at line 147 of file max310x.c.

#define MAX310X_FLOWLVL_REG   (0x0f) /* Flow control levels */

Definition at line 50 of file max310x.c.

#define MAX310X_FLOWLVL_RES (   words)    (((words / 8) & 0x0f) << 4)

Definition at line 150 of file max310x.c.

#define MAX310X_FLOWLVL_RES_MASK   (0x00f0) /* Flow control resume level */

Definition at line 148 of file max310x.c.

#define MAX310X_GPIOCFG_GP0OD_BIT   (1 << 4) /* GPIO 0 open-drain enable */

Definition at line 173 of file max310x.c.

#define MAX310X_GPIOCFG_GP0OUT_BIT   (1 << 0) /* GPIO 0 output enable */

Definition at line 169 of file max310x.c.

#define MAX310X_GPIOCFG_GP1OD_BIT   (1 << 5) /* GPIO 1 open-drain enable */

Definition at line 174 of file max310x.c.

#define MAX310X_GPIOCFG_GP1OUT_BIT   (1 << 1) /* GPIO 1 output enable */

Definition at line 170 of file max310x.c.

#define MAX310X_GPIOCFG_GP2OD_BIT   (1 << 6) /* GPIO 2 open-drain enable */

Definition at line 175 of file max310x.c.

#define MAX310X_GPIOCFG_GP2OUT_BIT   (1 << 2) /* GPIO 2 output enable */

Definition at line 171 of file max310x.c.

#define MAX310X_GPIOCFG_GP3OD_BIT   (1 << 7) /* GPIO 3 open-drain enable */

Definition at line 176 of file max310x.c.

#define MAX310X_GPIOCFG_GP3OUT_BIT   (1 << 3) /* GPIO 3 output enable */

Definition at line 172 of file max310x.c.

#define MAX310X_GPIOCFG_REG   (0x18) /* GPIO config */

Definition at line 59 of file max310x.c.

#define MAX310X_GPIODATA_GP0IN_BIT   (1 << 4) /* GPIO 0 input value */

Definition at line 183 of file max310x.c.

#define MAX310X_GPIODATA_GP0OUT_BIT   (1 << 0) /* GPIO 0 output value */

Definition at line 179 of file max310x.c.

#define MAX310X_GPIODATA_GP1IN_BIT   (1 << 5) /* GPIO 1 input value */

Definition at line 184 of file max310x.c.

#define MAX310X_GPIODATA_GP1OUT_BIT   (1 << 1) /* GPIO 1 output value */

Definition at line 180 of file max310x.c.

#define MAX310X_GPIODATA_GP2IN_BIT   (1 << 6) /* GPIO 2 input value */

Definition at line 185 of file max310x.c.

#define MAX310X_GPIODATA_GP2OUT_BIT   (1 << 2) /* GPIO 2 output value */

Definition at line 181 of file max310x.c.

#define MAX310X_GPIODATA_GP3IN_BIT   (1 << 7) /* GPIO 3 input value */

Definition at line 186 of file max310x.c.

#define MAX310X_GPIODATA_GP3OUT_BIT   (1 << 3) /* GPIO 3 output value */

Definition at line 182 of file max310x.c.

#define MAX310X_GPIODATA_REG   (0x19) /* GPIO data */

Definition at line 60 of file max310x.c.

#define MAX310X_HDPIXDELAY_REG   (0x0d) /* Auto transceiver delays */

Definition at line 48 of file max310x.c.

#define MAX310X_IRDA_IRDAEN_BIT   (1 << 0) /* IRDA mode enable */

Definition at line 139 of file max310x.c.

#define MAX310X_IRDA_MIR_BIT   (1 << 3) /* MIR mode enable */

Definition at line 142 of file max310x.c.

#define MAX310X_IRDA_REG   (0x0e) /* IRDA settings */

Definition at line 49 of file max310x.c.

#define MAX310X_IRDA_RXINV_BIT   (1 << 4) /* RX logic inversion enable */

Definition at line 143 of file max310x.c.

#define MAX310X_IRDA_SHORTIR_BIT   (1 << 2) /* Short SIR mode enable */

Definition at line 141 of file max310x.c.

#define MAX310X_IRDA_SIR_BIT   (1 << 1) /* SIR mode enable */

Definition at line 140 of file max310x.c.

#define MAX310X_IRDA_TXINV_BIT   (1 << 5) /* TX logic inversion enable */

Definition at line 144 of file max310x.c.

#define MAX310X_IRQ_CTS_BIT   (1 << 7) /* CTS interrupt */

Definition at line 77 of file max310x.c.

#define MAX310X_IRQ_LSR_BIT   (1 << 0) /* LSR interrupt */

Definition at line 70 of file max310x.c.

#define MAX310X_IRQ_RX
Value:
MAX310X_IRQ_RXEMPTY_BIT)

Definition at line 213 of file max310x.c.

#define MAX310X_IRQ_RXEMPTY_BIT   (1 << 6) /* RX FIFO empty interrupt */

Definition at line 76 of file max310x.c.

#define MAX310X_IRQ_RXFIFO_BIT   (1 << 3) /* RX FIFO interrupt */

Definition at line 73 of file max310x.c.

#define MAX310X_IRQ_SPCHR_BIT   (1 << 1) /* Special char interrupt */

Definition at line 71 of file max310x.c.

#define MAX310X_IRQ_STS_BIT   (1 << 2) /* Status interrupt */

Definition at line 72 of file max310x.c.

#define MAX310X_IRQ_TX
Value:
MAX310X_IRQ_TXEMPTY_BIT)

Definition at line 211 of file max310x.c.

#define MAX310X_IRQ_TXEMPTY_BIT   (1 << 5) /* TX FIFO empty interrupt */

Definition at line 75 of file max310x.c.

#define MAX310X_IRQ_TXFIFO_BIT   (1 << 4) /* TX FIFO interrupt */

Definition at line 74 of file max310x.c.

#define MAX310X_IRQEN_REG   (0x01) /* IRQ enable */

Definition at line 36 of file max310x.c.

#define MAX310X_IRQSTS_REG   (0x02) /* IRQ status */

Definition at line 37 of file max310x.c.

#define MAX310X_LCR_EVENPARITY_BIT   (1 << 4) /* Even parity bit enable */

Definition at line 129 of file max310x.c.

#define MAX310X_LCR_FORCEPARITY_BIT   (1 << 5) /* 9-bit multidrop parity */

Definition at line 130 of file max310x.c.

#define MAX310X_LCR_LENGTH0_BIT   (1 << 0) /* Word length bit 0 */

Definition at line 125 of file max310x.c.

#define MAX310X_LCR_LENGTH1_BIT
Value:
(1 << 1) /* Word length bit 1
*
* Word length bits table:
* 00 -> 5 bit words
* 01 -> 6 bit words
* 10 -> 7 bit words
* 11 -> 8 bit words
*/

Definition at line 126 of file max310x.c.

#define MAX310X_LCR_PARITY_BIT   (1 << 3) /* Parity bit enable */

Definition at line 128 of file max310x.c.

#define MAX310X_LCR_REG   (0x0b) /* LCR */

Definition at line 46 of file max310x.c.

#define MAX310X_LCR_RTS_BIT   (1 << 7) /* RTS pin control */

Definition at line 132 of file max310x.c.

#define MAX310X_LCR_STOPLEN_BIT
Value:
(1 << 2) /* STOP length bit
*
* STOP length bit table:
* 0 -> 1 stop bit
* 1 -> 1-1.5 stop bits if
* word length is 5,
* 2 stop bits otherwise
*/

Definition at line 127 of file max310x.c.

#define MAX310X_LCR_TXBREAK_BIT   (1 << 6) /* TX break enable */

Definition at line 131 of file max310x.c.

#define MAX310X_LCR_WORD_LEN_5   (0x00)

Definition at line 133 of file max310x.c.

#define MAX310X_LCR_WORD_LEN_6   (0x01)

Definition at line 134 of file max310x.c.

#define MAX310X_LCR_WORD_LEN_7   (0x02)

Definition at line 135 of file max310x.c.

#define MAX310X_LCR_WORD_LEN_8   (0x03)

Definition at line 136 of file max310x.c.

#define MAX310X_LSR_CTS_BIT   (1 << 7) /* CTS pin state */

Definition at line 86 of file max310x.c.

#define MAX310X_LSR_FRERR_BIT   (1 << 3) /* Frame error */

Definition at line 83 of file max310x.c.

#define MAX310X_LSR_IRQEN_REG   (0x03) /* LSR IRQ enable */

Definition at line 38 of file max310x.c.

#define MAX310X_LSR_IRQSTS_REG   (0x04) /* LSR IRQ status */

Definition at line 39 of file max310x.c.

#define MAX310X_LSR_RXBRK_BIT   (1 << 4) /* RX break */

Definition at line 84 of file max310x.c.

#define MAX310X_LSR_RXNOISE_BIT   (1 << 5) /* RX noise */

Definition at line 85 of file max310x.c.

#define MAX310X_LSR_RXOVR_BIT   (1 << 1) /* RX overrun */

Definition at line 81 of file max310x.c.

#define MAX310X_LSR_RXPAR_BIT   (1 << 2) /* RX parity error */

Definition at line 82 of file max310x.c.

#define MAX310X_LSR_RXTO_BIT   (1 << 0) /* RX timeout */

Definition at line 80 of file max310x.c.

#define MAX310X_MAJOR   204

Definition at line 30 of file max310x.c.

#define MAX310X_MINOR   209

Definition at line 31 of file max310x.c.

#define MAX310X_MODE1_AUTOSLEEP_BIT   (1 << 6) /* Auto sleep enable */

Definition at line 111 of file max310x.c.

#define MAX310X_MODE1_FORCESLEEP_BIT   (1 << 5) /* Force sleep mode */

Definition at line 110 of file max310x.c.

#define MAX310X_MODE1_IRQSEL_BIT   (1 << 7) /* IRQ pin enable */

Definition at line 112 of file max310x.c.

#define MAX310X_MODE1_REG   (0x09) /* MODE1 */

Definition at line 44 of file max310x.c.

#define MAX310X_MODE1_RTSHIZ_BIT   (1 << 3) /* RTS pin three-state */

Definition at line 108 of file max310x.c.

#define MAX310X_MODE1_RXDIS_BIT   (1 << 0) /* RX disable */

Definition at line 105 of file max310x.c.

#define MAX310X_MODE1_TRNSCVCTRL_BIT   (1 << 4) /* Transceiver ctrl enable */

Definition at line 109 of file max310x.c.

#define MAX310X_MODE1_TXDIS_BIT   (1 << 1) /* TX disable */

Definition at line 106 of file max310x.c.

#define MAX310X_MODE1_TXHIZ_BIT   (1 << 2) /* TX pin three-state */

Definition at line 107 of file max310x.c.

#define MAX310X_MODE2_ECHOSUPR_BIT   (1 << 7) /* ECHO suppression enable */

Definition at line 122 of file max310x.c.

#define MAX310X_MODE2_FIFORST_BIT   (1 << 1) /* FIFO reset */

Definition at line 116 of file max310x.c.

#define MAX310X_MODE2_LOOPBACK_BIT   (1 << 5) /* Internal loopback enable */

Definition at line 120 of file max310x.c.

#define MAX310X_MODE2_MULTIDROP_BIT   (1 << 6) /* 9-bit multidrop enable */

Definition at line 121 of file max310x.c.

#define MAX310X_MODE2_REG   (0x0a) /* MODE2 */

Definition at line 45 of file max310x.c.

#define MAX310X_MODE2_RST_BIT   (1 << 0) /* Chip reset */

Definition at line 115 of file max310x.c.

#define MAX310X_MODE2_RXEMPTINV_BIT   (1 << 3) /* RX FIFO empty INT invert */

Definition at line 118 of file max310x.c.

#define MAX310X_MODE2_RXTRIGINV_BIT   (1 << 2) /* RX FIFO INT invert */

Definition at line 117 of file max310x.c.

#define MAX310X_MODE2_SPCHR_BIT   (1 << 4) /* Special chr detect enable */

Definition at line 119 of file max310x.c.

#define MAX310X_PLLCFG_PLLFACTOR_MASK   (0xc0) /* PLL multiplication factor */

Definition at line 190 of file max310x.c.

#define MAX310X_PLLCFG_PREDIV_MASK   (0x3f) /* PLL predivision value */

Definition at line 189 of file max310x.c.

#define MAX310X_PLLCFG_REG   (0x1a) /* PLL config */

Definition at line 61 of file max310x.c.

#define MAX310X_RHR_REG   (0x00) /* RX FIFO */

Definition at line 34 of file max310x.c.

#define MAX310X_RXFIFOLVL_REG   (0x12) /* RX FIFO level */

Definition at line 53 of file max310x.c.

#define MAX310X_RXTO_REG   (0x0c) /* RX timeout */

Definition at line 47 of file max310x.c.

#define MAX310X_SPCHR_BREAK_BIT   (1 << 4) /* RX break */

Definition at line 93 of file max310x.c.

#define MAX310X_SPCHR_IRQEN_REG   (0x05) /* Special char IRQ enable */

Definition at line 40 of file max310x.c.

#define MAX310X_SPCHR_IRQSTS_REG   (0x06) /* Special char IRQ status */

Definition at line 41 of file max310x.c.

#define MAX310X_SPCHR_MULTIDROP_BIT   (1 << 5) /* 9-bit multidrop addr char */

Definition at line 94 of file max310x.c.

#define MAX310X_SPCHR_XOFF1_BIT   (1 << 2) /* XOFF1 character */

Definition at line 91 of file max310x.c.

#define MAX310X_SPCHR_XOFF2_BIT   (1 << 3) /* XOFF2 character */

Definition at line 92 of file max310x.c.

#define MAX310X_SPCHR_XON1_BIT   (1 << 0) /* XON1 character */

Definition at line 89 of file max310x.c.

#define MAX310X_SPCHR_XON2_BIT   (1 << 1) /* XON2 character */

Definition at line 90 of file max310x.c.

#define MAX310X_STS_CLKREADY_BIT   (1 << 5) /* Clock ready */

Definition at line 101 of file max310x.c.

#define MAX310X_STS_GPIO0_BIT   (1 << 0) /* GPIO 0 interrupt */

Definition at line 97 of file max310x.c.

#define MAX310X_STS_GPIO1_BIT   (1 << 1) /* GPIO 1 interrupt */

Definition at line 98 of file max310x.c.

#define MAX310X_STS_GPIO2_BIT   (1 << 2) /* GPIO 2 interrupt */

Definition at line 99 of file max310x.c.

#define MAX310X_STS_GPIO3_BIT   (1 << 3) /* GPIO 3 interrupt */

Definition at line 100 of file max310x.c.

#define MAX310X_STS_IRQEN_REG   (0x07) /* Status IRQ enable */

Definition at line 42 of file max310x.c.

#define MAX310X_STS_IRQSTS_REG   (0x08) /* Status IRQ status */

Definition at line 43 of file max310x.c.

#define MAX310X_STS_SLEEP_BIT   (1 << 6) /* Sleep interrupt */

Definition at line 102 of file max310x.c.

#define MAX310X_THR_REG   (0x00) /* TX FIFO */

Definition at line 35 of file max310x.c.

#define MAX310X_TXFIFOLVL_REG   (0x11) /* TX FIFO level */

Definition at line 52 of file max310x.c.

#define MAX310X_XOFF1_REG   (0x16) /* XOFF1 character */

Definition at line 57 of file max310x.c.

#define MAX310X_XOFF2_REG   (0x17) /* XOFF2 character */

Definition at line 58 of file max310x.c.

#define MAX310X_XON1_REG   (0x14) /* XON1 character */

Definition at line 55 of file max310x.c.

#define MAX310X_XON2_REG   (0x15) /* XON2 character */

Definition at line 56 of file max310x.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
MAX310X_TYPE_MAX3107 
MAX310X_TYPE_MAX3108 

Definition at line 217 of file max310x.c.

Function Documentation

MODULE_AUTHOR ( "Alexander Shiyan <[email protected]>"  )
MODULE_DESCRIPTION ( "MAX310X serial driver )
MODULE_DEVICE_TABLE ( spi  ,
max310x_id_table   
)
MODULE_LICENSE ( "GPL v2 )
module_spi_driver ( max310x_driver  )