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(-)
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;
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) {
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) {
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) {
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(-)
dri-devel@lists.freedesktop.org