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

Changed files
+38 -22
drivers
media
dvb-core
dvb-frontends
i2c
smiapp
pci
tuners
usb
dvb-usb-v2
-1
drivers/media/Kconfig
··· 182 182 depends on HAS_IOMEM 183 183 select I2C 184 184 select I2C_MUX 185 - select SPI 186 185 default y 187 186 help 188 187 By default, a media driver auto-selects all possible ancillary
+2
drivers/media/dvb-core/dvb-usb-ids.h
··· 280 280 #define USB_PID_PCTV_400E 0x020f 281 281 #define USB_PID_PCTV_450E 0x0222 282 282 #define USB_PID_PCTV_452E 0x021f 283 + #define USB_PID_PCTV_78E 0x025a 284 + #define USB_PID_PCTV_79E 0x0262 283 285 #define USB_PID_REALTEK_RTL2831U 0x2831 284 286 #define USB_PID_REALTEK_RTL2832U 0x2832 285 287 #define USB_PID_TECHNOTREND_CONNECT_S2_3600 0x3007
+13
drivers/media/dvb-frontends/af9033.c
··· 314 314 goto err; 315 315 } 316 316 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 + 317 330 /* settings for TS interface */ 318 331 if (state->cfg.ts_mode == AF9033_TS_MODE_USB) { 319 332 ret = af9033_wr_reg_mask(state, 0x80f9a5, 0x00, 0x01);
+9 -11
drivers/media/dvb-frontends/af9033_priv.h
··· 1418 1418 { 0x800068, 0x0a }, 1419 1419 { 0x80006a, 0x03 }, 1420 1420 { 0x800070, 0x0a }, 1421 - { 0x800071, 0x05 }, 1421 + { 0x800071, 0x0a }, 1422 1422 { 0x800072, 0x02 }, 1423 1423 { 0x800075, 0x8c }, 1424 1424 { 0x800076, 0x8c }, ··· 1484 1484 { 0x800104, 0x02 }, 1485 1485 { 0x800105, 0xbe }, 1486 1486 { 0x800106, 0x00 }, 1487 - { 0x800109, 0x02 }, 1488 1487 { 0x800115, 0x0a }, 1489 1488 { 0x800116, 0x03 }, 1490 1489 { 0x80011a, 0xbe }, ··· 1509 1510 { 0x80014b, 0x8c }, 1510 1511 { 0x80014d, 0xac }, 1511 1512 { 0x80014e, 0xc6 }, 1512 - { 0x80014f, 0x03 }, 1513 1513 { 0x800151, 0x1e }, 1514 1514 { 0x800153, 0xbc }, 1515 1515 { 0x800178, 0x09 }, ··· 1520 1522 { 0x80018d, 0x5f }, 1521 1523 { 0x80018f, 0xa0 }, 1522 1524 { 0x800190, 0x5a }, 1523 - { 0x80ed02, 0xff }, 1524 - { 0x80ee42, 0xff }, 1525 - { 0x80ee82, 0xff }, 1525 + { 0x800191, 0x00 }, 1526 + { 0x80ed02, 0x40 }, 1527 + { 0x80ee42, 0x40 }, 1528 + { 0x80ee82, 0x40 }, 1526 1529 { 0x80f000, 0x0f }, 1527 1530 { 0x80f01f, 0x8c }, 1528 1531 { 0x80f020, 0x00 }, ··· 1698 1699 { 0x800104, 0x02 }, 1699 1700 { 0x800105, 0xc8 }, 1700 1701 { 0x800106, 0x00 }, 1701 - { 0x800109, 0x02 }, 1702 1702 { 0x800115, 0x0a }, 1703 1703 { 0x800116, 0x03 }, 1704 1704 { 0x80011a, 0xc6 }, ··· 1723 1725 { 0x80014b, 0x8c }, 1724 1726 { 0x80014d, 0xa8 }, 1725 1727 { 0x80014e, 0xc6 }, 1726 - { 0x80014f, 0x03 }, 1727 1728 { 0x800151, 0x28 }, 1728 1729 { 0x800153, 0xcc }, 1729 1730 { 0x800178, 0x09 }, ··· 1734 1737 { 0x80018d, 0x5f }, 1735 1738 { 0x80018f, 0xfb }, 1736 1739 { 0x800190, 0x5c }, 1737 - { 0x80ed02, 0xff }, 1738 - { 0x80ee42, 0xff }, 1739 - { 0x80ee82, 0xff }, 1740 + { 0x800191, 0x00 }, 1741 + { 0x80ed02, 0x40 }, 1742 + { 0x80ee42, 0x40 }, 1743 + { 0x80ee82, 0x40 }, 1740 1744 { 0x80f000, 0x0f }, 1741 1745 { 0x80f01f, 0x8c }, 1742 1746 { 0x80f020, 0x00 },
+3 -10
drivers/media/i2c/smiapp/smiapp-core.c
··· 1282 1282 1283 1283 mutex_lock(&sensor->power_mutex); 1284 1284 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) { 1293 1286 /* Power on and perform initialisation. */ 1294 1287 ret = smiapp_power_on(sensor); 1295 1288 if (ret < 0) 1296 1289 goto out; 1297 - } else { 1290 + } else if (!on && sensor->power_count == 1) { 1298 1291 smiapp_power_off(sensor); 1299 1292 } 1300 1293 ··· 2565 2572 2566 2573 this->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; 2567 2574 this->sd.internal_ops = &smiapp_internal_ops; 2568 - this->sd.owner = NULL; 2575 + this->sd.owner = THIS_MODULE; 2569 2576 v4l2_set_subdevdata(&this->sd, client); 2570 2577 2571 2578 rval = media_entity_init(&this->sd.entity,
+1
drivers/media/pci/cx18/cx18-driver.c
··· 1091 1091 setup.addr = ADDR_UNSET; 1092 1092 setup.type = cx->options.tuner; 1093 1093 setup.mode_mask = T_ANALOG_TV; /* matches TV tuners */ 1094 + setup.config = NULL; 1094 1095 if (cx->options.radio > 0) 1095 1096 setup.mode_mask |= T_RADIO; 1096 1097 setup.tuner_callback = (setup.type == TUNER_XC2028) ?
+6
drivers/media/tuners/tuner_it913x.c
··· 396 396 struct i2c_adapter *i2c_adap, u8 i2c_addr, u8 config) 397 397 { 398 398 struct it913x_state *state = NULL; 399 + int ret; 399 400 400 401 /* allocate memory for the internal state */ 401 402 state = kzalloc(sizeof(struct it913x_state), GFP_KERNEL); ··· 425 424 426 425 state->tuner_type = config; 427 426 state->firmware_ver = 1; 427 + 428 + /* tuner RF initial */ 429 + ret = it913x_wr_reg(state, PRO_DMOD, 0xec4c, 0x68); 430 + if (ret < 0) 431 + goto error; 428 432 429 433 fe->tuner_priv = state; 430 434 memcpy(&fe->ops.tuner_ops, &it913x_tuner_ops,
+4
drivers/media/usb/dvb-usb-v2/af9035.c
··· 1575 1575 &af9035_props, "Leadtek WinFast DTV Dongle Dual", NULL) }, 1576 1576 { DVB_USB_DEVICE(USB_VID_HAUPPAUGE, 0xf900, 1577 1577 &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) }, 1578 1582 { } 1579 1583 }; 1580 1584 MODULE_DEVICE_TABLE(usb, af9035_id_table);