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

Commit dde45099 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

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

* 'for-v4.8/media/exynos-mfc' of git://linuxtv.org/snawrocki/samsung:
  media: s5p-mfc: add iommu support
  media: s5p-mfc: replace custom reserved memory handling code with generic one
  media: s5p-mfc: use generic reserved memory bindings
  of: reserved_mem: add support for using more than one region for given device
  media: set proper max seg size for devices on Exynos SoCs
  media: vb2-dma-contig: add helper for setting dma max seg size
  s5p-mfc: Fix race between s5p_mfc_probe() and s5p_mfc_open()
  s5p-mfc: Add release callback for memory region devs
  s5p-mfc: Set device name for reserved memory region devs
parents 6a2cf60b 04f77673
Loading
Loading
Loading
Loading
+31 −8
Original line number Diff line number Diff line
@@ -21,15 +21,18 @@ Required properties:
  - clock-names : from common clock binding: must contain "mfc",
		  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:
  - power-domains : power-domain property defined with a phandle
			   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:
SoC specific DT entry:
@@ -43,9 +46,29 @@ mfc: codec@13400000 {
	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:

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

	/* 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);
	if (IS_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);

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

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

	/* 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);
	if (IS_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);
	vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx);
	vb2_dma_contig_clear_max_seg_size(&pdev->dev);

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

	vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
	is->alloc_ctx = vb2_dma_contig_init_ctx(dev);
	if (IS_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);
	fimc_is_unregister_subdevs(is);
	vb2_dma_contig_cleanup_ctx(is->alloc_ctx);
	vb2_dma_contig_clear_max_seg_size(dev);
	fimc_is_put_clocks(is);
	fimc_is_debugfs_remove(is);
	release_firmware(is->fw.f_w);
+2 −0
Original line number Diff line number Diff line
@@ -1551,6 +1551,7 @@ static int fimc_lite_probe(struct platform_device *pdev)
			goto err_sd;
	}

	vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));
	fimc->alloc_ctx = vb2_dma_contig_init_ctx(dev);
	if (IS_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);
	fimc_lite_unregister_capture_subdev(fimc);
	vb2_dma_contig_cleanup_ctx(fimc->alloc_ctx);
	vb2_dma_contig_clear_max_seg_size(dev);
	fimc_lite_clk_put(fimc);

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