Skip to content

Commit

Permalink
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder…
Browse files Browse the repository at this point in the history
…/decoder

It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!

Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Apr 27, 2007
1 parent ac52ea3 commit 1a0adaf
Show file tree
Hide file tree
Showing 40 changed files with 12,637 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/video/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@ config VIDEO_HEXIUM_GEMINI

source "drivers/media/video/cx88/Kconfig"

source "drivers/media/video/ivtv/Kconfig"

config VIDEO_M32R_AR
tristate "AR devices"
depends on M32R && VIDEO_V4L1
Expand Down
1 change: 1 addition & 0 deletions drivers/media/video/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ obj-$(CONFIG_VIDEO_CPIA_USB) += cpia_usb.o
obj-$(CONFIG_VIDEO_MEYE) += meye.o
obj-$(CONFIG_VIDEO_SAA7134) += ir-kbd-i2c.o saa7134/
obj-$(CONFIG_VIDEO_CX88) += cx88/
obj-$(CONFIG_VIDEO_IVTV) += ivtv/
obj-$(CONFIG_VIDEO_EM28XX) += em28xx/
obj-$(CONFIG_VIDEO_USBVISION) += usbvision/
obj-$(CONFIG_VIDEO_TVP5150) += tvp5150.o
Expand Down
26 changes: 26 additions & 0 deletions drivers/media/video/ivtv/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
config VIDEO_IVTV
tristate "Conexant cx23416/cx23415 MPEG encoder/decoder support"
depends on VIDEO_V4L2 && USB && I2C && EXPERIMENTAL
select FW_LOADER
select VIDEO_TUNER
select VIDEO_TVEEPROM
select VIDEO_CX2341X
select VIDEO_MSP3400
select VIDEO_SAA711X
select VIDEO_SAA7127
select VIDEO_TVAUDIO
select VIDEO_CS53L32A
select VIDEO_TLV320AIC23B
select VIDEO_WM8775
select VIDEO_WM8739
select VIDEO_UPD64031A
select VIDEO_UPD64083
---help---
This is a video4linux driver for Conexant cx23416 or cx23416 based
PCI personal video recorder devices.

This is used in devices such as the Hauppauge PVR-150/250/350/500
cards.

To compile this driver as a module, choose M here: the
module will be called ivtv.
7 changes: 7 additions & 0 deletions drivers/media/video/ivtv/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ivtv-objs := ivtv-audio.o ivtv-cards.o ivtv-controls.o \
ivtv-driver.o ivtv-fileops.o ivtv-firmware.o \
ivtv-gpio.o ivtv-i2c.o ivtv-ioctl.o ivtv-irq.o \
ivtv-mailbox.o ivtv-queue.o ivtv-streams.o ivtv-udma.o \
ivtv-vbi.o ivtv-video.o ivtv-yuv.o

obj-$(CONFIG_VIDEO_IVTV) += ivtv.o
74 changes: 74 additions & 0 deletions drivers/media/video/ivtv/ivtv-audio.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
Audio-related ivtv functions.
Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
Copyright (C) 2005-2007 Hans Verkuil <hverkuil@xs4all.nl>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "ivtv-driver.h"
#include "ivtv-mailbox.h"
#include "ivtv-i2c.h"
#include "ivtv-gpio.h"
#include "ivtv-cards.h"
#include "ivtv-audio.h"
#include <media/msp3400.h>
#include <linux/videodev.h>

/* Selects the audio input and output according to the current
settings. */
int ivtv_audio_set_io(struct ivtv *itv)
{
struct v4l2_routing route;
u32 audio_input;
int mux_input;

/* Determine which input to use */
if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags)) {
audio_input = itv->card->radio_input.audio_input;
mux_input = itv->card->radio_input.muxer_input;
} else {
audio_input = itv->card->audio_inputs[itv->audio_input].audio_input;
mux_input = itv->card->audio_inputs[itv->audio_input].muxer_input;
}

/* handle muxer chips */
route.input = mux_input;
route.output = 0;
ivtv_i2c_hw(itv, itv->card->hw_muxer, VIDIOC_INT_S_AUDIO_ROUTING, &route);

route.input = audio_input;
if (itv->card->hw_audio & IVTV_HW_MSP34XX) {
route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1);
}
return ivtv_i2c_hw(itv, itv->card->hw_audio, VIDIOC_INT_S_AUDIO_ROUTING, &route);
}

void ivtv_audio_set_route(struct ivtv *itv, struct v4l2_routing *route)
{
ivtv_i2c_hw(itv, itv->card->hw_audio, VIDIOC_INT_S_AUDIO_ROUTING, route);
}

void ivtv_audio_set_audio_clock_freq(struct ivtv *itv, u8 freq)
{
static u32 freqs[3] = { 44100, 48000, 32000 };

/* The audio clock of the digitizer must match the codec sample
rate otherwise you get some very strange effects. */
if (freq > 2)
return;
ivtv_call_i2c_clients(itv, VIDIOC_INT_AUDIO_CLOCK_FREQ, &freqs[freq]);
}

23 changes: 23 additions & 0 deletions drivers/media/video/ivtv/ivtv-audio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Audio-related ivtv functions.
Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
Copyright (C) 2005-2007 Hans Verkuil <hverkuil@xs4all.nl>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

int ivtv_audio_set_io(struct ivtv *itv);
void ivtv_audio_set_route(struct ivtv *itv, struct v4l2_routing *route);
void ivtv_audio_set_audio_clock_freq(struct ivtv *itv, u8 freq);
Loading

0 comments on commit 1a0adaf

Please sign in to comment.