Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76730
b: refs/heads/master
c: a19602f
h: refs/heads/master
v: v3
  • Loading branch information
Steven Toth authored and Mauro Carvalho Chehab committed Jan 25, 2008
1 parent bc68d65 commit d4bfab5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 116 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 21a78091921915cd1afd0edb2940dd726edefe9b
refs/heads/master: a19602f26a24c32e491108b49790b106a6351f24
128 changes: 13 additions & 115 deletions trunk/drivers/media/video/cx23885/cx23885-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,13 @@ void cx23885_video_wakeup(struct cx23885_dev *dev,
break;
buf = list_entry(q->active.next,
struct cx23885_buffer, vb.queue);

/* count comes from the hw and is is 16bit wide --
* this trick handles wrap-arounds correctly for
* up to 32767 buffers in flight... */
if ((s16) (count - buf->count) < 0)
break;

do_gettimeofday(&buf->vb.ts);
dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf, buf->vb.i,
count, buf->count);
Expand All @@ -301,7 +303,6 @@ int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm)

dev->tvnorm = norm;


/* Tell the analog tuner/demods */
cx23885_call_i2c_clients(&dev->i2c_bus[1], VIDIOC_S_STD, &norm);

Expand Down Expand Up @@ -455,20 +456,6 @@ static int cx23885_start_video_dma(struct cx23885_dev *dev,
return 0;
}

#ifdef CONFIG_PM
static int cx23885_stop_video_dma(struct cx23885_dev *dev)
{
dprintk(1, "%s()\n", __FUNCTION__);
/* stop dma */
cx_clear(VID_A_DMA_CTL, 0x11);

/* disable irqs */
cx_clear(PCI_INT_MSK, 0x000001);
cx_clear(VID_A_INT_MSK, 0x000011);

return 0;
}
#endif

static int cx23885_restart_video_queue(struct cx23885_dev *dev,
struct cx23885_dmaqueue *q)
Expand Down Expand Up @@ -877,6 +864,10 @@ static int video_release(struct inode *inode, struct file *file)
file->private_data = NULL;
kfree(fh);

/* We are not putting the tuner to sleep here on exit, because
* we want to use the mpeg encoder in another session to capture
* tuner video. Closing this will result in no video to the encoder.
*/

return 0;
}
Expand Down Expand Up @@ -1337,6 +1328,9 @@ static int vidioc_g_register(struct file *file, void *fh,
{
struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;

if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
return -EINVAL;

cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_DBG_G_REGISTER, reg);

return 0;
Expand All @@ -1347,108 +1341,14 @@ static int vidioc_s_register(struct file *file, void *fh,
{
struct cx23885_dev *dev = ((struct cx23885_fh *)fh)->dev;

cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_DBG_S_REGISTER, reg);
return 0;
}
#endif

/* ----------------------------------------------------------- */
/* RADIO ESPECIFIC IOCTLS */
/* ----------------------------------------------------------- */

static int radio_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{
struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev;

strcpy(cap->driver, "cx23885");
strlcpy(cap->card, cx23885_boards[dev->board].name,
sizeof(cap->card));
sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci));
cap->version = CX23885_VERSION_CODE;
cap->capabilities = V4L2_CAP_TUNER;
return 0;
}

static int radio_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *t)
{
struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev;

if (unlikely(t->index > 0))
return -EINVAL;

strcpy(t->name, "Radio");
t->type = V4L2_TUNER_RADIO;

cx23885_call_i2c_clients(&dev->i2c_bus[1], VIDIOC_G_TUNER, t);
return 0;
}

static int radio_enum_input(struct file *file, void *priv,
struct v4l2_input *i)
{
if (i->index != 0)
return -EINVAL;
strcpy(i->name, "Radio");
i->type = V4L2_INPUT_TYPE_TUNER;

return 0;
}

static int radio_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
{
if (unlikely(a->index))
return -EINVAL;

memset(a, 0, sizeof(*a));
strcpy(a->name, "Radio");
return 0;
}

/* FIXME: Should add a standard for radio */

static int radio_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *t)
{
struct cx23885_dev *dev = ((struct cx23885_fh *)priv)->dev;

if (0 != t->index)
if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
return -EINVAL;

cx23885_call_i2c_clients(&dev->i2c_bus[1], VIDIOC_S_TUNER, t);

return 0;
}

static int radio_s_audio(struct file *file, void *fh,
struct v4l2_audio *a)
{
return 0;
}

static int radio_s_input(struct file *file, void *fh, unsigned int i)
{
return 0;
}

static int radio_queryctrl(struct file *file, void *priv,
struct v4l2_queryctrl *c)
{
int i;
cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_DBG_S_REGISTER, reg);

if (c->id < V4L2_CID_BASE ||
c->id >= V4L2_CID_LASTP1)
return -EINVAL;
if (c->id == V4L2_CID_AUDIO_MUTE) {
for (i = 0; i < CX23885_CTLS; i++)
if (cx23885_ctls[i].v.id == c->id)
break;
*c = cx23885_ctls[i].v;
} else
*c = no_ctl;
return 0;
}
#endif

/* ----------------------------------------------------------- */

Expand Down Expand Up @@ -1517,7 +1417,6 @@ int cx23885_video_irq(struct cx23885_dev *dev, u32 status)
return handled;
}


/* ----------------------------------------------------------- */
/* exported stuff */

Expand Down Expand Up @@ -1625,6 +1524,7 @@ int cx23885_video_register(struct cx23885_dev *dev)
cx23885_risc_stopper(dev->pci, &dev->vidq.stopper,
VID_A_DMA_CTL, 0x11, 0x00);

/* Don't enable VBI yet */
cx_set(PCI_INT_MSK, 1);


Expand All @@ -1647,8 +1547,6 @@ int cx23885_video_register(struct cx23885_dev *dev)
cx23885_video_mux(dev, 0);
mutex_unlock(&dev->lock);

/* FIXME start tvaudio thread */

return 0;

fail_unreg:
Expand Down

0 comments on commit d4bfab5

Please sign in to comment.