case AMSTREAM_GET_VPTS:
parm.data_32 = timestamp_vpts_get();
break;
+ case AMSTREAM_GET_VPTS_U64:
+ parm.data_64 = timestamp_vpts_get_u64();
+ break;
+ case AMSTREAM_GET_APTS_U64:
+ parm.data_64 = timestamp_apts_get_u64();
+ break;
case AMSTREAM_GET_PCRSCR:
parm.data_32 = timestamp_pcrscr_get();
break;
return ret;
}
+/*Show the 33bit Video PTS value*/
+static ssize_t demux_show_video_pts_u64(struct class *class,
+ struct class_attribute *attr, char *buf)
+{
+ struct aml_dvb *dvb = &aml_dvb_device;
+ ssize_t ret = 0;
+
+ u64 pts_val = aml_dmx_get_video_pts(dvb);
+ pts_val &= 0x00000000FFFFFFFF;
+
+ if (aml_dmx_get_video_pts_bit32(dvb)) {
+ pts_val = pts_val | (1LL<<32);
+ }
+
+ ret = sprintf(buf, "%llu\n", pts_val);
+
+ return ret;
+}
+
+/*Show the 33bit Audio PTS value*/
+static ssize_t demux_show_audio_pts_u64(struct class *class,
+ struct class_attribute *attr, char *buf)
+{
+ struct aml_dvb *dvb = &aml_dvb_device;
+ ssize_t ret = 0;
+
+ u64 pts_val = aml_dmx_get_audio_pts(dvb);
+ pts_val &= 0x00000000FFFFFFFF;
+
+ if (aml_dmx_get_audio_pts_bit32(dvb)) {
+ pts_val = pts_val | (1LL<<32);
+ }
+
+ ret = sprintf(buf, "%llu\n", pts_val);
+
+ return ret;
+}
/*Show the First Video PTS value*/
static ssize_t demux_show_first_video_pts(struct class *class,
NULL),
__ATTR(video_pts_bit32, 0644, demux_show_video_pts_bit32, NULL),
__ATTR(audio_pts_bit32, 0644, demux_show_audio_pts_bit32, NULL),
+ __ATTR(video_pts_u64, 0644, demux_show_video_pts_u64, NULL),
+ __ATTR(audio_pts_u64, 0644, demux_show_audio_pts_u64, NULL),
__ATTR(first_video_pts, 0644, demux_show_first_video_pts,
NULL),
__ATTR(first_audio_pts, 0644, demux_show_first_audio_pts,
static void tsdemux_pcr_set(unsigned int pcr);
/*TODO irq*/
+/* bit 15 ---------------*/
+/* bit 12 --VIDEO_PTS[32]*/
+/* bit 0 ---------------*/
+/*Read the 13th bit of STB_PTS_DTS_STATUS register
+correspond to the highest bit of video pts*/
static irqreturn_t tsdemux_isr(int irq, void *dev_id)
{
u32 int_status = 0;
if (int_status & (1 << NEW_PDTS_READY)) {
if (!enable_demux_driver()) {
u32 pdts_status = READ_DEMUX_REG(STB_PTS_DTS_STATUS);
+ u64 vpts;
+
+ vpts = READ_MPEG_REG(VIDEO_PTS_DEMUX);
+ vpts &= 0x00000000FFFFFFFF;
+ if (pdts_status & 0x1000) {
+ vpts = vpts | (1LL<<32);
+ }
if (pdts_status & (1 << VIDEO_PTS_READY))
- pts_checkin_wrptr(PTS_TYPE_VIDEO,
+ pts_checkin_wrptr_pts33(PTS_TYPE_VIDEO,
READ_DEMUX_REG(VIDEO_PDTS_WR_PTR),
- READ_DEMUX_REG(VIDEO_PTS_DEMUX));
+ vpts);
if (pdts_status & (1 << AUDIO_PTS_READY))
pts_checkin_wrptr(PTS_TYPE_AUDIO,
#define DMX_READ_REG(i, r)\
((i) ? ((i == 1) ? READ_DEMUX_REG(r##_2) : \
READ_DEMUX_REG(r##_3)) : READ_DEMUX_REG(r))
-
+ u64 vpts;
u32 pdts_status = DMX_READ_REG(id, STB_PTS_DTS_STATUS);
+ vpts = DMX_READ_REG(id, VIDEO_PTS_DEMUX);
+ vpts &= 0x00000000FFFFFFFF;
+ if (pdts_status & 0x1000) {
+ vpts = vpts | (1LL<<32);
+ }
if (pdts_status & (1 << VIDEO_PTS_READY))
- pts_checkin_wrptr(PTS_TYPE_VIDEO,
+ pts_checkin_wrptr_pts33(PTS_TYPE_VIDEO,
DMX_READ_REG(id, VIDEO_PDTS_WR_PTR),
- DMX_READ_REG(id, VIDEO_PTS_DEMUX));
+ vpts);
if (pdts_status & (1 << AUDIO_PTS_READY))
pts_checkin_wrptr(PTS_TYPE_AUDIO,