static void tcpal_work_read_fic(struct work_struct *_param)
{
	s32 size = TCBD_FIC_SIZE, ret;
	u8 buff[TCBD_FIC_SIZE];
	u64 diff;
	struct tcbd_irq_data *irq_data = container_of(_param,
						struct tcbd_irq_data, work);
	struct tcbd_device *device = irq_data->device;

	diff = tcpal_diff_time(irq_data->start_tick);
	tcbd_debug(DEBUG_INTRRUPT, "work delay :%d\n", (u32)diff);

	ret = tcbd_read_fic_data(device, buff, size);
	if (ret < 0) {
		tcbd_debug(DEBUG_ERROR, "failed to read fic! %d\n", ret);
		goto exit_work;
	}

#ifndef CONFIG_SKY_TDMB
	tcbd_enqueue_data(buff, size, 0, 1);
#endif

	if (!start_tune) /* set by tune_frequency*/
		goto exit_work;

	ret = tcc_fic_run_decoder(buff, MAX_FIC_SIZE);
	if (ret > 0) {
		tcc_fic_get_ensbl_info(1);
		start_tune = 0;
		tcc_fic_parser_init();
	}
exit_work:
	enable_irq(irq_data->tcbd_irq);
}
Beispiel #2
0
static inline void tcpal_split_stream(struct tcbd_irq_data *irq_data)
{
	s32 size, ret = 0;
	s8 irq_status;
	s8 irq_error;
	static u8 buff_read[TCBD_MAX_THRESHOLD*2];
	struct tcbd_device *device = irq_data->device;

	ret = tcbd_read_irq_status(device, &irq_status, &irq_error);
	ret |= tcbd_clear_irq(device, irq_status);

	ret |= tcbd_read_stream(device, buff_read, &size);
	if (ret == 0 && !irq_error)
		tcbd_split_stream(0, buff_read, size);
	else {
		tcbd_debug(DEBUG_ERROR, "### buffer is full, skip the data "
			"(ret:%d, status=0x%02X, error=0x%02X, %d)  ###\n",
			ret, irq_status, irq_error,
			(s32)tcpal_diff_time(irq_data->start_tick));

		tcbd_init_stream_data_config(device,
			ENABLE_CMD_FIFO,
			device->selected_buff,
			device->intr_threshold);
		/*tcbd_reset_ip(device, TCBD_SYS_COMP_ALL, TCBD_SYS_COMP_EP);*/
		tcbd_init_parser(0, NULL);
	}
}
static void tcpal_work_parse_stream(struct work_struct *_param)
{
	u64 diff = tcpal_diff_time(tcbd_irq_handler_data.start_tick);
	struct tcbd_irq_data *irq_data =
		container_of(_param, struct tcbd_irq_data, work);

	/* for checking delay of workqueue */
	if (diff > 10)
		tcbd_debug(DEBUG_INTRRUPT, "diff work start and process :%d\n",
						(s32)diff);
	tcpal_split_stream(irq_data);
	enable_irq(irq_data->tcbd_irq);
}