Commit 299392bf authored by Hans Verkuil's avatar Hans Verkuil Committed by Linus Torvalds

[PATCH] v4l: 798: this patch adds the vidioc log status to videodev2 h and adds

- This patch adds the VIDIOC_LOG_STATUS to videodev2.h and adds
          LOG_STATUS support to tda9887.c and bttv-driver.c.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c58c21c7
...@@ -1851,6 +1851,11 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) ...@@ -1851,6 +1851,11 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
up(&btv->lock); up(&btv->lock);
return 0; return 0;
} }
case VIDIOC_LOG_STATUS:
{
bttv_call_i2c_clients(btv, VIDIOC_LOG_STATUS, 0);
return 0;
}
default: default:
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
...@@ -2856,6 +2861,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file, ...@@ -2856,6 +2861,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
case VIDIOC_S_TUNER: case VIDIOC_S_TUNER:
case VIDIOC_G_FREQUENCY: case VIDIOC_G_FREQUENCY:
case VIDIOC_S_FREQUENCY: case VIDIOC_S_FREQUENCY:
case VIDIOC_LOG_STATUS:
return bttv_common_ioctls(btv,cmd,arg); return bttv_common_ioctls(btv,cmd,arg);
default: default:
......
...@@ -60,6 +60,7 @@ struct tda9887 { ...@@ -60,6 +60,7 @@ struct tda9887 {
unsigned int pinnacle_id; unsigned int pinnacle_id;
unsigned int using_v4l2; unsigned int using_v4l2;
unsigned int radio_mode; unsigned int radio_mode;
unsigned char data[4];
}; };
struct tvnorm { struct tvnorm {
...@@ -575,32 +576,31 @@ static int tda9887_status(struct tda9887 *t) ...@@ -575,32 +576,31 @@ static int tda9887_status(struct tda9887 *t)
static int tda9887_configure(struct tda9887 *t) static int tda9887_configure(struct tda9887 *t)
{ {
unsigned char buf[4];
int rc; int rc;
memset(buf,0,sizeof(buf)); memset(t->data,0,sizeof(t->data));
tda9887_set_tvnorm(t,buf); tda9887_set_tvnorm(t,t->data);
buf[1] |= cOutputPort1Inactive; t->data[1] |= cOutputPort1Inactive;
buf[1] |= cOutputPort2Inactive; t->data[1] |= cOutputPort2Inactive;
if (UNSET != t->pinnacle_id) { if (UNSET != t->pinnacle_id) {
tda9887_set_pinnacle(t,buf); tda9887_set_pinnacle(t,t->data);
} }
tda9887_set_config(t,buf); tda9887_set_config(t,t->data);
tda9887_set_insmod(t,buf); tda9887_set_insmod(t,t->data);
if (t->mode == T_STANDBY) { if (t->mode == T_STANDBY) {
buf[1] |= cForcedMuteAudioON; t->data[1] |= cForcedMuteAudioON;
} }
tda9887_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n", tda9887_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n",
buf[1],buf[2],buf[3]); t->data[1],t->data[2],t->data[3]);
if (debug > 1) if (debug > 1)
dump_write_message(t, buf); dump_write_message(t, t->data);
if (4 != (rc = i2c_master_send(&t->client,buf,4))) if (4 != (rc = i2c_master_send(&t->client,t->data,4)))
tda9887_info("i2c i/o error: rc == %d (should be 4)\n",rc); tda9887_info("i2c i/o error: rc == %d (should be 4)\n",rc);
if (debug > 2) { if (debug > 2) {
...@@ -785,6 +785,11 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -785,6 +785,11 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg)
} }
break; break;
} }
case VIDIOC_LOG_STATUS:
{
tda9887_info("Data bytes: b=%02x c=%02x e=%02x\n", t->data[1], t->data[2], t->data[3]);
break;
}
default: default:
/* nothing */ /* nothing */
break; break;
......
...@@ -981,6 +981,7 @@ struct v4l2_streamparm ...@@ -981,6 +981,7 @@ struct v4l2_streamparm
#if 1 #if 1
#define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap)
#endif #endif
#define VIDIOC_LOG_STATUS _IO ('V', 70)
/* for compatibility, will go away some day */ /* for compatibility, will go away some day */
#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment