struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
const char *name;
- CX18_DEBUG_IOCTL("VIDIOC_QUERYCTRL(%08x)\n", qctrl->id);
-
qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id);
if (qctrl->id == 0)
return -EINVAL;
int cx18_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu)
{
- struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
struct v4l2_queryctrl qctrl;
- CX18_DEBUG_IOCTL("VIDIOC_QUERYMENU\n");
qctrl.id = qmenu->id;
cx18_queryctrl(file, fh, &qctrl);
return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id));
struct cx18_open_id *id = fh;
struct cx18 *cx = id->cx;
int ret;
- s32 v = vctrl->value;
ret = v4l2_prio_check(&cx->prio, &id->prio);
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_CTRL(%08x, %x)\n", vctrl->id, v);
-
switch (vctrl->id) {
/* Standard V4L2 controls */
case V4L2_CID_BRIGHTNESS:
return cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, VIDIOC_S_CTRL, vctrl);
default:
- CX18_DEBUG_IOCTL("invalid control %x\n", vctrl->id);
+ CX18_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id);
return -EINVAL;
}
return 0;
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_CTRL(%08x)\n", vctrl->id);
-
switch (vctrl->id) {
/* Standard V4L2 controls */
case V4L2_CID_BRIGHTNESS:
case V4L2_CID_AUDIO_LOUDNESS:
return cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, VIDIOC_G_CTRL, vctrl);
default:
- CX18_DEBUG_IOCTL("invalid control %x\n", vctrl->id);
+ CX18_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id);
return -EINVAL;
}
return 0;
}
return err;
}
- CX18_DEBUG_IOCTL("VIDIOC_G_EXT_CTRLS\n");
if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG)
return cx2341x_ext_ctrls(&cx->params, 0, c, VIDIOC_G_EXT_CTRLS);
return -EINVAL;
}
return err;
}
- CX18_DEBUG_IOCTL("VIDIOC_S_EXT_CTRLS\n");
if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) {
struct cx2341x_mpeg_params p = cx->params;
int err = cx2341x_ext_ctrls(&p, atomic_read(&cx->ana_capturing),
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_TRY_EXT_CTRLS\n");
if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG)
return cx2341x_ext_ctrls(&cx->params,
atomic_read(&cx->ana_capturing),
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
struct v4l2_vbi_format *vbifmt = &fmt->fmt.vbi;
- CX18_DEBUG_IOCTL("VIDIOC_G_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n");
-
vbifmt->sampling_rate = 27000000;
vbifmt->offset = 248;
vbifmt->samples_per_line = cx->vbi.raw_decoder_line_size - 4;
int w = fmt->fmt.pix.width;
int h = fmt->fmt.pix.height;
- CX18_DEBUG_IOCTL("VIDIOC_TRY_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n");
-
w = min(w, 720);
w = max(w, 1);
h = min(h, cx->is_50hz ? 576 : 480);
static int cx18_try_fmt_vbi_cap(struct file *file, void *fh,
struct v4l2_format *fmt)
{
- struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
-
- CX18_DEBUG_IOCTL("VIDIOC_TRY_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n");
-
return cx18_g_fmt_vbi_cap(file, fh, fmt);
}
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n");
-
ret = cx18_try_fmt_vid_cap(file, fh, fmt);
if (ret)
return ret;
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n");
-
if (id->type == CX18_ENC_STREAM_TYPE_VBI &&
cx->vbi.sliced_in->service_set &&
atomic_read(&cx->ana_capturing) > 0)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_CHIP_IDENT\n");
-
chip->ident = V4L2_IDENT_NONE;
chip->revision = 0;
if (chip->match_type == V4L2_CHIP_MATCH_HOST) {
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_DBG_G_REGISTER\n");
-
if (v4l2_chip_match_host(reg->match_type, reg->match_chip))
return cx18_cxc(cx, VIDIOC_DBG_G_REGISTER, reg);
if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_DBG_S_REGISTER\n");
-
if (v4l2_chip_match_host(reg->match_type, reg->match_chip))
return cx18_cxc(cx, VIDIOC_DBG_S_REGISTER, reg);
if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_PRIORITY\n");
-
*p = v4l2_prio_max(&cx->prio);
return 0;
}
struct cx18_open_id *id = fh;
struct cx18 *cx = id->cx;
- CX18_DEBUG_IOCTL("VIDIOC_S_PRIORITY\n");
-
return v4l2_prio_change(&cx->prio, &id->prio, prio);
}
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_QUERYCAP\n");
-
strlcpy(vcap->driver, CX18_DRIVER_NAME, sizeof(vcap->driver));
strlcpy(vcap->card, cx->card_name, sizeof(vcap->card));
strlcpy(vcap->bus_info, pci_name(cx->dev), sizeof(vcap->bus_info));
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_ENUMAUDIO\n");
-
return cx18_get_audio_input(cx, vin->index, vin);
}
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_AUDIO\n");
-
vin->index = cx->audio_input;
return cx18_get_audio_input(cx, vin->index, vin);
}
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_S_AUDIO\n");
-
if (vout->index >= cx->nof_audio_inputs)
return -EINVAL;
cx->audio_input = vout->index;
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_ENUMINPUT\n");
-
/* set it to defaults from our table */
return cx18_get_input(cx, vin->index, vin);
}
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_CROPCAP\n");
-
if (cropcap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
cropcap->bounds.top = cropcap->bounds.left = 0;
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_CROP\n");
-
if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
return cx18_av_cmd(cx, VIDIOC_S_CROP, crop);
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_CROP\n");
-
if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
return cx18_av_cmd(cx, VIDIOC_G_CROP, crop);
}
};
- struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
-
- CX18_DEBUG_IOCTL("VIDIOC_ENUM_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n");
-
if (fmt->index > 1)
return -EINVAL;
*fmt = formats[fmt->index];
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_INPUT\n");
-
*i = cx->active_input;
return 0;
}
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_INPUT\n");
-
if (inp < 0 || inp >= cx->nof_inputs)
return -EINVAL;
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_FREQUENCY\n");
-
if (vf->tuner != 0)
return -EINVAL;
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_FREQUENCY\n");
-
if (vf->tuner != 0)
return -EINVAL;
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_STD\n");
-
*std = cx->std;
return 0;
}
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_STD\n");
-
if ((*std & V4L2_STD_ALL) == 0)
return -EINVAL;
if (ret)
return ret;
- CX18_DEBUG_IOCTL("VIDIOC_S_TUNER\n");
-
if (vt->index != 0)
return -EINVAL;
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_G_TUNER\n");
-
if (vt->index != 0)
return -EINVAL;
struct cx18_open_id *id = fh;
struct cx18 *cx = id->cx;
- CX18_DEBUG_IOCTL("VIDIOC_ENCODER_CMD:\n");
-
switch (enc->cmd) {
case V4L2_ENC_CMD_START:
CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n");
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
- CX18_DEBUG_IOCTL("VIDIOC_TRY_ENCDOER_CMD:\n");
-
switch (enc->cmd) {
case V4L2_ENC_CMD_START:
CX18_DEBUG_IOCTL("V4L2_ENC_CMD_START\n");
struct v4l2_audio audin;
int i;
- CX18_DEBUG_IOCTL("VIDIOC_LOG_STATUS\n");
CX18_INFO("================= START STATUS CARD #%d =================\n", cx->num);
if (cx->hw_flags & CX18_HW_TVEEPROM) {
struct tveeprom tv;
switch (cmd) {
case VIDIOC_INT_S_AUDIO_ROUTING: {
struct v4l2_routing *route = arg;
- CX18_DEBUG_IOCTL("VIDIOC_INT_S_AUDIO_ROUTING (%d, %d)\n",
- route->input, route->output);
+
+ CX18_DEBUG_IOCTL("VIDIOC_INT_S_AUDIO_ROUTING(%d, %d)\n",
+ route->input, route->output);
cx18_audio_set_route(cx, route);
break;
}
- case VIDIOC_INT_RESET: {
- u32 val = *(u32 *)arg;
- CX18_DEBUG_IOCTL("VIDIOC_INT_RESET (%#10x)\n", val);
- /* No op right now */
- /* cx18_av_cmd(cx, cmd, arg) */
- /* cx18_call_i2c_clients(cx, cmd, arg) */
- break;
- }
default:
- if (cx18_debug & CX18_DBGFLG_IOCTL) {
- printk(KERN_INFO "cx18%d ioctl: unsupported cmd: ",
- cx->num);
- v4l_printk_ioctl(cmd);
- printk("\n");
- }
return -EINVAL;
}
return 0;
int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long arg)
{
+ struct video_device *vfd = video_devdata(filp);
struct cx18_open_id *id = (struct cx18_open_id *)filp->private_data;
struct cx18 *cx = id->cx;
int res;
mutex_lock(&cx->serialize_lock);
+
+ if (cx18_debug & CX18_DBGFLG_IOCTL)
+ vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
res = video_ioctl2(inode, filp, cmd, arg);
+ vfd->debug = 0;
mutex_unlock(&cx->serialize_lock);
return res;
}
s->v4l2dev->type =
VID_TYPE_CAPTURE | VID_TYPE_TUNER | VID_TYPE_TELETEXT |
VID_TYPE_CLIPPING | VID_TYPE_SCALES | VID_TYPE_MPEG_ENCODER;
- snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "cx18%d %s",
- cx->num, s->name);
+ snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "cx18-%d",
+ cx->num);
s->v4l2dev->minor = minor;
s->v4l2dev->dev = &cx->dev->dev;
struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
const char *name;
- IVTV_DEBUG_IOCTL("VIDIOC_QUERYCTRL(%08x)\n", qctrl->id);
-
qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id);
if (qctrl->id == 0)
return -EINVAL;
int ivtv_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu)
{
- struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
struct v4l2_queryctrl qctrl;
- IVTV_DEBUG_IOCTL("VIDIOC_QUERYMENU\n");
qctrl.id = qmenu->id;
ivtv_queryctrl(file, fh, &qctrl);
return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id));
int ivtv_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl)
{
struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
- s32 v = vctrl->value;
-
- IVTV_DEBUG_IOCTL("VIDIOC_S_CTRL(%08x, %x)\n", vctrl->id, v);
switch (vctrl->id) {
/* Standard V4L2 controls */
return ivtv_i2c_hw(itv, itv->card->hw_audio_ctrl, VIDIOC_S_CTRL, vctrl);
default:
- IVTV_DEBUG_IOCTL("invalid control %x\n", vctrl->id);
+ IVTV_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id);
return -EINVAL;
}
return 0;
{
struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
- IVTV_DEBUG_IOCTL("VIDIOC_G_CTRL(%08x)\n", vctrl->id);
-
switch (vctrl->id) {
/* Standard V4L2 controls */
case V4L2_CID_BRIGHTNESS:
case V4L2_CID_AUDIO_LOUDNESS:
return ivtv_i2c_hw(itv, itv->card->hw_audio_ctrl, VIDIOC_G_CTRL, vctrl);
default:
- IVTV_DEBUG_IOCTL("invalid control %x\n", vctrl->id);
+ IVTV_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id);
return -EINVAL;
}
return 0;
}
return err;
}
- IVTV_DEBUG_IOCTL("VIDIOC_G_EXT_CTRLS\n");
if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG)
return cx2341x_ext_ctrls(&itv->params, 0, c, VIDIOC_G_EXT_CTRLS);
return -EINVAL;
}
return err;
}
- IVTV_DEBUG_IOCTL("VIDIOC_S_EXT_CTRLS\n");
if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) {
static u32 freqs[3] = { 44100, 48000, 32000 };
struct cx2341x_mpeg_params p = itv->params;
{
struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv;
- IVTV_DEBUG_IOCTL("VIDIOC_TRY_EXT_CTRLS\n");
if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG)
return cx2341x_ext_ctrls(&itv->params, atomic_read(&itv->capturing), c, VIDIOC_TRY_EXT_CTRLS);
return -EINVAL;
if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY))
return -EINVAL;
+ if (!itv->osd_video_pbase)
+ return -EINVAL;
fb->capability = V4L2_FBUF_CAP_EXTERNOVERLAY | V4L2_FBUF_CAP_CHROMAKEY |
V4L2_FBUF_CAP_GLOBAL_ALPHA;
fb->fmt.height = itv->osd_rect.height;
fb->fmt.field = V4L2_FIELD_INTERLACED;
fb->fmt.bytesperline = fb->fmt.width;
+ fb->fmt.colorspace = V4L2_COLORSPACE_SMPTE170M;
+ fb->fmt.field = V4L2_FIELD_INTERLACED;
+ fb->fmt.priv = 0;
if (fb->fmt.pixelformat != V4L2_PIX_FMT_PAL8)
fb->fmt.bytesperline *= 2;
if (fb->fmt.pixelformat == V4L2_PIX_FMT_RGB32 ||
fb->fmt.pixelformat == V4L2_PIX_FMT_YUV32)
fb->fmt.bytesperline *= 2;
+ fb->fmt.sizeimage = fb->fmt.bytesperline * fb->fmt.height;
fb->base = (void *)itv->osd_video_pbase;
fb->flags = 0;
if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT_OVERLAY))
return -EINVAL;
+ if (!itv->osd_video_pbase)
+ return -EINVAL;
itv->osd_global_alpha_state = (fb->flags & V4L2_FBUF_FLAG_GLOBAL_ALPHA) != 0;
itv->osd_local_alpha_state =
static int ivtv_serialized_ioctl(struct ivtv *itv, struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
{
+ struct video_device *vfd = video_devdata(filp);
struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data;
int ret;
return ret;
}
- if (ivtv_debug & IVTV_DBGFLG_IOCTL) {
- printk(KERN_INFO "ivtv%d ioctl: ", itv->num);
- v4l_printk_ioctl(cmd);
- printk("\n");
- }
-
- return video_ioctl2(inode, filp, cmd, arg);
+ if (ivtv_debug & IVTV_DBGFLG_IOCTL)
+ vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
+ ret = video_ioctl2(inode, filp, cmd, arg);
+ vfd->debug = 0;
+ return ret;
}
int ivtv_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
if (itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT) {
s->v4l2dev->type |= VID_TYPE_MPEG_DECODER;
}
- snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "ivtv%d %s",
- itv->num, s->name);
+ snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "ivtv%d",
+ itv->num);
s->v4l2dev->minor = minor;
s->v4l2dev->dev = &itv->dev->dev;
else
var->pixclock = pixclock;
+ itv->osd_rect.width = var->xres;
+ itv->osd_rect.height = var->yres;
+
IVTVFB_DEBUG_INFO("Display size: %dx%d (virtual %dx%d) @ %dbpp\n",
var->xres, var->yres,
var->xres_virtual, var->yres_virtual,