/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
/*
 * Copyright (c) 2020 MediaTek Inc.
 */

#ifndef MDRV_ATSC30_IF_AUSTIN_H
#define MDRV_ATSC30_IF_AUSTIN_H

#include <linux/types.h>
#include <media/dvb_dvr2.h>
#include <media/dvb_demux2.h>

#include "alp_parser_if.h"
#include "ring_buf.h"

#include "mdrv_atsc30_msg_q.h"
#include "mdrv_atsc30_if.h"

#include "mtk_dmx_bufctrl.h"
#include "mtk_dmx_dvrdrv.h"

int if_alp_austin_timestampinfo_prepare(
	struct mdrv_atsc30_if_context *atsc30_if_context,
	uintptr_t alp_packet_start,
	struct timestamp_info *timestamp_info);

int if_austin_prepare_payloadbuf(
	struct dvb_ringbuffer *ringbuf,
	struct mdrv_atsc30_if_context *atsc30_context,
	u64 *payload_wptr);

int if_austin_pvr_callback(
	const u8 *buffer1,
	size_t buffer1_len,
	const u8 *buffer2,
	size_t buffer2_len,
	struct dvb_dvr2 *dvb_dvr2,
	u32 *buf_flags);

int if_austin_pvr_finalize_callback(
	struct mtk_dvr2 *mtk_dvr2,
	int timeout);

int if_context_allocate_resource_austin(
		u8 framer_idx,
		struct mdrv_atsc30_if_context *atsc30_if_context,
		ring_buf_init_config_t austin_preparser_buf_config);

int if_context_free_resource_austin(
		struct mdrv_atsc30_if_context *atsc30_if_context);


#endif /* MDRV_ATSC30_IF_AUSTIN_H */

