diff options
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/av7110.c')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c index 275ed0bc7..cb0441f28 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.c +++ b/linux/drivers/media/dvb/ttpci/av7110.c @@ -2972,6 +2972,44 @@ restart_feeds(av7110_t *av7110) AV_StartPlay(av7110, mode); } +static int dvb_get_stc(dmx_demux_t *demux, unsigned int num, + uint64_t *stc, unsigned int *base) +{ + int ret; + u16 fwstc[4]; + u16 tag = ((COMTYPE_REQUEST << 8) + ReqSTC); + struct dvb_demux *dvbdemux; + av7110_t *av7110; + + /* pointer casting paranoia... */ + if (!demux) + BUG(); + dvbdemux = (struct dvb_demux *) demux->priv; + if (!dvbdemux) + BUG(); + av7110 = (av7110_t *) dvbdemux->priv; + + DEB_EE(("av7110: %p\n",av7110)); + + if (num != 0) + return -EINVAL; + + ret = CommandRequest(av7110, &tag, 0, fwstc, 3); + if (ret) { + printk(KERN_ERR "%s: CommandRequest error\n", __FUNCTION__); + return -EIO; + } + + *stc = (((uint64_t)fwstc[2] & 1) << 32) | + (((uint64_t)fwstc[1]) << 16) | ((uint64_t)fwstc[0]); + *base = 1; + + DEB_EE(("av7110: stc = %llu\n", *stc)); + + return 0; +} + + /****************************************************************************** * SEC device file operations ******************************************************************************/ @@ -3857,6 +3895,7 @@ int av7110_register(av7110_t *av7110) DMX_MEMORY_BASED_FILTERING); dvb_dmx_init(&av7110->demux); + av7110->demux.dmx.get_stc = dvb_get_stc; dvbfront->id = "hw_frontend"; dvbfront->vendor = "VLSI"; |