Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
r592.h File Reference
#include <linux/memstick.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/kfifo.h>
#include <linux/ctype.h>

Go to the source code of this file.

Data Structures

struct  r592_device
 

Macros

#define R592_TPC_EXEC   0x00
 
#define R592_TPC_EXEC_LEN_SHIFT   16 /* Bits 16..25 are TPC len */
 
#define R592_TPC_EXEC_BIG_FIFO   (1 << 26) /* If bit 26 is set, large fifo is used (reg 48) */
 
#define R592_TPC_EXEC_TPC_SHIFT   28 /* Bits 28..31 are the TPC number */
 
#define R592_SFIFO   0x08
 
#define R592_STATUS   0x10
 
#define R592_STATUS_P_CMDNACK   (1 << 16) /* INT reg: NACK (parallel mode) */
 
#define R592_STATUS_P_BREQ   (1 << 17) /* INT reg: card ready (parallel mode)*/
 
#define R592_STATUS_P_INTERR   (1 << 18) /* INT reg: int error (parallel mode)*/
 
#define R592_STATUS_P_CED   (1 << 19) /* INT reg: command done (parallel mode) */
 
#define R592_STATUS_SFIFO_FULL   (1 << 20) /* Small Fifo almost full (last chunk is written) */
 
#define R592_STATUS_SFIFO_EMPTY   (1 << 21) /* Small Fifo empty */
 
#define R592_STATUS_SEND_ERR   (1 << 24) /* Send failed */
 
#define R592_STATUS_RECV_ERR   (1 << 25) /* Receive failed */
 
#define R592_STATUS_RDY   (1 << 28) /* RDY signal received */
 
#define R592_STATUS_CED   (1 << 29) /* INT: Command done (serial mode)*/
 
#define R592_STATUS_SFIFO_INPUT   (1 << 30) /* Small fifo received data*/
 
#define R592_SFIFO_SIZE   32 /* total size of small fifo is 32 bytes */
 
#define R592_SFIFO_PACKET   8 /* packet size of small fifo */
 
#define R592_IO   0x18
 
#define R592_IO_16   (1 << 16) /* Set by default, can be cleared */
 
#define R592_IO_18   (1 << 18) /* Set by default, can be cleared */
 
#define R592_IO_SERIAL1   (1 << 20) /* Set by default, can be cleared, (cleared on parallel) */
 
#define R592_IO_22   (1 << 22) /* Set by default, can be cleared */
 
#define R592_IO_DIRECTION   (1 << 24) /* TPC direction (1 write 0 read) */
 
#define R592_IO_26   (1 << 26) /* Set by default, can be cleared */
 
#define R592_IO_SERIAL2   (1 << 30) /* Set by default, can be cleared (cleared on parallel), serial doesn't work if unset */
 
#define R592_IO_RESET   (1 << 31) /* Reset, sets defaults*/
 
#define R592_POWER   0x20 /* bits 0-7 writeable */
 
#define R592_POWER_0   (1 << 0) /* set on start, cleared on stop - must be set*/
 
#define R592_POWER_1   (1 << 1) /* set on start, cleared on stop - must be set*/
 
#define R592_POWER_3   (1 << 3) /* must be clear */
 
#define R592_POWER_20   (1 << 5) /* set before switch to parallel */
 
#define R592_IO_MODE   0x24
 
#define R592_IO_MODE_SERIAL   1
 
#define R592_IO_MODE_PARALLEL   3
 
#define R592_REG_MSC   0x28
 
#define R592_REG_MSC_PRSNT   (1 << 1) /* card present (only status)*/
 
#define R592_REG_MSC_IRQ_INSERT   (1 << 8) /* detect insert / card insered */
 
#define R592_REG_MSC_IRQ_REMOVE   (1 << 9) /* detect removal / card removed */
 
#define R592_REG_MSC_FIFO_EMPTY   (1 << 10) /* fifo is empty */
 
#define R592_REG_MSC_FIFO_DMA_DONE   (1 << 11) /* dma enable / dma done */
 
#define R592_REG_MSC_FIFO_USER_ORN   (1 << 12) /* set if software reads empty fifo (if R592_REG_MSC_FIFO_EMPTY is set) */
 
#define R592_REG_MSC_FIFO_MISMATH   (1 << 13) /* set if amount of data in fifo doesn't match amount in TPC */
 
#define R592_REG_MSC_FIFO_DMA_ERR   (1 << 14) /* IO failure */
 
#define R592_REG_MSC_LED   (1 << 15) /* clear to turn led off (only status)*/
 
#define DMA_IRQ_ACK_MASK   (R592_REG_MSC_FIFO_DMA_DONE | R592_REG_MSC_FIFO_DMA_ERR)
 
#define DMA_IRQ_EN_MASK   (DMA_IRQ_ACK_MASK << 16)
 
#define IRQ_ALL_ACK_MASK   0x00007F00
 
#define IRQ_ALL_EN_MASK   (IRQ_ALL_ACK_MASK << 16)
 
#define R592_FIFO_DMA   0x2C
 
#define R592_FIFO_PIO   0x30
 
#define R592_LFIFO_SIZE   512 /* large fifo size */
 
#define R592_FIFO_DMA_SETTINGS   0x34
 
#define R592_FIFO_DMA_SETTINGS_EN   (1 << 0) /* DMA enabled */
 
#define R592_FIFO_DMA_SETTINGS_DIR   (1 << 1) /* Dma direction (1 read, 0 write) */
 
#define R592_FIFO_DMA_SETTINGS_CAP   (1 << 24) /* Dma is aviable */
 
#define R592_REG38   0x38
 
#define R592_REG38_CHANGE   (1 << 16) /* Start bit */
 
#define R592_REG38_DONE   (1 << 20) /* HW set this after the delay */
 
#define R592_REG38_SHIFT   17
 
#define R592_REG_3C   0x3C
 
#define DRV_NAME   "r592"
 
#define message(format,...)   printk(KERN_INFO DRV_NAME ": " format "\n", ## __VA_ARGS__)
 
#define __dbg(level, format,...)
 
#define dbg(format,...)   __dbg(1, format, ## __VA_ARGS__)
 
#define dbg_verbose(format,...)   __dbg(2, format, ## __VA_ARGS__)
 
#define dbg_reg(format,...)   __dbg(3, format, ## __VA_ARGS__)
 

Macro Definition Documentation

#define __dbg (   level,
  format,
  ... 
)
Value:
do { \
if (debug >= level) \
": " format "\n", ## __VA_ARGS__); \
} while (0)

Definition at line 163 of file r592.h.

#define dbg (   format,
  ... 
)    __dbg(1, format, ## __VA_ARGS__)

Definition at line 171 of file r592.h.

#define dbg_reg (   format,
  ... 
)    __dbg(3, format, ## __VA_ARGS__)

Definition at line 173 of file r592.h.

#define dbg_verbose (   format,
  ... 
)    __dbg(2, format, ## __VA_ARGS__)

Definition at line 172 of file r592.h.

#define DMA_IRQ_ACK_MASK   (R592_REG_MSC_FIFO_DMA_DONE | R592_REG_MSC_FIFO_DMA_ERR)

Definition at line 95 of file r592.h.

#define DMA_IRQ_EN_MASK   (DMA_IRQ_ACK_MASK << 16)

Definition at line 98 of file r592.h.

#define DRV_NAME   "r592"

Definition at line 157 of file r592.h.

#define IRQ_ALL_ACK_MASK   0x00007F00

Definition at line 100 of file r592.h.

#define IRQ_ALL_EN_MASK   (IRQ_ALL_ACK_MASK << 16)

Definition at line 101 of file r592.h.

#define message (   format,
  ... 
)    printk(KERN_INFO DRV_NAME ": " format "\n", ## __VA_ARGS__)

Definition at line 160 of file r592.h.

#define R592_FIFO_DMA   0x2C

Definition at line 104 of file r592.h.

#define R592_FIFO_DMA_SETTINGS   0x34

Definition at line 112 of file r592.h.

#define R592_FIFO_DMA_SETTINGS_CAP   (1 << 24) /* Dma is aviable */

Definition at line 115 of file r592.h.

#define R592_FIFO_DMA_SETTINGS_DIR   (1 << 1) /* Dma direction (1 read, 0 write) */

Definition at line 114 of file r592.h.

#define R592_FIFO_DMA_SETTINGS_EN   (1 << 0) /* DMA enabled */

Definition at line 113 of file r592.h.

#define R592_FIFO_PIO   0x30

Definition at line 107 of file r592.h.

#define R592_IO   0x18

Definition at line 57 of file r592.h.

#define R592_IO_16   (1 << 16) /* Set by default, can be cleared */

Definition at line 58 of file r592.h.

#define R592_IO_18   (1 << 18) /* Set by default, can be cleared */

Definition at line 59 of file r592.h.

#define R592_IO_22   (1 << 22) /* Set by default, can be cleared */

Definition at line 61 of file r592.h.

#define R592_IO_26   (1 << 26) /* Set by default, can be cleared */

Definition at line 63 of file r592.h.

#define R592_IO_DIRECTION   (1 << 24) /* TPC direction (1 write 0 read) */

Definition at line 62 of file r592.h.

#define R592_IO_MODE   0x24

Definition at line 76 of file r592.h.

#define R592_IO_MODE_PARALLEL   3

Definition at line 78 of file r592.h.

#define R592_IO_MODE_SERIAL   1

Definition at line 77 of file r592.h.

#define R592_IO_RESET   (1 << 31) /* Reset, sets defaults*/

Definition at line 65 of file r592.h.

#define R592_IO_SERIAL1   (1 << 20) /* Set by default, can be cleared, (cleared on parallel) */

Definition at line 60 of file r592.h.

#define R592_IO_SERIAL2   (1 << 30) /* Set by default, can be cleared (cleared on parallel), serial doesn't work if unset */

Definition at line 64 of file r592.h.

#define R592_LFIFO_SIZE   512 /* large fifo size */

Definition at line 108 of file r592.h.

#define R592_POWER   0x20 /* bits 0-7 writeable */

Definition at line 69 of file r592.h.

#define R592_POWER_0   (1 << 0) /* set on start, cleared on stop - must be set*/

Definition at line 70 of file r592.h.

#define R592_POWER_1   (1 << 1) /* set on start, cleared on stop - must be set*/

Definition at line 71 of file r592.h.

#define R592_POWER_20   (1 << 5) /* set before switch to parallel */

Definition at line 73 of file r592.h.

#define R592_POWER_3   (1 << 3) /* must be clear */

Definition at line 72 of file r592.h.

#define R592_REG38   0x38

Definition at line 123 of file r592.h.

#define R592_REG38_CHANGE   (1 << 16) /* Start bit */

Definition at line 124 of file r592.h.

#define R592_REG38_DONE   (1 << 20) /* HW set this after the delay */

Definition at line 125 of file r592.h.

#define R592_REG38_SHIFT   17

Definition at line 126 of file r592.h.

#define R592_REG_3C   0x3C

Definition at line 129 of file r592.h.

#define R592_REG_MSC   0x28

Definition at line 83 of file r592.h.

#define R592_REG_MSC_FIFO_DMA_DONE   (1 << 11) /* dma enable / dma done */

Definition at line 88 of file r592.h.

#define R592_REG_MSC_FIFO_DMA_ERR   (1 << 14) /* IO failure */

Definition at line 92 of file r592.h.

#define R592_REG_MSC_FIFO_EMPTY   (1 << 10) /* fifo is empty */

Definition at line 87 of file r592.h.

#define R592_REG_MSC_FIFO_MISMATH   (1 << 13) /* set if amount of data in fifo doesn't match amount in TPC */

Definition at line 91 of file r592.h.

#define R592_REG_MSC_FIFO_USER_ORN   (1 << 12) /* set if software reads empty fifo (if R592_REG_MSC_FIFO_EMPTY is set) */

Definition at line 90 of file r592.h.

#define R592_REG_MSC_IRQ_INSERT   (1 << 8) /* detect insert / card insered */

Definition at line 85 of file r592.h.

#define R592_REG_MSC_IRQ_REMOVE   (1 << 9) /* detect removal / card removed */

Definition at line 86 of file r592.h.

#define R592_REG_MSC_LED   (1 << 15) /* clear to turn led off (only status)*/

Definition at line 93 of file r592.h.

#define R592_REG_MSC_PRSNT   (1 << 1) /* card present (only status)*/

Definition at line 84 of file r592.h.

#define R592_SFIFO   0x08

Definition at line 29 of file r592.h.

#define R592_SFIFO_PACKET   8 /* packet size of small fifo */

Definition at line 54 of file r592.h.

#define R592_SFIFO_SIZE   32 /* total size of small fifo is 32 bytes */

Definition at line 53 of file r592.h.

#define R592_STATUS   0x10

Definition at line 33 of file r592.h.

#define R592_STATUS_CED   (1 << 29) /* INT: Command done (serial mode)*/

Definition at line 50 of file r592.h.

#define R592_STATUS_P_BREQ   (1 << 17) /* INT reg: card ready (parallel mode)*/

Definition at line 36 of file r592.h.

#define R592_STATUS_P_CED   (1 << 19) /* INT reg: command done (parallel mode) */

Definition at line 38 of file r592.h.

#define R592_STATUS_P_CMDNACK   (1 << 16) /* INT reg: NACK (parallel mode) */

Definition at line 35 of file r592.h.

#define R592_STATUS_P_INTERR   (1 << 18) /* INT reg: int error (parallel mode)*/

Definition at line 37 of file r592.h.

#define R592_STATUS_RDY   (1 << 28) /* RDY signal received */

Definition at line 49 of file r592.h.

#define R592_STATUS_RECV_ERR   (1 << 25) /* Receive failed */

Definition at line 46 of file r592.h.

#define R592_STATUS_SEND_ERR   (1 << 24) /* Send failed */

Definition at line 45 of file r592.h.

#define R592_STATUS_SFIFO_EMPTY   (1 << 21) /* Small Fifo empty */

Definition at line 42 of file r592.h.

#define R592_STATUS_SFIFO_FULL   (1 << 20) /* Small Fifo almost full (last chunk is written) */

Definition at line 41 of file r592.h.

#define R592_STATUS_SFIFO_INPUT   (1 << 30) /* Small fifo received data*/

Definition at line 51 of file r592.h.

#define R592_TPC_EXEC   0x00

Definition at line 20 of file r592.h.

#define R592_TPC_EXEC_BIG_FIFO   (1 << 26) /* If bit 26 is set, large fifo is used (reg 48) */

Definition at line 22 of file r592.h.

#define R592_TPC_EXEC_LEN_SHIFT   16 /* Bits 16..25 are TPC len */

Definition at line 21 of file r592.h.

#define R592_TPC_EXEC_TPC_SHIFT   28 /* Bits 28..31 are the TPC number */

Definition at line 23 of file r592.h.