Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
s626.c File Reference
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include "../comedidev.h"
#include "comedi_fc.h"
#include "s626.h"

Go to the source code of this file.

Data Structures

struct  s626_private
 
struct  dio_private
 
struct  enc_private
 

Macros

#define PCI_VENDOR_ID_S626   0x1131
 
#define PCI_DEVICE_ID_S626   0x7146
 
#define PCI_SUBVENDOR_ID_S626   0x6000
 
#define PCI_SUBDEVICE_ID_S626   0x0272
 
#define devpriv   ((struct s626_private *)dev->private)
 
#define diopriv   ((struct dio_private *)s->private)
 
#define encpriv   ((struct enc_private *)(dev->subdevices+5)->private)
 
#define INDXMASK(C)   (1 << (((C) > 2) ? ((C) * 2 - 1) : ((C) * 2 + 4)))
 
#define OVERMASK(C)   (1 << (((C) > 2) ? ((C) * 2 + 5) : ((C) * 2 + 10)))
 
#define EVBITS(C)   { 0, OVERMASK(C), INDXMASK(C), OVERMASK(C) | INDXMASK(C) }
 
#define MC_ENABLE(REGADRS, CTRLWORD)   writel(((uint32_t)(CTRLWORD) << 16) | (uint32_t)(CTRLWORD), devpriv->base_addr+(REGADRS))
 
#define MC_DISABLE(REGADRS, CTRLWORD)   writel((uint32_t)(CTRLWORD) << 16 , devpriv->base_addr+(REGADRS))
 
#define MC_TEST(REGADRS, CTRLWORD)   ((readl(devpriv->base_addr+(REGADRS)) & CTRLWORD) != 0)
 
#define WR7146(REGARDS, CTRLWORD)   writel(CTRLWORD, devpriv->base_addr+(REGARDS))
 
#define RR7146(REGARDS)   readl(devpriv->base_addr+(REGARDS))
 
#define BUGFIX_STREG(REGADRS)   (REGADRS - 4)
 
#define VECTPORT(VECTNUM)   (P_TSL2 + ((VECTNUM) << 2))
 
#define SETVECT(VECTNUM, VECTVAL)   WR7146(VECTPORT(VECTNUM), (VECTVAL))
 
#define I2C_B2(ATTR, VAL)   (((ATTR) << 6) | ((VAL) << 24))
 
#define I2C_B1(ATTR, VAL)   (((ATTR) << 4) | ((VAL) << 16))
 
#define I2C_B0(ATTR, VAL)   (((ATTR) << 2) | ((VAL) << 8))
 
#define VECT0   (XSD2 | RSD3 | SIB_A2)
 
#define MAX_SPEED   200000 /* in nanoseconds */
 
#define MIN_SPEED   2000000000 /* in nanoseconds */
 

Functions

 MODULE_DEVICE_TABLE (pci, s626_pci_table)
 
 module_comedi_pci_driver (s626_driver, s626_pci_driver)
 
 MODULE_AUTHOR ("Gianluca Palli <[email protected]>")
 
 MODULE_DESCRIPTION ("Sensoray 626 Comedi driver module")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define BUGFIX_STREG (   REGADRS)    (REGADRS - 4)

Definition at line 214 of file s626.c.

#define devpriv   ((struct s626_private *)dev->private)

Definition at line 164 of file s626.c.

#define diopriv   ((struct dio_private *)s->private)

Definition at line 165 of file s626.c.

#define encpriv   ((struct enc_private *)(dev->subdevices+5)->private)

Definition at line 188 of file s626.c.

#define EVBITS (   C)    { 0, OVERMASK(C), INDXMASK(C), OVERMASK(C) | INDXMASK(C) }

Definition at line 193 of file s626.c.

#define I2C_B0 (   ATTR,
  VAL 
)    (((ATTR) << 2) | ((VAL) << 8))

Definition at line 223 of file s626.c.

#define I2C_B1 (   ATTR,
  VAL 
)    (((ATTR) << 4) | ((VAL) << 16))

Definition at line 222 of file s626.c.

#define I2C_B2 (   ATTR,
  VAL 
)    (((ATTR) << 6) | ((VAL) << 24))

Definition at line 221 of file s626.c.

#define INDXMASK (   C)    (1 << (((C) > 2) ? ((C) * 2 - 1) : ((C) * 2 + 4)))

Definition at line 191 of file s626.c.

#define MAX_SPEED   200000 /* in nanoseconds */
#define MC_DISABLE (   REGADRS,
  CTRLWORD 
)    writel((uint32_t)(CTRLWORD) << 16 , devpriv->base_addr+(REGADRS))

Definition at line 202 of file s626.c.

#define MC_ENABLE (   REGADRS,
  CTRLWORD 
)    writel(((uint32_t)(CTRLWORD) << 16) | (uint32_t)(CTRLWORD), devpriv->base_addr+(REGADRS))

Definition at line 200 of file s626.c.

#define MC_TEST (   REGADRS,
  CTRLWORD 
)    ((readl(devpriv->base_addr+(REGADRS)) & CTRLWORD) != 0)

Definition at line 204 of file s626.c.

#define MIN_SPEED   2000000000 /* in nanoseconds */
#define OVERMASK (   C)    (1 << (((C) > 2) ? ((C) * 2 + 5) : ((C) * 2 + 10)))

Definition at line 192 of file s626.c.

#define PCI_DEVICE_ID_S626   0x7146

Definition at line 77 of file s626.c.

#define PCI_SUBDEVICE_ID_S626   0x0272

Definition at line 79 of file s626.c.

#define PCI_SUBVENDOR_ID_S626   0x6000

Definition at line 78 of file s626.c.

#define PCI_VENDOR_ID_S626   0x1131

Definition at line 76 of file s626.c.

#define RR7146 (   REGARDS)    readl(devpriv->base_addr+(REGARDS))

Definition at line 212 of file s626.c.

#define SETVECT (   VECTNUM,
  VECTVAL 
)    WR7146(VECTPORT(VECTNUM), (VECTVAL))

Definition at line 218 of file s626.c.

#define VECT0   (XSD2 | RSD3 | SIB_A2)

Definition at line 363 of file s626.c.

#define VECTPORT (   VECTNUM)    (P_TSL2 + ((VECTNUM) << 2))

Definition at line 217 of file s626.c.

#define WR7146 (   REGARDS,
  CTRLWORD 
)    writel(CTRLWORD, devpriv->base_addr+(REGARDS))

Definition at line 208 of file s626.c.

Function Documentation

MODULE_AUTHOR ( "Gianluca Palli <[email protected]>"  )
module_comedi_pci_driver ( s626_driver  ,
s626_pci_driver   
)
MODULE_DESCRIPTION ( "Sensoray 626 Comedi driver module )
MODULE_DEVICE_TABLE ( pci  ,
s626_pci_table   
)
MODULE_LICENSE ( "GPL"  )