em28xx-dvb.c (740c699a8d316c8bf8593f19e2ca47795e690622) em28xx-dvb.c (192292403147877c7d5f737a3cc751ded397aef7)
1/*
2 DVB device driver for em28xx
3
4 (c) 2008-2011 Mauro Carvalho Chehab <mchehab@infradead.org>
5
6 (c) 2008 Devin Heitmueller <devin.heitmueller@gmail.com>
7 - Fixes for the driver to properly work with HVR-950
8 - Fixes for the driver to properly work with Pinnacle PCTV HD Pro Stick

--- 41 unchanged lines hidden (view full) ---

50#include "drxk.h"
51#include "tda10071.h"
52#include "tda18212.h"
53#include "a8293.h"
54#include "qt1010.h"
55#include "mb86a20s.h"
56#include "m88ds3103.h"
57#include "m88ts2022.h"
1/*
2 DVB device driver for em28xx
3
4 (c) 2008-2011 Mauro Carvalho Chehab <mchehab@infradead.org>
5
6 (c) 2008 Devin Heitmueller <devin.heitmueller@gmail.com>
7 - Fixes for the driver to properly work with HVR-950
8 - Fixes for the driver to properly work with Pinnacle PCTV HD Pro Stick

--- 41 unchanged lines hidden (view full) ---

50#include "drxk.h"
51#include "tda10071.h"
52#include "tda18212.h"
53#include "a8293.h"
54#include "qt1010.h"
55#include "mb86a20s.h"
56#include "m88ds3103.h"
57#include "m88ts2022.h"
58#include "si2168.h"
59#include "si2157.h"
58
59MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
60MODULE_LICENSE("GPL");
61MODULE_DESCRIPTION(DRIVER_DESC " - digital TV interface");
62MODULE_VERSION(EM28XX_VERSION);
63
64
65static unsigned int debug;

--- 22 unchanged lines hidden (view full) ---

88 struct dmx_frontend fe_mem;
89 struct dvb_net net;
90
91 /* Due to DRX-K - probably need changes */
92 int (*gate_ctrl)(struct dvb_frontend *, int);
93 struct semaphore pll_mutex;
94 bool dont_attach_fe1;
95 int lna_gpio;
60
61MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
62MODULE_LICENSE("GPL");
63MODULE_DESCRIPTION(DRIVER_DESC " - digital TV interface");
64MODULE_VERSION(EM28XX_VERSION);
65
66
67static unsigned int debug;

--- 22 unchanged lines hidden (view full) ---

90 struct dmx_frontend fe_mem;
91 struct dvb_net net;
92
93 /* Due to DRX-K - probably need changes */
94 int (*gate_ctrl)(struct dvb_frontend *, int);
95 struct semaphore pll_mutex;
96 bool dont_attach_fe1;
97 int lna_gpio;
98 struct i2c_client *i2c_client_demod;
96 struct i2c_client *i2c_client_tuner;
97};
98
99
100static inline void print_err_status(struct em28xx *dev,
101 int packet, int status)
102{
103 char *errmsg = "Unknown";

--- 1387 unchanged lines hidden (view full) ---

1491 dvb_frontend_detach(dvb->fe[0]);
1492 result = -ENODEV;
1493 goto out_free;
1494 }
1495
1496 dvb->i2c_client_tuner = client;
1497 }
1498 break;
99 struct i2c_client *i2c_client_tuner;
100};
101
102
103static inline void print_err_status(struct em28xx *dev,
104 int packet, int status)
105{
106 char *errmsg = "Unknown";

--- 1387 unchanged lines hidden (view full) ---

1494 dvb_frontend_detach(dvb->fe[0]);
1495 result = -ENODEV;
1496 goto out_free;
1497 }
1498
1499 dvb->i2c_client_tuner = client;
1500 }
1501 break;
1502 case EM28178_BOARD_PCTV_292E:
1503 {
1504 struct i2c_adapter *adapter;
1505 struct i2c_client *client;
1506 struct i2c_board_info info;
1507 struct si2168_config si2168_config;
1508 struct si2157_config si2157_config;
1509
1510 /* attach demod */
1511 si2168_config.i2c_adapter = &adapter;
1512 si2168_config.fe = &dvb->fe[0];
1513 memset(&info, 0, sizeof(struct i2c_board_info));
1514 strlcpy(info.type, "si2168", I2C_NAME_SIZE);
1515 info.addr = 0x64;
1516 info.platform_data = &si2168_config;
1517 request_module(info.type);
1518 client = i2c_new_device(&dev->i2c_adap[dev->def_i2c_bus], &info);
1519 if (client == NULL || client->dev.driver == NULL) {
1520 result = -ENODEV;
1521 goto out_free;
1522 }
1523
1524 if (!try_module_get(client->dev.driver->owner)) {
1525 i2c_unregister_device(client);
1526 result = -ENODEV;
1527 goto out_free;
1528 }
1529
1530 dvb->i2c_client_demod = client;
1531
1532 /* attach tuner */
1533 si2157_config.fe = dvb->fe[0];
1534 memset(&info, 0, sizeof(struct i2c_board_info));
1535 strlcpy(info.type, "si2157", I2C_NAME_SIZE);
1536 info.addr = 0x60;
1537 info.platform_data = &si2157_config;
1538 request_module(info.type);
1539 client = i2c_new_device(adapter, &info);
1540 if (client == NULL || client->dev.driver == NULL) {
1541 module_put(dvb->i2c_client_demod->dev.driver->owner);
1542 i2c_unregister_device(dvb->i2c_client_demod);
1543 result = -ENODEV;
1544 goto out_free;
1545 }
1546
1547 if (!try_module_get(client->dev.driver->owner)) {
1548 i2c_unregister_device(client);
1549 module_put(dvb->i2c_client_demod->dev.driver->owner);
1550 i2c_unregister_device(dvb->i2c_client_demod);
1551 result = -ENODEV;
1552 goto out_free;
1553 }
1554
1555 dvb->i2c_client_tuner = client;
1556 }
1557 break;
1499 default:
1500 em28xx_errdev("/2: The frontend of your DVB/ATSC card"
1501 " isn't supported yet\n");
1502 break;
1503 }
1504 if (NULL == dvb->fe[0]) {
1505 em28xx_errdev("/2: frontend initialization failed\n");
1506 result = -EINVAL;

--- 70 unchanged lines hidden (view full) ---

1577 }
1578
1579 /* remove I2C tuner */
1580 if (client) {
1581 module_put(client->dev.driver->owner);
1582 i2c_unregister_device(client);
1583 }
1584
1558 default:
1559 em28xx_errdev("/2: The frontend of your DVB/ATSC card"
1560 " isn't supported yet\n");
1561 break;
1562 }
1563 if (NULL == dvb->fe[0]) {
1564 em28xx_errdev("/2: frontend initialization failed\n");
1565 result = -EINVAL;

--- 70 unchanged lines hidden (view full) ---

1636 }
1637
1638 /* remove I2C tuner */
1639 if (client) {
1640 module_put(client->dev.driver->owner);
1641 i2c_unregister_device(client);
1642 }
1643
1644 /* remove I2C demod */
1645 client = dvb->i2c_client_demod;
1646 if (client) {
1647 module_put(client->dev.driver->owner);
1648 i2c_unregister_device(client);
1649 }
1650
1585 em28xx_unregister_dvb(dvb);
1586 kfree(dvb);
1587 dev->dvb = NULL;
1588 kref_put(&dev->ref, em28xx_free_device);
1589
1590 return 0;
1591}
1592

--- 49 unchanged lines hidden (view full) ---

1642 em28xx_info("fe1 resume %d", ret);
1643 }
1644 /* remove I2C tuner */
1645 if (client) {
1646 module_put(client->dev.driver->owner);
1647 i2c_unregister_device(client);
1648 }
1649
1651 em28xx_unregister_dvb(dvb);
1652 kfree(dvb);
1653 dev->dvb = NULL;
1654 kref_put(&dev->ref, em28xx_free_device);
1655
1656 return 0;
1657}
1658

--- 49 unchanged lines hidden (view full) ---

1708 em28xx_info("fe1 resume %d", ret);
1709 }
1710 /* remove I2C tuner */
1711 if (client) {
1712 module_put(client->dev.driver->owner);
1713 i2c_unregister_device(client);
1714 }
1715
1716 /* remove I2C demod */
1717 client = dvb->i2c_client_demod;
1718 if (client) {
1719 module_put(client->dev.driver->owner);
1720 i2c_unregister_device(client);
1721 }
1722
1650 em28xx_unregister_dvb(dvb);
1651 kfree(dvb);
1652 dev->dvb = NULL;
1653 }
1654
1655 return 0;
1656}
1657

--- 21 unchanged lines hidden ---
1723 em28xx_unregister_dvb(dvb);
1724 kfree(dvb);
1725 dev->dvb = NULL;
1726 }
1727
1728 return 0;
1729}
1730

--- 21 unchanged lines hidden ---