Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (48 commits)
  V4L/DVB (8001): dib0070: fix dib0070_attach when !CONFIG_DVB_TUNER_DIB0070
  V4L/DVB (8000): tda827x: fix NULL pointer in tda827xa_lna_gain
  V4L/DVB (7990): Fix entry for PowerColor RA 330 and make it run with firmware version 2.7
  V4L/DVB (7983): tda18271_calc_rf_cal must return the return value of tda18271_lookup_map
  V4L/DVB (7978): cx18: explicitly test for XC2028 tuner
  V4L/DVB (7977): cx18: fix init order and remove duplicate open_on_first_use.
  V4L/DVB (7975): saa7134_empress
  V4L/DVB (7974): fix MEDIA_TUNER && FW_LOADER build error
  V4L/DVB (7972): or51132.c: unaligned
  V4L/DVB (7971): usb: unaligned
  V4L/DVB (7970): mix trivial endianness annotations
  V4L/DVB (7969): m920x: unaligned access
  V4L/DVB (7968): zoran: endianness annotations
  V4L/DVB (7967): bt8xx: unaligned access
  V4L/DVB (7966): cx18: direct dereferencing of iomem
  V4L/DVB (7965): annotate bcx_riscmem
  V4L/DVB (7964): cx18 iomem annotations
  V4L/DVB (7963): ivtv: trivial annotations
  V4L/DVB (7962): ttusb endianness annotations and fixes
  V4L/DVB (7961): fix endianness bug in dib0700_devices.c
  ...
  • Loading branch information
Linus Torvalds committed Jun 5, 2008
2 parents 5965087 + be573e7 commit b2ab26a
Show file tree
Hide file tree
Showing 65 changed files with 434 additions and 348 deletions.
2 changes: 1 addition & 1 deletion Documentation/video4linux/CARDLIST.cx88
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
59 -> DViCO FusionHDTV 5 PCI nano [18ac:d530]
60 -> Pinnacle Hybrid PCTV [12ab:1788]
61 -> Winfast TV2000 XP Global [107d:6f18]
62 -> PowerColor Real Angel 330 [14f1:ea3d]
62 -> PowerColor RA330 [14f1:ea3d]
63 -> Geniatech X8000-MT DVBT [14f1:8852]
64 -> DViCO FusionHDTV DVB-T PRO [18ac:db30]
65 -> DViCO FusionHDTV 7 Gold [18ac:d610]
Expand Down
4 changes: 3 additions & 1 deletion Documentation/video4linux/cx18.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Some notes regarding the cx18 driver for the Conexant CX23418 MPEG
encoder chip:

1) The only hardware currently supported is the Hauppauge HVR-1600.
1) The only hardware currently supported is the Hauppauge HVR-1600
card and the Compro VideoMate H900 (note that this card only
supports analog input, it has no digital tuner!).

2) Some people have problems getting the i2c bus to work. Cause unknown.
The symptom is that the eeprom cannot be read and the card is
Expand Down
7 changes: 1 addition & 6 deletions drivers/media/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
# Makefile for the kernel multimedia device drivers.
#

obj-y := common/

obj-$(CONFIG_VIDEO_MEDIA) += common/

# Since hybrid devices are here, should be compiled if DVB and/or V4L
obj-$(CONFIG_VIDEO_MEDIA) += video/
obj-y += common/ video/

obj-$(CONFIG_VIDEO_DEV) += radio/
obj-$(CONFIG_DVB_CORE) += dvb/
1 change: 1 addition & 0 deletions drivers/media/common/tuners/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ config MEDIA_TUNER
tristate
default VIDEO_MEDIA && I2C
depends on VIDEO_MEDIA && I2C
select FW_LOADER if !MEDIA_TUNER_CUSTOMIZE && HOTPLUG
select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMIZE && HOTPLUG
select MEDIA_TUNER_XC5000 if !MEDIA_TUNER_CUSTOMIZE && HOTPLUG
select MEDIA_TUNER_MT20XX if !MEDIA_TUNER_CUSTOMIZE
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/common/tuners/mxl5005s.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ enum {
MXL_QAM,
MXL_ANALOG_CABLE,
MXL_ANALOG_OTA
} tuner_modu_type;
};

/* MXL5005 Tuner Register Struct */
struct TunerReg {
Expand Down Expand Up @@ -194,7 +194,7 @@ enum {
RFSYN_DIVM, /* 88 */
DN_BYPASS_AGC_I2C /* 89 */
#endif
} MXL5005_ControlName;
};

/*
* The following context is source code provided by MaxLinear.
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/common/tuners/tda18271-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,11 @@ int tda18271_calc_rf_cal(struct dvb_frontend *fe, u32 *freq)
unsigned char *regs = priv->tda18271_regs;
u8 val;

tda18271_lookup_map(fe, RF_CAL, freq, &val);
int ret = tda18271_lookup_map(fe, RF_CAL, freq, &val);

regs[R_EB14] = val;

return 0;
return ret;
}

/*
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/common/tuners/tda827x.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,13 @@ static void tda827xa_lna_gain(struct dvb_frontend *fe, int high,
unsigned char buf[] = {0x22, 0x01};
int arg;
int gp_func;
struct i2c_msg msg = { .addr = priv->cfg->switch_addr, .flags = 0,
.buf = buf, .len = sizeof(buf) };
struct i2c_msg msg = { .flags = 0, .buf = buf, .len = sizeof(buf) };

if (NULL == priv->cfg) {
dprintk("tda827x_config not defined, cannot set LNA gain!\n");
return;
}
msg.addr = priv->cfg->switch_addr;
if (priv->cfg->config) {
if (high)
dprintk("setting LNA to high gain\n");
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/common/tuners/tea5761.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe,
{
struct tea5761_priv *priv = NULL;

if (tea5761_autodetection(i2c_adap, i2c_addr) == EINVAL)
if (tea5761_autodetection(i2c_adap, i2c_addr) != 0)
return NULL;

priv = kzalloc(sizeof(struct tea5761_priv), GFP_KERNEL);
Expand Down
8 changes: 8 additions & 0 deletions drivers/media/common/tuners/tuner-i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,12 @@ __fail: \
__ret; \
})

#define hybrid_tuner_report_instance_count(state) \
({ \
int __ret = 0; \
if (state) \
__ret = state->i2c_props.count; \
__ret; \
})

#endif /* __TUNER_I2C_H__ */
6 changes: 4 additions & 2 deletions drivers/media/common/tuners/tuner-simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,8 +1018,10 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
fe->ops.i2c_gate_ctrl(fe, 1);

if (1 != i2c_transfer(i2c_adap, &msg, 1))
tuner_warn("unable to probe %s, proceeding anyway.",
tuners[type].name);
printk(KERN_WARNING "tuner-simple %d-%04x: "
"unable to probe %s, proceeding anyway.",
i2c_adapter_id(i2c_adap), i2c_addr,
tuners[type].name);

if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
Expand Down
87 changes: 41 additions & 46 deletions drivers/media/common/tuners/tuner-xc2028.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module_param_string(firmware_name, firmware_name, sizeof(firmware_name), 0);
MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the "
"default firmware name\n");

static LIST_HEAD(xc2028_list);
static LIST_HEAD(hybrid_tuner_instance_list);
static DEFINE_MUTEX(xc2028_list_mutex);

/* struct for storing firmware table */
Expand All @@ -68,12 +68,11 @@ struct firmware_properties {
};

struct xc2028_data {
struct list_head xc2028_list;
struct list_head hybrid_tuner_instance_list;
struct tuner_i2c_props i2c_props;
int (*tuner_callback) (void *dev,
int command, int arg);
void *video_dev;
int count;
__u32 frequency;

struct firmware_description *firm;
Expand Down Expand Up @@ -1072,20 +1071,19 @@ static int xc2028_dvb_release(struct dvb_frontend *fe)

mutex_lock(&xc2028_list_mutex);

priv->count--;

if (!priv->count) {
list_del(&priv->xc2028_list);

/* only perform final cleanup if this is the last instance */
if (hybrid_tuner_report_instance_count(priv) == 1) {
kfree(priv->ctrl.fname);

free_firmware(priv);
kfree(priv);
fe->tuner_priv = NULL;
}

if (priv)
hybrid_tuner_release_state(priv);

mutex_unlock(&xc2028_list_mutex);

fe->tuner_priv = NULL;

return 0;
}

Expand Down Expand Up @@ -1150,7 +1148,7 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
struct xc2028_config *cfg)
{
struct xc2028_data *priv;
void *video_dev;
int instance;

if (debug)
printk(KERN_DEBUG "xc2028: Xcv2028/3028 init called!\n");
Expand All @@ -1163,48 +1161,40 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
return NULL;
}

video_dev = cfg->i2c_adap->algo_data;

if (debug)
printk(KERN_DEBUG "xc2028: video_dev =%p\n", video_dev);

mutex_lock(&xc2028_list_mutex);

list_for_each_entry(priv, &xc2028_list, xc2028_list) {
if (&priv->i2c_props.adap->dev == &cfg->i2c_adap->dev) {
video_dev = NULL;
if (debug)
printk(KERN_DEBUG "xc2028: reusing device\n");

break;
}
}

if (video_dev) {
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (priv == NULL) {
mutex_unlock(&xc2028_list_mutex);
return NULL;
}

priv->i2c_props.addr = cfg->i2c_addr;
priv->i2c_props.adap = cfg->i2c_adap;
priv->i2c_props.name = "xc2028";

priv->video_dev = video_dev;
instance = hybrid_tuner_request_state(struct xc2028_data, priv,
hybrid_tuner_instance_list,
cfg->i2c_adap, cfg->i2c_addr,
"xc2028");
switch (instance) {
case 0:
/* memory allocation failure */
goto fail;
break;
case 1:
/* new tuner instance */
priv->tuner_callback = cfg->callback;
priv->ctrl.max_len = 13;

mutex_init(&priv->lock);

list_add_tail(&priv->xc2028_list, &xc2028_list);
}

fe->tuner_priv = priv;
priv->count++;
/* analog side (tuner-core) uses i2c_adap->algo_data.
* digital side is not guaranteed to have algo_data defined.
*
* digital side will always have fe->dvb defined.
* analog side (tuner-core) doesn't (yet) define fe->dvb.
*/
priv->video_dev = ((fe->dvb) && (fe->dvb->priv)) ?
fe->dvb->priv : cfg->i2c_adap->algo_data;

if (debug)
printk(KERN_DEBUG "xc2028: usage count is %i\n", priv->count);
fe->tuner_priv = priv;
break;
case 2:
/* existing tuner instance */
fe->tuner_priv = priv;
break;
}

memcpy(&fe->ops.tuner_ops, &xc2028_dvb_tuner_ops,
sizeof(xc2028_dvb_tuner_ops));
Expand All @@ -1217,6 +1207,11 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
mutex_unlock(&xc2028_list_mutex);

return fe;
fail:
mutex_unlock(&xc2028_list_mutex);

xc2028_dvb_release(fe);
return NULL;
}

EXPORT_SYMBOL(xc2028_attach);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/b2c2/flexcop-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ static void flexcop_usb_transfer_exit(struct flexcop_usb *fc_usb)

static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
{
u16 frame_size = fc_usb->uintf->cur_altsetting->endpoint[0].desc.wMaxPacketSize;
u16 frame_size = le16_to_cpu(fc_usb->uintf->cur_altsetting->endpoint[0].desc.wMaxPacketSize);
int bufsize = B2C2_USB_NUM_ISO_URB * B2C2_USB_FRAMES_PER_ISO * frame_size,i,j,ret;
int buffer_offset = 0;

Expand Down
Loading

0 comments on commit b2ab26a

Please sign in to comment.