[media] em28xx: support for Hauppauge WinTV-dualHD 01595 ATSC/QAM

Hauppauge WinTV-dualHD model 01595 is a USB 2.0 dual ATSC/QAM tuner with
the following components:

USB bridge: Empia em28274
Demodulator: 2x LG LGDT3306a at addresses 0xb2 and 0x1c
Tuner: 2x Silicon Labs si2157 at addresses 0xc0 and 0xc4

This patch enables only the first tuner.

Signed-off-by: Kevin Cheng <kcheng@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
Kevin Cheng
2017-01-10 01:14:29 -02:00
committed by Mauro Carvalho Chehab
父節點 4f75189024
當前提交 1586342e42
共有 3 個文件被更改,包括 94 次插入0 次删除

查看文件

@@ -37,6 +37,7 @@
#include "lgdt330x.h"
#include "lgdt3305.h"
#include "lgdt3306a.h"
#include "zl10353.h"
#include "s5h1409.h"
#include "mt2060.h"
@@ -920,6 +921,17 @@ static struct tda18271_config pinnacle_80e_dvb_config = {
.role = TDA18271_MASTER,
};
static struct lgdt3306a_config hauppauge_01595_lgdt3306a_config = {
.qam_if_khz = 4000,
.vsb_if_khz = 3250,
.spectral_inversion = 0,
.deny_i2c_rptr = 0,
.mpeg_mode = LGDT3306A_MPEG_SERIAL,
.tpclk_edge = LGDT3306A_TPCLK_RISING_EDGE,
.tpvalid_polarity = LGDT3306A_TP_VALID_HIGH,
.xtalMHz = 25,
};
/* ------------------------------------------------------------------ */
static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev)
@@ -1950,6 +1962,68 @@ static int em28xx_dvb_init(struct em28xx *dev)
}
break;
case EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595:
{
struct i2c_adapter *adapter;
struct i2c_client *client;
struct i2c_board_info info = {};
struct lgdt3306a_config lgdt3306a_config;
struct si2157_config si2157_config = {};
/* attach demod */
lgdt3306a_config = hauppauge_01595_lgdt3306a_config;
lgdt3306a_config.fe = &dvb->fe[0];
lgdt3306a_config.i2c_adapter = &adapter;
strlcpy(info.type, "lgdt3306a", sizeof(info.type));
info.addr = 0x59;
info.platform_data = &lgdt3306a_config;
request_module(info.type);
client = i2c_new_device(&dev->i2c_adap[dev->def_i2c_bus],
&info);
if (client == NULL || client->dev.driver == NULL) {
result = -ENODEV;
goto out_free;
}
if (!try_module_get(client->dev.driver->owner)) {
i2c_unregister_device(client);
result = -ENODEV;
goto out_free;
}
dvb->i2c_client_demod = client;
/* attach tuner */
si2157_config.fe = dvb->fe[0];
si2157_config.if_port = 1;
si2157_config.inversion = 1;
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
si2157_config.mdev = dev->media_dev;
#endif
memset(&info, 0, sizeof(struct i2c_board_info));
strlcpy(info.type, "si2157", sizeof(info.type));
info.addr = 0x60;
info.platform_data = &si2157_config;
request_module(info.type);
client = i2c_new_device(adapter, &info);
if (client == NULL || client->dev.driver == NULL) {
module_put(dvb->i2c_client_demod->dev.driver->owner);
i2c_unregister_device(dvb->i2c_client_demod);
result = -ENODEV;
goto out_free;
}
if (!try_module_get(client->dev.driver->owner)) {
i2c_unregister_device(client);
module_put(dvb->i2c_client_demod->dev.driver->owner);
i2c_unregister_device(dvb->i2c_client_demod);
result = -ENODEV;
goto out_free;
}
dvb->i2c_client_tuner = client;
}
break;
default:
dev_err(&dev->intf->dev,
"The frontend of your DVB/ATSC card isn't supported yet\n");