include/linux/comedi/comedi_8254.h

Source file repositories/reference/linux-study-clean/include/linux/comedi/comedi_8254.h

File Facts

System
Linux kernel
Corpus path
include/linux/comedi/comedi_8254.h
Extension
.h
Size
5201 bytes
Lines
162
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct comedi_8254 {
	comedi_8254_iocb_fn *iocb;
	unsigned long context;
	unsigned int iosize;
	unsigned int regshift;
	unsigned int osc_base;
	unsigned int divisor;
	unsigned int divisor1;
	unsigned int divisor2;
	unsigned int next_div;
	unsigned int next_div1;
	unsigned int next_div2;
	unsigned int clock_src[3];
	unsigned int gate_src[3];
	bool busy[3];

	int (*insn_config)(struct comedi_device *dev,
			   struct comedi_subdevice *s,
			   struct comedi_insn *insn, unsigned int *data);
};

unsigned int comedi_8254_status(struct comedi_8254 *i8254,
				unsigned int counter);
unsigned int comedi_8254_read(struct comedi_8254 *i8254, unsigned int counter);
void comedi_8254_write(struct comedi_8254 *i8254,
		       unsigned int counter, unsigned int val);

int comedi_8254_set_mode(struct comedi_8254 *i8254,
			 unsigned int counter, unsigned int mode);
int comedi_8254_load(struct comedi_8254 *i8254,
		     unsigned int counter, unsigned int val, unsigned int mode);

void comedi_8254_pacer_enable(struct comedi_8254 *i8254,
			      unsigned int counter1, unsigned int counter2,
			      bool enable);
void comedi_8254_update_divisors(struct comedi_8254 *i8254);
void comedi_8254_cascade_ns_to_timer(struct comedi_8254 *i8254,
				     unsigned int *nanosec, unsigned int flags);
void comedi_8254_ns_to_timer(struct comedi_8254 *i8254,
			     unsigned int *nanosec, unsigned int flags);

void comedi_8254_set_busy(struct comedi_8254 *i8254,
			  unsigned int counter, bool busy);

void comedi_8254_subdevice_init(struct comedi_subdevice *s,
				struct comedi_8254 *i8254);

#ifdef CONFIG_HAS_IOPORT
struct comedi_8254 *comedi_8254_io_alloc(unsigned long iobase,
					 unsigned int osc_base,
					 unsigned int iosize,
					 unsigned int regshift);
#else
static inline struct comedi_8254 *comedi_8254_io_alloc(unsigned long iobase,
						       unsigned int osc_base,
						       unsigned int iosize,
						       unsigned int regshift)
{
	return ERR_PTR(-ENXIO);
}
#endif

struct comedi_8254 *comedi_8254_mm_alloc(void __iomem *mmio,
					 unsigned int osc_base,
					 unsigned int iosize,
					 unsigned int regshift);

#endif	/* _COMEDI_8254_H */

Annotation

Implementation Notes