linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/2] Add display-timing node parsing to exynos drm fimd
@ 2013-02-21  5:11 Vikas Sajjan
  2013-02-21  5:11 ` [PATCH v7 1/2] video: drm: exynos: Add display-timing node parsing using video helper function Vikas Sajjan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Vikas Sajjan @ 2013-02-21  5:11 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-media, kgene.kim, inki.dae, l.krishna

Add display-timing node parsing to drm fimd and depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

It also adds pinctrl support for drm fimd.

changes since v6:
	addressed comments from Inki Dae <inki.dae@samsung.com> to
	separated out the pinctrl functionality and made a separate patch.

changes since v5:
	- addressed comments from Inki Dae <inki.dae@samsung.com>,
	to remove the allocation of 'fbmode' and replaced
	'-1'in "of_get_fb_videomode(dev->of_node, fbmode, -1)" with
	OF_USE_NATIVE_MODE.

changes since v4:
	- addressed comments from Paul Menzel 
	<paulepanter@users.sourceforge.net>, to modify the commit message

changes since v3:
	- addressed comments from Sean Paul <seanpaul@chromium.org>, to modify
	the return values and print messages.

changes since v2:
	- moved 'devm_pinctrl_get_select_default' function call under
		'if (pdev->dev.of_node)', this makes NON-DT code unchanged.
		(reported by: Rahul Sharma <r.sh.open@gmail.com>)

changes since v1:
	- addressed comments from Sean Paul <seanpaul@chromium.org>


Vikas Sajjan (2):
  video: drm: exynos: Add display-timing node parsing using video
    helper function
  video: drm: exynos: Add pinctrl support to fimd

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   36 ++++++++++++++++++++++++++----
 1 file changed, 32 insertions(+), 4 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v7 1/2] video: drm: exynos: Add display-timing node parsing using video helper function
  2013-02-21  5:11 [PATCH v7 0/2] Add display-timing node parsing to exynos drm fimd Vikas Sajjan
@ 2013-02-21  5:11 ` Vikas Sajjan
  2013-02-21  5:11 ` [PATCH v7 2/2] video: drm: exynos: Add pinctrl support to fimd Vikas Sajjan
  2013-02-21  6:57 ` [PATCH v7 0/2] Add display-timing node parsing to exynos drm fimd Joonyoung Shim
  2 siblings, 0 replies; 6+ messages in thread
From: Vikas Sajjan @ 2013-02-21  5:11 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-media, kgene.kim, inki.dae, l.krishna

Add support for parsing the display-timing node using video helper
function.

The DT node parsing and pinctrl selection is done only if 'dev.of_node'
exists and the NON-DT logic is still maintained under the 'else' part.

Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..f80cf68 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -20,6 +20,7 @@
 #include <linux/of_device.h>
 #include <linux/pm_runtime.h>
 
+#include <video/of_display_timing.h>
 #include <video/samsung_fimd.h>
 #include <drm/exynos_drm.h>
 
@@ -877,16 +878,34 @@ static int fimd_probe(struct platform_device *pdev)
 	struct exynos_drm_subdrv *subdrv;
 	struct exynos_drm_fimd_pdata *pdata;
 	struct exynos_drm_panel_info *panel;
+	struct fb_videomode *fbmode;
 	struct resource *res;
 	int win;
 	int ret = -EINVAL;
 
 	DRM_DEBUG_KMS("%s\n", __FILE__);
 
-	pdata = pdev->dev.platform_data;
-	if (!pdata) {
-		dev_err(dev, "no platform data specified\n");
-		return -EINVAL;
+	if (pdev->dev.of_node) {
+		pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+		if (!pdata) {
+			DRM_ERROR("memory allocation for pdata failed\n");
+			return -ENOMEM;
+		}
+
+		fbmode = &pdata->panel.timing;
+		ret = of_get_fb_videomode(dev->of_node, fbmode,
+					OF_USE_NATIVE_MODE);
+		if (ret) {
+			DRM_ERROR("failed: of_get_fb_videomode()\n"
+				"with return value: %d\n", ret);
+			return ret;
+		}
+	} else {
+		pdata = pdev->dev.platform_data;
+		if (!pdata) {
+			DRM_ERROR("no platform data specified\n");
+			return -EINVAL;
+		}
 	}
 
 	panel = &pdata->panel;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v7 2/2] video: drm: exynos: Add pinctrl support to fimd
  2013-02-21  5:11 [PATCH v7 0/2] Add display-timing node parsing to exynos drm fimd Vikas Sajjan
  2013-02-21  5:11 ` [PATCH v7 1/2] video: drm: exynos: Add display-timing node parsing using video helper function Vikas Sajjan
@ 2013-02-21  5:11 ` Vikas Sajjan
  2013-02-21  7:05   ` Joonyoung Shim
  2013-02-21  6:57 ` [PATCH v7 0/2] Add display-timing node parsing to exynos drm fimd Joonyoung Shim
  2 siblings, 1 reply; 6+ messages in thread
From: Vikas Sajjan @ 2013-02-21  5:11 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-media, kgene.kim, inki.dae, l.krishna

Adds support for pinctrl to drm fimd.

Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index f80cf68..878b134 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -19,6 +19,7 @@
 #include <linux/clk.h>
 #include <linux/of_device.h>
 #include <linux/pm_runtime.h>
+#include <linux/pinctrl/consumer.h>
 
 #include <video/of_display_timing.h>
 #include <video/samsung_fimd.h>
@@ -879,6 +880,7 @@ static int fimd_probe(struct platform_device *pdev)
 	struct exynos_drm_fimd_pdata *pdata;
 	struct exynos_drm_panel_info *panel;
 	struct fb_videomode *fbmode;
+	struct pinctrl *pctrl;
 	struct resource *res;
 	int win;
 	int ret = -EINVAL;
@@ -900,6 +902,13 @@ static int fimd_probe(struct platform_device *pdev)
 				"with return value: %d\n", ret);
 			return ret;
 		}
+		pctrl = devm_pinctrl_get_select_default(dev);
+		if (IS_ERR_OR_NULL(pctrl)) {
+			DRM_ERROR("failed: devm_pinctrl_get_select_default()\n"
+				"with return value: %d\n", PTR_RET(pctrl));
+			return PTR_RET(pctrl);
+		}
+
 	} else {
 		pdata = pdev->dev.platform_data;
 		if (!pdata) {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v7 0/2] Add display-timing node parsing to exynos drm fimd
  2013-02-21  5:11 [PATCH v7 0/2] Add display-timing node parsing to exynos drm fimd Vikas Sajjan
  2013-02-21  5:11 ` [PATCH v7 1/2] video: drm: exynos: Add display-timing node parsing using video helper function Vikas Sajjan
  2013-02-21  5:11 ` [PATCH v7 2/2] video: drm: exynos: Add pinctrl support to fimd Vikas Sajjan
@ 2013-02-21  6:57 ` Joonyoung Shim
  2 siblings, 0 replies; 6+ messages in thread
From: Joonyoung Shim @ 2013-02-21  6:57 UTC (permalink / raw)
  To: Vikas Sajjan; +Cc: dri-devel, l.krishna, kgene.kim, linux-media

Hi,

Please refer my comments about v6 patch.


On 02/21/2013 02:11 PM, Vikas Sajjan wrote:
> Add display-timing node parsing to drm fimd and depends on
> the display helper patchset at
> http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html
>
> It also adds pinctrl support for drm fimd.
>
> changes since v6:
> 	addressed comments from Inki Dae <inki.dae@samsung.com> to
> 	separated out the pinctrl functionality and made a separate patch.
>
> changes since v5:
> 	- addressed comments from Inki Dae <inki.dae@samsung.com>,
> 	to remove the allocation of 'fbmode' and replaced
> 	'-1'in "of_get_fb_videomode(dev->of_node, fbmode, -1)" with
> 	OF_USE_NATIVE_MODE.
>
> changes since v4:
> 	- addressed comments from Paul Menzel
> 	<paulepanter@users.sourceforge.net>, to modify the commit message
>
> changes since v3:
> 	- addressed comments from Sean Paul <seanpaul@chromium.org>, to modify
> 	the return values and print messages.
>
> changes since v2:
> 	- moved 'devm_pinctrl_get_select_default' function call under
> 		'if (pdev->dev.of_node)', this makes NON-DT code unchanged.
> 		(reported by: Rahul Sharma <r.sh.open@gmail.com>)
>
> changes since v1:
> 	- addressed comments from Sean Paul <seanpaul@chromium.org>
>
>
> Vikas Sajjan (2):
>    video: drm: exynos: Add display-timing node parsing using video
>      helper function
>    video: drm: exynos: Add pinctrl support to fimd
>
>   drivers/gpu/drm/exynos/exynos_drm_fimd.c |   36 ++++++++++++++++++++++++++----
>   1 file changed, 32 insertions(+), 4 deletions(-)
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v7 2/2] video: drm: exynos: Add pinctrl support to fimd
  2013-02-21  5:11 ` [PATCH v7 2/2] video: drm: exynos: Add pinctrl support to fimd Vikas Sajjan
@ 2013-02-21  7:05   ` Joonyoung Shim
  2013-02-27  9:29     ` Vikas Sajjan
  0 siblings, 1 reply; 6+ messages in thread
From: Joonyoung Shim @ 2013-02-21  7:05 UTC (permalink / raw)
  To: Vikas Sajjan; +Cc: dri-devel, l.krishna, kgene.kim, linux-media

Hi,

On 02/21/2013 02:11 PM, Vikas Sajjan wrote:
> Adds support for pinctrl to drm fimd.
>
> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
> ---
>   drivers/gpu/drm/exynos/exynos_drm_fimd.c |    9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index f80cf68..878b134 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -19,6 +19,7 @@
>   #include <linux/clk.h>
>   #include <linux/of_device.h>
>   #include <linux/pm_runtime.h>
> +#include <linux/pinctrl/consumer.h>
>   
>   #include <video/of_display_timing.h>
>   #include <video/samsung_fimd.h>
> @@ -879,6 +880,7 @@ static int fimd_probe(struct platform_device *pdev)
>   	struct exynos_drm_fimd_pdata *pdata;
>   	struct exynos_drm_panel_info *panel;
>   	struct fb_videomode *fbmode;
> +	struct pinctrl *pctrl;
>   	struct resource *res;
>   	int win;
>   	int ret = -EINVAL;
> @@ -900,6 +902,13 @@ static int fimd_probe(struct platform_device *pdev)
>   				"with return value: %d\n", ret);
>   			return ret;
>   		}
> +		pctrl = devm_pinctrl_get_select_default(dev);
> +		if (IS_ERR_OR_NULL(pctrl)) {
> +			DRM_ERROR("failed: devm_pinctrl_get_select_default()\n"
> +				"with return value: %d\n", PTR_RET(pctrl));
> +			return PTR_RET(pctrl);
> +		}

I think pinctrl isn't related with dt then it doesn't need to be in "if 
(pdev->dev.of_node)".

> +

Blank.

>   	} else {
>   		pdata = pdev->dev.platform_data;
>   		if (!pdata) {


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v7 2/2] video: drm: exynos: Add pinctrl support to fimd
  2013-02-21  7:05   ` Joonyoung Shim
@ 2013-02-27  9:29     ` Vikas Sajjan
  0 siblings, 0 replies; 6+ messages in thread
From: Vikas Sajjan @ 2013-02-27  9:29 UTC (permalink / raw)
  To: Joonyoung Shim; +Cc: dri-devel, l.krishna, kgene.kim, linux-media, sunil joshi

Hi Mr.Shim,

On 21 February 2013 12:35, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
> Hi,
>
>
> On 02/21/2013 02:11 PM, Vikas Sajjan wrote:
>>
>> Adds support for pinctrl to drm fimd.
>>
>> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
>> Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
>> ---
>>   drivers/gpu/drm/exynos/exynos_drm_fimd.c |    9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> index f80cf68..878b134 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> @@ -19,6 +19,7 @@
>>   #include <linux/clk.h>
>>   #include <linux/of_device.h>
>>   #include <linux/pm_runtime.h>
>> +#include <linux/pinctrl/consumer.h>
>>     #include <video/of_display_timing.h>
>>   #include <video/samsung_fimd.h>
>> @@ -879,6 +880,7 @@ static int fimd_probe(struct platform_device *pdev)
>>         struct exynos_drm_fimd_pdata *pdata;
>>         struct exynos_drm_panel_info *panel;
>>         struct fb_videomode *fbmode;
>> +       struct pinctrl *pctrl;
>>         struct resource *res;
>>         int win;
>>         int ret = -EINVAL;
>> @@ -900,6 +902,13 @@ static int fimd_probe(struct platform_device *pdev)
>>                                 "with return value: %d\n", ret);
>>                         return ret;
>>                 }
>> +               pctrl = devm_pinctrl_get_select_default(dev);
>> +               if (IS_ERR_OR_NULL(pctrl)) {
>> +                       DRM_ERROR("failed:
>> devm_pinctrl_get_select_default()\n"
>> +                               "with return value: %d\n",
>> PTR_RET(pctrl));
>> +                       return PTR_RET(pctrl);
>> +               }
>
>
> I think pinctrl isn't related with dt then it doesn't need to be in "if
> (pdev->dev.of_node)".
>
actuall in V1 patchset it was outside "if (pdev->dev.of_node)".
lated in V2, I moved 'devm_pinctrl_get_select_default' function call under
'if (pdev->dev.of_node)', to keep NON-DT code unchanged.

>>
>
>
> Blank.
>
>
>>         } else {
>>                 pdata = pdev->dev.platform_data;
>>                 if (!pdata) {
>
>



-- 
Thanks and Regards
 Vikas Sajjan

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-27  9:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-21  5:11 [PATCH v7 0/2] Add display-timing node parsing to exynos drm fimd Vikas Sajjan
2013-02-21  5:11 ` [PATCH v7 1/2] video: drm: exynos: Add display-timing node parsing using video helper function Vikas Sajjan
2013-02-21  5:11 ` [PATCH v7 2/2] video: drm: exynos: Add pinctrl support to fimd Vikas Sajjan
2013-02-21  7:05   ` Joonyoung Shim
2013-02-27  9:29     ` Vikas Sajjan
2013-02-21  6:57 ` [PATCH v7 0/2] Add display-timing node parsing to exynos drm fimd Joonyoung Shim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).