/* vpif_buffer_setup: This function allocates memory for the buffers  */
static int vpif_buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size)
/* vpif_buffer_setup: This function allocates memory for the buffers  */
static int vpif_buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size)
{
	struct vpif_fh *fh = q->priv_data;
	struct channel_obj *ch = fh->channel;
	struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
	if (V4L2_MEMORY_MMAP != common->memory)
		return 0;
	*size = config_params.channel_bufsize[ch->channel_id];
	if (*count < config_params.min_numbuffers)
		*count = config_params.min_numbuffers;
	return 0;
}