23 #ifndef __ANALOGY_SUBDEVICE__
24 #define __ANALOGY_SUBDEVICE__
27 #include <linux/list.h>
42 #define A4L_SUBD_MASK_READ 0x80000000
43 #define A4L_SUBD_MASK_WRITE 0x40000000
44 #define A4L_SUBD_MASK_SPECIAL 0x20000000
60 #define A4L_SUBD_UNUSED (A4L_SUBD_MASK_SPECIAL|0x1)
64 #define A4L_SUBD_AI (A4L_SUBD_MASK_READ|0x2)
68 #define A4L_SUBD_AO (A4L_SUBD_MASK_WRITE|0x4)
72 #define A4L_SUBD_DI (A4L_SUBD_MASK_READ|0x8)
76 #define A4L_SUBD_DO (A4L_SUBD_MASK_WRITE|0x10)
80 #define A4L_SUBD_DIO (A4L_SUBD_MASK_SPECIAL|0x20)
84 #define A4L_SUBD_COUNTER (A4L_SUBD_MASK_SPECIAL|0x40)
88 #define A4L_SUBD_TIMER (A4L_SUBD_MASK_SPECIAL|0x80)
92 #define A4L_SUBD_MEMORY (A4L_SUBD_MASK_SPECIAL|0x100)
96 #define A4L_SUBD_CALIB (A4L_SUBD_MASK_SPECIAL|0x200)
100 #define A4L_SUBD_PROC (A4L_SUBD_MASK_SPECIAL|0x400)
104 #define A4L_SUBD_SERIAL (A4L_SUBD_MASK_SPECIAL|0x800)
108 #define A4L_SUBD_TYPES (A4L_SUBD_UNUSED | \
134 #define A4L_SUBD_CMD 0x1000
140 #define A4L_SUBD_MMAP 0x8000
155 #define A4L_SUBD_BUSY_NR 0
156 #define A4L_SUBD_BUSY (1 << A4L_SUBD_BUSY_NR)
162 #define A4L_SUBD_CLEAN_NR 1
163 #define A4L_SUBD_CLEAN (1 << A4L_SUBD_CLEAN_NR)
242 struct a4l_subd_info {
244 unsigned long status;
245 unsigned char nb_chan;
247 typedef struct a4l_subd_info a4l_sbinfo_t;
250 struct a4l_chan_info {
251 unsigned long chan_flags;
252 unsigned char nb_rng;
253 unsigned char nb_bits;
255 typedef struct a4l_chan_info a4l_chinfo_t;
257 struct a4l_chinfo_arg {
258 unsigned int idx_subd;
261 typedef struct a4l_chinfo_arg a4l_chinfo_arg_t;
264 struct a4l_rng_info {
269 typedef struct a4l_rng_info a4l_rnginfo_t;
271 struct a4l_rng_info_arg {
272 unsigned int idx_subd;
273 unsigned int idx_chan;
276 typedef struct a4l_rng_info_arg a4l_rnginfo_arg_t;
285 unsigned char nb_chan,
unsigned int *chans);
287 #define a4l_subd_is_input(x) ((A4L_SUBD_MASK_READ & (x)->flags) != 0)
290 #define a4l_subd_is_output(x) \
291 ((A4L_SUBD_MASK_WRITE & (x)->flags) != 0 || \
292 (A4L_SUBD_DIO & (x)->flags) != 0)
300 int a4l_ioctl_subdinfo(a4l_cxt_t * cxt,
void *arg);
301 int a4l_ioctl_chaninfo(a4l_cxt_t * cxt,
void *arg);
302 int a4l_ioctl_rnginfo(a4l_cxt_t * cxt,
void *arg);
303 int a4l_ioctl_nbchaninfo(a4l_cxt_t * cxt,
void *arg);
304 int a4l_ioctl_nbrnginfo(a4l_cxt_t * cxt,
void *arg);
Structure describing some channel's characteristics.
Definition: channel_range.h:164
struct a4l_buffer * buf
Linked buffer.
Definition: subdevice.h:191
Analogy for Linux, context structure / macros declarations.
Analogy for Linux, driver facilities.
unsigned int idx
Subdevice index.
Definition: subdevice.h:188
Structure describing the asynchronous instruction.
Definition: command.h:198
int(* insn_read)(struct a4l_subdevice *, a4l_kinsn_t *)
Callback for the instruction "read".
Definition: subdevice.h:209
unsigned long status
Subdevice's status.
Definition: subdevice.h:195
int(* insn_write)(struct a4l_subdevice *, a4l_kinsn_t *)
Callback for the instruction "write".
Definition: subdevice.h:211
a4l_chdesc_t * chan_desc
Tab of channels descriptors pointers.
Definition: subdevice.h:201
void(* munge)(struct a4l_subdevice *, void *, unsigned long)
Callback for munge operation.
Definition: subdevice.h:223
int(* cancel)(struct a4l_subdevice *)
Callback for asynchronous transfer cancellation.
Definition: subdevice.h:221
int(* insn_config)(struct a4l_subdevice *, a4l_kinsn_t *)
Callback for the configuration instruction.
Definition: subdevice.h:215
struct list_head list
List stuff.
Definition: subdevice.h:182
Analogy for Linux, instruction related features.
a4l_cmd_t * cmd_mask
Command capabilities mask.
Definition: subdevice.h:205
int a4l_add_subd(a4l_dev_t *dev, a4l_subd_t *subd)
Add a subdevice to the driver descriptor.
a4l_rngdesc_t * rng_desc
Tab of ranges descriptors pointers.
Definition: subdevice.h:203
Analogy for Linux, channel, range related features.
a4l_subd_t * a4l_get_subd(a4l_dev_t *dev, int idx)
Get a pointer to the subdevice descriptor referenced by its registration index.
Structure describing a (unique) range.
Definition: channel_range.h:239
Structure describing the subdevice.
Definition: subdevice.h:180
int(* do_cmdtest)(struct a4l_subdevice *, a4l_cmd_t *)
Callback for command checking.
Definition: subdevice.h:219
char priv[0]
Private data.
Definition: subdevice.h:228
Analogy for Linux, misc declarations.
Structure describing a channels set.
Definition: channel_range.h:193
int(* do_cmd)(struct a4l_subdevice *, a4l_cmd_t *)
Callback for command handling.
Definition: subdevice.h:217
int(* insn_bits)(struct a4l_subdevice *, a4l_kinsn_t *)
Callback for the instruction "bits".
Definition: subdevice.h:213
a4l_subd_t * a4l_alloc_subd(int sizeof_priv, void(*setup)(a4l_subd_t *))
Allocate a subdevice descriptor.
int(* trigger)(struct a4l_subdevice *, lsampl_t)
Callback for trigger operation.
Definition: subdevice.h:225
struct a4l_device * dev
Containing device.
Definition: subdevice.h:185
unsigned long flags
Type flags.
Definition: subdevice.h:199