Skip to content

Commit

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

* 'media_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  [media] mantis_pci: remove asm/pgtable.h include
  [media] tda829x: fix regression in probe functions
  [media] mceusb: don't claim multifunction device non-IR parts
  [media] nuvoton-cir: fix wake from suspend
  [media] cx18: Add support for Hauppauge HVR-1600 models with s5h1411
  [media] ivtv: Fix corrective action taken upon DMA ERR interrupt to avoid hang
  [media] cx25840: fix probing of cx2583x chips
  [media] cx23885: Remove unused 'err:' labels to quiet compiler warning
  [media] cx23885: Revert "Check for slave nack on all transactions"
  [media] DiB7000M: add pid filtering
  [media] Fix sysfs rc protocol lookup for rc-5-sz
  [media] au0828: fix VBI handling when in V4L2 streaming mode
  [media] ir-raw: Properly initialize the IR event (BZ#27202)
  [media] s2255drv: firmware re-loading changes
  [media] Fix double free of video_device in mem2mem_testdev
  [media] DM04/QQBOX memcpy to const char fix
  • Loading branch information
Linus Torvalds committed Mar 10, 2011
2 parents 4c418ba + a4e36e6 commit 9179746
Show file tree
Hide file tree
Showing 21 changed files with 283 additions and 63 deletions.
14 changes: 7 additions & 7 deletions drivers/media/common/tuners/tda8290.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,13 +658,13 @@ static int tda8290_probe(struct tuner_i2c_props *i2c_props)
#define TDA8290_ID 0x89
u8 reg = 0x1f, id;
struct i2c_msg msg_read[] = {
{ .addr = 0x4b, .flags = 0, .len = 1, .buf = &reg },
{ .addr = 0x4b, .flags = I2C_M_RD, .len = 1, .buf = &id },
{ .addr = i2c_props->addr, .flags = 0, .len = 1, .buf = &reg },
{ .addr = i2c_props->addr, .flags = I2C_M_RD, .len = 1, .buf = &id },
};

/* detect tda8290 */
if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) {
printk(KERN_WARNING "%s: tda8290 couldn't read register 0x%02x\n",
printk(KERN_WARNING "%s: couldn't read register 0x%02x\n",
__func__, reg);
return -ENODEV;
}
Expand All @@ -685,13 +685,13 @@ static int tda8295_probe(struct tuner_i2c_props *i2c_props)
#define TDA8295C2_ID 0x8b
u8 reg = 0x2f, id;
struct i2c_msg msg_read[] = {
{ .addr = 0x4b, .flags = 0, .len = 1, .buf = &reg },
{ .addr = 0x4b, .flags = I2C_M_RD, .len = 1, .buf = &id },
{ .addr = i2c_props->addr, .flags = 0, .len = 1, .buf = &reg },
{ .addr = i2c_props->addr, .flags = I2C_M_RD, .len = 1, .buf = &id },
};

/* detect tda8290 */
/* detect tda8295 */
if (i2c_transfer(i2c_props->adap, msg_read, 2) != 2) {
printk(KERN_WARNING "%s: tda8290 couldn't read register 0x%02x\n",
printk(KERN_WARNING "%s: couldn't read register 0x%02x\n",
__func__, reg);
return -ENODEV;
}
Expand Down
21 changes: 19 additions & 2 deletions drivers/media/dvb/dvb-usb/dib0700_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,23 @@ static int dib7070p_tuner_attach(struct dvb_usb_adapter *adap)
return 0;
}

static int stk7700p_pid_filter(struct dvb_usb_adapter *adapter, int index,
u16 pid, int onoff)
{
struct dib0700_state *st = adapter->dev->priv;
if (st->is_dib7000pc)
return dib7000p_pid_filter(adapter->fe, index, pid, onoff);
return dib7000m_pid_filter(adapter->fe, index, pid, onoff);
}

static int stk7700p_pid_filter_ctrl(struct dvb_usb_adapter *adapter, int onoff)
{
struct dib0700_state *st = adapter->dev->priv;
if (st->is_dib7000pc)
return dib7000p_pid_filter_ctrl(adapter->fe, onoff);
return dib7000m_pid_filter_ctrl(adapter->fe, onoff);
}

static int stk70x0p_pid_filter(struct dvb_usb_adapter *adapter, int index, u16 pid, int onoff)
{
return dib7000p_pid_filter(adapter->fe, index, pid, onoff);
Expand Down Expand Up @@ -1875,8 +1892,8 @@ struct dvb_usb_device_properties dib0700_devices[] = {
{
.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF,
.pid_filter_count = 32,
.pid_filter = stk70x0p_pid_filter,
.pid_filter_ctrl = stk70x0p_pid_filter_ctrl,
.pid_filter = stk7700p_pid_filter,
.pid_filter_ctrl = stk7700p_pid_filter_ctrl,
.frontend_attach = stk7700p_frontend_attach,
.tuner_attach = stk7700p_tuner_attach,

Expand Down
6 changes: 3 additions & 3 deletions drivers/media/dvb/dvb-usb/lmedm04.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ static int lme2510_download_firmware(struct usb_device *dev,
}

/* Default firmware for LME2510C */
const char lme_firmware[50] = "dvb-usb-lme2510c-s7395.fw";
char lme_firmware[50] = "dvb-usb-lme2510c-s7395.fw";

static void lme_coldreset(struct usb_device *dev)
{
Expand Down Expand Up @@ -1006,7 +1006,7 @@ static struct dvb_usb_device_properties lme2510c_properties = {
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
.usb_ctrl = DEVICE_SPECIFIC,
.download_firmware = lme2510_download_firmware,
.firmware = lme_firmware,
.firmware = (const char *)&lme_firmware,
.size_of_priv = sizeof(struct lme2510_state),
.num_adapters = 1,
.adapter = {
Expand Down Expand Up @@ -1109,5 +1109,5 @@ module_exit(lme2510_module_exit);

MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>");
MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0");
MODULE_VERSION("1.74");
MODULE_VERSION("1.75");
MODULE_LICENSE("GPL");
19 changes: 19 additions & 0 deletions drivers/media/dvb/frontends/dib7000m.c
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,25 @@ struct i2c_adapter * dib7000m_get_i2c_master(struct dvb_frontend *demod, enum di
}
EXPORT_SYMBOL(dib7000m_get_i2c_master);

int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff)
{
struct dib7000m_state *state = fe->demodulator_priv;
u16 val = dib7000m_read_word(state, 294 + state->reg_offs) & 0xffef;
val |= (onoff & 0x1) << 4;
dprintk("PID filter enabled %d", onoff);
return dib7000m_write_word(state, 294 + state->reg_offs, val);
}
EXPORT_SYMBOL(dib7000m_pid_filter_ctrl);

int dib7000m_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff)
{
struct dib7000m_state *state = fe->demodulator_priv;
dprintk("PID filter: index %x, PID %d, OnOff %d", id, pid, onoff);
return dib7000m_write_word(state, 300 + state->reg_offs + id,
onoff ? (1 << 13) | pid : 0);
}
EXPORT_SYMBOL(dib7000m_pid_filter);

#if 0
/* used with some prototype boards */
int dib7000m_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods,
Expand Down
15 changes: 15 additions & 0 deletions drivers/media/dvb/frontends/dib7000m.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ extern struct dvb_frontend *dib7000m_attach(struct i2c_adapter *i2c_adap,
extern struct i2c_adapter *dib7000m_get_i2c_master(struct dvb_frontend *,
enum dibx000_i2c_interface,
int);
extern int dib7000m_pid_filter(struct dvb_frontend *, u8 id, u16 pid, u8 onoff);
extern int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff);
#else
static inline
struct dvb_frontend *dib7000m_attach(struct i2c_adapter *i2c_adap,
Expand All @@ -63,6 +65,19 @@ struct i2c_adapter *dib7000m_get_i2c_master(struct dvb_frontend *demod,
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
static inline int dib7000m_pid_filter(struct dvb_frontend *fe, u8 id,
u16 pid, u8 onoff)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV;
}

static inline int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe,
uint8_t onoff)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return -ENODEV;
}
#endif

/* TODO
Expand Down
1 change: 0 additions & 1 deletion drivers/media/dvb/mantis/mantis_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <linux/kmod.h>
#include <linux/vmalloc.h>
Expand Down
3 changes: 1 addition & 2 deletions drivers/media/rc/ir-raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ int ir_raw_event_store_edge(struct rc_dev *dev, enum raw_event_type type)
{
ktime_t now;
s64 delta; /* ns */
struct ir_raw_event ev;
DEFINE_IR_RAW_EVENT(ev);
int rc = 0;

if (!dev->raw)
Expand All @@ -125,7 +125,6 @@ int ir_raw_event_store_edge(struct rc_dev *dev, enum raw_event_type type)
* being called for the first time, note that delta can't
* possibly be negative.
*/
ev.duration = 0;
if (delta > IR_MAX_DURATION || !dev->raw->last_type)
type |= IR_START_EVENT;
else
Expand Down
27 changes: 15 additions & 12 deletions drivers/media/rc/mceusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,18 @@ enum mceusb_model_type {
MCE_GEN2_TX_INV,
POLARIS_EVK,
CX_HYBRID_TV,
MULTIFUNCTION,
};

struct mceusb_model {
u32 mce_gen1:1;
u32 mce_gen2:1;
u32 mce_gen3:1;
u32 tx_mask_normal:1;
u32 is_polaris:1;
u32 no_tx:1;

int ir_intfnum;

const char *rc_map; /* Allow specify a per-board map */
const char *name; /* per-board name */
};
Expand All @@ -179,7 +181,6 @@ static const struct mceusb_model mceusb_model[] = {
.tx_mask_normal = 1,
},
[POLARIS_EVK] = {
.is_polaris = 1,
/*
* In fact, the EVK is shipped without
* remotes, but we should have something handy,
Expand All @@ -189,10 +190,13 @@ static const struct mceusb_model mceusb_model[] = {
.name = "Conexant Hybrid TV (cx231xx) MCE IR",
},
[CX_HYBRID_TV] = {
.is_polaris = 1,
.no_tx = 1, /* tx isn't wired up at all */
.name = "Conexant Hybrid TV (cx231xx) MCE IR",
},
[MULTIFUNCTION] = {
.mce_gen2 = 1,
.ir_intfnum = 2,
},
};

static struct usb_device_id mceusb_dev_table[] = {
Expand All @@ -216,8 +220,9 @@ static struct usb_device_id mceusb_dev_table[] = {
{ USB_DEVICE(VENDOR_PHILIPS, 0x206c) },
/* Philips/Spinel plus IR transceiver for ASUS */
{ USB_DEVICE(VENDOR_PHILIPS, 0x2088) },
/* Realtek MCE IR Receiver */
{ USB_DEVICE(VENDOR_REALTEK, 0x0161) },
/* Realtek MCE IR Receiver and card reader */
{ USB_DEVICE(VENDOR_REALTEK, 0x0161),
.driver_info = MULTIFUNCTION },
/* SMK/Toshiba G83C0004D410 */
{ USB_DEVICE(VENDOR_SMK, 0x031d),
.driver_info = MCE_GEN2_TX_INV },
Expand Down Expand Up @@ -1101,7 +1106,7 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
bool is_gen3;
bool is_microsoft_gen1;
bool tx_mask_normal;
bool is_polaris;
int ir_intfnum;

dev_dbg(&intf->dev, "%s called\n", __func__);

Expand All @@ -1110,13 +1115,11 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
is_gen3 = mceusb_model[model].mce_gen3;
is_microsoft_gen1 = mceusb_model[model].mce_gen1;
tx_mask_normal = mceusb_model[model].tx_mask_normal;
is_polaris = mceusb_model[model].is_polaris;
ir_intfnum = mceusb_model[model].ir_intfnum;

if (is_polaris) {
/* Interface 0 is IR */
if (idesc->desc.bInterfaceNumber)
return -ENODEV;
}
/* There are multi-function devices with non-IR interfaces */
if (idesc->desc.bInterfaceNumber != ir_intfnum)
return -ENODEV;

/* step through the endpoints to find first bulk in and out endpoint */
for (i = 0; i < idesc->desc.bNumEndpoints; ++i) {
Expand Down
5 changes: 3 additions & 2 deletions drivers/media/rc/nuvoton-cir.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,9 @@ static void nvt_cir_regs_init(struct nvt_dev *nvt)

static void nvt_cir_wake_regs_init(struct nvt_dev *nvt)
{
/* set number of bytes needed for wake key comparison (default 67) */
nvt_cir_wake_reg_write(nvt, CIR_WAKE_FIFO_LEN, CIR_WAKE_FIFO_CMP_DEEP);
/* set number of bytes needed for wake from s3 (default 65) */
nvt_cir_wake_reg_write(nvt, CIR_WAKE_FIFO_CMP_BYTES,
CIR_WAKE_FIFO_CMP_DEEP);

/* set tolerance/variance allowed per byte during wake compare */
nvt_cir_wake_reg_write(nvt, CIR_WAKE_CMP_TOLERANCE,
Expand Down
7 changes: 5 additions & 2 deletions drivers/media/rc/nuvoton-cir.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,11 @@ struct nvt_dev {
#define CIR_WAKE_IRFIFOSTS_RX_EMPTY 0x20
#define CIR_WAKE_IRFIFOSTS_RX_FULL 0x10

/* CIR Wake FIFO buffer is 67 bytes long */
#define CIR_WAKE_FIFO_LEN 67
/*
* The CIR Wake FIFO buffer is 67 bytes long, but the stock remote wakes
* the system comparing only 65 bytes (fails with this set to 67)
*/
#define CIR_WAKE_FIFO_CMP_BYTES 65
/* CIR Wake byte comparison tolerance */
#define CIR_WAKE_CMP_TOLERANCE 5

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/rc/rc-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ static ssize_t store_protocols(struct device *device,
count++;
} else {
for (i = 0; i < ARRAY_SIZE(proto_names); i++) {
if (!strncasecmp(tmp, proto_names[i].name, strlen(proto_names[i].name))) {
if (!strcasecmp(tmp, proto_names[i].name)) {
tmp += strlen(proto_names[i].name);
mask = proto_names[i].type;
break;
Expand Down
28 changes: 24 additions & 4 deletions drivers/media/video/au0828/au0828-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,12 @@ static int vidioc_reqbufs(struct file *file, void *priv,
if (rc < 0)
return rc;

return videobuf_reqbufs(&fh->vb_vidq, rb);
if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
rc = videobuf_reqbufs(&fh->vb_vidq, rb);
else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE)
rc = videobuf_reqbufs(&fh->vb_vbiq, rb);

return rc;
}

static int vidioc_querybuf(struct file *file, void *priv,
Expand All @@ -1772,7 +1777,12 @@ static int vidioc_querybuf(struct file *file, void *priv,
if (rc < 0)
return rc;

return videobuf_querybuf(&fh->vb_vidq, b);
if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
rc = videobuf_querybuf(&fh->vb_vidq, b);
else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE)
rc = videobuf_querybuf(&fh->vb_vbiq, b);

return rc;
}

static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b)
Expand All @@ -1785,7 +1795,12 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b)
if (rc < 0)
return rc;

return videobuf_qbuf(&fh->vb_vidq, b);
if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
rc = videobuf_qbuf(&fh->vb_vidq, b);
else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE)
rc = videobuf_qbuf(&fh->vb_vbiq, b);

return rc;
}

static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
Expand All @@ -1806,7 +1821,12 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
dev->greenscreen_detected = 0;
}

return videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK);
if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
rc = videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK);
else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE)
rc = videobuf_dqbuf(&fh->vb_vbiq, b, file->f_flags & O_NONBLOCK);

return rc;
}

static struct v4l2_file_operations au0828_v4l_fops = {
Expand Down
Loading

0 comments on commit 9179746

Please sign in to comment.