/* ------------------------------------------------------------------- */
/* static data */
-static struct v4l2_tvnorm tvnorms[] = {
+struct v4l2_tvnorm cx88_tvnorms[] = {
{
.name = "NTSC-M",
.id = V4L2_STD_NTSC_M,
.id = V4L2_STD_SECAM_DK,
}
};
+EXPORT_SYMBOL(cx88_tvnorms);
+
+unsigned int cx88_tvnormsize=ARRAY_SIZE(cx88_tvnorms);
+EXPORT_SYMBOL(cx88_tvnormsize);
static struct v4l2_tvnorm radionorms[] = {
{
/* ------------------------------------------------------------------ */
/* VIDEO CTRL IOCTLS */
-static int vidioc_g_ctrl (struct file *file, void *priv,
- struct v4l2_control *ctl)
+int cx88_get_control (struct cx88_core *core, struct v4l2_control *ctl)
{
- struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
struct cx88_ctrl *c = NULL;
u32 value;
int i;
value,c->mask, c->sreg ? " [shadowed]" : "");
return 0;
}
+EXPORT_SYMBOL(cx88_get_control);
-static int set_control(struct cx88_core *core, struct v4l2_control *ctl)
+int cx88_set_control(struct cx88_core *core, struct v4l2_control *ctl)
{
struct cx88_ctrl *c = NULL;
u32 value,mask;
}
return 0;
}
+EXPORT_SYMBOL(cx88_set_control);
static void init_controls(struct cx88_core *core)
{
ctrl.id=cx8800_ctls[i].v.id;
ctrl.value=cx8800_ctls[i].v.default_value;
- set_control(core, &ctrl);
+ cx88_set_control(core, &ctrl);
}
}
}
#endif
-
static int vidioc_reqbufs (struct file *file, void *priv, struct v4l2_requestbuffers *p)
{
struct cx8800_fh *fh = priv;
struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
mutex_lock(&core->lock);
- cx88_set_tvnorm(core,&tvnorms[i]);
+ cx88_set_tvnorm(core,&cx88_tvnorms[i]);
mutex_unlock(&core->lock);
return 0;
}
/* only one input in this sample driver */
-static int vidioc_enum_input (struct file *file, void *priv,
- struct v4l2_input *i)
+int cx88_enum_input (struct cx88_core *core,struct v4l2_input *i)
{
- struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
-
static const char *iname[] = {
[ CX88_VMUX_COMPOSITE1 ] = "Composite1",
[ CX88_VMUX_COMPOSITE2 ] = "Composite2",
if ((CX88_VMUX_TELEVISION == INPUT(n)->type) ||
(CX88_VMUX_CABLE == INPUT(n)->type))
i->type = V4L2_INPUT_TYPE_TUNER;
- for (n = 0; n < ARRAY_SIZE(tvnorms); n++)
- i->std |= tvnorms[n].id;
+ for (n = 0; n < ARRAY_SIZE(cx88_tvnorms); n++)
+ i->std |= cx88_tvnorms[n].id;
return 0;
}
+EXPORT_SYMBOL(cx88_enum_input);
+
+static int vidioc_enum_input (struct file *file, void *priv,
+ struct v4l2_input *i)
+{
+ struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
+ return cx88_enum_input (core,i);
+}
static int vidioc_g_input (struct file *file, void *priv, unsigned int *i)
{
return cx8800_ctrl_query(qctrl);
}
-static int vidioc_s_ctrl (struct file *file, void *priv,
+static int vidioc_g_ctrl (struct file *file, void *priv,
struct v4l2_control *ctl)
{
struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
+ return
+ cx88_get_control(core,ctl);
+}
+static int vidioc_s_ctrl (struct file *file, void *priv,
+ struct v4l2_control *ctl)
+{
+ struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core;
return
- set_control(core,ctl);
+ cx88_set_control(core,ctl);
}
static int vidioc_g_tuner (struct file *file, void *priv,
return 0;
}
-static int vidioc_s_frequency (struct file *file, void *priv,
+int cx88_set_freq (struct cx88_core *core,
struct v4l2_frequency *f)
{
- struct cx8800_fh *fh = priv;
- struct cx88_core *core = fh->dev->core;
-
if (unlikely(UNSET == core->tuner_type))
return -EINVAL;
if (unlikely(f->tuner != 0))
return -EINVAL;
- if (unlikely(0 == fh->radio && f->type != V4L2_TUNER_ANALOG_TV))
- return -EINVAL;
- if (unlikely(1 == fh->radio && f->type != V4L2_TUNER_RADIO))
- return -EINVAL;
+
mutex_lock(&core->lock);
core->freq = f->frequency;
cx88_newstation(core);
cx88_set_tvaudio(core);
mutex_unlock(&core->lock);
+
return 0;
}
+EXPORT_SYMBOL(cx88_set_freq);
+
+static int vidioc_s_frequency (struct file *file, void *priv,
+ struct v4l2_frequency *f)
+{
+ struct cx8800_fh *fh = priv;
+ struct cx88_core *core = fh->dev->core;
+
+ if (unlikely(0 == fh->radio && f->type != V4L2_TUNER_ANALOG_TV))
+ return -EINVAL;
+ if (unlikely(1 == fh->radio && f->type != V4L2_TUNER_RADIO))
+ return -EINVAL;
+
+ return
+ cx88_set_freq (core,f);
+}
/* ----------------------------------------------------------- */
.vidioc_s_tuner = vidioc_s_tuner,
.vidioc_g_frequency = vidioc_g_frequency,
.vidioc_s_frequency = vidioc_s_frequency,
- .tvnorms = tvnorms,
- .tvnormsize = ARRAY_SIZE(tvnorms),
+ .tvnorms = cx88_tvnorms,
+ .tvnormsize = ARRAY_SIZE(cx88_tvnorms),
};
static const struct file_operations radio_fops =
/* initialize driver struct */
spin_lock_init(&dev->slock);
- core->tvnorm = tvnorms;
+ core->tvnorm = cx88_tvnorms;
/* init video dma queues */
INIT_LIST_HEAD(&dev->vidq.active);
/* initial device configuration */
mutex_lock(&core->lock);
- cx88_set_tvnorm(core,tvnorms);
+ cx88_set_tvnorm(core,cx88_tvnorms);
init_controls(core);
video_mux(core,0);
mutex_unlock(&core->lock);
module_init(cx8800_init);
module_exit(cx8800_fini);
-EXPORT_SYMBOL(cx88_do_ioctl);
-
/* ----------------------------------------------------------- */
/*
* Local variables: