Skip to content

Commit c1f03b4

Browse files
committed
Merge tag 'media-v3.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab: "some media bug fixes: - a Kconfig dependency issue - some fixes for af9033/it913x demod to be more reliable and address a performance regression - cx18: fix an oops on devices with tda8290 tuner - two new USB IDs for af9035 - a couple fixes on smapp driver" * tag 'media-v3.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: [media] af9035: new IDs: add support for PCTV 78e and PCTV 79e [media] af9033: feed clock to RF tuner [media] it913x: init tuner on attach [media] af9033: update IT9135 tuner inittabs [media] Kconfig: do not select SPI bus on sub-driver auto-select [media] cx18: fix kernel oops with tda8290 tuner [media] smiapp: Set sub-device owner [media] smiapp: Fix power count handling
2 parents 3c2ea70 + a04646c commit c1f03b4

File tree

8 files changed

+38
-22
lines changed

8 files changed

+38
-22
lines changed

drivers/media/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ config MEDIA_SUBDRV_AUTOSELECT
182182
depends on HAS_IOMEM
183183
select I2C
184184
select I2C_MUX
185-
select SPI
186185
default y
187186
help
188187
By default, a media driver auto-selects all possible ancillary

drivers/media/dvb-core/dvb-usb-ids.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@
280280
#define USB_PID_PCTV_400E 0x020f
281281
#define USB_PID_PCTV_450E 0x0222
282282
#define USB_PID_PCTV_452E 0x021f
283+
#define USB_PID_PCTV_78E 0x025a
284+
#define USB_PID_PCTV_79E 0x0262
283285
#define USB_PID_REALTEK_RTL2831U 0x2831
284286
#define USB_PID_REALTEK_RTL2832U 0x2832
285287
#define USB_PID_TECHNOTREND_CONNECT_S2_3600 0x3007

drivers/media/dvb-frontends/af9033.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,19 @@ static int af9033_init(struct dvb_frontend *fe)
314314
goto err;
315315
}
316316

317+
/* feed clock to RF tuner */
318+
switch (state->cfg.tuner) {
319+
case AF9033_TUNER_IT9135_38:
320+
case AF9033_TUNER_IT9135_51:
321+
case AF9033_TUNER_IT9135_52:
322+
case AF9033_TUNER_IT9135_60:
323+
case AF9033_TUNER_IT9135_61:
324+
case AF9033_TUNER_IT9135_62:
325+
ret = af9033_wr_reg(state, 0x80fba8, 0x00);
326+
if (ret < 0)
327+
goto err;
328+
}
329+
317330
/* settings for TS interface */
318331
if (state->cfg.ts_mode == AF9033_TS_MODE_USB) {
319332
ret = af9033_wr_reg_mask(state, 0x80f9a5, 0x00, 0x01);

drivers/media/dvb-frontends/af9033_priv.h

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ static const struct reg_val tuner_init_it9135_60[] = {
14181418
{ 0x800068, 0x0a },
14191419
{ 0x80006a, 0x03 },
14201420
{ 0x800070, 0x0a },
1421-
{ 0x800071, 0x05 },
1421+
{ 0x800071, 0x0a },
14221422
{ 0x800072, 0x02 },
14231423
{ 0x800075, 0x8c },
14241424
{ 0x800076, 0x8c },
@@ -1484,7 +1484,6 @@ static const struct reg_val tuner_init_it9135_60[] = {
14841484
{ 0x800104, 0x02 },
14851485
{ 0x800105, 0xbe },
14861486
{ 0x800106, 0x00 },
1487-
{ 0x800109, 0x02 },
14881487
{ 0x800115, 0x0a },
14891488
{ 0x800116, 0x03 },
14901489
{ 0x80011a, 0xbe },
@@ -1510,7 +1509,6 @@ static const struct reg_val tuner_init_it9135_60[] = {
15101509
{ 0x80014b, 0x8c },
15111510
{ 0x80014d, 0xac },
15121511
{ 0x80014e, 0xc6 },
1513-
{ 0x80014f, 0x03 },
15141512
{ 0x800151, 0x1e },
15151513
{ 0x800153, 0xbc },
15161514
{ 0x800178, 0x09 },
@@ -1522,9 +1520,10 @@ static const struct reg_val tuner_init_it9135_60[] = {
15221520
{ 0x80018d, 0x5f },
15231521
{ 0x80018f, 0xa0 },
15241522
{ 0x800190, 0x5a },
1525-
{ 0x80ed02, 0xff },
1526-
{ 0x80ee42, 0xff },
1527-
{ 0x80ee82, 0xff },
1523+
{ 0x800191, 0x00 },
1524+
{ 0x80ed02, 0x40 },
1525+
{ 0x80ee42, 0x40 },
1526+
{ 0x80ee82, 0x40 },
15281527
{ 0x80f000, 0x0f },
15291528
{ 0x80f01f, 0x8c },
15301529
{ 0x80f020, 0x00 },
@@ -1699,7 +1698,6 @@ static const struct reg_val tuner_init_it9135_61[] = {
16991698
{ 0x800104, 0x02 },
17001699
{ 0x800105, 0xc8 },
17011700
{ 0x800106, 0x00 },
1702-
{ 0x800109, 0x02 },
17031701
{ 0x800115, 0x0a },
17041702
{ 0x800116, 0x03 },
17051703
{ 0x80011a, 0xc6 },
@@ -1725,7 +1723,6 @@ static const struct reg_val tuner_init_it9135_61[] = {
17251723
{ 0x80014b, 0x8c },
17261724
{ 0x80014d, 0xa8 },
17271725
{ 0x80014e, 0xc6 },
1728-
{ 0x80014f, 0x03 },
17291726
{ 0x800151, 0x28 },
17301727
{ 0x800153, 0xcc },
17311728
{ 0x800178, 0x09 },
@@ -1737,9 +1734,10 @@ static const struct reg_val tuner_init_it9135_61[] = {
17371734
{ 0x80018d, 0x5f },
17381735
{ 0x80018f, 0xfb },
17391736
{ 0x800190, 0x5c },
1740-
{ 0x80ed02, 0xff },
1741-
{ 0x80ee42, 0xff },
1742-
{ 0x80ee82, 0xff },
1737+
{ 0x800191, 0x00 },
1738+
{ 0x80ed02, 0x40 },
1739+
{ 0x80ee42, 0x40 },
1740+
{ 0x80ee82, 0x40 },
17431741
{ 0x80f000, 0x0f },
17441742
{ 0x80f01f, 0x8c },
17451743
{ 0x80f020, 0x00 },

drivers/media/i2c/smiapp/smiapp-core.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,19 +1282,12 @@ static int smiapp_set_power(struct v4l2_subdev *subdev, int on)
12821282

12831283
mutex_lock(&sensor->power_mutex);
12841284

1285-
/*
1286-
* If the power count is modified from 0 to != 0 or from != 0
1287-
* to 0, update the power state.
1288-
*/
1289-
if (!sensor->power_count == !on)
1290-
goto out;
1291-
1292-
if (on) {
1285+
if (on && !sensor->power_count) {
12931286
/* Power on and perform initialisation. */
12941287
ret = smiapp_power_on(sensor);
12951288
if (ret < 0)
12961289
goto out;
1297-
} else {
1290+
} else if (!on && sensor->power_count == 1) {
12981291
smiapp_power_off(sensor);
12991292
}
13001293

@@ -2572,7 +2565,7 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
25722565

25732566
this->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
25742567
this->sd.internal_ops = &smiapp_internal_ops;
2575-
this->sd.owner = NULL;
2568+
this->sd.owner = THIS_MODULE;
25762569
v4l2_set_subdevdata(&this->sd, client);
25772570

25782571
rval = media_entity_init(&this->sd.entity,

drivers/media/pci/cx18/cx18-driver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,7 @@ static int cx18_probe(struct pci_dev *pci_dev,
10911091
setup.addr = ADDR_UNSET;
10921092
setup.type = cx->options.tuner;
10931093
setup.mode_mask = T_ANALOG_TV; /* matches TV tuners */
1094+
setup.config = NULL;
10941095
if (cx->options.radio > 0)
10951096
setup.mode_mask |= T_RADIO;
10961097
setup.tuner_callback = (setup.type == TUNER_XC2028) ?

drivers/media/tuners/tuner_it913x.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ struct dvb_frontend *it913x_attach(struct dvb_frontend *fe,
396396
struct i2c_adapter *i2c_adap, u8 i2c_addr, u8 config)
397397
{
398398
struct it913x_state *state = NULL;
399+
int ret;
399400

400401
/* allocate memory for the internal state */
401402
state = kzalloc(sizeof(struct it913x_state), GFP_KERNEL);
@@ -425,6 +426,11 @@ struct dvb_frontend *it913x_attach(struct dvb_frontend *fe,
425426
state->tuner_type = config;
426427
state->firmware_ver = 1;
427428

429+
/* tuner RF initial */
430+
ret = it913x_wr_reg(state, PRO_DMOD, 0xec4c, 0x68);
431+
if (ret < 0)
432+
goto error;
433+
428434
fe->tuner_priv = state;
429435
memcpy(&fe->ops.tuner_ops, &it913x_tuner_ops,
430436
sizeof(struct dvb_tuner_ops));

drivers/media/usb/dvb-usb-v2/af9035.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,10 @@ static const struct usb_device_id af9035_id_table[] = {
15751575
&af9035_props, "Leadtek WinFast DTV Dongle Dual", NULL) },
15761576
{ DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xf900,
15771577
&af9035_props, "Hauppauge WinTV-MiniStick 2", NULL) },
1578+
{ DVB_USB_DEVICE(USB_VID_PCTV, USB_PID_PCTV_78E,
1579+
&af9035_props, "PCTV 78e", RC_MAP_IT913X_V1) },
1580+
{ DVB_USB_DEVICE(USB_VID_PCTV, USB_PID_PCTV_79E,
1581+
&af9035_props, "PCTV 79e", RC_MAP_IT913X_V2) },
15781582
{ }
15791583
};
15801584
MODULE_DEVICE_TABLE(usb, af9035_id_table);

0 commit comments

Comments
 (0)