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: (42 commits)
  V4L/DVB (8108): Fix open/close race in saa7134
  V4L/DVB (8100): V4L/vivi: fix possible memory leak in vivi_fillbuff
  V4L/DVB (8097): xc5000: check device hardware state to determine if firmware download is needed
  V4L/DVB (8096): au8522: prevent false-positive lock status
  V4L/DVB (8092): videodev: simplify and fix standard enumeration
  V4L/DVB (8075): stv0299: Uncorrected block count and bit error rate fixed
  V4L/DVB (8074): av7110: OSD transfers should not be interrupted
  V4L/DVB (8073): av7110: Catch another type of ARM crash
  V4L/DVB (8071): tda10023: Fix possible kernel oops during initialisation
  V4L/DVB (8069): cx18: Fix S-Video and Compsite inputs for the Yuan MPC718 and enable card entry
  V4L/DVB (8068): cx18: Add I2C slave reset via GPIO upon initialization
  V4L/DVB (8067): cx18: Fix firmware load for case when digital capture happens first
  V4L/DVB (8066): cx18: Fix audio mux input definitions for HVR-1600 Line In 2 and FM radio
  V4L/DVB (8063): cx18: Fix unintended auto configurations in cx18-av-core
  V4L/DVB (8061): cx18: only select tuner / frontend modules if !DVB_FE_CUSTOMISE
  V4L/DVB (8048): saa7134: Fix entries for Avermedia A16d and Avermedia E506
  V4L/DVB (8044): au8522: tuning optimizations
  V4L/DVB (8043): au0828: add support for additional USB device id's
  V4L/DVB (8042): DVB-USB UMT-010 channel scan oops
  V4L/DVB (8040): soc-camera: remove soc_camera_host_class class
  ...
  • Loading branch information
Linus Torvalds committed Jun 29, 2008
2 parents 0acbbee + a178987 commit 1702b52
Show file tree
Hide file tree
Showing 43 changed files with 608 additions and 446 deletions.
2 changes: 1 addition & 1 deletion Documentation/video4linux/CARDLIST.au0828
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0 -> Unknown board (au0828)
1 -> Hauppauge HVR950Q (au0828) [2040:7200]
1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721f,2040:7280,0fd9:0008]
2 -> Hauppauge HVR850 (au0828) [2040:7240]
3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620]
38 changes: 38 additions & 0 deletions drivers/media/common/ir-keymaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2201,3 +2201,41 @@ IR_KEYTAB_TYPE ir_codes_powercolor_real_angel[IR_KEYTAB_SIZE] = {
[0x25] = KEY_POWER, /* power */
};
EXPORT_SYMBOL_GPL(ir_codes_powercolor_real_angel);

IR_KEYTAB_TYPE ir_codes_avermedia_a16d[IR_KEYTAB_SIZE] = {
[0x20] = KEY_LIST,
[0x00] = KEY_POWER,
[0x28] = KEY_1,
[0x18] = KEY_2,
[0x38] = KEY_3,
[0x24] = KEY_4,
[0x14] = KEY_5,
[0x34] = KEY_6,
[0x2c] = KEY_7,
[0x1c] = KEY_8,
[0x3c] = KEY_9,
[0x12] = KEY_SUBTITLE,
[0x22] = KEY_0,
[0x32] = KEY_REWIND,
[0x3a] = KEY_SHUFFLE,
[0x02] = KEY_PRINT,
[0x11] = KEY_CHANNELDOWN,
[0x31] = KEY_CHANNELUP,
[0x0c] = KEY_ZOOM,
[0x1e] = KEY_VOLUMEDOWN,
[0x3e] = KEY_VOLUMEUP,
[0x0a] = KEY_MUTE,
[0x04] = KEY_AUDIO,
[0x26] = KEY_RECORD,
[0x06] = KEY_PLAY,
[0x36] = KEY_STOP,
[0x16] = KEY_PAUSE,
[0x2e] = KEY_REWIND,
[0x0e] = KEY_FASTFORWARD,
[0x30] = KEY_TEXT,
[0x21] = KEY_GREEN,
[0x01] = KEY_BLUE,
[0x08] = KEY_EPG,
[0x2a] = KEY_MENU,
};
EXPORT_SYMBOL_GPL(ir_codes_avermedia_a16d);
10 changes: 9 additions & 1 deletion drivers/media/common/tuners/tda18271-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,17 @@ int tda18271_calc_rf_cal(struct dvb_frontend *fe, u32 *freq)
u8 val;

int ret = tda18271_lookup_map(fe, RF_CAL, freq, &val);
/* The TDA18271HD/C1 rf_cal map lookup is expected to go out of range
* for frequencies above 61.1 MHz. In these cases, the internal RF
* tracking filters calibration mechanism is used.
*
* There is no need to warn the user about this.
*/
if (ret < 0)
goto fail;

regs[R_EB14] = val;

fail:
return ret;
}

Expand Down
53 changes: 34 additions & 19 deletions drivers/media/common/tuners/tda18271-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ static inline int charge_pump_source(struct dvb_frontend *fe, int force)
TDA18271_MAIN_PLL, force);
}

static inline void tda18271_set_if_notch(struct dvb_frontend *fe)
{
struct tda18271_priv *priv = fe->tuner_priv;
unsigned char *regs = priv->tda18271_regs;

switch (priv->mode) {
case TDA18271_ANALOG:
regs[R_MPD] &= ~0x80; /* IF notch = 0 */
break;
case TDA18271_DIGITAL:
regs[R_MPD] |= 0x80; /* IF notch = 1 */
break;
}
}

static int tda18271_channel_configuration(struct dvb_frontend *fe,
struct tda18271_std_map_item *map,
u32 freq, u32 bw)
Expand All @@ -60,25 +75,18 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
regs[R_EP3] &= ~0x1f; /* clear std bits */
regs[R_EP3] |= (map->agc_mode << 3) | map->std;

/* set rfagc to high speed mode */
regs[R_EP3] &= ~0x04;
if (priv->id == TDA18271HDC2) {
/* set rfagc to high speed mode */
regs[R_EP3] &= ~0x04;
}

/* set cal mode to normal */
regs[R_EP4] &= ~0x03;

/* update IF output level & IF notch frequency */
/* update IF output level */
regs[R_EP4] &= ~0x1c; /* clear if level bits */
regs[R_EP4] |= (map->if_lvl << 2);

switch (priv->mode) {
case TDA18271_ANALOG:
regs[R_MPD] &= ~0x80; /* IF notch = 0 */
break;
case TDA18271_DIGITAL:
regs[R_MPD] |= 0x80; /* IF notch = 1 */
break;
}

/* update FM_RFn */
regs[R_EP4] &= ~0x80;
regs[R_EP4] |= map->fm_rfn << 7;
Expand All @@ -95,6 +103,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
/* disable Power Level Indicator */
regs[R_EP1] |= 0x40;

/* make sure thermometer is off */
regs[R_TM] &= ~0x10;

/* frequency dependent parameters */

tda18271_calc_ir_measure(fe, &freq);
Expand Down Expand Up @@ -135,13 +146,15 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
switch (priv->role) {
case TDA18271_MASTER:
tda18271_calc_main_pll(fe, N);
tda18271_set_if_notch(fe);
tda18271_write_regs(fe, R_MPD, 4);
break;
case TDA18271_SLAVE:
tda18271_calc_cal_pll(fe, N);
tda18271_write_regs(fe, R_CPD, 4);

regs[R_MPD] = regs[R_CPD] & 0x7f;
tda18271_set_if_notch(fe);
tda18271_write_regs(fe, R_MPD, 1);
break;
}
Expand All @@ -160,12 +173,14 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,

msleep(20);

/* set rfagc to normal speed mode */
if (map->fm_rfn)
regs[R_EP3] &= ~0x04;
else
regs[R_EP3] |= 0x04;
ret = tda18271_write_regs(fe, R_EP3, 1);
if (priv->id == TDA18271HDC2) {
/* set rfagc to normal speed mode */
if (map->fm_rfn)
regs[R_EP3] &= ~0x04;
else
regs[R_EP3] |= 0x04;
ret = tda18271_write_regs(fe, R_EP3, 1);
}
fail:
return ret;
}
Expand Down Expand Up @@ -507,7 +522,7 @@ static int tda18271_powerscan_init(struct dvb_frontend *fe)
/* set cal mode to normal */
regs[R_EP4] &= ~0x03;

/* update IF output level & IF notch frequency */
/* update IF output level */
regs[R_EP4] &= ~0x1c; /* clear if level bits */

ret = tda18271_write_regs(fe, R_EP3, 2);
Expand Down
30 changes: 23 additions & 7 deletions drivers/media/common/tuners/xc5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ static XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = {
{"FM Radio-INPUT1", 0x0208, 0x9002}
};

static int xc5000_is_firmware_loaded(struct dvb_frontend *fe);
static int xc5000_writeregs(struct xc5000_priv *priv, u8 *buf, u8 len);
static int xc5000_readregs(struct xc5000_priv *priv, u8 *buf, u8 len);
static void xc5000_TunerReset(struct dvb_frontend *fe);
Expand Down Expand Up @@ -352,7 +353,7 @@ static int xc_SetTVStandard(struct xc5000_priv *priv,

static int xc_shutdown(struct xc5000_priv *priv)
{
return 0;
return XC_RESULT_SUCCESS;
/* Fixme: cannot bring tuner back alive once shutdown
* without reloading the driver modules.
* return xc_write_reg(priv, XREG_POWER_DOWN, 0);
Expand Down Expand Up @@ -685,6 +686,25 @@ static int xc5000_set_params(struct dvb_frontend *fe,
return 0;
}

static int xc5000_is_firmware_loaded(struct dvb_frontend *fe)
{
struct xc5000_priv *priv = fe->tuner_priv;
int ret;
u16 id;

ret = xc5000_readreg(priv, XREG_PRODUCT_ID, &id);
if (ret == XC_RESULT_SUCCESS) {
if (id == XC_PRODUCT_ID_FW_NOT_LOADED)
ret = XC_RESULT_RESET_FAILURE;
else
ret = XC_RESULT_SUCCESS;
}

dprintk(1, "%s() returns %s id = 0x%x\n", __func__,
ret == XC_RESULT_SUCCESS ? "True" : "False", id);
return ret;
}

static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe);

static int xc5000_set_analog_params(struct dvb_frontend *fe,
Expand All @@ -693,7 +713,7 @@ static int xc5000_set_analog_params(struct dvb_frontend *fe,
struct xc5000_priv *priv = fe->tuner_priv;
int ret;

if(priv->fwloaded == 0)
if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS)
xc_load_fw_and_init_tuner(fe);

dprintk(1, "%s() frequency=%d (in units of 62.5khz)\n",
Expand Down Expand Up @@ -808,11 +828,10 @@ static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe)
struct xc5000_priv *priv = fe->tuner_priv;
int ret = 0;

if (priv->fwloaded == 0) {
if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) {
ret = xc5000_fwupload(fe);
if (ret != XC_RESULT_SUCCESS)
return ret;
priv->fwloaded = 1;
}

/* Start the tuner self-calibration process */
Expand Down Expand Up @@ -852,7 +871,6 @@ static int xc5000_sleep(struct dvb_frontend *fe)
return -EREMOTEIO;
}
else {
/* priv->fwloaded = 0; */
return XC_RESULT_SUCCESS;
}
}
Expand Down Expand Up @@ -933,15 +951,13 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
cfg->i2c_address);
printk(KERN_INFO
"xc5000: Firmware has been loaded previously\n");
priv->fwloaded = 1;
break;
case XC_PRODUCT_ID_FW_NOT_LOADED:
printk(KERN_INFO
"xc5000: Successfully identified at address 0x%02x\n",
cfg->i2c_address);
printk(KERN_INFO
"xc5000: Firmware has not been loaded previously\n");
priv->fwloaded = 0;
break;
default:
printk(KERN_ERR
Expand Down
1 change: 0 additions & 1 deletion drivers/media/common/tuners/xc5000_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ struct xc5000_priv {
u32 bandwidth;
u8 video_standard;
u8 rf_mode;
u8 fwloaded;

void *devptr;
};
Expand Down
27 changes: 10 additions & 17 deletions drivers/media/dvb/dvb-usb/gl861.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
return -EINVAL;
}

msleep(1); /* avoid I2C errors */

return usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), req, type,
value, index, rbuf, rlen, 2000);
}
Expand Down Expand Up @@ -92,16 +94,6 @@ static struct i2c_algorithm gl861_i2c_algo = {
};

/* Callbacks for DVB USB */
static int gl861_identify_state(struct usb_device *udev,
struct dvb_usb_device_properties *props,
struct dvb_usb_device_description **desc,
int *cold)
{
*cold = 0;

return 0;
}

static struct zl10353_config gl861_zl10353_config = {
.demod_address = 0x0f,
.no_tuner = 1,
Expand Down Expand Up @@ -172,7 +164,6 @@ static struct dvb_usb_device_properties gl861_properties = {

.size_of_priv = 0,

.identify_state = gl861_identify_state,
.num_adapters = 1,
.adapter = {{

Expand All @@ -194,13 +185,15 @@ static struct dvb_usb_device_properties gl861_properties = {

.num_device_descs = 2,
.devices = {
{ "MSI Mega Sky 55801 DVB-T USB2.0",
{ &gl861_table[0], NULL },
{ NULL },
{
.name = "MSI Mega Sky 55801 DVB-T USB2.0",
.cold_ids = { NULL },
.warm_ids = { &gl861_table[0], NULL },
},
{ "A-LINK DTU DVB-T USB2.0",
{ &gl861_table[1], NULL },
{ NULL },
{
.name = "A-LINK DTU DVB-T USB2.0",
.cold_ids = { NULL },
.warm_ids = { &gl861_table[1], NULL },
},
}
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/umt-010.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static struct dvb_usb_device_properties umt_properties = {
/* parameter for the MPEG2-data transfer */
.stream = {
.type = USB_BULK,
.count = 20,
.count = MAX_NO_URBS_FOR_DATA_STREAM,
.endpoint = 0x06,
.u = {
.bulk = {
Expand Down
Loading

0 comments on commit 1702b52

Please sign in to comment.