Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
parport_ip32.c File Reference
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/parport.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/stddef.h>
#include <linux/types.h>
#include <asm/io.h>
#include <asm/ip32/ip32_ints.h>
#include <asm/ip32/mace.h>

Go to the source code of this file.

Data Structures

struct  parport_ip32_regs
 
struct  parport_ip32_private
 
struct  parport_ip32_dma_data
 

Macros

#define DEBUG_PARPORT_IP32   0 /* 0 (disabled) for production */
 
#define DEFAULT_VERBOSE_PROBING   0
 
#define PPIP32   "parport_ip32: "
 
#define PARPORT_IP32_ENABLE_IRQ   (1U << 0)
 
#define PARPORT_IP32_ENABLE_DMA   (1U << 1)
 
#define PARPORT_IP32_ENABLE_SPP   (1U << 2)
 
#define PARPORT_IP32_ENABLE_EPP   (1U << 3)
 
#define PARPORT_IP32_ENABLE_ECP   (1U << 4)
 
#define FIFO_NFAULT_TIMEOUT   100 /* milliseconds */
 
#define FIFO_POLLING_INTERVAL   50 /* microseconds */
 
#define DSR_nBUSY   (1U << 7) /* PARPORT_STATUS_BUSY */
 
#define DSR_nACK   (1U << 6) /* PARPORT_STATUS_ACK */
 
#define DSR_PERROR   (1U << 5) /* PARPORT_STATUS_PAPEROUT */
 
#define DSR_SELECT   (1U << 4) /* PARPORT_STATUS_SELECT */
 
#define DSR_nFAULT   (1U << 3) /* PARPORT_STATUS_ERROR */
 
#define DSR_nPRINT   (1U << 2) /* specific to TL16PIR552 */
 
#define DSR_TIMEOUT   (1U << 0) /* EPP timeout */
 
#define DCR_DIR   (1U << 5) /* direction */
 
#define DCR_IRQ   (1U << 4) /* interrupt on nAck */
 
#define DCR_SELECT   (1U << 3) /* PARPORT_CONTROL_SELECT */
 
#define DCR_nINIT   (1U << 2) /* PARPORT_CONTROL_INIT */
 
#define DCR_AUTOFD   (1U << 1) /* PARPORT_CONTROL_AUTOFD */
 
#define DCR_STROBE   (1U << 0) /* PARPORT_CONTROL_STROBE */
 
#define CNFGA_IRQ   (1U << 7)
 
#define CNFGA_ID_MASK   ((1U << 6) | (1U << 5) | (1U << 4))
 
#define CNFGA_ID_SHIFT   4
 
#define CNFGA_ID_16   (00U << CNFGA_ID_SHIFT)
 
#define CNFGA_ID_8   (01U << CNFGA_ID_SHIFT)
 
#define CNFGA_ID_32   (02U << CNFGA_ID_SHIFT)
 
#define CNFGA_nBYTEINTRANS   (1U << 2)
 
#define CNFGA_PWORDLEFT   ((1U << 1) | (1U << 0))
 
#define CNFGB_COMPRESS   (1U << 7)
 
#define CNFGB_INTRVAL   (1U << 6)
 
#define CNFGB_IRQ_MASK   ((1U << 5) | (1U << 4) | (1U << 3))
 
#define CNFGB_IRQ_SHIFT   3
 
#define CNFGB_DMA_MASK   ((1U << 2) | (1U << 1) | (1U << 0))
 
#define CNFGB_DMA_SHIFT   0
 
#define ECR_MODE_MASK   ((1U << 7) | (1U << 6) | (1U << 5))
 
#define ECR_MODE_SHIFT   5
 
#define ECR_MODE_SPP   (00U << ECR_MODE_SHIFT)
 
#define ECR_MODE_PS2   (01U << ECR_MODE_SHIFT)
 
#define ECR_MODE_PPF   (02U << ECR_MODE_SHIFT)
 
#define ECR_MODE_ECP   (03U << ECR_MODE_SHIFT)
 
#define ECR_MODE_EPP   (04U << ECR_MODE_SHIFT)
 
#define ECR_MODE_TST   (06U << ECR_MODE_SHIFT)
 
#define ECR_MODE_CFG   (07U << ECR_MODE_SHIFT)
 
#define ECR_nERRINTR   (1U << 4)
 
#define ECR_DMAEN   (1U << 3)
 
#define ECR_SERVINTR   (1U << 2)
 
#define ECR_F_FULL   (1U << 1)
 
#define ECR_F_EMPTY   (1U << 0)
 
#define pr_debug1(...)   do { } while (0)
 
#define __pr_trace(pr, p, fmt,...)
 
#define pr_trace(p, fmt,...)   __pr_trace(pr_debug, p, fmt , ##__VA_ARGS__)
 
#define pr_trace1(p, fmt,...)   __pr_trace(pr_debug1, p, fmt , ##__VA_ARGS__)
 
#define __pr_probe(...)   do { if (verbose_probing) printk(__VA_ARGS__); } while (0)
 
#define pr_probe(p, fmt,...)   __pr_probe(KERN_INFO PPIP32 "0x%lx: " fmt, (p)->base , ##__VA_ARGS__)
 
#define parport_ip32_dump_state(...)   do { } while (0)
 
#define CHECK_EXTRA_BITS(...)   do { } while (0)
 
#define r_base(offset)   ((u8 __iomem *)base + ((offset) << regshift))
 
#define r_base_hi(offset)   ((u8 __iomem *)base_hi + ((offset) << regshift))
 
#define printmode(x)
 

Enumerations

enum  parport_ip32_irq_mode { PARPORT_IP32_IRQ_FWD, PARPORT_IP32_IRQ_HERE }
 

Functions

 MODULE_AUTHOR ("Arnaud Giersch <[email protected]>")
 
 MODULE_DESCRIPTION ("SGI IP32 built-in parallel port driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION ("0.6")
 
 module_init (parport_ip32_init)
 
 module_exit (parport_ip32_exit)
 
 module_param (verbose_probing, bool, S_IRUGO)
 
 MODULE_PARM_DESC (verbose_probing,"Log chit-chat during initialization")
 
 module_param (features, uint, S_IRUGO)
 
 MODULE_PARM_DESC (features,"Bit mask of features to enable"", bit 0: IRQ support"", bit 1: DMA support"", bit 2: hardware SPP mode"", bit 3: hardware EPP mode"", bit 4: hardware ECP mode")
 

Macro Definition Documentation

#define __pr_probe (   ...)    do { if (verbose_probing) printk(__VA_ARGS__); } while (0)

Definition at line 314 of file parport_ip32.c.

#define __pr_trace (   pr,
  p,
  fmt,
  ... 
)
Value:
pr("%s: %s" fmt "\n", \
({ const struct parport *__p = (p); \
__p ? __p->name : "parport_ip32"; }), \
__func__ , ##__VA_ARGS__)

Definition at line 298 of file parport_ip32.c.

#define CHECK_EXTRA_BITS (   ...)    do { } while (0)

Definition at line 462 of file parport_ip32.c.

#define CNFGA_ID_16   (00U << CNFGA_ID_SHIFT)

Definition at line 207 of file parport_ip32.c.

#define CNFGA_ID_32   (02U << CNFGA_ID_SHIFT)

Definition at line 209 of file parport_ip32.c.

#define CNFGA_ID_8   (01U << CNFGA_ID_SHIFT)

Definition at line 208 of file parport_ip32.c.

#define CNFGA_ID_MASK   ((1U << 6) | (1U << 5) | (1U << 4))

Definition at line 205 of file parport_ip32.c.

#define CNFGA_ID_SHIFT   4

Definition at line 206 of file parport_ip32.c.

#define CNFGA_IRQ   (1U << 7)

Definition at line 204 of file parport_ip32.c.

#define CNFGA_nBYTEINTRANS   (1U << 2)

Definition at line 211 of file parport_ip32.c.

#define CNFGA_PWORDLEFT   ((1U << 1) | (1U << 0))

Definition at line 212 of file parport_ip32.c.

#define CNFGB_COMPRESS   (1U << 7)

Definition at line 215 of file parport_ip32.c.

#define CNFGB_DMA_MASK   ((1U << 2) | (1U << 1) | (1U << 0))

Definition at line 219 of file parport_ip32.c.

#define CNFGB_DMA_SHIFT   0

Definition at line 220 of file parport_ip32.c.

#define CNFGB_INTRVAL   (1U << 6)

Definition at line 216 of file parport_ip32.c.

#define CNFGB_IRQ_MASK   ((1U << 5) | (1U << 4) | (1U << 3))

Definition at line 217 of file parport_ip32.c.

#define CNFGB_IRQ_SHIFT   3

Definition at line 218 of file parport_ip32.c.

#define DCR_AUTOFD   (1U << 1) /* PARPORT_CONTROL_AUTOFD */

Definition at line 200 of file parport_ip32.c.

#define DCR_DIR   (1U << 5) /* direction */

Definition at line 196 of file parport_ip32.c.

#define DCR_IRQ   (1U << 4) /* interrupt on nAck */

Definition at line 197 of file parport_ip32.c.

#define DCR_nINIT   (1U << 2) /* PARPORT_CONTROL_INIT */

Definition at line 199 of file parport_ip32.c.

#define DCR_SELECT   (1U << 3) /* PARPORT_CONTROL_SELECT */

Definition at line 198 of file parport_ip32.c.

#define DCR_STROBE   (1U << 0) /* PARPORT_CONTROL_STROBE */

Definition at line 201 of file parport_ip32.c.

#define DEBUG_PARPORT_IP32   0 /* 0 (disabled) for production */

Definition at line 76 of file parport_ip32.c.

#define DEFAULT_VERBOSE_PROBING   0

Definition at line 120 of file parport_ip32.c.

#define DSR_nACK   (1U << 6) /* PARPORT_STATUS_ACK */

Definition at line 186 of file parport_ip32.c.

#define DSR_nBUSY   (1U << 7) /* PARPORT_STATUS_BUSY */

Definition at line 185 of file parport_ip32.c.

#define DSR_nFAULT   (1U << 3) /* PARPORT_STATUS_ERROR */

Definition at line 189 of file parport_ip32.c.

#define DSR_nPRINT   (1U << 2) /* specific to TL16PIR552 */

Definition at line 190 of file parport_ip32.c.

#define DSR_PERROR   (1U << 5) /* PARPORT_STATUS_PAPEROUT */

Definition at line 187 of file parport_ip32.c.

#define DSR_SELECT   (1U << 4) /* PARPORT_STATUS_SELECT */

Definition at line 188 of file parport_ip32.c.

#define DSR_TIMEOUT   (1U << 0) /* EPP timeout */

Definition at line 192 of file parport_ip32.c.

#define ECR_DMAEN   (1U << 3)

Definition at line 234 of file parport_ip32.c.

#define ECR_F_EMPTY   (1U << 0)

Definition at line 237 of file parport_ip32.c.

#define ECR_F_FULL   (1U << 1)

Definition at line 236 of file parport_ip32.c.

#define ECR_MODE_CFG   (07U << ECR_MODE_SHIFT)

Definition at line 232 of file parport_ip32.c.

#define ECR_MODE_ECP   (03U << ECR_MODE_SHIFT)

Definition at line 228 of file parport_ip32.c.

#define ECR_MODE_EPP   (04U << ECR_MODE_SHIFT)

Definition at line 229 of file parport_ip32.c.

#define ECR_MODE_MASK   ((1U << 7) | (1U << 6) | (1U << 5))

Definition at line 223 of file parport_ip32.c.

#define ECR_MODE_PPF   (02U << ECR_MODE_SHIFT)

Definition at line 227 of file parport_ip32.c.

#define ECR_MODE_PS2   (01U << ECR_MODE_SHIFT)

Definition at line 226 of file parport_ip32.c.

#define ECR_MODE_SHIFT   5

Definition at line 224 of file parport_ip32.c.

#define ECR_MODE_SPP   (00U << ECR_MODE_SHIFT)

Definition at line 225 of file parport_ip32.c.

#define ECR_MODE_TST   (06U << ECR_MODE_SHIFT)

Definition at line 231 of file parport_ip32.c.

#define ECR_nERRINTR   (1U << 4)

Definition at line 233 of file parport_ip32.c.

#define ECR_SERVINTR   (1U << 2)

Definition at line 235 of file parport_ip32.c.

#define FIFO_NFAULT_TIMEOUT   100 /* milliseconds */

Definition at line 144 of file parport_ip32.c.

#define FIFO_POLLING_INTERVAL   50 /* microseconds */

Definition at line 145 of file parport_ip32.c.

#define parport_ip32_dump_state (   ...)    do { } while (0)

Definition at line 439 of file parport_ip32.c.

#define PARPORT_IP32_ENABLE_DMA   (1U << 1)

Definition at line 133 of file parport_ip32.c.

#define PARPORT_IP32_ENABLE_ECP   (1U << 4)

Definition at line 136 of file parport_ip32.c.

#define PARPORT_IP32_ENABLE_EPP   (1U << 3)

Definition at line 135 of file parport_ip32.c.

#define PARPORT_IP32_ENABLE_IRQ   (1U << 0)

Definition at line 132 of file parport_ip32.c.

#define PARPORT_IP32_ENABLE_SPP   (1U << 2)

Definition at line 134 of file parport_ip32.c.

#define PPIP32   "parport_ip32: "

Definition at line 124 of file parport_ip32.c.

#define pr_debug1 (   ...)    do { } while (0)

Definition at line 284 of file parport_ip32.c.

#define pr_probe (   p,
  fmt,
  ... 
)    __pr_probe(KERN_INFO PPIP32 "0x%lx: " fmt, (p)->base , ##__VA_ARGS__)

Definition at line 316 of file parport_ip32.c.

#define pr_trace (   p,
  fmt,
  ... 
)    __pr_trace(pr_debug, p, fmt , ##__VA_ARGS__)

Definition at line 303 of file parport_ip32.c.

#define pr_trace1 (   p,
  fmt,
  ... 
)    __pr_trace(pr_debug1, p, fmt , ##__VA_ARGS__)

Definition at line 304 of file parport_ip32.c.

#define printmode (   x)
Value:
if (p->modes & PARPORT_MODE_##x) \
printk("%s%s", f++ ? "," : "", #x)
#define r_base (   offset)    ((u8 __iomem *)base + ((offset) << regshift))
#define r_base_hi (   offset)    ((u8 __iomem *)base_hi + ((offset) << regshift))

Enumeration Type Documentation

enum parport_ip32_irq_mode - operation mode of interrupt handler : forward interrupt to the upper parport layer : interrupt is handled locally

Enumerator:
PARPORT_IP32_IRQ_FWD 
PARPORT_IP32_IRQ_HERE 

Definition at line 246 of file parport_ip32.c.

Function Documentation

MODULE_AUTHOR ( "Arnaud Giersch <[email protected]>"  )
MODULE_DESCRIPTION ( "SGI IP32 built-in parallel port driver )
module_exit ( parport_ip32_exit  )
module_init ( parport_ip32_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( verbose_probing  ,
bool  ,
S_IRUGO   
)
module_param ( features  ,
uint  ,
S_IRUGO   
)
MODULE_PARM_DESC ( verbose_probing  ,
"Log chit-chat during initialization"   
)
MODULE_PARM_DESC ( features  ,
"Bit mask of features to enable""  ,
bit 0:IRQ support""  ,
bit 1:DMA support""  ,
bit 2:hardware SPP mode""  ,
bit 3:hardware EPP mode""  ,
bit 4:hardware ECP mode  
)
MODULE_VERSION ( "0.6"  )