Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
au1k_ir.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/types.h>
#include <net/irda/irda.h>
#include <net/irda/irmod.h>
#include <net/irda/wrapper.h>
#include <net/irda/irda_device.h>
#include <asm/mach-au1x00/au1000.h>

Go to the source code of this file.

Data Structures

struct  db_dest
 
struct  ring_dest
 
struct  au1k_private
 

Macros

#define IR_RING_PTR_STATUS   0x00
 
#define IR_RING_BASE_ADDR_H   0x04
 
#define IR_RING_BASE_ADDR_L   0x08
 
#define IR_RING_SIZE   0x0C
 
#define IR_RING_PROMPT   0x10
 
#define IR_RING_ADDR_CMPR   0x14
 
#define IR_INT_CLEAR   0x18
 
#define IR_CONFIG_1   0x20
 
#define IR_SIR_FLAGS   0x24
 
#define IR_STATUS   0x28
 
#define IR_READ_PHY_CONFIG   0x2C
 
#define IR_WRITE_PHY_CONFIG   0x30
 
#define IR_MAX_PKT_LEN   0x34
 
#define IR_RX_BYTE_CNT   0x38
 
#define IR_CONFIG_2   0x3C
 
#define IR_ENABLE   0x40
 
#define IR_RX_INVERT_LED   (1 << 0)
 
#define IR_TX_INVERT_LED   (1 << 1)
 
#define IR_ST   (1 << 2)
 
#define IR_SF   (1 << 3)
 
#define IR_SIR   (1 << 4)
 
#define IR_MIR   (1 << 5)
 
#define IR_FIR   (1 << 6)
 
#define IR_16CRC   (1 << 7)
 
#define IR_TD   (1 << 8)
 
#define IR_RX_ALL   (1 << 9)
 
#define IR_DMA_ENABLE   (1 << 10)
 
#define IR_RX_ENABLE   (1 << 11)
 
#define IR_TX_ENABLE   (1 << 12)
 
#define IR_LOOPBACK   (1 << 14)
 
#define IR_SIR_MODE
 
#define IR_RX_STATUS   (1 << 9)
 
#define IR_TX_STATUS   (1 << 10)
 
#define IR_PHYEN   (1 << 15)
 
#define IR_BR(x)   (((x) & 0x3f) << 10) /* baud rate */
 
#define IR_PW(x)   (((x) & 0x1f) << 5) /* pulse width */
 
#define IR_P(x)   ((x) & 0x1f) /* preamble bits */
 
#define IR_MODE_INV   (1 << 0)
 
#define IR_ONE_PIN   (1 << 1)
 
#define IR_PHYCLK_40MHZ   (0 << 2)
 
#define IR_PHYCLK_48MHZ   (1 << 2)
 
#define IR_PHYCLK_56MHZ   (2 << 2)
 
#define IR_PHYCLK_64MHZ   (3 << 2)
 
#define IR_DP   (1 << 4)
 
#define IR_DA   (1 << 5)
 
#define IR_FLT_HIGH   (0 << 6)
 
#define IR_FLT_MEDHI   (1 << 6)
 
#define IR_FLT_MEDLO   (2 << 6)
 
#define IR_FLT_LO   (3 << 6)
 
#define IR_IEN   (1 << 8)
 
#define IR_HC   (1 << 3) /* divide SBUS clock by 2 */
 
#define IR_CE   (1 << 2) /* clock enable */
 
#define IR_C   (1 << 1) /* coherency bit */
 
#define IR_BE   (1 << 0) /* set in big endian mode */
 
#define NUM_IR_DESC   64
 
#define RING_SIZE_4   0x0
 
#define RING_SIZE_16   0x3
 
#define RING_SIZE_64   0xF
 
#define MAX_NUM_IR_DESC   64
 
#define MAX_BUF_SIZE   2048
 
#define AU_OWN   (1 << 7) /* tx,rx */
 
#define IR_DIS_CRC   (1 << 6) /* tx */
 
#define IR_BAD_CRC   (1 << 5) /* tx */
 
#define IR_NEED_PULSE   (1 << 4) /* tx */
 
#define IR_FORCE_UNDER   (1 << 3) /* tx */
 
#define IR_DISABLE_TX   (1 << 2) /* tx */
 
#define IR_HW_UNDER   (1 << 0) /* tx */
 
#define IR_TX_ERROR   (IR_DIS_CRC | IR_BAD_CRC | IR_HW_UNDER)
 
#define IR_PHY_ERROR   (1 << 6) /* rx */
 
#define IR_CRC_ERROR   (1 << 5) /* rx */
 
#define IR_MAX_LEN   (1 << 4) /* rx */
 
#define IR_FIFO_OVER   (1 << 3) /* rx */
 
#define IR_SIR_ERROR   (1 << 2) /* rx */
 
#define IR_RX_ERROR
 
#define RUN_AT(x)   (jiffies + (x))
 

Functions

 MODULE_AUTHOR ("Pete Popov <[email protected]>")
 
 MODULE_DESCRIPTION ("Au1000 IrDA Device Driver")
 
 module_init (au1k_irda_load)
 
 module_exit (au1k_irda_unload)
 

Macro Definition Documentation

#define AU_OWN   (1 << 7) /* tx,rx */

Definition at line 113 of file au1k_ir.c.

#define IR_16CRC   (1 << 7)

Definition at line 63 of file au1k_ir.c.

#define IR_BAD_CRC   (1 << 5) /* tx */

Definition at line 115 of file au1k_ir.c.

#define IR_BE   (1 << 0) /* set in big endian mode */

Definition at line 103 of file au1k_ir.c.

#define IR_BR (   x)    (((x) & 0x3f) << 10) /* baud rate */

Definition at line 80 of file au1k_ir.c.

#define IR_C   (1 << 1) /* coherency bit */

Definition at line 102 of file au1k_ir.c.

#define IR_CE   (1 << 2) /* clock enable */

Definition at line 101 of file au1k_ir.c.

#define IR_CONFIG_1   0x20

Definition at line 45 of file au1k_ir.c.

#define IR_CONFIG_2   0x3C

Definition at line 52 of file au1k_ir.c.

#define IR_CRC_ERROR   (1 << 5) /* rx */

Definition at line 123 of file au1k_ir.c.

#define IR_DA   (1 << 5)

Definition at line 92 of file au1k_ir.c.

#define IR_DIS_CRC   (1 << 6) /* tx */

Definition at line 114 of file au1k_ir.c.

#define IR_DISABLE_TX   (1 << 2) /* tx */

Definition at line 118 of file au1k_ir.c.

#define IR_DMA_ENABLE   (1 << 10)

Definition at line 66 of file au1k_ir.c.

#define IR_DP   (1 << 4)

Definition at line 91 of file au1k_ir.c.

#define IR_ENABLE   0x40

Definition at line 53 of file au1k_ir.c.

#define IR_FIFO_OVER   (1 << 3) /* rx */

Definition at line 125 of file au1k_ir.c.

#define IR_FIR   (1 << 6)

Definition at line 62 of file au1k_ir.c.

#define IR_FLT_HIGH   (0 << 6)

Definition at line 93 of file au1k_ir.c.

#define IR_FLT_LO   (3 << 6)

Definition at line 96 of file au1k_ir.c.

#define IR_FLT_MEDHI   (1 << 6)

Definition at line 94 of file au1k_ir.c.

#define IR_FLT_MEDLO   (2 << 6)

Definition at line 95 of file au1k_ir.c.

#define IR_FORCE_UNDER   (1 << 3) /* tx */

Definition at line 117 of file au1k_ir.c.

#define IR_HC   (1 << 3) /* divide SBUS clock by 2 */

Definition at line 100 of file au1k_ir.c.

#define IR_HW_UNDER   (1 << 0) /* tx */

Definition at line 119 of file au1k_ir.c.

#define IR_IEN   (1 << 8)

Definition at line 97 of file au1k_ir.c.

#define IR_INT_CLEAR   0x18

Definition at line 44 of file au1k_ir.c.

#define IR_LOOPBACK   (1 << 14)

Definition at line 69 of file au1k_ir.c.

#define IR_MAX_LEN   (1 << 4) /* rx */

Definition at line 124 of file au1k_ir.c.

#define IR_MAX_PKT_LEN   0x34

Definition at line 50 of file au1k_ir.c.

#define IR_MIR   (1 << 5)

Definition at line 61 of file au1k_ir.c.

#define IR_MODE_INV   (1 << 0)

Definition at line 85 of file au1k_ir.c.

#define IR_NEED_PULSE   (1 << 4) /* tx */

Definition at line 116 of file au1k_ir.c.

#define IR_ONE_PIN   (1 << 1)

Definition at line 86 of file au1k_ir.c.

#define IR_P (   x)    ((x) & 0x1f) /* preamble bits */

Definition at line 82 of file au1k_ir.c.

#define IR_PHY_ERROR   (1 << 6) /* rx */

Definition at line 122 of file au1k_ir.c.

#define IR_PHYCLK_40MHZ   (0 << 2)

Definition at line 87 of file au1k_ir.c.

#define IR_PHYCLK_48MHZ   (1 << 2)

Definition at line 88 of file au1k_ir.c.

#define IR_PHYCLK_56MHZ   (2 << 2)

Definition at line 89 of file au1k_ir.c.

#define IR_PHYCLK_64MHZ   (3 << 2)

Definition at line 90 of file au1k_ir.c.

#define IR_PHYEN   (1 << 15)

Definition at line 77 of file au1k_ir.c.

#define IR_PW (   x)    (((x) & 0x1f) << 5) /* pulse width */

Definition at line 81 of file au1k_ir.c.

#define IR_READ_PHY_CONFIG   0x2C

Definition at line 48 of file au1k_ir.c.

#define IR_RING_ADDR_CMPR   0x14

Definition at line 43 of file au1k_ir.c.

#define IR_RING_BASE_ADDR_H   0x04

Definition at line 39 of file au1k_ir.c.

#define IR_RING_BASE_ADDR_L   0x08

Definition at line 40 of file au1k_ir.c.

#define IR_RING_PROMPT   0x10

Definition at line 42 of file au1k_ir.c.

#define IR_RING_PTR_STATUS   0x00

Definition at line 38 of file au1k_ir.c.

#define IR_RING_SIZE   0x0C

Definition at line 41 of file au1k_ir.c.

#define IR_RX_ALL   (1 << 9)

Definition at line 65 of file au1k_ir.c.

#define IR_RX_BYTE_CNT   0x38

Definition at line 51 of file au1k_ir.c.

#define IR_RX_ENABLE   (1 << 11)

Definition at line 67 of file au1k_ir.c.

#define IR_RX_ERROR
Value:

Definition at line 127 of file au1k_ir.c.

#define IR_RX_INVERT_LED   (1 << 0)

Definition at line 56 of file au1k_ir.c.

#define IR_RX_STATUS   (1 << 9)

Definition at line 75 of file au1k_ir.c.

#define IR_SF   (1 << 3)

Definition at line 59 of file au1k_ir.c.

#define IR_SIR   (1 << 4)

Definition at line 60 of file au1k_ir.c.

#define IR_SIR_ERROR   (1 << 2) /* rx */

Definition at line 126 of file au1k_ir.c.

#define IR_SIR_FLAGS   0x24

Definition at line 46 of file au1k_ir.c.

#define IR_SIR_MODE
Value:
IR_RX_ALL | IR_RX_ENABLE | IR_SF | \
IR_16CRC)

Definition at line 70 of file au1k_ir.c.

#define IR_ST   (1 << 2)

Definition at line 58 of file au1k_ir.c.

#define IR_STATUS   0x28

Definition at line 47 of file au1k_ir.c.

#define IR_TD   (1 << 8)

Definition at line 64 of file au1k_ir.c.

#define IR_TX_ENABLE   (1 << 12)

Definition at line 68 of file au1k_ir.c.

#define IR_TX_ERROR   (IR_DIS_CRC | IR_BAD_CRC | IR_HW_UNDER)

Definition at line 120 of file au1k_ir.c.

#define IR_TX_INVERT_LED   (1 << 1)

Definition at line 57 of file au1k_ir.c.

#define IR_TX_STATUS   (1 << 10)

Definition at line 76 of file au1k_ir.c.

#define IR_WRITE_PHY_CONFIG   0x30

Definition at line 49 of file au1k_ir.c.

#define MAX_BUF_SIZE   2048

Definition at line 110 of file au1k_ir.c.

#define MAX_NUM_IR_DESC   64

Definition at line 109 of file au1k_ir.c.

#define NUM_IR_DESC   64

Definition at line 105 of file au1k_ir.c.

#define RING_SIZE_16   0x3

Definition at line 107 of file au1k_ir.c.

#define RING_SIZE_4   0x0

Definition at line 106 of file au1k_ir.c.

#define RING_SIZE_64   0xF

Definition at line 108 of file au1k_ir.c.

#define RUN_AT (   x)    (jiffies + (x))

Definition at line 183 of file au1k_ir.c.

Function Documentation

MODULE_AUTHOR ( "Pete Popov <[email protected]>"  )
MODULE_DESCRIPTION ( "Au1000 IrDA Device Driver"  )
module_exit ( au1k_irda_unload  )
module_init ( au1k_irda_load  )