[media] mn88472: add ts mode and ts clock to driver
Signed-off-by: Benjamin Larsson <benjamin@southpole.se> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
d8da7513bc
commit
021cd2d21b
|
@ -19,6 +19,16 @@
|
|||
|
||||
#include <linux/dvb/frontend.h>
|
||||
|
||||
enum ts_clock {
|
||||
VARIABLE_TS_CLOCK,
|
||||
FIXED_TS_CLOCK,
|
||||
};
|
||||
|
||||
enum ts_mode {
|
||||
SERIAL_TS_MODE,
|
||||
PARALLEL_TS_MODE,
|
||||
};
|
||||
|
||||
struct mn88472_config {
|
||||
/*
|
||||
* Max num of bytes given I2C adapter could write at once.
|
||||
|
@ -39,6 +49,8 @@ struct mn88472_config {
|
|||
* Hz
|
||||
*/
|
||||
u32 xtal;
|
||||
int ts_mode;
|
||||
int ts_clock;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -868,6 +868,8 @@ static int rtl2832u_frontend_attach(struct dvb_usb_adapter *adap)
|
|||
mn88472_config.i2c_wr_max = 22,
|
||||
strlcpy(info.type, "mn88472", I2C_NAME_SIZE);
|
||||
mn88472_config.xtal = 20500000;
|
||||
mn88472_config.ts_mode = SERIAL_TS_MODE;
|
||||
mn88472_config.ts_clock = VARIABLE_TS_CLOCK;
|
||||
info.addr = 0x18;
|
||||
info.platform_data = &mn88472_config;
|
||||
request_module(info.type);
|
||||
|
|
|
@ -178,8 +178,32 @@ static int mn88472_set_frontend(struct dvb_frontend *fe)
|
|||
|
||||
ret = regmap_write(dev->regmap[0], 0x46, 0x00);
|
||||
ret = regmap_write(dev->regmap[0], 0xae, 0x00);
|
||||
|
||||
switch (dev->ts_mode) {
|
||||
case SERIAL_TS_MODE:
|
||||
ret = regmap_write(dev->regmap[2], 0x08, 0x1d);
|
||||
break;
|
||||
case PARALLEL_TS_MODE:
|
||||
ret = regmap_write(dev->regmap[2], 0x08, 0x00);
|
||||
break;
|
||||
default:
|
||||
dev_dbg(&client->dev, "ts_mode error: %d\n", dev->ts_mode);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
switch (dev->ts_clock) {
|
||||
case VARIABLE_TS_CLOCK:
|
||||
ret = regmap_write(dev->regmap[0], 0xd9, 0xe3);
|
||||
break;
|
||||
case FIXED_TS_CLOCK:
|
||||
ret = regmap_write(dev->regmap[0], 0xd9, 0xe1);
|
||||
break;
|
||||
default:
|
||||
dev_dbg(&client->dev, "ts_clock error: %d\n", dev->ts_clock);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Reset demod */
|
||||
ret = regmap_write(dev->regmap[2], 0xf8, 0x9f);
|
||||
|
@ -439,6 +463,8 @@ static int mn88472_probe(struct i2c_client *client,
|
|||
|
||||
dev->i2c_wr_max = config->i2c_wr_max;
|
||||
dev->xtal = config->xtal;
|
||||
dev->ts_mode = config->ts_mode;
|
||||
dev->ts_clock = config->ts_clock;
|
||||
dev->client[0] = client;
|
||||
dev->regmap[0] = regmap_init_i2c(dev->client[0], ®map_config);
|
||||
if (IS_ERR(dev->regmap[0])) {
|
||||
|
|
|
@ -32,6 +32,8 @@ struct mn88472_dev {
|
|||
fe_delivery_system_t delivery_system;
|
||||
bool warm; /* FW running */
|
||||
u32 xtal;
|
||||
int ts_mode;
|
||||
int ts_clock;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue