drivers/comedi/drivers/s626.h

Source file repositories/reference/linux-study-clean/drivers/comedi/drivers/s626.h

File Facts

System
Linux kernel
Corpus path
drivers/comedi/drivers/s626.h
Extension
.h
Size
33062 bytes
Lines
870
Domain
Driver Families
Bucket
drivers/comedi
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef S626_H_INCLUDED
#define S626_H_INCLUDED

#define S626_DMABUF_SIZE	4096	/* 4k pages */

#define S626_ADC_CHANNELS       16
#define S626_DAC_CHANNELS       4
#define S626_ENCODER_CHANNELS   6
#define S626_DIO_CHANNELS       48
#define S626_DIO_BANKS		3	/* Number of DIO groups. */
#define S626_DIO_EXTCHANS	40	/*
					 * Number of extended-capability
					 * DIO channels.
					 */

#define S626_NUM_TRIMDACS	12	/* Number of valid TrimDAC channels. */

/* PCI bus interface types. */
#define S626_INTEL		1	/* Intel bus type. */
#define S626_MOTOROLA		2	/* Motorola bus type. */

#define S626_PLATFORM		S626_INTEL /* *** SELECT PLATFORM TYPE *** */

#define S626_RANGE_5V		0x10	/* +/-5V range */
#define S626_RANGE_10V		0x00	/* +/-10V range */

#define S626_EOPL		0x80	/* End of ADC poll list marker. */
#define S626_GSEL_BIPOLAR5V	0x00F0	/* S626_LP_GSEL setting 5V bipolar. */
#define S626_GSEL_BIPOLAR10V	0x00A0	/* S626_LP_GSEL setting 10V bipolar. */

/* Error codes that must be visible to this base class. */
#define S626_ERR_ILLEGAL_PARM	0x00010000	/*
						 * Illegal function parameter
						 * value was specified.
						 */
#define S626_ERR_I2C		0x00020000	/* I2C error. */
#define S626_ERR_COUNTERSETUP	0x00200000	/*
						 * Illegal setup specified for
						 * counter channel.
						 */
#define S626_ERR_DEBI_TIMEOUT	0x00400000	/* DEBI transfer timed out. */

/*
 * Organization (physical order) and size (in DWORDs) of logical DMA buffers
 * contained by ANA_DMABUF.
 */
#define S626_ADC_DMABUF_DWORDS	40	/*
					 * ADC DMA buffer must hold 16 samples,
					 * plus pre/post garbage samples.
					 */
#define S626_DAC_WDMABUF_DWORDS	1	/*
					 * DAC output DMA buffer holds a single
					 * sample.
					 */

/* All remaining space in 4KB DMA buffer is available for the RPS1 program. */

/* Address offsets, in DWORDS, from base of DMA buffer. */
#define S626_DAC_WDMABUF_OS	S626_ADC_DMABUF_DWORDS

/* Interrupt enable bit in ISR and IER. */
#define S626_IRQ_GPIO3		0x00000040	/* IRQ enable for GPIO3. */
#define S626_IRQ_RPS1		0x10000000
#define S626_ISR_AFOU		0x00000800
/* Audio fifo under/overflow  detected. */

#define S626_IRQ_COINT1A	0x0400	/* counter 1A overflow interrupt mask */
#define S626_IRQ_COINT1B	0x0800	/* counter 1B overflow interrupt mask */
#define S626_IRQ_COINT2A	0x1000	/* counter 2A overflow interrupt mask */
#define S626_IRQ_COINT2B	0x2000	/* counter 2B overflow interrupt mask */
#define S626_IRQ_COINT3A	0x4000	/* counter 3A overflow interrupt mask */
#define S626_IRQ_COINT3B	0x8000	/* counter 3B overflow interrupt mask */

/* RPS command codes. */
#define S626_RPS_CLRSIGNAL	0x00000000	/* CLEAR SIGNAL */
#define S626_RPS_SETSIGNAL	0x10000000	/* SET SIGNAL */
#define S626_RPS_NOP		0x00000000	/* NOP */
#define S626_RPS_PAUSE		0x20000000	/* PAUSE */
#define S626_RPS_UPLOAD		0x40000000	/* UPLOAD */
#define S626_RPS_JUMP		0x80000000	/* JUMP */
#define S626_RPS_LDREG		0x90000100	/* LDREG (1 uint32_t only) */
#define S626_RPS_STREG		0xA0000100	/* STREG (1 uint32_t only) */
#define S626_RPS_STOP		0x50000000	/* STOP */
#define S626_RPS_IRQ		0x60000000	/* IRQ */

#define S626_RPS_LOGICAL_OR	0x08000000	/* Logical OR conditionals. */
#define S626_RPS_INVERT		0x04000000	/*
						 * Test for negated
						 * semaphores.
						 */

Annotation

Implementation Notes