linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/5] simplefb: add clock handling code
@ 2014-11-12 16:15 Hans de Goede
  2014-11-12 16:15 ` [PATCH v5 1/5] simplefb: Add simplefb MAINTAINERS entry Hans de Goede
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Hans de Goede @ 2014-11-12 16:15 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Tomi,

Here is v5 of my simplefb patch-set, this time with an Ack from
Grant Likely for the dt-bindings bits, which should end all controversy
surrounding that patch.

For changes since the original postings please see the per patch changelogs
in the patch commit messages.

Please merge this into your tree for 3.19.

Thanks & Regards,

Hans

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

* [PATCH v5 1/5] simplefb: Add simplefb MAINTAINERS entry
  2014-11-12 16:15 [PATCH v5 0/5] simplefb: add clock handling code Hans de Goede
@ 2014-11-12 16:15 ` Hans de Goede
  2014-11-12 16:15 ` [PATCH v5 2/5] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Hans de Goede @ 2014-11-12 16:15 UTC (permalink / raw)
  To: linux-arm-kernel

During the discussion about adding clock handling code to simplefb, it became
clear that simplefb currently does not have an active maintainer.

I've discussed this with Stephen Warren <swarren@wwwdotorg.org>, the original
author of simplefb, and with his permisson I'm picking up maintainership of
simplefb.

Cc: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
---
 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index df82827..7678808 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8442,6 +8442,14 @@ F:	drivers/media/usb/siano/
 F:	drivers/media/usb/siano/
 F:	drivers/media/mmc/siano/
 
+SIMPLEFB FB DRIVER
+M:	Hans de Goede <hdegoede@redhat.com>
+L:	linux-fbdev@vger.kernel.org
+S:	Maintained
+F:	Documentation/devicetree/bindings/video/simple-framebuffer.txt
+F:	drivers/video/fbdev/simplefb.c
+F:	include/linux/platform_data/simplefb.h
+
 SH_VEU V4L2 MEM2MEM DRIVER
 L:	linux-media@vger.kernel.org
 S:	Orphan
-- 
2.1.0


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

* [PATCH v5 2/5] dt-bindings: Add a clocks property to the simple-framebuffer binding
  2014-11-12 16:15 [PATCH v5 0/5] simplefb: add clock handling code Hans de Goede
  2014-11-12 16:15 ` [PATCH v5 1/5] simplefb: Add simplefb MAINTAINERS entry Hans de Goede
@ 2014-11-12 16:15 ` Hans de Goede
  2014-11-12 16:15 ` [PATCH v5 3/5] simplefb: formalize pseudo palette handling Hans de Goede
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Hans de Goede @ 2014-11-12 16:15 UTC (permalink / raw)
  To: linux-arm-kernel

A simple-framebuffer node represents a framebuffer setup by the firmware /
bootloader. Such a framebuffer may have a number of clocks in use, add a
property to communicate this to the OS.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Mike Turquette <mturquette@linaro.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Grant Likely <grant.likely@linaro.org>

--
Changes in v2:
-Added Reviewed-by: Mike Turquette <mturquette@linaro.org>
Changes in v3:
-Updated description to make clear simplefb deals with more then just memory
Changes in v5:
-Improved clocks property description
---
 .../devicetree/bindings/video/simple-framebuffer.txt         | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/video/simple-framebuffer.txt b/Documentation/devicetree/bindings/video/simple-framebuffer.txt
index 70c26f3..8f35718 100644
--- a/Documentation/devicetree/bindings/video/simple-framebuffer.txt
+++ b/Documentation/devicetree/bindings/video/simple-framebuffer.txt
@@ -1,8 +1,8 @@
 Simple Framebuffer
 
-A simple frame-buffer describes a raw memory region that may be rendered to,
-with the assumption that the display hardware has already been set up to scan
-out from that buffer.
+A simple frame-buffer describes a frame-buffer setup by firmware or
+the bootloader, with the assumption that the display hardware has already
+been set up to scan out from the memory pointed to by the reg property.
 
 Required properties:
 - compatible: "simple-framebuffer"
@@ -14,6 +14,12 @@ Required properties:
   - r5g6b5 (16-bit pixels, d[15:11]=r, d[10:5]=g, d[4:0]=b).
   - a8b8g8r8 (32-bit pixels, d[31:24]=a, d[23:16]=b, d[15:8]=g, d[7:0]=r).
 
+Optional properties:
+- clocks : List of clocks used by the framebuffer. Clocks listed here
+           are expected to already be configured correctly. The OS must
+           ensure these clocks are not modified or disabled while the
+           simple framebuffer remains active.
+
 Example:
 
 	framebuffer {
-- 
2.1.0


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

* [PATCH v5 3/5] simplefb: formalize pseudo palette handling
  2014-11-12 16:15 [PATCH v5 0/5] simplefb: add clock handling code Hans de Goede
  2014-11-12 16:15 ` [PATCH v5 1/5] simplefb: Add simplefb MAINTAINERS entry Hans de Goede
  2014-11-12 16:15 ` [PATCH v5 2/5] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
@ 2014-11-12 16:15 ` Hans de Goede
  2014-11-12 16:15 ` [PATCH v5 4/5] simplefb: add goto error path to probe Hans de Goede
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Hans de Goede @ 2014-11-12 16:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Luc Verhaegen <libv@skynet.be>

Add a proper struct describing simplefb private data, with the palette in there,
instead of directly storing the palette in the fb_info->par pointer.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Stephen Warren <swarren@nvidia.com>
[hdegoede@redhat.com: drop unnecessary void * cast]
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
--
Changes in v5:
-Improved commit message
---
 drivers/video/fbdev/simplefb.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index 210f3a0..ec112c1 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -41,6 +41,8 @@ static struct fb_var_screeninfo simplefb_var = {
 	.vmode		= FB_VMODE_NONINTERLACED,
 };
 
+#define PSEUDO_PALETTE_SIZE 16
+
 static int simplefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 			      u_int transp, struct fb_info *info)
 {
@@ -50,7 +52,7 @@ static int simplefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 	u32 cb = blue >> (16 - info->var.blue.length);
 	u32 value;
 
-	if (regno >= 16)
+	if (regno >= PSEUDO_PALETTE_SIZE)
 		return -EINVAL;
 
 	value = (cr << info->var.red.offset) |
@@ -163,11 +165,16 @@ static int simplefb_parse_pd(struct platform_device *pdev,
 	return 0;
 }
 
+struct simplefb_par {
+	u32 palette[PSEUDO_PALETTE_SIZE];
+};
+
 static int simplefb_probe(struct platform_device *pdev)
 {
 	int ret;
 	struct simplefb_params params;
 	struct fb_info *info;
+	struct simplefb_par *par;
 	struct resource *mem;
 
 	if (fb_get_options("simplefb", NULL))
@@ -188,11 +195,13 @@ static int simplefb_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	info = framebuffer_alloc(sizeof(u32) * 16, &pdev->dev);
+	info = framebuffer_alloc(sizeof(struct simplefb_par), &pdev->dev);
 	if (!info)
 		return -ENOMEM;
 	platform_set_drvdata(pdev, info);
 
+	par = info->par;
+
 	info->fix = simplefb_fix;
 	info->fix.smem_start = mem->start;
 	info->fix.smem_len = resource_size(mem);
@@ -225,7 +234,7 @@ static int simplefb_probe(struct platform_device *pdev)
 		framebuffer_release(info);
 		return -ENODEV;
 	}
-	info->pseudo_palette = (void *)(info + 1);
+	info->pseudo_palette = par->palette;
 
 	dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%x bytes, mapped to 0x%p\n",
 			     info->fix.smem_start, info->fix.smem_len,
-- 
2.1.0


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

* [PATCH v5 4/5] simplefb: add goto error path to probe
  2014-11-12 16:15 [PATCH v5 0/5] simplefb: add clock handling code Hans de Goede
                   ` (2 preceding siblings ...)
  2014-11-12 16:15 ` [PATCH v5 3/5] simplefb: formalize pseudo palette handling Hans de Goede
@ 2014-11-12 16:15 ` Hans de Goede
  2014-11-12 16:15 ` [PATCH v5 5/5] simplefb: add clock handling code Hans de Goede
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Hans de Goede @ 2014-11-12 16:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Luc Verhaegen <libv@skynet.be>

Use the usual kernel style of goto error_foo to free resources on probe
error. This is a preparation patch for adding clocks support.

While at it also update ioremap_wc error return from ENODEV to ENOMEM.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
--
Changes in v5:
-Improved commit message
---
 drivers/video/fbdev/simplefb.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index ec112c1..cdcf1fe 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -220,8 +220,8 @@ static int simplefb_probe(struct platform_device *pdev)
 
 	info->apertures = alloc_apertures(1);
 	if (!info->apertures) {
-		framebuffer_release(info);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto error_fb_release;
 	}
 	info->apertures->ranges[0].base = info->fix.smem_start;
 	info->apertures->ranges[0].size = info->fix.smem_len;
@@ -231,8 +231,8 @@ static int simplefb_probe(struct platform_device *pdev)
 	info->screen_base = ioremap_wc(info->fix.smem_start,
 				       info->fix.smem_len);
 	if (!info->screen_base) {
-		framebuffer_release(info);
-		return -ENODEV;
+		ret = -ENOMEM;
+		goto error_fb_release;
 	}
 	info->pseudo_palette = par->palette;
 
@@ -247,14 +247,18 @@ static int simplefb_probe(struct platform_device *pdev)
 	ret = register_framebuffer(info);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);
-		iounmap(info->screen_base);
-		framebuffer_release(info);
-		return ret;
+		goto error_unmap;
 	}
 
 	dev_info(&pdev->dev, "fb%d: simplefb registered!\n", info->node);
 
 	return 0;
+
+error_unmap:
+	iounmap(info->screen_base);
+error_fb_release:
+	framebuffer_release(info);
+	return ret;
 }
 
 static int simplefb_remove(struct platform_device *pdev)
-- 
2.1.0


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

* [PATCH v5 5/5] simplefb: add clock handling code
  2014-11-12 16:15 [PATCH v5 0/5] simplefb: add clock handling code Hans de Goede
                   ` (3 preceding siblings ...)
  2014-11-12 16:15 ` [PATCH v5 4/5] simplefb: add goto error path to probe Hans de Goede
@ 2014-11-12 16:15 ` Hans de Goede
  2014-11-13  7:38 ` [PATCH v5 0/5] " Grant Likely
  2014-11-13 15:20 ` Tomi Valkeinen
  6 siblings, 0 replies; 11+ messages in thread
From: Hans de Goede @ 2014-11-12 16:15 UTC (permalink / raw)
  To: linux-arm-kernel

From: Luc Verhaegen <libv@skynet.be>

This claims and enables clocks listed in the simple framebuffer dt node.
This is needed so that the display engine, in case the required clocks
are known by the kernel code and are described in the dt, will remain
properly enabled.

Signed-off-by: Luc Verhaegen <libv@skynet.be>
[hdegoede@redhat.com: Change clks from list to dynamic array]
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
--
Changes in v4:
-change clks from linkedlist to dynamic allocated array
-propagate EPROBE_DEFER up from simplefb_clocks_init to simplefb_probe
---
 drivers/video/fbdev/simplefb.c | 101 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 100 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index cdcf1fe..cd96edd 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -26,6 +26,7 @@
 #include <linux/module.h>
 #include <linux/platform_data/simplefb.h>
 #include <linux/platform_device.h>
+#include <linux/clk-provider.h>
 
 static struct fb_fix_screeninfo simplefb_fix = {
 	.id		= "simple",
@@ -167,8 +168,98 @@ static int simplefb_parse_pd(struct platform_device *pdev,
 
 struct simplefb_par {
 	u32 palette[PSEUDO_PALETTE_SIZE];
+	int clk_count;
+	struct clk **clks;
 };
 
+/*
+ * Clock handling code.
+ *
+ * Here we handle the clocks property of our "simple-framebuffer" dt node.
+ * This is necessary so that we can make sure that any clocks needed by
+ * the display engine that the bootloader set up for us (and for which it
+ * provided a simplefb dt node), stay up, for the life of the simplefb
+ * driver.
+ *
+ * When the driver unloads, we cleanly disable, and then release the clocks.
+ *
+ * We only complain about errors here, no action is taken as the most likely
+ * error can only happen due to a mismatch between the bootloader which set
+ * up simplefb, and the clock definitions in the device tree. Chances are
+ * that there are no adverse effects, and if there are, a clean teardown of
+ * the fb probe will not help us much either. So just complain and carry on,
+ * and hope that the user actually gets a working fb at the end of things.
+ */
+static int
+simplefb_clocks_init(struct simplefb_par *par, struct platform_device *pdev)
+{
+	struct device_node *np = pdev->dev.of_node;
+	struct clk *clock;
+	int i, ret;
+
+	if (dev_get_platdata(&pdev->dev) || !np)
+		return 0;
+
+	par->clk_count = of_clk_get_parent_count(np);
+	if (par->clk_count <= 0)
+		return 0;
+
+	par->clks = kcalloc(par->clk_count, sizeof(struct clk *), GFP_KERNEL);
+	if (!par->clks)
+		return -ENOMEM;
+
+	for (i = 0; i < par->clk_count; i++) {
+		clock = of_clk_get(np, i);
+		if (IS_ERR(clock)) {
+			if (PTR_ERR(clock) = -EPROBE_DEFER) {
+				while (--i >= 0) {
+					if (par->clks[i])
+						clk_put(par->clks[i]);
+				}
+				kfree(par->clks);
+				return -EPROBE_DEFER;
+			}
+			dev_err(&pdev->dev, "%s: clock %d not found: %ld\n",
+				__func__, i, PTR_ERR(clock));
+			continue;
+		}
+		par->clks[i] = clock;
+	}
+
+	for (i = 0; i < par->clk_count; i++) {
+		if (par->clks[i]) {
+			ret = clk_prepare_enable(par->clks[i]);
+			if (ret) {
+				dev_err(&pdev->dev,
+					"%s: failed to enable clock %d: %d\n",
+					__func__, i, ret);
+				clk_put(par->clks[i]);
+				par->clks[i] = NULL;
+			}
+		}
+	}
+
+	return 0;
+}
+
+static void
+simplefb_clocks_destroy(struct simplefb_par *par)
+{
+	int i;
+
+	if (!par->clks)
+		return;
+
+	for (i = 0; i < par->clk_count; i++) {
+		if (par->clks[i]) {
+			clk_disable_unprepare(par->clks[i]);
+			clk_put(par->clks[i]);
+		}
+	}
+
+	kfree(par->clks);
+}
+
 static int simplefb_probe(struct platform_device *pdev)
 {
 	int ret;
@@ -236,6 +327,10 @@ static int simplefb_probe(struct platform_device *pdev)
 	}
 	info->pseudo_palette = par->palette;
 
+	ret = simplefb_clocks_init(par, pdev);
+	if (ret < 0)
+		goto error_unmap;
+
 	dev_info(&pdev->dev, "framebuffer at 0x%lx, 0x%x bytes, mapped to 0x%p\n",
 			     info->fix.smem_start, info->fix.smem_len,
 			     info->screen_base);
@@ -247,13 +342,15 @@ static int simplefb_probe(struct platform_device *pdev)
 	ret = register_framebuffer(info);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);
-		goto error_unmap;
+		goto error_clocks;
 	}
 
 	dev_info(&pdev->dev, "fb%d: simplefb registered!\n", info->node);
 
 	return 0;
 
+error_clocks:
+	simplefb_clocks_destroy(par);
 error_unmap:
 	iounmap(info->screen_base);
 error_fb_release:
@@ -264,8 +361,10 @@ error_fb_release:
 static int simplefb_remove(struct platform_device *pdev)
 {
 	struct fb_info *info = platform_get_drvdata(pdev);
+	struct simplefb_par *par = info->par;
 
 	unregister_framebuffer(info);
+	simplefb_clocks_destroy(par);
 	framebuffer_release(info);
 
 	return 0;
-- 
2.1.0


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

* Re: [PATCH v5 0/5] simplefb: add clock handling code
  2014-11-12 16:15 [PATCH v5 0/5] simplefb: add clock handling code Hans de Goede
                   ` (4 preceding siblings ...)
  2014-11-12 16:15 ` [PATCH v5 5/5] simplefb: add clock handling code Hans de Goede
@ 2014-11-13  7:38 ` Grant Likely
  2014-11-13 16:05   ` Grant Likely
  2014-11-13 15:20 ` Tomi Valkeinen
  6 siblings, 1 reply; 11+ messages in thread
From: Grant Likely @ 2014-11-13  7:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 12, 2014 at 4:15 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> Hi Tomi,
>
> Here is v5 of my simplefb patch-set, this time with an Ack from
> Grant Likely for the dt-bindings bits, which should end all controversy
> surrounding that patch.
>
> For changes since the original postings please see the per patch changelogs
> in the patch commit messages.
>
> Please merge this into your tree for 3.19.

Hi Tomi,

I'm discussing this with Rob today. Please hold off 24 hours before
merging. If you don't hear anything to the contrary by tomorrow then
go ahead and merge.

g.

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

* Re: [PATCH v5 0/5] simplefb: add clock handling code
  2014-11-12 16:15 [PATCH v5 0/5] simplefb: add clock handling code Hans de Goede
                   ` (5 preceding siblings ...)
  2014-11-13  7:38 ` [PATCH v5 0/5] " Grant Likely
@ 2014-11-13 15:20 ` Tomi Valkeinen
  2014-11-13 18:00   ` Hans de Goede
  6 siblings, 1 reply; 11+ messages in thread
From: Tomi Valkeinen @ 2014-11-13 15:20 UTC (permalink / raw)
  To: linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1865 bytes --]

On 12/11/14 18:15, Hans de Goede wrote:
> Hi Tomi,
> 
> Here is v5 of my simplefb patch-set, this time with an Ack from
> Grant Likely for the dt-bindings bits, which should end all controversy
> surrounding that patch.
> 
> For changes since the original postings please see the per patch changelogs
> in the patch commit messages.
> 
> Please merge this into your tree for 3.19.

I applied this and the "dt-bindings: simplefb: Specify node location and
handoff related properties" v3 series to my test branch, compiled for
x64 and:

drivers/video/fbdev/simplefb.c: In function ‘simplefb_clocks_init’:
drivers/video/fbdev/simplefb.c:204:2: error: implicit declaration of
function ‘of_clk_get_parent_count’ [-Werror=implicit-function-declaration]
  par->clk_count = of_clk_get_parent_count(np);
  ^
In file included from include/linux/i2c.h:33:0,
                 from include/uapi/linux/fb.h:5,
                 from include/linux/fb.h:5,
                 from drivers/video/fbdev/simplefb.c:24:
drivers/video/fbdev/simplefb.c: In function ‘simplefb_init’:
drivers/video/fbdev/simplefb.c:399:25: error: ‘of_chosen’ undeclared
(first use in this function)
  for_each_child_of_node(of_chosen, np) {
                         ^
include/linux/of.h:736:33: note: in definition of macro
‘for_each_child_of_node’
  for (child = of_get_next_child(parent, NULL); child != NULL; \
                                 ^
drivers/video/fbdev/simplefb.c:399:25: note: each undeclared identifier
is reported only once for each function it appears in
  for_each_child_of_node(of_chosen, np) {
                         ^
include/linux/of.h:736:33: note: in definition of macro
‘for_each_child_of_node’
  for (child = of_get_next_child(parent, NULL); child != NULL; \
                                 ^

We need "depends on OF"?

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v5 0/5] simplefb: add clock handling code
  2014-11-13  7:38 ` [PATCH v5 0/5] " Grant Likely
@ 2014-11-13 16:05   ` Grant Likely
  2014-11-13 16:22     ` Tomi Valkeinen
  0 siblings, 1 reply; 11+ messages in thread
From: Grant Likely @ 2014-11-13 16:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 13, 2014 at 7:38 AM, Grant Likely <grant.likely@linaro.org> wrote:
> On Wed, Nov 12, 2014 at 4:15 PM, Hans de Goede <hdegoede@redhat.com> wrote:
>> Hi Tomi,
>>
>> Here is v5 of my simplefb patch-set, this time with an Ack from
>> Grant Likely for the dt-bindings bits, which should end all controversy
>> surrounding that patch.
>>
>> For changes since the original postings please see the per patch changelogs
>> in the patch commit messages.
>>
>> Please merge this into your tree for 3.19.
>
> Hi Tomi,
>
> I'm discussing this with Rob today. Please hold off 24 hours before
> merging. If you don't hear anything to the contrary by tomorrow then
> go ahead and merge.

I just talked to Rob. All is good, you can apply.

g.

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

* Re: [PATCH v5 0/5] simplefb: add clock handling code
  2014-11-13 16:05   ` Grant Likely
@ 2014-11-13 16:22     ` Tomi Valkeinen
  0 siblings, 0 replies; 11+ messages in thread
From: Tomi Valkeinen @ 2014-11-13 16:22 UTC (permalink / raw)
  To: linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 968 bytes --]

On 13/11/14 18:05, Grant Likely wrote:
> On Thu, Nov 13, 2014 at 7:38 AM, Grant Likely <grant.likely@linaro.org> wrote:
>> On Wed, Nov 12, 2014 at 4:15 PM, Hans de Goede <hdegoede@redhat.com> wrote:
>>> Hi Tomi,
>>>
>>> Here is v5 of my simplefb patch-set, this time with an Ack from
>>> Grant Likely for the dt-bindings bits, which should end all controversy
>>> surrounding that patch.
>>>
>>> For changes since the original postings please see the per patch changelogs
>>> in the patch commit messages.
>>>
>>> Please merge this into your tree for 3.19.
>>
>> Hi Tomi,
>>
>> I'm discussing this with Rob today. Please hold off 24 hours before
>> merging. If you don't hear anything to the contrary by tomorrow then
>> go ahead and merge.
> 
> I just talked to Rob. All is good, you can apply.

Ok. I'll apply tomorrow if there are no more comments during the night
for the new series, and the compilation issue has been solved.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH v5 0/5] simplefb: add clock handling code
  2014-11-13 15:20 ` Tomi Valkeinen
@ 2014-11-13 18:00   ` Hans de Goede
  0 siblings, 0 replies; 11+ messages in thread
From: Hans de Goede @ 2014-11-13 18:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 11/13/2014 04:20 PM, Tomi Valkeinen wrote:
> On 12/11/14 18:15, Hans de Goede wrote:
>> Hi Tomi,
>>
>> Here is v5 of my simplefb patch-set, this time with an Ack from
>> Grant Likely for the dt-bindings bits, which should end all controversy
>> surrounding that patch.
>>
>> For changes since the original postings please see the per patch changelogs
>> in the patch commit messages.
>>
>> Please merge this into your tree for 3.19.
> 
> I applied this and the "dt-bindings: simplefb: Specify node location and
> handoff related properties" v3 series to my test branch, compiled for
> x64 and:
> 
> drivers/video/fbdev/simplefb.c: In function ‘simplefb_clocks_init’:
> drivers/video/fbdev/simplefb.c:204:2: error: implicit declaration of
> function ‘of_clk_get_parent_count’ [-Werror=implicit-function-declaration]
>   par->clk_count = of_clk_get_parent_count(np);
>   ^
> In file included from include/linux/i2c.h:33:0,
>                  from include/uapi/linux/fb.h:5,
>                  from include/linux/fb.h:5,
>                  from drivers/video/fbdev/simplefb.c:24:
> drivers/video/fbdev/simplefb.c: In function ‘simplefb_init’:
> drivers/video/fbdev/simplefb.c:399:25: error: ‘of_chosen’ undeclared
> (first use in this function)
>   for_each_child_of_node(of_chosen, np) {
>                          ^
> include/linux/of.h:736:33: note: in definition of macro
> ‘for_each_child_of_node’
>   for (child = of_get_next_child(parent, NULL); child != NULL; \
>                                  ^
> drivers/video/fbdev/simplefb.c:399:25: note: each undeclared identifier
> is reported only once for each function it appears in
>   for_each_child_of_node(of_chosen, np) {
>                          ^
> include/linux/of.h:736:33: note: in definition of macro
> ‘for_each_child_of_node’
>   for (child = of_get_next_child(parent, NULL); child != NULL; \
>                                  ^
> 
> We need "depends on OF"?

Good catch!

So a quick-grep through the entire kernel sources has thought me that
apparently simplefb is used on non devicetree / of platforms through
platform-device instantiation, using the trick of naming the platform-device the
same as the driver to get the driver to bind.

So the answer to your compile breakage is to make the relevant code bits
be #ifdef CONFIG_OF

I'll respin the offending patch (5/5) in the "simplefb: add clock handling code"
series, and I'll respin the entire second series, as I need to also address
your comment on the example in the bindings there.

I hope to be able to post a re-spun version of both later tonight.

Regards,

Hans



> 
>  Tomi
> 
> 

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

end of thread, other threads:[~2014-11-13 18:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12 16:15 [PATCH v5 0/5] simplefb: add clock handling code Hans de Goede
2014-11-12 16:15 ` [PATCH v5 1/5] simplefb: Add simplefb MAINTAINERS entry Hans de Goede
2014-11-12 16:15 ` [PATCH v5 2/5] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
2014-11-12 16:15 ` [PATCH v5 3/5] simplefb: formalize pseudo palette handling Hans de Goede
2014-11-12 16:15 ` [PATCH v5 4/5] simplefb: add goto error path to probe Hans de Goede
2014-11-12 16:15 ` [PATCH v5 5/5] simplefb: add clock handling code Hans de Goede
2014-11-13  7:38 ` [PATCH v5 0/5] " Grant Likely
2014-11-13 16:05   ` Grant Likely
2014-11-13 16:22     ` Tomi Valkeinen
2014-11-13 15:20 ` Tomi Valkeinen
2014-11-13 18:00   ` Hans de Goede

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).