static int __devinit mxr_acquire_layers(struct mxr_device *mdev,
	struct mxr_platform_data *pdata)
{
	struct sub_mxr_device *sub_mxr;

	sub_mxr = &mdev->sub_mxr[MXR_SUB_MIXER0];
#if defined(CONFIG_ARCH_EXYNOS4)
	sub_mxr->layer[MXR_LAYER_VIDEO] = mxr_vp_layer_create(mdev,
			MXR_SUB_MIXER0, 0, EXYNOS_VIDEONODE_MXR_VIDEO);
#else
	sub_mxr->layer[MXR_LAYER_VIDEO] =
		mxr_video_layer_create(mdev, MXR_SUB_MIXER0, 0);
#endif
	sub_mxr->layer[MXR_LAYER_GRP0] = mxr_graph_layer_create(mdev,
			MXR_SUB_MIXER0, 0, EXYNOS_VIDEONODE_MXR_GRP(0));
	sub_mxr->layer[MXR_LAYER_GRP1] = mxr_graph_layer_create(mdev,
			MXR_SUB_MIXER0, 1, EXYNOS_VIDEONODE_MXR_GRP(1));
	if (!sub_mxr->layer[MXR_LAYER_VIDEO] || !sub_mxr->layer[MXR_LAYER_GRP0]
			|| !sub_mxr->layer[MXR_LAYER_GRP1]) {
		mxr_err(mdev, "failed to acquire layers\n");
		goto fail;
	}

	/* Exynos5250 supports 2 sub-mixers */
	if (MXR_MAX_SUB_MIXERS == 2) {
		sub_mxr = &mdev->sub_mxr[MXR_SUB_MIXER1];
		sub_mxr->layer[MXR_LAYER_VIDEO] =
			mxr_video_layer_create(mdev, MXR_SUB_MIXER1, 1);
		sub_mxr->layer[MXR_LAYER_GRP0] = mxr_graph_layer_create(mdev,
				MXR_SUB_MIXER1, 2, EXYNOS_VIDEONODE_MXR_GRP(2));
		sub_mxr->layer[MXR_LAYER_GRP1] = mxr_graph_layer_create(mdev,
				MXR_SUB_MIXER1, 3, EXYNOS_VIDEONODE_MXR_GRP(3));
		if (!sub_mxr->layer[MXR_LAYER_VIDEO] ||
				!sub_mxr->layer[MXR_LAYER_GRP0] ||
				!sub_mxr->layer[MXR_LAYER_GRP1]) {
			mxr_err(mdev, "failed to acquire layers\n");
			goto fail;
		}
	}

	return 0;

fail:
	mxr_release_layers(mdev);
	return -ENODEV;
}
Exemplo n.º 2
0
static int mxr_acquire_layers(struct mxr_device *mdev,
			      struct mxr_platform_data *pdata)
{
	mdev->layer[0] = mxr_graph_layer_create(mdev, 0);
	mdev->layer[1] = mxr_graph_layer_create(mdev, 1);
	mdev->layer[2] = mxr_vp_layer_create(mdev, 0);

	if (!mdev->layer[0] || !mdev->layer[1] || !mdev->layer[2]) {
		mxr_err(mdev, "failed to acquire layers\n");
		goto fail;
	}

	return 0;

fail:
	mxr_release_layers(mdev);
	return -ENODEV;
}