Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3185462f authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski
Browse files

Merge branch 'for-v4.8/media/exynos-mfc' of...

Merge branch 'for-v4.8/media/exynos-mfc' of git://linuxtv.org/snawrocki/samsung into for-v4.8/exynos-mfc

The Exynos MFC driver was converted to use a generic reserved memory
regions and IOMMU. Pull these changes before removal of mach-specific
code from mach-exynos and before changing DT bindings.
parents 1a695a90 04f77673
Loading
Loading
Loading
Loading
+31 −8
Original line number Original line Diff line number Diff line
@@ -21,15 +21,18 @@ Required properties:
  - clock-names : from common clock binding: must contain "mfc",
  - clock-names : from common clock binding: must contain "mfc",
		  corresponding to entry in the clocks property.
		  corresponding to entry in the clocks property.


  - samsung,mfc-r : Base address of the first memory bank used by MFC
		    for DMA contiguous memory allocation and its size.

  - samsung,mfc-l : Base address of the second memory bank used by MFC
		    for DMA contiguous memory allocation and its size.

Optional properties:
Optional properties:
  - power-domains : power-domain property defined with a phandle
  - power-domains : power-domain property defined with a phandle
			   to respective power domain.
			   to respective power domain.
  - memory-region : from reserved memory binding: phandles to two reserved
	memory regions, first is for "left" mfc memory bus interfaces,
	second if for the "right" mfc memory bus, used when no SYSMMU
	support is available

Obsolete properties:
  - samsung,mfc-r, samsung,mfc-l : support removed, please use memory-region
	property instead



Example:
Example:
SoC specific DT entry:
SoC specific DT entry:
@@ -43,9 +46,29 @@ mfc: codec@13400000 {
	clock-names = "mfc";
	clock-names = "mfc";
};
};


Reserved memory specific DT entry for given board (see reserved memory binding
for more information):

reserved-memory {
	#address-cells = <1>;
	#size-cells = <1>;
	ranges;

	mfc_left: region@51000000 {
		compatible = "shared-dma-pool";
		no-map;
		reg = <0x51000000 0x800000>;
	};

	mfc_right: region@43000000 {
		compatible = "shared-dma-pool";
		no-map;
		reg = <0x43000000 0x800000>;
	};
};

Board specific DT entry:
Board specific DT entry:


codec@13400000 {
codec@13400000 {
	samsung,mfc-r = <0x43000000 0x800000>;
	memory-region = <&mfc_left>, <&mfc_right>;
	samsung,mfc-l = <0x51000000 0x800000>;
};
};
+2 −0
Original line number Original line Diff line number Diff line
@@ -1124,6 +1124,7 @@ static int gsc_probe(struct platform_device *pdev)
		goto err_m2m;
		goto err_m2m;


	/* Initialize continious memory allocator */
	/* Initialize continious memory allocator */
	vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
	gsc->alloc_ctx = vb2_dma_contig_init_ctx(dev);
	gsc->alloc_ctx = vb2_dma_contig_init_ctx(dev);
	if (IS_ERR(gsc->alloc_ctx)) {
	if (IS_ERR(gsc->alloc_ctx)) {
		ret = PTR_ERR(gsc->alloc_ctx);
		ret = PTR_ERR(gsc->alloc_ctx);
@@ -1153,6 +1154,7 @@ static int gsc_remove(struct platform_device *pdev)
	v4l2_device_unregister(&gsc->v4l2_dev);
	v4l2_device_unregister(&gsc->v4l2_dev);


	vb2_dma_contig_cleanup_ctx(gsc->alloc_ctx);
	vb2_dma_contig_cleanup_ctx(gsc->alloc_ctx);
	vb2_dma_contig_clear_max_seg_size(&pdev->dev);
	pm_runtime_disable(&pdev->dev);
	pm_runtime_disable(&pdev->dev);
	gsc_clk_put(gsc);
	gsc_clk_put(gsc);


+2 −0
Original line number Original line Diff line number Diff line
@@ -1019,6 +1019,7 @@ static int fimc_probe(struct platform_device *pdev)
	}
	}


	/* Initialize contiguous memory allocator */
	/* Initialize contiguous memory allocator */
	vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
	fimc->alloc_ctx = vb2_dma_contig_init_ctx(dev);
	fimc->alloc_ctx = vb2_dma_contig_init_ctx(dev);
	if (IS_ERR(fimc->alloc_ctx)) {
	if (IS_ERR(fimc->alloc_ctx)) {
		ret = PTR_ERR(fimc->alloc_ctx);
		ret = PTR_ERR(fimc->alloc_ctx);
@@ -1124,6 +1125,7 @@ static int fimc_remove(struct platform_device *pdev)


	fimc_unregister_capture_subdev(fimc);
	fimc_unregister_capture_subdev(fimc);
	vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx);
	vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx);
	vb2_dma_contig_clear_max_seg_size(&pdev->dev);


	clk_disable(fimc->clock[CLK_BUS]);
	clk_disable(fimc->clock[CLK_BUS]);
	fimc_clk_put(fimc);
	fimc_clk_put(fimc);
+2 −0
Original line number Original line Diff line number Diff line
@@ -847,6 +847,7 @@ static int fimc_is_probe(struct platform_device *pdev)
	if (ret < 0)
	if (ret < 0)
		goto err_pm;
		goto err_pm;


	vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
	is->alloc_ctx = vb2_dma_contig_init_ctx(dev);
	is->alloc_ctx = vb2_dma_contig_init_ctx(dev);
	if (IS_ERR(is->alloc_ctx)) {
	if (IS_ERR(is->alloc_ctx)) {
		ret = PTR_ERR(is->alloc_ctx);
		ret = PTR_ERR(is->alloc_ctx);
@@ -940,6 +941,7 @@ static int fimc_is_remove(struct platform_device *pdev)
	free_irq(is->irq, is);
	free_irq(is->irq, is);
	fimc_is_unregister_subdevs(is);
	fimc_is_unregister_subdevs(is);
	vb2_dma_contig_cleanup_ctx(is->alloc_ctx);
	vb2_dma_contig_cleanup_ctx(is->alloc_ctx);
	vb2_dma_contig_clear_max_seg_size(dev);
	fimc_is_put_clocks(is);
	fimc_is_put_clocks(is);
	fimc_is_debugfs_remove(is);
	fimc_is_debugfs_remove(is);
	release_firmware(is->fw.f_w);
	release_firmware(is->fw.f_w);
+2 −0
Original line number Original line Diff line number Diff line
@@ -1551,6 +1551,7 @@ static int fimc_lite_probe(struct platform_device *pdev)
			goto err_sd;
			goto err_sd;
	}
	}


	vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
	fimc->alloc_ctx = vb2_dma_contig_init_ctx(dev);
	fimc->alloc_ctx = vb2_dma_contig_init_ctx(dev);
	if (IS_ERR(fimc->alloc_ctx)) {
	if (IS_ERR(fimc->alloc_ctx)) {
		ret = PTR_ERR(fimc->alloc_ctx);
		ret = PTR_ERR(fimc->alloc_ctx);
@@ -1652,6 +1653,7 @@ static int fimc_lite_remove(struct platform_device *pdev)
	pm_runtime_set_suspended(dev);
	pm_runtime_set_suspended(dev);
	fimc_lite_unregister_capture_subdev(fimc);
	fimc_lite_unregister_capture_subdev(fimc);
	vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx);
	vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx);
	vb2_dma_contig_clear_max_seg_size(dev);
	fimc_lite_clk_put(fimc);
	fimc_lite_clk_put(fimc);


	dev_info(dev, "Driver unloaded\n");
	dev_info(dev, "Driver unloaded\n");
Loading