diff options
author | Benjamin Larsson <benjamin@southpole.se> | 2014-12-06 00:25:33 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-08 09:54:41 (GMT) |
commit | 021cd2d21b5d68d6e7c1edb468e990e1c0caf6fb (patch) | |
tree | 8cf254cf90472b060b818c6c590ac113d00e0afd /drivers/staging/media | |
parent | d8da7513bcf9834abbb1963f909f96a9f513dd65 (diff) | |
download | linux-021cd2d21b5d68d6e7c1edb468e990e1c0caf6fb.tar.xz |
[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>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r-- | drivers/staging/media/mn88472/mn88472.c | 30 | ||||
-rw-r--r-- | drivers/staging/media/mn88472/mn88472_priv.h | 2 |
2 files changed, 30 insertions, 2 deletions
diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c index 44edcf6..ed379ab 100644 --- a/drivers/staging/media/mn88472/mn88472.c +++ b/drivers/staging/media/mn88472/mn88472.c @@ -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); - ret = regmap_write(dev->regmap[2], 0x08, 0x1d); - ret = regmap_write(dev->regmap[0], 0xd9, 0xe3); + + 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])) { diff --git a/drivers/staging/media/mn88472/mn88472_priv.h b/drivers/staging/media/mn88472/mn88472_priv.h index b12b731..9ba8c8b 100644 --- a/drivers/staging/media/mn88472/mn88472_priv.h +++ b/drivers/staging/media/mn88472/mn88472_priv.h @@ -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 |