Skip to content

Commit 1702b52

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* 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 ...
2 parents 0acbbee + a178987 commit 1702b52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+608
-446
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
0 -> Unknown board (au0828)
2-
1 -> Hauppauge HVR950Q (au0828) [2040:7200]
2+
1 -> Hauppauge HVR950Q (au0828) [2040:7200,2040:7210,2040:7217,2040:721b,2040:721f,2040:7280,0fd9:0008]
33
2 -> Hauppauge HVR850 (au0828) [2040:7240]
44
3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620]

drivers/media/common/ir-keymaps.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,3 +2201,41 @@ IR_KEYTAB_TYPE ir_codes_powercolor_real_angel[IR_KEYTAB_SIZE] = {
22012201
[0x25] = KEY_POWER, /* power */
22022202
};
22032203
EXPORT_SYMBOL_GPL(ir_codes_powercolor_real_angel);
2204+
2205+
IR_KEYTAB_TYPE ir_codes_avermedia_a16d[IR_KEYTAB_SIZE] = {
2206+
[0x20] = KEY_LIST,
2207+
[0x00] = KEY_POWER,
2208+
[0x28] = KEY_1,
2209+
[0x18] = KEY_2,
2210+
[0x38] = KEY_3,
2211+
[0x24] = KEY_4,
2212+
[0x14] = KEY_5,
2213+
[0x34] = KEY_6,
2214+
[0x2c] = KEY_7,
2215+
[0x1c] = KEY_8,
2216+
[0x3c] = KEY_9,
2217+
[0x12] = KEY_SUBTITLE,
2218+
[0x22] = KEY_0,
2219+
[0x32] = KEY_REWIND,
2220+
[0x3a] = KEY_SHUFFLE,
2221+
[0x02] = KEY_PRINT,
2222+
[0x11] = KEY_CHANNELDOWN,
2223+
[0x31] = KEY_CHANNELUP,
2224+
[0x0c] = KEY_ZOOM,
2225+
[0x1e] = KEY_VOLUMEDOWN,
2226+
[0x3e] = KEY_VOLUMEUP,
2227+
[0x0a] = KEY_MUTE,
2228+
[0x04] = KEY_AUDIO,
2229+
[0x26] = KEY_RECORD,
2230+
[0x06] = KEY_PLAY,
2231+
[0x36] = KEY_STOP,
2232+
[0x16] = KEY_PAUSE,
2233+
[0x2e] = KEY_REWIND,
2234+
[0x0e] = KEY_FASTFORWARD,
2235+
[0x30] = KEY_TEXT,
2236+
[0x21] = KEY_GREEN,
2237+
[0x01] = KEY_BLUE,
2238+
[0x08] = KEY_EPG,
2239+
[0x2a] = KEY_MENU,
2240+
};
2241+
EXPORT_SYMBOL_GPL(ir_codes_avermedia_a16d);

drivers/media/common/tuners/tda18271-common.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,17 @@ int tda18271_calc_rf_cal(struct dvb_frontend *fe, u32 *freq)
649649
u8 val;
650650

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

653661
regs[R_EB14] = val;
654-
662+
fail:
655663
return ret;
656664
}
657665

drivers/media/common/tuners/tda18271-fe.c

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ static inline int charge_pump_source(struct dvb_frontend *fe, int force)
4545
TDA18271_MAIN_PLL, force);
4646
}
4747

48+
static inline void tda18271_set_if_notch(struct dvb_frontend *fe)
49+
{
50+
struct tda18271_priv *priv = fe->tuner_priv;
51+
unsigned char *regs = priv->tda18271_regs;
52+
53+
switch (priv->mode) {
54+
case TDA18271_ANALOG:
55+
regs[R_MPD] &= ~0x80; /* IF notch = 0 */
56+
break;
57+
case TDA18271_DIGITAL:
58+
regs[R_MPD] |= 0x80; /* IF notch = 1 */
59+
break;
60+
}
61+
}
62+
4863
static int tda18271_channel_configuration(struct dvb_frontend *fe,
4964
struct tda18271_std_map_item *map,
5065
u32 freq, u32 bw)
@@ -60,25 +75,18 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
6075
regs[R_EP3] &= ~0x1f; /* clear std bits */
6176
regs[R_EP3] |= (map->agc_mode << 3) | map->std;
6277

63-
/* set rfagc to high speed mode */
64-
regs[R_EP3] &= ~0x04;
78+
if (priv->id == TDA18271HDC2) {
79+
/* set rfagc to high speed mode */
80+
regs[R_EP3] &= ~0x04;
81+
}
6582

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

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

73-
switch (priv->mode) {
74-
case TDA18271_ANALOG:
75-
regs[R_MPD] &= ~0x80; /* IF notch = 0 */
76-
break;
77-
case TDA18271_DIGITAL:
78-
regs[R_MPD] |= 0x80; /* IF notch = 1 */
79-
break;
80-
}
81-
8290
/* update FM_RFn */
8391
regs[R_EP4] &= ~0x80;
8492
regs[R_EP4] |= map->fm_rfn << 7;
@@ -95,6 +103,9 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
95103
/* disable Power Level Indicator */
96104
regs[R_EP1] |= 0x40;
97105

106+
/* make sure thermometer is off */
107+
regs[R_TM] &= ~0x10;
108+
98109
/* frequency dependent parameters */
99110

100111
tda18271_calc_ir_measure(fe, &freq);
@@ -135,13 +146,15 @@ static int tda18271_channel_configuration(struct dvb_frontend *fe,
135146
switch (priv->role) {
136147
case TDA18271_MASTER:
137148
tda18271_calc_main_pll(fe, N);
149+
tda18271_set_if_notch(fe);
138150
tda18271_write_regs(fe, R_MPD, 4);
139151
break;
140152
case TDA18271_SLAVE:
141153
tda18271_calc_cal_pll(fe, N);
142154
tda18271_write_regs(fe, R_CPD, 4);
143155

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

161174
msleep(20);
162175

163-
/* set rfagc to normal speed mode */
164-
if (map->fm_rfn)
165-
regs[R_EP3] &= ~0x04;
166-
else
167-
regs[R_EP3] |= 0x04;
168-
ret = tda18271_write_regs(fe, R_EP3, 1);
176+
if (priv->id == TDA18271HDC2) {
177+
/* set rfagc to normal speed mode */
178+
if (map->fm_rfn)
179+
regs[R_EP3] &= ~0x04;
180+
else
181+
regs[R_EP3] |= 0x04;
182+
ret = tda18271_write_regs(fe, R_EP3, 1);
183+
}
169184
fail:
170185
return ret;
171186
}
@@ -507,7 +522,7 @@ static int tda18271_powerscan_init(struct dvb_frontend *fe)
507522
/* set cal mode to normal */
508523
regs[R_EP4] &= ~0x03;
509524

510-
/* update IF output level & IF notch frequency */
525+
/* update IF output level */
511526
regs[R_EP4] &= ~0x1c; /* clear if level bits */
512527

513528
ret = tda18271_write_regs(fe, R_EP3, 2);

drivers/media/common/tuners/xc5000.c

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ static XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = {
177177
{"FM Radio-INPUT1", 0x0208, 0x9002}
178178
};
179179

180+
static int xc5000_is_firmware_loaded(struct dvb_frontend *fe);
180181
static int xc5000_writeregs(struct xc5000_priv *priv, u8 *buf, u8 len);
181182
static int xc5000_readregs(struct xc5000_priv *priv, u8 *buf, u8 len);
182183
static void xc5000_TunerReset(struct dvb_frontend *fe);
@@ -352,7 +353,7 @@ static int xc_SetTVStandard(struct xc5000_priv *priv,
352353

353354
static int xc_shutdown(struct xc5000_priv *priv)
354355
{
355-
return 0;
356+
return XC_RESULT_SUCCESS;
356357
/* Fixme: cannot bring tuner back alive once shutdown
357358
* without reloading the driver modules.
358359
* return xc_write_reg(priv, XREG_POWER_DOWN, 0);
@@ -685,6 +686,25 @@ static int xc5000_set_params(struct dvb_frontend *fe,
685686
return 0;
686687
}
687688

689+
static int xc5000_is_firmware_loaded(struct dvb_frontend *fe)
690+
{
691+
struct xc5000_priv *priv = fe->tuner_priv;
692+
int ret;
693+
u16 id;
694+
695+
ret = xc5000_readreg(priv, XREG_PRODUCT_ID, &id);
696+
if (ret == XC_RESULT_SUCCESS) {
697+
if (id == XC_PRODUCT_ID_FW_NOT_LOADED)
698+
ret = XC_RESULT_RESET_FAILURE;
699+
else
700+
ret = XC_RESULT_SUCCESS;
701+
}
702+
703+
dprintk(1, "%s() returns %s id = 0x%x\n", __func__,
704+
ret == XC_RESULT_SUCCESS ? "True" : "False", id);
705+
return ret;
706+
}
707+
688708
static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe);
689709

690710
static int xc5000_set_analog_params(struct dvb_frontend *fe,
@@ -693,7 +713,7 @@ static int xc5000_set_analog_params(struct dvb_frontend *fe,
693713
struct xc5000_priv *priv = fe->tuner_priv;
694714
int ret;
695715

696-
if(priv->fwloaded == 0)
716+
if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS)
697717
xc_load_fw_and_init_tuner(fe);
698718

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

811-
if (priv->fwloaded == 0) {
831+
if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) {
812832
ret = xc5000_fwupload(fe);
813833
if (ret != XC_RESULT_SUCCESS)
814834
return ret;
815-
priv->fwloaded = 1;
816835
}
817836

818837
/* Start the tuner self-calibration process */
@@ -852,7 +871,6 @@ static int xc5000_sleep(struct dvb_frontend *fe)
852871
return -EREMOTEIO;
853872
}
854873
else {
855-
/* priv->fwloaded = 0; */
856874
return XC_RESULT_SUCCESS;
857875
}
858876
}
@@ -933,15 +951,13 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
933951
cfg->i2c_address);
934952
printk(KERN_INFO
935953
"xc5000: Firmware has been loaded previously\n");
936-
priv->fwloaded = 1;
937954
break;
938955
case XC_PRODUCT_ID_FW_NOT_LOADED:
939956
printk(KERN_INFO
940957
"xc5000: Successfully identified at address 0x%02x\n",
941958
cfg->i2c_address);
942959
printk(KERN_INFO
943960
"xc5000: Firmware has not been loaded previously\n");
944-
priv->fwloaded = 0;
945961
break;
946962
default:
947963
printk(KERN_ERR

drivers/media/common/tuners/xc5000_priv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ struct xc5000_priv {
3030
u32 bandwidth;
3131
u8 video_standard;
3232
u8 rf_mode;
33-
u8 fwloaded;
3433

3534
void *devptr;
3635
};

drivers/media/dvb/dvb-usb/gl861.c

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ static int gl861_i2c_msg(struct dvb_usb_device *d, u8 addr,
4747
return -EINVAL;
4848
}
4949

50+
msleep(1); /* avoid I2C errors */
51+
5052
return usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), req, type,
5153
value, index, rbuf, rlen, 2000);
5254
}
@@ -92,16 +94,6 @@ static struct i2c_algorithm gl861_i2c_algo = {
9294
};
9395

9496
/* Callbacks for DVB USB */
95-
static int gl861_identify_state(struct usb_device *udev,
96-
struct dvb_usb_device_properties *props,
97-
struct dvb_usb_device_description **desc,
98-
int *cold)
99-
{
100-
*cold = 0;
101-
102-
return 0;
103-
}
104-
10597
static struct zl10353_config gl861_zl10353_config = {
10698
.demod_address = 0x0f,
10799
.no_tuner = 1,
@@ -172,7 +164,6 @@ static struct dvb_usb_device_properties gl861_properties = {
172164

173165
.size_of_priv = 0,
174166

175-
.identify_state = gl861_identify_state,
176167
.num_adapters = 1,
177168
.adapter = {{
178169

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

195186
.num_device_descs = 2,
196187
.devices = {
197-
{ "MSI Mega Sky 55801 DVB-T USB2.0",
198-
{ &gl861_table[0], NULL },
199-
{ NULL },
188+
{
189+
.name = "MSI Mega Sky 55801 DVB-T USB2.0",
190+
.cold_ids = { NULL },
191+
.warm_ids = { &gl861_table[0], NULL },
200192
},
201-
{ "A-LINK DTU DVB-T USB2.0",
202-
{ &gl861_table[1], NULL },
203-
{ NULL },
193+
{
194+
.name = "A-LINK DTU DVB-T USB2.0",
195+
.cold_ids = { NULL },
196+
.warm_ids = { &gl861_table[1], NULL },
204197
},
205198
}
206199
};

drivers/media/dvb/dvb-usb/umt-010.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static struct dvb_usb_device_properties umt_properties = {
107107
/* parameter for the MPEG2-data transfer */
108108
.stream = {
109109
.type = USB_BULK,
110-
.count = 20,
110+
.count = MAX_NO_URBS_FOR_DATA_STREAM,
111111
.endpoint = 0x06,
112112
.u = {
113113
.bulk = {

0 commit comments

Comments
 (0)