#ifndef _COMEDI_8254_H
#define _COMEDI_8254_H
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/err.h>
struct comedi_device;
struct comedi_insn;
struct comedi_subdevice;
#define I8254_OSC_BASE_10MHZ …
#define I8254_OSC_BASE_5MHZ …
#define I8254_OSC_BASE_4MHZ …
#define I8254_OSC_BASE_2MHZ …
#define I8254_OSC_BASE_1MHZ …
#define I8254_OSC_BASE_100KHZ …
#define I8254_OSC_BASE_10KHZ …
#define I8254_OSC_BASE_1KHZ …
#define I8254_IO8 …
#define I8254_IO16 …
#define I8254_IO32 …
#define I8254_COUNTER0_REG …
#define I8254_COUNTER1_REG …
#define I8254_COUNTER2_REG …
#define I8254_CTRL_REG …
#define I8254_CTRL_SEL_CTR(x) …
#define I8254_CTRL_READBACK(x) …
#define I8254_CTRL_READBACK_COUNT …
#define I8254_CTRL_READBACK_STATUS …
#define I8254_CTRL_READBACK_SEL_CTR(x) …
#define I8254_CTRL_RW(x) …
#define I8254_CTRL_LATCH …
#define I8254_CTRL_LSB_ONLY …
#define I8254_CTRL_MSB_ONLY …
#define I8254_CTRL_LSB_MSB …
#define I8254_MAX_COUNT …
struct comedi_8254;
comedi_8254_iocb_fn;
struct comedi_8254 { … };
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