Skip to content

Commit

Permalink
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/mchehab/linux-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (45 commits)
  V4L/DVB (10411): s5h1409: Perform s5h1409 soft reset after tuning
  V4L/DVB (10403): saa7134-alsa: saa7130 doesn't support digital audio
  V4L/DVB (10229): ivtv: fix memory leak
  V4L/DVB (10385): gspca - main: Fix memory leak when USB disconnection while streaming.
  V4L/DVB (10325): em28xx: Fix for fail to submit URB with IRQs and Pre-emption Disabled
  V4L/DVB (10317): radio-mr800: fix radio->muted and radio->stereo
  V4L/DVB (10314): cx25840: ignore TUNER_SET_CONFIG in the command callback.
  V4L/DVB (10288): af9015: bug fix: stick does not work always when plugged
  V4L/DVB (10287): af9015: fix second FE
  V4L/DVB (10270): saa7146: fix unbalanced mutex_lock/unlock
  V4L/DVB (10265): budget.c driver: Kernel oops: "BUG: unable to handle kernel paging request at ffffffff
  V4L/DVB (10261): em28xx: fix kernel panic on audio shutdown
  V4L/DVB (10257): em28xx: Fix for KWorld 330U Board
  V4L/DVB (10256): em28xx: Fix for KWorld 330U AC97
  V4L/DVB (10254): em28xx: Fix audio URB transfer buffer race condition
  V4L/DVB (10250): cx25840: fix regression: fw not loaded on first use
  V4L/DVB (10248): v4l-dvb: fix a bunch of compile warnings.
  V4L/DVB (10243): em28xx: fix compile warning
  V4L/DVB (10240): Fix obvious swapped names in v4l2_subdev logic
  V4L/DVB (10233): [PATCH] Terratec Cinergy DT XS Diversity new USB ID (0ccd:0081)
  ...
  • Loading branch information
Linus Torvalds committed Feb 3, 2009
2 parents 5c350d9 + 67e70ba commit 9e6235e
Show file tree
Hide file tree
Showing 54 changed files with 854 additions and 731 deletions.
25 changes: 17 additions & 8 deletions Documentation/video4linux/v4lgrab.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@
*
* Compile with:
* gcc -s -Wall -Wstrict-prototypes v4lgrab.c -o v4lgrab
* Use as:
* v4lgrab >image.ppm
* Use as:
* v4lgrab >image.ppm
*
* Copyright (C) 1998-05-03, Phil Blundell <philb@gnu.org>
* Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c
* with minor modifications (Dave Forrest, drf5n@virginia.edu).
* Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c
* with minor modifications (Dave Forrest, drf5n@virginia.edu).
*
*
* For some cameras you may need to pre-load libv4l to perform
* the necessary decompression, e.g.:
*
* export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so
* ./v4lgrab >image.ppm
*
* see http://hansdegoede.livejournal.com/3636.html for details.
*
*/

Expand All @@ -24,7 +33,7 @@
#include <linux/types.h>
#include <linux/videodev.h>

#define FILE "/dev/video0"
#define VIDEO_DEV "/dev/video0"

/* Stole this from tvset.c */

Expand Down Expand Up @@ -90,7 +99,7 @@ int get_brightness_adj(unsigned char *image, long size, int *brightness) {

int main(int argc, char ** argv)
{
int fd = open(FILE, O_RDONLY), f;
int fd = open(VIDEO_DEV, O_RDONLY), f;
struct video_capability cap;
struct video_window win;
struct video_picture vpic;
Expand All @@ -100,13 +109,13 @@ int main(int argc, char ** argv)
unsigned int i, src_depth;

if (fd < 0) {
perror(FILE);
perror(VIDEO_DEV);
exit(1);
}

if (ioctl(fd, VIDIOCGCAP, &cap) < 0) {
perror("VIDIOGCAP");
fprintf(stderr, "(" FILE " not a video4linux device?)\n");
fprintf(stderr, "(" VIDEO_DEV " not a video4linux device?)\n");
close(fd);
exit(1);
}
Expand Down
1 change: 1 addition & 0 deletions drivers/media/common/saa7146_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c)
vv->vflip = c->value;
break;
default: {
mutex_unlock(&dev->lock);
return -EINVAL;
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/common/tuners/mxl5007t.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ static int mxl5007t_get_status(struct dvb_frontend *fe, u32 *status)
{
struct mxl5007t_state *state = fe->tuner_priv;
int rf_locked, ref_locked;
s32 rf_input_level;
s32 rf_input_level = 0;
int ret;

if (fe->ops.i2c_gate_ctrl)
Expand Down
24 changes: 21 additions & 3 deletions drivers/media/dvb/dvb-core/dvb_ca_en50221.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ struct dvb_ca_slot {
/* current state of the CAM */
int slot_state;

/* mutex used for serializing access to one CI slot */
struct mutex slot_lock;

/* Number of CAMCHANGES that have occurred since last processing */
atomic_t camchange_count;

Expand Down Expand Up @@ -711,14 +714,20 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot, u8 * b
dprintk("%s\n", __func__);


// sanity check
/* sanity check */
if (bytes_write > ca->slot_info[slot].link_buf_size)
return -EINVAL;

/* check if interface is actually waiting for us to read from it, or if a read is in progress */
/* it is possible we are dealing with a single buffer implementation,
thus if there is data available for read or if there is even a read
already in progress, we do nothing but awake the kernel thread to
process the data if necessary. */
if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
goto exitnowrite;
if (status & (STATUSREG_DA | STATUSREG_RE)) {
if (status & STATUSREG_DA)
dvb_ca_en50221_thread_wakeup(ca);

status = -EAGAIN;
goto exitnowrite;
}
Expand Down Expand Up @@ -987,6 +996,8 @@ static int dvb_ca_en50221_thread(void *data)
/* go through all the slots processing them */
for (slot = 0; slot < ca->slot_count; slot++) {

mutex_lock(&ca->slot_info[slot].slot_lock);

// check the cam status + deal with CAMCHANGEs
while (dvb_ca_en50221_check_camstatus(ca, slot)) {
/* clear down an old CI slot if necessary */
Expand Down Expand Up @@ -1122,7 +1133,7 @@ static int dvb_ca_en50221_thread(void *data)

case DVB_CA_SLOTSTATE_RUNNING:
if (!ca->open)
continue;
break;

// poll slots for data
pktcount = 0;
Expand All @@ -1146,6 +1157,8 @@ static int dvb_ca_en50221_thread(void *data)
}
break;
}

mutex_unlock(&ca->slot_info[slot].slot_lock);
}
}

Expand Down Expand Up @@ -1181,13 +1194,15 @@ static int dvb_ca_en50221_io_do_ioctl(struct inode *inode, struct file *file,
switch (cmd) {
case CA_RESET:
for (slot = 0; slot < ca->slot_count; slot++) {
mutex_lock(&ca->slot_info[slot].slot_lock);
if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_NONE) {
dvb_ca_en50221_slot_shutdown(ca, slot);
if (ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)
dvb_ca_en50221_camchange_irq(ca->pub,
slot,
DVB_CA_EN50221_CAMCHANGE_INSERTED);
}
mutex_unlock(&ca->slot_info[slot].slot_lock);
}
ca->next_read_slot = 0;
dvb_ca_en50221_thread_wakeup(ca);
Expand Down Expand Up @@ -1308,7 +1323,9 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file,
goto exit;
}

mutex_lock(&ca->slot_info[slot].slot_lock);
status = dvb_ca_en50221_write_data(ca, slot, fragbuf, fraglen + 2);
mutex_unlock(&ca->slot_info[slot].slot_lock);
if (status == (fraglen + 2)) {
written = 1;
break;
Expand Down Expand Up @@ -1664,6 +1681,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter,
ca->slot_info[i].slot_state = DVB_CA_SLOTSTATE_NONE;
atomic_set(&ca->slot_info[i].camchange_count, 0);
ca->slot_info[i].camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED;
mutex_init(&ca->slot_info[i].slot_lock);
}

if (signal_pending(current)) {
Expand Down
6 changes: 4 additions & 2 deletions drivers/media/dvb/dvb-core/dvb_ca_en50221.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ struct dvb_ca_en50221 {
/* the module owning this structure */
struct module* owner;

/* NOTE: the read_*, write_* and poll_slot_status functions must use locks as
* they may be called from several threads at once */
/* NOTE: the read_*, write_* and poll_slot_status functions will be
* called for different slots concurrently and need to use locks where
* and if appropriate. There will be no concurrent access to one slot.
*/

/* functions for accessing attribute memory on the CAM */
int (*read_attribute_mem)(struct dvb_ca_en50221* ca, int slot, int address);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/af9005-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ static int af9005_get_post_vit_ber(struct dvb_frontend *fe,
u16 * abort_count)
{
u32 loc_cw_count = 0, loc_err_count;
u16 loc_abort_count;
u16 loc_abort_count = 0;
int ret;

ret =
Expand Down
30 changes: 24 additions & 6 deletions drivers/media/dvb/dvb-usb/af9015.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,12 @@ static int af9015_read_config(struct usb_device *udev)

/* IR remote controller */
req.addr = AF9015_EEPROM_IR_MODE;
ret = af9015_rw_udev(udev, &req);
/* first message will timeout often due to possible hw bug */
for (i = 0; i < 4; i++) {
ret = af9015_rw_udev(udev, &req);
if (!ret)
break;
}
if (ret)
goto error;
deb_info("%s: IR mode:%d\n", __func__, val);
Expand Down Expand Up @@ -835,18 +840,19 @@ static int af9015_read_config(struct usb_device *udev)
if (!dvb_usb_af9015_dual_mode)
af9015_config.dual_mode = 0;

/* set buffer size according to USB port speed */
/* Set adapter0 buffer size according to USB port speed, adapter1 buffer
size can be static because it is enabled only USB2.0 */
for (i = 0; i < af9015_properties_count; i++) {
/* USB1.1 set smaller buffersize and disable 2nd adapter */
if (udev->speed == USB_SPEED_FULL) {
af9015_properties[i].adapter->stream.u.bulk.buffersize =
TS_USB11_MAX_PACKET_SIZE;
af9015_properties[i].adapter[0].stream.u.bulk.buffersize
= TS_USB11_MAX_PACKET_SIZE;
/* disable 2nd adapter because we don't have
PID-filters */
af9015_config.dual_mode = 0;
} else {
af9015_properties[i].adapter->stream.u.bulk.buffersize =
TS_USB20_MAX_PACKET_SIZE;
af9015_properties[i].adapter[0].stream.u.bulk.buffersize
= TS_USB20_MAX_PACKET_SIZE;
}
}

Expand Down Expand Up @@ -1254,6 +1260,12 @@ static struct dvb_usb_device_properties af9015_properties[] = {
.type = USB_BULK,
.count = 6,
.endpoint = 0x85,
.u = {
.bulk = {
.buffersize =
TS_USB20_MAX_PACKET_SIZE,
}
}
},
}
},
Expand Down Expand Up @@ -1353,6 +1365,12 @@ static struct dvb_usb_device_properties af9015_properties[] = {
.type = USB_BULK,
.count = 6,
.endpoint = 0x85,
.u = {
.bulk = {
.buffersize =
TS_USB20_MAX_PACKET_SIZE,
}
}
},
}
},
Expand Down
18 changes: 15 additions & 3 deletions drivers/media/dvb/dvb-usb/dib0700_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,9 @@ struct usb_device_id dib0700_usb_id_table[] = {
{ USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000H) },
/* 40 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E) },
{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E_SE) },
{ USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_EXPRESS) },
{ USB_DEVICE(USB_VID_TERRATEC,
USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2) },
{ 0 } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
Expand Down Expand Up @@ -1537,7 +1540,8 @@ struct dvb_usb_device_properties dib0700_devices[] = {
{ "DiBcom STK7700D reference design",
{ &dib0700_usb_id_table[14], NULL },
{ NULL },
}
},

},

.rc_interval = DEFAULT_RC_INTERVAL,
Expand All @@ -1557,7 +1561,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
},
},

.num_device_descs = 2,
.num_device_descs = 3,
.devices = {
{ "ASUS My Cinema U3000 Mini DVBT Tuner",
{ &dib0700_usb_id_table[23], NULL },
Expand All @@ -1566,6 +1570,10 @@ struct dvb_usb_device_properties dib0700_devices[] = {
{ "Yuan EC372S",
{ &dib0700_usb_id_table[31], NULL },
{ NULL },
},
{ "Terratec Cinergy T Express",
{ &dib0700_usb_id_table[42], NULL },
{ NULL },
}
},

Expand Down Expand Up @@ -1653,7 +1661,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
}
},

.num_device_descs = 4,
.num_device_descs = 5,
.devices = {
{ "DiBcom STK7070PD reference design",
{ &dib0700_usb_id_table[17], NULL },
Expand All @@ -1670,6 +1678,10 @@ struct dvb_usb_device_properties dib0700_devices[] = {
{ "Hauppauge Nova-TD-500 (84xxx)",
{ &dib0700_usb_id_table[36], NULL },
{ NULL },
},
{ "Terratec Cinergy DT USB XS Diversity",
{ &dib0700_usb_id_table[43], NULL },
{ NULL },
}
}
}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/dvb/dvb-usb/dvb-usb-ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@
#define USB_PID_AVERMEDIA_A309 0xa309
#define USB_PID_TECHNOTREND_CONNECT_S2400 0x3006
#define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a
#define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2 0x0081
#define USB_PID_TERRATEC_CINERGY_HT_USB_XE 0x0058
#define USB_PID_TERRATEC_CINERGY_HT_EXPRESS 0x0060
#define USB_PID_TERRATEC_CINERGY_T_EXPRESS 0x0062
#define USB_PID_TERRATEC_CINERGY_T_XXS 0x0078
#define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e
#define USB_PID_PINNACLE_PCTV2000E 0x022c
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/frontends/drx397xD.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ static int drx_tune(struct drx397xD_state *s,
u32 edi = 0, ebx = 0, ebp = 0, edx = 0;
u16 v20 = 0, v1E = 0, v16 = 0, v14 = 0, v12 = 0, v10 = 0, v0E = 0;

int rc, df_tuner;
int rc, df_tuner = 0;
int a, b, c, d;
pr_debug("%s %d\n", __func__, s->config.d60);

Expand Down
7 changes: 4 additions & 3 deletions drivers/media/dvb/frontends/s5h1409.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,6 @@ static int s5h1409_set_frontend(struct dvb_frontend *fe,

s5h1409_enable_modulation(fe, p->u.vsb.modulation);

/* Allow the demod to settle */
msleep(100);

if (fe->ops.tuner_ops.set_params) {
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
Expand All @@ -562,6 +559,10 @@ static int s5h1409_set_frontend(struct dvb_frontend *fe,
s5h1409_set_qam_interleave_mode(fe);
}

/* Issue a reset to the demod so it knows to resync against the
newly tuned frequency */
s5h1409_softreset(fe);

return 0;
}

Expand Down
3 changes: 3 additions & 0 deletions drivers/media/dvb/frontends/stb0899_algo.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ inline u32 stb0899_do_div(u64 n, u32 d)
return n;
}

#if 0
/* These functions are currently unused */
/*
* stb0899_calc_srate
* Compute symbol rate
Expand Down Expand Up @@ -63,6 +65,7 @@ static u32 stb0899_get_srate(struct stb0899_state *state)

return stb0899_calc_srate(internal->master_clk, sfr);
}
#endif

/*
* stb0899_set_srate
Expand Down
1 change: 1 addition & 0 deletions drivers/media/dvb/ttpci/budget.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ static void frontend_init(struct budget *budget)
budget->dvb_frontend = dvb_attach(l64781_attach, &grundig_29504_401_config, &budget->i2c_adap);
if (budget->dvb_frontend) {
budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params;
budget->dvb_frontend->tuner_priv = NULL;
break;
}
break;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/ttusb-dec/ttusb_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
static int ttusb_dec_init_stb(struct ttusb_dec *dec)
{
int result;
unsigned int mode, model, version;
unsigned int mode = 0, model = 0, version = 0;

dprintk("%s\n", __func__);

Expand Down
Loading

0 comments on commit 9e6235e

Please sign in to comment.