aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/qcom/iris/iris_probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/platform/qcom/iris/iris_probe.c')
-rw-r--r--drivers/media/platform/qcom/iris/iris_probe.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
index ce16d894c809..3015e6cb347f 100644
--- a/drivers/media/platform/qcom/iris/iris_probe.c
+++ b/drivers/media/platform/qcom/iris/iris_probe.c
@@ -168,15 +168,20 @@ static void iris_remove(struct platform_device *pdev)
if (!core)
return;
+ iris_core_deinit(core);
+
video_unregister_device(core->vdev_dec);
v4l2_device_unregister(&core->v4l2_dev);
+
+ mutex_destroy(&core->lock);
}
static int iris_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct iris_core *core;
+ u64 dma_mask;
int ret;
core = devm_kzalloc(&pdev->dev, sizeof(*core), GFP_KERNEL);
@@ -184,6 +189,9 @@ static int iris_probe(struct platform_device *pdev)
return -ENOMEM;
core->dev = dev;
+ core->state = IRIS_CORE_DEINIT;
+ mutex_init(&core->lock);
+
core->reg_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(core->reg_base))
return PTR_ERR(core->reg_base);
@@ -209,8 +217,19 @@ static int iris_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, core);
+ dma_mask = core->iris_platform_data->dma_mask;
+
+ ret = dma_set_mask_and_coherent(dev, dma_mask);
+ if (ret)
+ goto err_vdev_unreg;
+
+ dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32));
+ dma_set_seg_boundary(&pdev->dev, DMA_BIT_MASK(32));
+
return 0;
+err_vdev_unreg:
+ video_unregister_device(core->vdev_dec);
err_v4l2_unreg:
v4l2_device_unregister(&core->v4l2_dev);