[v2,06/15] media: staging/imx: add imx7 capture subsystem

Message ID 20180423134750.30403-7-rui.silva@linaro.org
State New
Headers show
Series
  • media: staging/imx7: add i.MX7 media driver
Related show

Commit Message

Rui Miguel Silva April 23, 2018, 1:47 p.m.
Add imx7 capture subsystem to imx-media core to allow the use some of the
existing modules for i.MX5/6 with i.MX7 SoC.

Since i.MX7 does not have an IPU unset the ipu_present flag to differentiate
some runtime behaviors.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>

---
 drivers/staging/media/imx/imx-media-dev.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Rui Miguel Silva April 24, 2018, 8:46 a.m. | #1
Hi Philipp,
On Mon 23 Apr 2018 at 15:48, Philipp Zabel wrote:
> On Mon, 2018-04-23 at 14:47 +0100, Rui Miguel Silva wrote:

>> Add imx7 capture subsystem to imx-media core to allow the use 

>> some of the

>> existing modules for i.MX5/6 with i.MX7 SoC.

>> 

>> Since i.MX7 does not have an IPU unset the ipu_present flag to 

>> differentiate

>> some runtime behaviors.

>> 

>> Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>

>> ---

>>  drivers/staging/media/imx/imx-media-dev.c | 4 ++++

>>  1 file changed, 4 insertions(+)

>> 

>> diff --git a/drivers/staging/media/imx/imx-media-dev.c 

>> b/drivers/staging/media/imx/imx-media-dev.c

>> index c0f277adeebe..be68235c4caa 100644

>> --- a/drivers/staging/media/imx/imx-media-dev.c

>> +++ b/drivers/staging/media/imx/imx-media-dev.c

>> @@ -486,6 +486,9 @@ static int imx_media_probe(struct 

>> platform_device *pdev)

>>  

>>  	imxmd->ipu_present = true;

>>  

>> +	if (of_device_is_compatible(node, 

>> "fsl,imx7-capture-subsystem"))

>> +		imxmd->ipu_present = false;

>> +

>

> Is this something of_match_device should be used for?


Yeah, good point. I will develop your suggestion.

---
Cheers,
	Rui

>

>>  	if (imxmd->ipu_present) {

>>  		ret = imx_media_add_internal_subdevs(imxmd);

>>  		if (ret) {

>> @@ -543,6 +546,7 @@ static int imx_media_remove(struct 

>> platform_device *pdev)

>>  

>>  static const struct of_device_id imx_media_dt_ids[] = {

>>  	{ .compatible = "fsl,imx-capture-subsystem" },

>> +	{ .compatible = "fsl,imx7-capture-subsystem" },

>>  	{ /* sentinel */ }

>>  };

>>  MODULE_DEVICE_TABLE(of, imx_media_dt_ids);

>

> regards

> Philipp

> _______________________________________________

> devel mailing list

> devel@linuxdriverproject.org

> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c
index c0f277adeebe..be68235c4caa 100644
--- a/drivers/staging/media/imx/imx-media-dev.c
+++ b/drivers/staging/media/imx/imx-media-dev.c
@@ -486,6 +486,9 @@  static int imx_media_probe(struct platform_device *pdev)
 
 	imxmd->ipu_present = true;
 
+	if (of_device_is_compatible(node, "fsl,imx7-capture-subsystem"))
+		imxmd->ipu_present = false;
+
 	if (imxmd->ipu_present) {
 		ret = imx_media_add_internal_subdevs(imxmd);
 		if (ret) {
@@ -543,6 +546,7 @@  static int imx_media_remove(struct platform_device *pdev)
 
 static const struct of_device_id imx_media_dt_ids[] = {
 	{ .compatible = "fsl,imx-capture-subsystem" },
+	{ .compatible = "fsl,imx7-capture-subsystem" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, imx_media_dt_ids);