Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH] video: ARM CLCD: Added dt support to set tim2 register
From: Arun Ramamurthy @ 2015-02-25 21:01 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Russell King, Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: devicetree, linux-kernel, linux-fbdev, Dmitry Torokhov,
	Anatol Pomazau, Jonathan Richardson, Scott Branden, Ray Jui,
	bcm-kernel-feedback-list, Arun Ramamurthy

Added code based on linaro tree:
http://git.linaro.org/kernel/linux-linaro-stable.git
with commit id:6846e7822c4cab5a84672baace3b768c2d0db142
at drivers/video/amba-clcd.c. This lets the driver set
certain tim2 register bits after reading them from
device tree.

Reviewed-by: Ray Jui <rjui@broadcom.com>
Reviewed-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
---
 .../devicetree/bindings/video/arm,pl11x.txt        | 17 ++++++++-
 drivers/video/fbdev/amba-clcd.c                    | 41 ++++++++++++++++++++++
 2 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/video/arm,pl11x.txt b/Documentation/devicetree/bindings/video/arm,pl11x.txt
index 3e3039a..14d6f87 100644
--- a/Documentation/devicetree/bindings/video/arm,pl11x.txt
+++ b/Documentation/devicetree/bindings/video/arm,pl11x.txt
@@ -35,6 +35,21 @@ Optional properties:
 	cell's memory interface can handle; if not present, the memory
 	interface is fast enough to handle all possible video modes
 
+- tim2: Used to set certain bits in LCDTiming2 register.
+	It can be TIM2_CLKSEL or TIM2_IOE or both
+
+	TIM2_CLKSEL: This bit drives the CLCDCLKSEL signal. It is the select
+	signal for the external LCD clock multiplexor.
+
+	TIM2_IOE: Invert output enable:
+	0 = CLAC output pin is active HIGH in TFT mode
+	1 = CLAC output pin is active LOW in TFT mode.
+	This bit selects the active polarity of the output enable signal in
+	TFT mode. In this mode, the CLAC pin is an enable that indicates to
+	the LCD panel when valid display data is available. In active
+	display mode, data is driven onto the LCD data lines at the
+	programmed edge of CLCP when CLAC is in its active state.
+
 Required sub-nodes:
 
 - port: describes LCD panel signals, following the common binding
@@ -76,7 +91,7 @@ Example:
 		clocks = <&oscclk1>, <&oscclk2>;
 		clock-names = "clcdclk", "apb_pclk";
 		max-memory-bandwidth = <94371840>; /* Bps, 1024x768@60 16bpp */
-
+		tim2 = "TIM2_CLKSEL";
 		port {
 			clcd_pads: endpoint {
 				remote-endpoint = <&clcd_panel>;
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index 32c0b6b..4e4e50f 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -41,6 +41,44 @@
 /* This is limited to 16 characters when displayed by X startup */
 static const char *clcd_name = "CLCD FB";
 
+struct string_lookup {
+	const char	*string;
+	const u32	val;
+};
+
+static const struct string_lookup tim2_lookups[] = {
+	{ "TIM2_CLKSEL",	TIM2_CLKSEL},
+	{ "TIM2_IOE",		TIM2_IOE},
+	{ NULL, 0},
+};
+
+static u32 parse_setting(const struct string_lookup *lookup, const char *name)
+{
+	int i = 0;
+
+	while (lookup[i].string != NULL) {
+		if (strcmp(lookup[i].string, name) = 0)
+			return lookup[i].val;
+		++i;
+	}
+	return 0;
+}
+
+static u32 get_string_lookup(struct device_node *node, const char *name,
+		      const struct string_lookup *lookup)
+{
+	const char *string;
+	int count, i;
+	u32 ret = 0;
+
+	count = of_property_count_strings(node, name);
+	if (count >= 0)
+		for (i = 0; i < count; i++)
+			if (of_property_read_string_index(node, name, i,
+					&string) = 0)
+				ret |= parse_setting(lookup, string);
+	return ret;
+}
 /*
  * Unfortunately, the enable/disable functions may be called either from
  * process or IRQ context, and we _need_ to delay.  This is _not_ good.
@@ -626,6 +664,9 @@ static int clcdfb_of_init_tft_panel(struct clcd_fb *fb, u32 r0, u32 g0, u32 b0)
 	/* Bypass pixel clock divider, data output on the falling edge */
 	fb->panel->tim2 = TIM2_BCD | TIM2_IPC;
 
+	fb->panel->tim2 |= get_string_lookup(fb->dev->dev.of_node,
+					"tim2", tim2_lookups);
+
 	/* TFT display, vert. comp. interrupt at the start of the back porch */
 	fb->panel->cntl |= CNTL_LCDTFT | CNTL_LCDVCOMP(1);
 
-- 
2.3.0


^ permalink raw reply related

* [PATCH] video: ARM CLCD: Added support for FBIOPAN_DISPLAY and virtual y resolution
From: Arun Ramamurthy @ 2015-02-25 21:01 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Russell King, Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA, Dmitry Torokhov,
	Anatol Pomazau, Jonathan Richardson, Scott Branden, Ray Jui,
	bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w, Arun Ramamurthy
In-Reply-To: <1424898082-1522-1-git-send-email-arun.ramamurthy-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>

Added code to support FBIOPAN_DISPLAY. Also added yres_virtual
parameter to device tree to set the virtual y resolution

Reviewed-by: Ray Jui <rjui@broadcom.com>
Reviewed-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
---
 .../devicetree/bindings/video/arm,pl11x.txt        |  4 +++
 drivers/video/fbdev/amba-clcd.c                    | 31 +++++++++++++++++++---
 2 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/video/arm,pl11x.txt b/Documentation/devicetree/bindings/video/arm,pl11x.txt
index 14d6f87..2262cdb 100644
--- a/Documentation/devicetree/bindings/video/arm,pl11x.txt
+++ b/Documentation/devicetree/bindings/video/arm,pl11x.txt
@@ -50,6 +50,10 @@ Optional properties:
 	display mode, data is driven onto the LCD data lines at the
 	programmed edge of CLCP when CLAC is in its active state.
 
+- yres_virtual: Virtual Y resolution,
+	It can be used to configure a virtual y resolution. It
+	must be a value larger than the actual y resolution.
+
 Required sub-nodes:
 
 - port: describes LCD panel signals, following the common binding
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index 4e4e50f..3bc09ad 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -454,6 +454,18 @@ static int clcdfb_mmap(struct fb_info *info,
 	return ret;
 }
 
+static int clcdfb_pan_display(struct fb_var_screeninfo *var,
+			      struct fb_info *info)
+{
+	struct clcd_fb *fb;
+
+	info->var = *var;
+	fb = to_clcd(info);
+	clcdfb_set_start(fb);
+
+	return 0;
+}
+
 static struct fb_ops clcdfb_ops = {
 	.owner		= THIS_MODULE,
 	.fb_check_var	= clcdfb_check_var,
@@ -464,6 +476,7 @@ static struct fb_ops clcdfb_ops = {
 	.fb_copyarea	= cfb_copyarea,
 	.fb_imageblit	= cfb_imageblit,
 	.fb_mmap	= clcdfb_mmap,
+	.fb_pan_display	= clcdfb_pan_display,
 };
 
 static int clcdfb_register(struct clcd_fb *fb)
@@ -517,14 +530,16 @@ static int clcdfb_register(struct clcd_fb *fb)
 	fb->fb.fix.type		= FB_TYPE_PACKED_PIXELS;
 	fb->fb.fix.type_aux	= 0;
 	fb->fb.fix.xpanstep	= 0;
-	fb->fb.fix.ypanstep	= 0;
+	if (fb->fb.var.yres_virtual > fb->panel->mode.yres)
+		fb->fb.fix.ypanstep = 1;
+	else
+		fb->fb.fix.ypanstep = 0;
 	fb->fb.fix.ywrapstep	= 0;
 	fb->fb.fix.accel	= FB_ACCEL_NONE;
 
 	fb->fb.var.xres		= fb->panel->mode.xres;
 	fb->fb.var.yres		= fb->panel->mode.yres;
 	fb->fb.var.xres_virtual	= fb->panel->mode.xres;
-	fb->fb.var.yres_virtual	= fb->panel->mode.yres;
 	fb->fb.var.bits_per_pixel = fb->panel->bpp;
 	fb->fb.var.grayscale	= fb->panel->grayscale;
 	fb->fb.var.pixclock	= fb->panel->mode.pixclock;
@@ -690,7 +705,7 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
 	struct device_node *endpoint;
 	int err;
 	unsigned int bpp;
-	u32 max_bandwidth;
+	u32 max_bandwidth, yres_virtual;
 	u32 tft_r0b0g0[3];
 
 	fb->panel = devm_kzalloc(&fb->dev->dev, sizeof(*fb->panel), GFP_KERNEL);
@@ -730,6 +745,14 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
 	fb->panel->width = -1;
 	fb->panel->height = -1;
 
+	/* if yres_virtual property is not specified in device tree,
+	 * set it as the actual y resolution */
+	if (of_property_read_u32(fb->dev->dev.of_node,
+				"yres_virtual", &yres_virtual))
+		fb->fb.var.yres_virtual = fb->panel->mode.yres;
+	else
+		fb->fb.var.yres_virtual = yres_virtual;
+
 	if (of_property_read_u32_array(endpoint,
 			"arm,pl11x,tft-r0g0b0-pads",
 			tft_r0b0g0, ARRAY_SIZE(tft_r0b0g0)) = 0)
@@ -797,7 +820,7 @@ static int clcdfb_of_dma_setup(struct clcd_fb *fb)
 	if (err)
 		return err;
 
-	framesize = fb->panel->mode.xres * fb->panel->mode.yres *
+	framesize = fb->panel->mode.xres * fb->fb.var.yres_virtual *
 			fb->panel->bpp / 8;
 	fb->fb.screen_base = dma_alloc_coherent(&fb->dev->dev, framesize,
 			&dma, GFP_KERNEL);
-- 
2.3.0


^ permalink raw reply related

* [PATCH] video: ARM CLCD: Added support for FBIO_WAITFORVSYNC
From: Arun Ramamurthy @ 2015-02-25 21:01 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Russell King, Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: devicetree, linux-kernel, linux-fbdev, Dmitry Torokhov,
	Anatol Pomazau, Jonathan Richardson, Scott Branden, Ray Jui,
	bcm-kernel-feedback-list, Arun Ramamurthy
In-Reply-To: <1424898082-1522-1-git-send-email-arun.ramamurthy@broadcom.com>

Added ioctl and interrupt handler functions to support FBIO_WAITFORVSYNC
Also corrected documentation to make interrupts and interrupt-names
optional as they are not required properties.

Reviewed-by: Ray Jui <rjui@broadcom.com>
Reviewed-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>0
---
 .../devicetree/bindings/video/arm,pl11x.txt        | 11 +--
 drivers/video/fbdev/amba-clcd.c                    | 82 ++++++++++++++++++++++
 include/linux/amba/clcd.h                          |  4 ++
 3 files changed, 89 insertions(+), 8 deletions(-)

diff --git a/Documentation/devicetree/bindings/video/arm,pl11x.txt b/Documentation/devicetree/bindings/video/arm,pl11x.txt
index 2262cdb..7d19024 100644
--- a/Documentation/devicetree/bindings/video/arm,pl11x.txt
+++ b/Documentation/devicetree/bindings/video/arm,pl11x.txt
@@ -10,14 +10,6 @@ Required properties:
 
 - reg: base address and size of the control registers block
 
-- interrupt-names: either the single entry "combined" representing a
-	combined interrupt output (CLCDINTR), or the four entries
-	"mbe", "vcomp", "lnbu", "fuf" representing the individual
-	CLCDMBEINTR, CLCDVCOMPINTR, CLCDLNBUINTR, CLCDFUFINTR interrupts
-
-- interrupts: contains an interrupt specifier for each entry in
-	interrupt-names
-
 - clock-names: should contain "clcdclk" and "apb_pclk"
 
 - clocks: contains phandle and clock specifier pairs for the entries
@@ -54,6 +46,9 @@ Optional properties:
 	It can be used to configure a virtual y resolution. It
 	must be a value larger than the actual y resolution.
 
+- interrupts: contains an interrupt specifier for the clcd vcomp interrupt
+	 This is required for the driver to handle FBIO_WAITFORVSYNC ioctls.
+
 Required sub-nodes:
 
 - port: describes LCD panel signals, following the common binding
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index 3bc09ad..9f7a58c 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -30,6 +30,8 @@
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_graph.h>
+#include <linux/of_irq.h>
+#include <linux/interrupt.h>
 #include <video/display_timing.h>
 #include <video/of_display_timing.h>
 #include <video/videomode.h>
@@ -466,6 +468,73 @@ static int clcdfb_pan_display(struct fb_var_screeninfo *var,
 	return 0;
 }
 
+static int clcdfb_ioctl(struct fb_info *info,
+			unsigned int cmd, unsigned long args)
+{
+	struct clcd_fb *fb = to_clcd(info);
+	int retval = 0;
+	u32 val, ienb_val;
+
+	switch (cmd) {
+	case FBIO_WAITFORVSYNC:{
+		if (fb->lcd_irq <= 0) {
+			retval = -EINVAL;
+			break;
+		}
+		/* disable Vcomp interrupts */
+		ienb_val = readl(fb->regs + fb->off_ienb);
+		ienb_val &= ~CLCD_PL111_IENB_VCOMP;
+		writel(ienb_val, fb->regs + fb->off_ienb);
+
+		/* clear Vcomp interrupt */
+		writel(CLCD_PL111_IENB_VCOMP, fb->regs + CLCD_PL111_ICR);
+
+		/* Generate Interrupt at the start of Vsync */
+		reinit_completion(&fb->wait);
+		val = readl(fb->regs +  fb->off_cntl);
+		val &= ~(CNTL_LCDVCOMP(3));
+		writel(val, fb->regs + fb->off_cntl);
+
+		/* enable Vcomp interrupt */
+		ienb_val = readl(fb->regs + fb->off_ienb);
+		ienb_val |= CLCD_PL111_IENB_VCOMP;
+		writel(ienb_val, fb->regs + fb->off_ienb);
+		if (!wait_for_completion_interruptible_timeout
+			(&fb->wait, HZ/10))
+			retval = -ETIMEDOUT;
+		break;
+	}
+	default:
+		retval = -ENOIOCTLCMD;
+		break;
+	}
+	return retval;
+}
+
+static irqreturn_t clcd_interrupt(int irq, void *data)
+{
+	struct clcd_fb *fb = data;
+	u32 val;
+
+	/* check for vsync interrupt */
+	val = readl(fb->regs + CLCD_PL111_MIS);
+
+	if (val & CLCD_PL111_IENB_VCOMP) {
+		val = readl(fb->regs + fb->off_ienb);
+		val &= ~CLCD_PL111_IENB_VCOMP;
+
+		/* disable Vcomp interrupts */
+		writel(val, fb->regs + fb->off_ienb);
+
+		/* clear Vcomp interrupt */
+		writel(CLCD_PL111_IENB_VCOMP, fb->regs + CLCD_PL111_ICR);
+
+		complete(&fb->wait);
+		return IRQ_HANDLED;
+	}
+	return IRQ_NONE;
+}
+
 static struct fb_ops clcdfb_ops = {
 	.owner		= THIS_MODULE,
 	.fb_check_var	= clcdfb_check_var,
@@ -477,6 +546,7 @@ static struct fb_ops clcdfb_ops = {
 	.fb_imageblit	= cfb_imageblit,
 	.fb_mmap	= clcdfb_mmap,
 	.fb_pan_display	= clcdfb_pan_display,
+	.fb_ioctl	= clcdfb_ioctl,
 };
 
 static int clcdfb_register(struct clcd_fb *fb)
@@ -753,6 +823,18 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
 	else
 		fb->fb.var.yres_virtual = yres_virtual;
 
+	fb->lcd_irq = irq_of_parse_and_map(fb->dev->dev.of_node, 0);
+	if (fb->lcd_irq > 0) {
+		err = devm_request_irq(&fb->dev->dev,
+					fb->lcd_irq, clcd_interrupt,
+					IRQF_SHARED, "clcd", fb);
+		if (err < 0) {
+			dev_err(&fb->dev->dev, "unable to register CLCD interrupt\n");
+			return err;
+		}
+		init_completion(&fb->wait);
+	}
+
 	if (of_property_read_u32_array(endpoint,
 			"arm,pl11x,tft-r0g0b0-pads",
 			tft_r0b0g0, ARRAY_SIZE(tft_r0b0g0)) = 0)
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h
index e82e3ee..6a3bc2d 100644
--- a/include/linux/amba/clcd.h
+++ b/include/linux/amba/clcd.h
@@ -28,6 +28,8 @@
 #define CLCD_PL110_UCUR		0x00000028
 #define CLCD_PL110_LCUR		0x0000002C
 
+#define CLCD_PL111_IENB_VCOMP	(1 << 3)
+
 #define CLCD_PL111_CNTL		0x00000018
 #define CLCD_PL111_IENB		0x0000001c
 #define CLCD_PL111_RIS		0x00000020
@@ -184,6 +186,8 @@ struct clcd_fb {
 	u32			clcd_cntl;
 	u32			cmap[16];
 	bool			clk_enabled;
+	struct completion	wait;
+	int			lcd_irq;
 };
 
 static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
-- 
2.3.0


^ permalink raw reply related

* [PATCH] video: ARM CLCD: Correcting timing checks for STN and TFT dispalys
From: Arun Ramamurthy @ 2015-02-25 21:01 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Russell King, Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: devicetree, linux-kernel, linux-fbdev, Dmitry Torokhov,
	Anatol Pomazau, Jonathan Richardson, Scott Branden, Ray Jui,
	bcm-kernel-feedback-list, Arun Ramamurthy
In-Reply-To: <1424898082-1522-1-git-send-email-arun.ramamurthy@broadcom.com>

The minimum values for timing parameters such as left margin,
right margin etc are different for STN and TFT dispalys.
This commit fixes a check that does not account for
this difference.

Reviewed-by: Ray Jui <rjui@broadcom.com>
Reviewed-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
---
 include/linux/amba/clcd.h | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h
index 6a3bc2d..0fe8a17 100644
--- a/include/linux/amba/clcd.h
+++ b/include/linux/amba/clcd.h
@@ -288,16 +288,28 @@ static inline int clcdfb_check(struct clcd_fb *fb, struct fb_var_screeninfo *var
 	var->xres_virtual = var->xres = (var->xres + 15) & ~15;
 	var->yres_virtual = var->yres = (var->yres + 1) & ~1;
 
-#define CHECK(e,l,h) (var->e < l || var->e > h)
-	if (CHECK(right_margin, (5+1), 256) ||	/* back porch */
-	    CHECK(left_margin, (5+1), 256) ||	/* front porch */
-	    CHECK(hsync_len, (5+1), 256) ||
-	    var->xres > 4096 ||
-	    var->lower_margin > 255 ||		/* back porch */
-	    var->upper_margin > 255 ||		/* front porch */
-	    var->vsync_len > 32 ||
-	    var->yres > 1024)
-		return -EINVAL;
+#define CHECK(e, l, h) (var->e < l || var->e > h)
+	if (!(fb->panel->cntl & CNTL_LCDTFT)) {
+		if (CHECK(right_margin, (5+1), 256) ||	/* back porch */
+		CHECK(left_margin, (5+1), 256) ||	/* front porch */
+		CHECK(hsync_len, (5+1), 256) ||
+		var->xres > 4096 ||
+		var->lower_margin > 255 ||	/* back porch */
+		var->upper_margin > 255 ||	/* front porch */
+		var->vsync_len > 32 ||
+		var->yres > 1024)
+			return -EINVAL;
+	} else {
+		if (CHECK(right_margin, 1, 256) ||	/* back porch */
+		CHECK(left_margin, 1, 256) ||	/* front porch */
+		CHECK(hsync_len, 1, 256) ||
+		var->xres > 4096 ||
+		var->lower_margin > 255 ||	/* back porch */
+		var->upper_margin > 255 ||	/* front porch */
+		var->vsync_len > 32 ||
+		var->yres > 1024)
+			return -EINVAL;
+	}
 #undef CHECK
 
 	/* single panel mode: PCD = max(PCD, 1) */
-- 
2.3.0


^ permalink raw reply related

* Re: [PATCH] OMAP: DSS: DPI: disable vt-switch on suspend/resume.
From: NeilBrown @ 2015-02-25 22:26 UTC (permalink / raw)
  To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev, linux-kernel, GTA04 owners
In-Reply-To: <54ED9DF8.8030105@ti.com>

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

On Wed, 25 Feb 2015 12:03:36 +0200 Tomi Valkeinen <tomi.valkeinen@ti.com>
wrote:

> On 25/02/15 11:37, NeilBrown wrote:
> > 
> > These devices do not need to return to non-graphic console
> > for suspend, so disable that option.
> > This means there is less work to do in the suspend/resume cycle,
> > making it smoother and cheaper.
> > 
> > 
> > Signed-off-by: NeilBrown <neil@brown.name>
> > 
> > --
> > Hi Tomi,
> >  I wonder if you would consider this patch too.  It works for me and
> > removes pointless vt switching.  I assume no-one would need or want that
> > switching on suspend/resume but I guess I cannot be certain.
> > 
> > Maybe a module-parameter could be used if there was any uncertainty.
> 
> I was just yesterday picking patches from TI's kernel on top of
> mainline, and there's a similar one for omapfb and for omapdrm. Here's
> for omapfb:
> 
> http://git.ti.com/android-sdk/kernel-video/commit/5915d8744c927307987b12b14bc6aa37b3bac05c?format=patch
> 
> The patch in TI's kernel claims it's needed to make resume work. You're
> saying it just optimizes suspend/resume. I hadn't picked this up
> earlier, because I didn't understand why pm_set_vt_switch() would be
> needed to make resume work. And never had time to study it, so I still
> don't know what it's about...
> 
> Looking at the drivers/tty/vt/vt_ioctl.c, it sounds to me that we should
> always do pm_set_vt_switch(0), as omapdss restores everything just fine
> on resume. Although it makes me wonder how it works if there are two
> display controllers, one needing the switch and the other not...

I wondered that too.  It would seem to make more sense for
pm_set_vt_switch(0) to be the default, that drivers which need the textmode
switch should call (1).  But I suspect there are "historical reasons" for the
current situation.

My experience is that suspend works just find without this setting, and I
don't even notice the vt switch, unless I have DEBUG_DRIVERS which slows
suspend/resume down so much (writing lots of test to a serial console) that
the transition is noticeable.
I made the patch because I think it is the right thing to do, rather than
because it fixed a particular symptom.

I suspect that if suspend doesn't work without this patch, then something very
different is being done in user-space.  Maybe some other display manager, not
X.  Maybe the X server is running on vt1 rather than vt7.



> 
> Your patch does the call in a bit odd place, so I'll be queuing the
> patches for omapfb and omapdrm. Or actually, maybe the call could be
> done in one place in omapdss driver, as you do, but in omap_dsshw_probe().

I just figured that it had to be in some 'probe' function somewhere - I have
no opinion about which one (maybe all?-).  I'm perfectly happy with it
appearing anywhere that affects omap dss devices.

One thing I was reminded while testing and may as well mention:
I usually blank my display before suspending (using
FBIOBLANK/FB_BLANK_POWERDOWN ioctls).  However if I don't then I get a
warning:

[   87.261077] WARNING: CPU: 0 PID: 1901 at ../drivers/video/fbdev/omap2/dss/dispc.c:558 dispc_mgr_go+0x20/0x8c()
[   87.261138] Modules linked in: ipv6 usb_f_ecm g_ether usb_f_rndis u_ether libcomposite configfs hso w1_bq27000 libertas_sdio libertas cfg80211 omap_hdq itg3200 ehci_omap ehci_hcd uio_pdrv_genirq uio
[   87.261169] CPU: 0 PID: 1901 Comm: Xorg Not tainted 4.0.0-rc1-gta04+ #538
[   87.261169] Hardware name: Generic OMAP36xx (Flattened Device Tree)
[   87.261199] [<c00137e0>] (unwind_backtrace) from [<c00113a4>] (show_stack+0x10/0x14)
[   87.261230] [<c00113a4>] (show_stack) from [<c0033938>] (warn_slowpath_common+0x80/0xa8)
[   87.261260] [<c0033938>] (warn_slowpath_common) from [<c0033978>] (warn_slowpath_null+0x18/0x1c)
[   87.261291] [<c0033978>] (warn_slowpath_null) from [<c0232538>] (dispc_mgr_go+0x20/0x8c)
[   87.261291] [<c0232538>] (dispc_mgr_go) from [<c023e30c>] (dss_set_go_bits+0xd4/0x100)
[   87.261322] [<c023e30c>] (dss_set_go_bits) from [<c023f308>] (omap_dss_mgr_apply+0x16c/0x1b8)
[   87.261352] [<c023f308>] (omap_dss_mgr_apply) from [<c0250790>] (omapfb_apply_changes+0x428/0x488)
[   87.261352] [<c0250790>] (omapfb_apply_changes) from [<c0251024>] (omapfb_set_par+0x74/0xb0)
[   87.261383] [<c0251024>] (omapfb_set_par) from [<c02281a4>] (fb_set_var+0x250/0x330)
[   87.261413] [<c02281a4>] (fb_set_var) from [<c021fa24>] (fbcon_blank+0x6c/0x260)
[   87.261444] [<c021fa24>] (fbcon_blank) from [<c0275464>] (do_unblank_screen+0xf8/0x19c)
[   87.261474] [<c0275464>] (do_unblank_screen) from [<c026c268>] (complete_change_console+0x50/0xcc)
[   87.261474] [<c026c268>] (complete_change_console) from [<c026ccd8>] (vt_ioctl+0x9f4/0x1238)
[   87.261505] [<c026ccd8>] (vt_ioctl) from [<c02621e8>] (tty_ioctl+0xc48/0xcac)
[   87.261535] [<c02621e8>] (tty_ioctl) from [<c00dc344>] (do_vfs_ioctl+0x5b0/0x61c)
[   87.261566] [<c00dc344>] (do_vfs_ioctl) from [<c00dc3e4>] (SyS_ioctl+0x34/0x58)
[   87.261566] [<c00dc3e4>] (SyS_ioctl) from [<c000ea40>] (ret_fast_syscall+0x0/0x34)

I think the Xserver is responding to a 'suspend' notification and is blanking
the screen, maybe at an awkward time.

I haven't looked into further details yet.  I don't really expect you to, but
I thought I would mention it.

Thanks,
NeilBrown


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

^ permalink raw reply

* Re: [PATCH] OMAPDSS: restore "name" sysfs entry.
From: NeilBrown @ 2015-02-25 22:33 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Dr. H. Nikolaus Schaller, linux-omap, linux-fbdev, linux-kernel,
	GTA04 owners
In-Reply-To: <54ED96A2.6080300@ti.com>

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

On Wed, 25 Feb 2015 11:32:18 +0200 Tomi Valkeinen <tomi.valkeinen@ti.com>
wrote:


> Yep, I don't think so. In any case, all this is to be deprecated, and as
> soon as omapdrm driver works reliably that should be the driver to use.

How close is that?  Is it worth experimenting yet?  Is there an xorg driver
available?  Maybe a wiki page telling me how to set it up?

http://processors.wiki.ti.com/index.php/Linux_Core_DSS_User%27s_Guide

seems to have some useful suggestions, but no mention of Xorg...

Thanks,
NeilBrown

> 
> So of course we need to keep omapfb working for the years to come, but
> I'd rather not add any new sysfs files for a soon deprecated driver.
> 
>  Tomi
> 
> 


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

^ permalink raw reply

* Re: [PATCH 2/2] fbcon: expose cursor blink interval via sysfs
From: Scot Doyle @ 2015-02-25 23:32 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Geert Uytterhoeven, linux-fbdev, linux-api, linux-kernel
In-Reply-To: <20150225094946.GA24627@amd>

On Wed, 25 Feb 2015, Pavel Machek wrote:
> On Mon 2015-01-26 20:41:53, Scot Doyle wrote:
> > The fbcon cursor, when set to blink, is hardcoded to toggle display state
> > five times per second. Expose this setting via
> > /sys/class/graphics/fbcon/cursor_blink_ms
> > 
> > Values written to the interface set the approximate time interval in
> > milliseconds between cursor toggles, from 1 to 32767. Since the interval
> > is stored internally as a number of jiffies, the millisecond value read
> > from the interface may not exactly match the entered value.
> > 
> > An outstanding blink timer is reset after a new value is entered.
> > 
> > If the cursor blink is disabled, either via the 'cursor_blink' boolean
> > setting or some other mechanism, the 'cursor_blink_ms' setting may still
> > be modified. The new value will be used if the blink is reactivated.
> > 
> > Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
> 
> Normally, this would be set by ansi escape sequences, no? We can hide
> cursor using them, set its appearance.. makes sense to change timing
> value there, too....
> 									Pavel

Hi Pavel, what about something like this? For example,
"echo -e '\033[16;500]' would set the blink interval to 500 milliseconds.

The duration is stored twice to avoid locking the console in
cursor_timer_handler().


diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 6e00572..f117966 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -135,6 +135,7 @@ const struct consw *conswitchp;
  */
 #define DEFAULT_BELL_PITCH	750
 #define DEFAULT_BELL_DURATION	(HZ/8)
+#define DEFAULT_CURSOR_BLINK_MS	200
 
 struct vc vc_cons [MAX_NR_CONSOLES];
 
@@ -1590,6 +1591,13 @@ static void setterm_command(struct vc_data *vc)
 		case 15: /* activate the previous console */
 			set_console(last_console);
 			break;
+		case 16: /* set cursor blink duration in msec */
+			if (vc->vc_npar >= 1 && vc->vc_par[1] > 0 &&
+					vc->vc_par[1] <= USHRT_MAX)
+				vc->vc_cur_blink_ms = vc->vc_par[1];
+			else
+				vc->vc_cur_blink_ms = DEFAULT_CURSOR_BLINK_MS;
+			break;
 	}
 }
 
@@ -1717,6 +1725,7 @@ static void reset_terminal(struct vc_data *vc, int do_clear)
 
 	vc->vc_bell_pitch = DEFAULT_BELL_PITCH;
 	vc->vc_bell_duration = DEFAULT_BELL_DURATION;
+	vc->vc_cur_blink_ms = DEFAULT_CURSOR_BLINK_MS;
 
 	gotoxy(vc, 0, 0);
 	save_cur(vc);
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index b972106..05b1d1a 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -402,7 +402,7 @@ static void cursor_timer_handler(unsigned long dev_addr)
 	struct fbcon_ops *ops = info->fbcon_par;
 
 	queue_work(system_power_efficient_wq, &info->queue);
-	mod_timer(&ops->cursor_timer, jiffies + HZ/5);
+	mod_timer(&ops->cursor_timer, jiffies + ops->cur_blink_jiffies);
 }
 
 static void fbcon_add_cursor_timer(struct fb_info *info)
@@ -417,7 +417,7 @@ static void fbcon_add_cursor_timer(struct fb_info *info)
 
 		init_timer(&ops->cursor_timer);
 		ops->cursor_timer.function = cursor_timer_handler;
-		ops->cursor_timer.expires = jiffies + HZ / 5;
+		ops->cursor_timer.expires = jiffies + ops->cur_blink_jiffies;
 		ops->cursor_timer.data = (unsigned long ) info;
 		add_timer(&ops->cursor_timer);
 		ops->flags |= FBCON_FLAGS_CURSOR_TIMER;
@@ -1309,9 +1309,9 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
 	if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
 		return;
 
-	if (vc->vc_cursor_type & 0x10)
-		fbcon_del_cursor_timer(info);
-	else
+	ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
+	fbcon_del_cursor_timer(info);
+	if (!(vc->vc_cursor_type & 0x10))
 		fbcon_add_cursor_timer(info);
 
 	ops->cursor_flash = (mode = CM_ERASE) ? 0 : 1;
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index 6bd2e0c..7aaa4ea 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -70,6 +70,7 @@ struct fbcon_ops {
 	struct fb_cursor cursor_state;
 	struct display *p;
         int    currcon;	                /* Current VC. */
+	int    cur_blink_jiffies;
 	int    cursor_flash;
 	int    cursor_reset;
 	int    blank_state;
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index e859c98..e329ee2 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -104,6 +104,7 @@ struct vc_data {
 	unsigned int    vc_resize_user;         /* resize request from user */
 	unsigned int	vc_bell_pitch;		/* Console bell pitch */
 	unsigned int	vc_bell_duration;	/* Console bell duration */
+	unsigned short	vc_cur_blink_ms;	/* Cursor blink duration */
 	struct vc_data **vc_display_fg;		/* [!] Ptr to var holding fg console for this display */
 	struct uni_pagedir *vc_uni_pagedir;
 	struct uni_pagedir **vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */

^ permalink raw reply related

* [PATCH 0/2] backlight: pwm: Add backlight-boot-off property
From: huang lin @ 2015-02-26  3:12 UTC (permalink / raw)
  To: djkurtz-F7+t8E8rja9g9hUCZPvPmw
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, huang lin,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA, Thierry Reding, Jingoo Han,
	Kumar Gala, Jean-Christophe Plagniol-Villard,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Ian Campbell, Rob Herring,
	linux-pwm-u79uwXL29TY76Z2rM5mHXA, Tomi Valkeinen, Pawel Moll,
	Lee Jones, Mark Rutland


Add backlight-boot-off property, so we can keeping the
backlight disabled at boot until it is enabled implicitly
by a panel driver, or explicitly by userspace



huang lin (2):
  Documentation: devicetree: add backlight-boot-off property in
    pwm-backlight
  backlight: pwm: Add backlight-boot-off property

 Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt | 1 +
 drivers/video/backlight/pwm_bl.c                                    | 4 ++++
 2 files changed, 5 insertions(+)

-- 
1.9.1


^ permalink raw reply

* [PATCH 2/2] backlight: pwm: Add backlight-boot-off property
From: huang lin @ 2015-02-26  3:39 UTC (permalink / raw)
  To: djkurtz
  Cc: thierry.reding, jg1.han, lee.jones, linux-pwm, linux-fbdev,
	linux-rockchip, huang lin
In-Reply-To: <1424920366-7626-1-git-send-email-hl@rock-chips.com>

Add backlight-boot-off property, so we can keeping the
backlight disabled at boot until it is enabled implicitly
by a panel driver, or explicitly by userspace

Signed-off-by: huang lin <hl@rock-chips.com>

---

 drivers/video/backlight/pwm_bl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 3a145a6..dece351 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -319,6 +319,10 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 	}
 
 	bl->props.brightness = data->dft_brightness;
+
+	if (of_find_property(pdev->dev.of_node, "backlight-boot-off", NULL))
+		bl->props.power = FB_BLANK_POWERDOWN;
+
 	backlight_update_status(bl);
 
 	platform_set_drvdata(pdev, bl);
-- 
1.9.1



^ permalink raw reply related

* Re: Build warning for unused function in the file,sm7xxfb.c
From: Greg KH @ 2015-02-26  4:33 UTC (permalink / raw)
  To: linux-fbdev

On Thu, Feb 26, 2015 at 09:57:31AM +0530, Sudip Mukherjee wrote:
> On Wed, Feb 25, 2015 at 11:04:22PM -0500, nick wrote:
> > Greetings Sudip and others,
> > After doing a clean kernel build today I get this warning:
> > drivers/staging/sm7xxfb/sm7xxfb.c:117:19: warning: ‘sm7xx_vga_setup’ defined but not used [-Wunused-function]
> > static int __init sm7xx_vga_setup(char *options).
> > After looking into it further I found it's not being called anywhere, I was going to remove it until I 
> > found out it was used for command processing by this driver for setup of cards supported. I was wondering
> > if this function is still needed due to legacy support or to allow this command line processing feature to
> > be used still.
> Hi Nick,
> I was under the impression that you have been blacklisted from lkml.

He is, you got the email directly, it never made it to vger.

I suggest updating your personal blacklist as well, it makes things
easier.

greg k-h

^ permalink raw reply

* Re: Build warning for unused function in the file,sm7xxfb.c
From: Sudip Mukherjee @ 2015-02-26  4:39 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <20150226043341.GA8294@kroah.com>

On Wed, Feb 25, 2015 at 11:04:22PM -0500, nick wrote:
> Greetings Sudip and others,
> After doing a clean kernel build today I get this warning:
> drivers/staging/sm7xxfb/sm7xxfb.c:117:19: warning: ‘sm7xx_vga_setup’ defined but not used [-Wunused-function]
> static int __init sm7xx_vga_setup(char *options).
> After looking into it further I found it's not being called anywhere, I was going to remove it until I 
> found out it was used for command processing by this driver for setup of cards supported. I was wondering
> if this function is still needed due to legacy support or to allow this command line processing feature to
> be used still.
Hi Nick,
I was under the impression that you have been blacklisted from lkml.
anyways, as of now this function is not used, but my next set of patch will use that and it will be sent to Greg as soon as he applies my pending patches with him.

regards
sudip


> Thanks,
> Nick

^ permalink raw reply

* Re: Build warning for unused function in the file,sm7xxfb.c
From: Sudip Mukherjee @ 2015-02-26  5:26 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <20150226043341.GA8294@kroah.com>

On Wed, Feb 25, 2015 at 08:33:41PM -0800, Greg KH wrote:
> On Thu, Feb 26, 2015 at 09:57:31AM +0530, Sudip Mukherjee wrote:
> 
> I suggest updating your personal blacklist as well, it makes things
> easier.
yes, better. and i was just seeing some of his patches, mostly all are removing of FIXME comments.

but i got confused with bab5bb398273bb37547a185f7b344b37c700d0b9
he has removed a call to function kvm_make_request() and introduced a new function kvm_set_pending_timer() which is just calling kvm_make_request(). and the commit message just says "Adds a function kvm_vcpu_set_pending_timer instead of calling kvm_make_request in lapic.c." , i am just unable to understand why this change?

regards
sudip
> 
> greg k-h

^ permalink raw reply

* Re: [PATCH 2/2] backlight: pwm: Add backlight-boot-off property
From: Ajay kumar @ 2015-02-26  5:59 UTC (permalink / raw)
  To: huang lin
  Cc: Daniel Kurtz, Thierry Reding, Jingoo Han, Lee Jones, linux-pwm,
	linux-fbdev@vger.kernel.org, linux-rockchip
In-Reply-To: <1424921954-8621-1-git-send-email-hl@rock-chips.com>

Hi Huang,

On Thu, Feb 26, 2015 at 9:09 AM, huang lin <hl@rock-chips.com> wrote:
> Add backlight-boot-off property, so we can keeping the
> backlight disabled at boot until it is enabled implicitly
> by a panel driver, or explicitly by userspace
>
> Signed-off-by: huang lin <hl@rock-chips.com>
>
> ---
>
>  drivers/video/backlight/pwm_bl.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index 3a145a6..dece351 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -319,6 +319,10 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>         }
>
>         bl->props.brightness = data->dft_brightness;
> +
> +       if (of_find_property(pdev->dev.of_node, "backlight-boot-off", NULL))
> +               bl->props.power = FB_BLANK_POWERDOWN;
> +

You need to check this. Originally, Thierry proposed it.
http://permalink.gmane.org/gmane.linux.drivers.devicetree/84604

>         backlight_update_status(bl);
>
>         platform_set_drvdata(pdev, bl);
> --
> 1.9.1
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 2/2] backlight: pwm: Add backlight-boot-off property
From: hl @ 2015-02-26  8:06 UTC (permalink / raw)
  To: Ajay kumar
  Cc: Daniel Kurtz, Thierry Reding, Jingoo Han, Lee Jones, linux-pwm,
	linux-fbdev@vger.kernel.org, linux-rockchip
In-Reply-To: <CAEC9eQP-jFJpneinkjD_VDKi83+SiBE2rcwf2vm2ZmbHV-vdOQ@mail.gmail.com>


On 2015年02月26日 13:47, Ajay kumar wrote:
> Hi Huang,
>
> On Thu, Feb 26, 2015 at 9:09 AM, huang lin <hl@rock-chips.com> wrote:
>> Add backlight-boot-off property, so we can keeping the
>> backlight disabled at boot until it is enabled implicitly
>> by a panel driver, or explicitly by userspace
>>
>> Signed-off-by: huang lin <hl@rock-chips.com>
>>
>> ---
>>
>>   drivers/video/backlight/pwm_bl.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
>> index 3a145a6..dece351 100644
>> --- a/drivers/video/backlight/pwm_bl.c
>> +++ b/drivers/video/backlight/pwm_bl.c
>> @@ -319,6 +319,10 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>>          }
>>
>>          bl->props.brightness = data->dft_brightness;
>> +
>> +       if (of_find_property(pdev->dev.of_node, "backlight-boot-off", NULL))
>> +               bl->props.power = FB_BLANK_POWERDOWN;
>> +
> You need to check this. Originally, Thierry proposed it.
> http://permalink.gmane.org/gmane.linux.drivers.devicetree/84604
I have applied Thierry patch , and it can work. I think it should be 
merged, since i use three type of edp panels,
they have same issue: when the backlight probe, the panel will visual 
glitches.

>
>>          backlight_update_status(bl);
>>
>>          platform_set_drvdata(pdev, bl);
>> --
>> 1.9.1
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

-- 
黄林
福州瑞芯微电子有限公司
Fuzhou Rockchip Electronics Co.Ltd
福建省福州市铜盘路软件大道89号软件园A区21号楼(350003)
Addr:No.21 Building, A District, No.89, software Boulevard Fuzhou, Fujian,PRC
Email:hl@rock-chips.com
Tel:+86-591-83991906/07
  
****************************************************************************************
保密提示:本邮件及其附件含有机密信息,仅发送给本邮件所指特定收件人。若非该特定收件人,请
勿复制、 使用或披露本邮件的任何内容。若误收本邮件,请从系统中永久性删除本邮件及所有附件,
并以回复邮件或其他方式即刻告知发件人。福州瑞芯微电子有限公司拥有本邮件信息的著作权及解释
权,禁止任何未经授权许可的侵权行为。
  
IMPORTANT NOTICE: This email is from Fuzhou Rockchip Electronics Co., Ltd .The contents
of this email and any attachments may contain information that is privileged, confidential
and/or exempt from disclosure under applicable law and relevant NDA. If you are not the
intended recipient, you are hereby notified that any disclosure, copying, distribution,
or use of the information is STRICTLY PROHIBITED. Please immediately contact the sender
as soon as possible and destroy the material in its entirety in any format. Thank you.
********************************************************************************


^ permalink raw reply

* Re: [PATCH 2/2] backlight: pwm: Add backlight-boot-off property
From: Ajay kumar @ 2015-02-26  8:25 UTC (permalink / raw)
  To: hl
  Cc: Daniel Kurtz, Thierry Reding, Jingoo Han, Lee Jones, linux-pwm,
	linux-fbdev@vger.kernel.org, linux-rockchip
In-Reply-To: <54EED3F9.7030009@rock-chips.com>

On Thu, Feb 26, 2015 at 1:36 PM, hl <hl@rock-chips.com> wrote:
>
> On 2015年02月26日 13:47, Ajay kumar wrote:
>>
>> Hi Huang,
>>
>> On Thu, Feb 26, 2015 at 9:09 AM, huang lin <hl@rock-chips.com> wrote:
>>>
>>> Add backlight-boot-off property, so we can keeping the
>>> backlight disabled at boot until it is enabled implicitly
>>> by a panel driver, or explicitly by userspace
>>>
>>> Signed-off-by: huang lin <hl@rock-chips.com>
>>>
>>> ---
>>>
>>>   drivers/video/backlight/pwm_bl.c | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/drivers/video/backlight/pwm_bl.c
>>> b/drivers/video/backlight/pwm_bl.c
>>> index 3a145a6..dece351 100644
>>> --- a/drivers/video/backlight/pwm_bl.c
>>> +++ b/drivers/video/backlight/pwm_bl.c
>>> @@ -319,6 +319,10 @@ static int pwm_backlight_probe(struct
>>> platform_device *pdev)
>>>          }
>>>
>>>          bl->props.brightness = data->dft_brightness;
>>> +
>>> +       if (of_find_property(pdev->dev.of_node, "backlight-boot-off",
>>> NULL))
>>> +               bl->props.power = FB_BLANK_POWERDOWN;
>>> +
>>
>> You need to check this. Originally, Thierry proposed it.
>> http://permalink.gmane.org/gmane.linux.drivers.devicetree/84604
>
> I have applied Thierry patch , and it can work. I think it should be merged,
> since i use three type of edp panels,
> they have same issue: when the backlight probe, the panel will visual
> glitches.
Right, the same problem exists on Exynos5800-peach-pi display!
I had tested this long back, and I think its not merged since the DT property
has an issue that "it doesn't really represent h/w property of the device".

>>
>>>          backlight_update_status(bl);
>>>
>>>          platform_set_drvdata(pdev, bl);
>>> --
>>> 1.9.1
>>>
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
>>
>
> --
> 黄林
> 福州瑞芯微电子有限公司
> Fuzhou Rockchip Electronics Co.Ltd
> 福建省福州市铜盘路软件大道89号软件园A区21号楼(350003)
> Addr:No.21 Building, A District, No.89, software Boulevard Fuzhou,
> Fujian,PRC
> Email:hl@rock-chips.com
> Tel:+86-591-83991906/07
>
> ****************************************************************************************
> 保密提示:本邮件及其附件含有机密信息,仅发送给本邮件所指特定收件人。若非该特定收件人,请
> 勿复制、 使用或披露本邮件的任何内容。若误收本邮件,请从系统中永久性删除本邮件及所有附件,
> 并以回复邮件或其他方式即刻告知发件人。福州瑞芯微电子有限公司拥有本邮件信息的著作权及解释
> 权,禁止任何未经授权许可的侵权行为。
>  IMPORTANT NOTICE: This email is from Fuzhou Rockchip Electronics Co., Ltd
> .The contents
> of this email and any attachments may contain information that is
> privileged, confidential
> and/or exempt from disclosure under applicable law and relevant NDA. If you
> are not the
> intended recipient, you are hereby notified that any disclosure, copying,
> distribution,
> or use of the information is STRICTLY PROHIBITED. Please immediately contact
> the sender
> as soon as possible and destroy the material in its entirety in any format.
> Thank you.
> ********************************************************************************
>

^ permalink raw reply

* [PATCH 1/3] Printk() is replaced with respective pr_* functions
From: Parmeshwr Prasad @ 2015-02-26 10:42 UTC (permalink / raw)
  To: pjones-H+wXaHxf7aLQT0dZR+AlfA
  Cc: plagnioj-sclMFOaUSTBWk0Htik3J/w, tomi.valkeinen-l0cyMroinI0,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-efi-u79uwXL29TY76Z2rM5mHXA

This is a trivial patch. I am replacing printk() with respective pr_* functions.

Signed-off-by: Parmeshwr Prasad <parmeshwr_prasad@dell.com>
---
 drivers/video/fbdev/efifb.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index 4bfff34..7557991 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -6,6 +6,8 @@
  *
  */

+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -142,10 +144,10 @@ static int efifb_probe(struct platform_device *dev)
        if (!screen_info.pages)
                screen_info.pages = 1;
        if (!screen_info.lfb_base) {
-               printk(KERN_DEBUG "efifb: invalid framebuffer address\n");
+               pr_debug("invalid framebuffer address\n");
                return -ENODEV;
        }
-       printk(KERN_INFO "efifb: probing for efifb\n");
+       pr_info("probing for efifb\n");

        /* just assume they're all unset if any are */
        if (!screen_info.blue_size) {
@@ -193,14 +195,14 @@ static int efifb_probe(struct platform_device *dev)
        } else {
                /* We cannot make this fatal. Sometimes this comes from magic
                   spaces our resource handlers simply don't know about */
-               printk(KERN_WARNING
-                      "efifb: cannot reserve video memory at 0x%lx\n",
+               pr_warn(
+                      "cannot reserve video memory at 0x%lx\n",
                        efifb_fix.smem_start);
        }

        info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev);
        if (!info) {
-               printk(KERN_ERR "efifb: cannot allocate framebuffer\n");
+               pr_err("cannot allocate framebuffer\n");
                err = -ENOMEM;
                goto err_release_mem;
        }
@@ -218,18 +220,18 @@ static int efifb_probe(struct platform_device *dev)

        info->screen_base = ioremap_wc(efifb_fix.smem_start,
efifb_fix.smem_len);
        if (!info->screen_base) {
-               printk(KERN_ERR "efifb: abort, cannot ioremap video memory "
+               pr_err("abort, cannot ioremap video memory "
                                "0x%x @ 0x%lx\n",
                        efifb_fix.smem_len, efifb_fix.smem_start);
                err = -EIO;
                goto err_release_fb;
        }

-       printk(KERN_INFO "efifb: framebuffer at 0x%lx, mapped to 0x%p, "
+       pr_info("framebuffer at 0x%lx, mapped to 0x%p, "
               "using %dk, total %dk\n",
               efifb_fix.smem_start, info->screen_base,
               size_remap/1024, size_total/1024);
-       printk(KERN_INFO "efifb: mode is %dx%dx%d, linelength=%d, pages=%d\n",
+       pr_info("mode is %dx%dx%d, linelength=%d, pages=%d\n",
               efifb_defined.xres, efifb_defined.yres,
               efifb_defined.bits_per_pixel, efifb_fix.line_length,
               screen_info.pages);
@@ -237,7 +239,7 @@ static int efifb_probe(struct platform_device *dev)
        efifb_defined.xres_virtual = efifb_defined.xres;
        efifb_defined.yres_virtual = efifb_fix.smem_len /
                                        efifb_fix.line_length;
-       printk(KERN_INFO "efifb: scrolling: redraw\n");
+       pr_info("scrolling: redraw\n");
        efifb_defined.yres_virtual = efifb_defined.yres;

        /* some dummy values for timing to make fbset happy */
@@ -255,7 +257,7 @@ static int efifb_probe(struct platform_device *dev)
        efifb_defined.transp.offset = screen_info.rsvd_pos;
        efifb_defined.transp.length = screen_info.rsvd_size;

-       printk(KERN_INFO "efifb: %s: "
+       pr_info("%s: "
               "size=%d:%d:%d:%d, shift=%d:%d:%d:%d\n",
               "Truecolor",
               screen_info.rsvd_size,
@@ -276,11 +278,11 @@ static int efifb_probe(struct platform_device *dev)
        info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE;

        if ((err = fb_alloc_cmap(&info->cmap, 256, 0)) < 0) {
-               printk(KERN_ERR "efifb: cannot allocate colormap\n");
+               pr_err("cannot allocate colormap\n");
                goto err_unmap;
        }
        if ((err = register_framebuffer(info)) < 0) {
-               printk(KERN_ERR "efifb: cannot register framebuffer\n");
+               pr_err("cannot register framebuffer\n");
                goto err_fb_dealoc;
        }
        fb_info(info, "%s frame buffer device\n", info->fix.id);
--
1.9.3


^ permalink raw reply related

* [PATCH 2/3] Static should not be initialize so removing static initilization from efifb.c
From: Parmeshwr Prasad @ 2015-02-26 10:45 UTC (permalink / raw)
  To: pjones-H+wXaHxf7aLQT0dZR+AlfA
  Cc: plagnioj-sclMFOaUSTBWk0Htik3J/w, tomi.valkeinen-l0cyMroinI0,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-efi-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20150218083330.GC9820@linuxteamdev.amer.dell.com>

 Static variables should not be initialized. So removing initialization of
static variable.

Signed-off-by: Parmeshwr Prasad <parmeshwr_prasad@dell.com>
---
 drivers/video/fbdev/efifb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index facfbb3..cc1a156 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -17,7 +17,7 @@
 #include <video/vga.h>
 #include <asm/sysfb.h>

-static bool request_mem_succeeded = false;
+static bool request_mem_succeeded;

 static struct fb_var_screeninfo efifb_defined = {
        .activate               = FB_ACTIVATE_NOW,
--
1.9.3


^ permalink raw reply related

* [PATCH 3/3] Moved assignment out of if() statement in efifb.c
From: Parmeshwr Prasad @ 2015-02-26 10:48 UTC (permalink / raw)
  To: pjones-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	plagnioj-sclMFOaUSTBWk0Htik3J/w
In-Reply-To: <20150218083654.GD9820@linuxteamdev.amer.dell.com>

Removing initialization out of if condition.

Signed-off-by: Parmeshwr Prasad <parmeshwr_prasad@dell.com>
---
 drivers/video/fbdev/efifb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index cc1a156..9124ba9 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -275,11 +275,13 @@ static int efifb_probe(struct platform_device *dev)
        info->fix = efifb_fix;
        info->flags = FBINFO_FLAG_DEFAULT | FBINFO_MISC_FIRMWARE;

-       if ((err = fb_alloc_cmap(&info->cmap, 256, 0)) < 0) {
+       err = fb_alloc_cmap(&info->cmap, 256, 0);
+       if (err < 0) {
                pr_err("efifb: cannot allocate colormap\n");
                goto err_unmap;
        }
-       if ((err = register_framebuffer(info)) < 0) {
+       err = register_framebuffer(info);
+       if (err < 0) {
                pr_err("efifb: cannot register framebuffer\n");
                goto err_fb_dealoc;
        }
--
1.9.3


^ permalink raw reply related

* Re: [RFC] pwm-backlight: Allow backlight to remain disabled on boot
From: Lee Jones @ 2015-02-26 11:06 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1406806970-12561-1-git-send-email-thierry.reding@gmail.com>

On Thu, 31 Jul 2014, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> The default for backlight devices is to be enabled immediately when
> registering with the backlight core. This can be useful for setups that
> use a simple framebuffer device and where the backlight cannot otherwise
> be hooked up to the panel.
> 
> However, when dealing with more complex setups, such as those of recent
> ARM SoCs, this can be problematic. Since the backlight is usually setup
> separately from the display controller, the probe order is not usually
> deterministic. That can lead to situations where the backlight will be
> powered up and the panel will show an uninitialized framebuffer.
> 
> Furthermore, subsystems such as DRM have advanced functionality to set
> the power mode of a panel. In order to allow such setups to power up the
> panel at exactly the right moment, a way is needed to prevent the
> backlight core from powering the backlight up automatically when it is
> registered.
> 
> This commit introduces a new boot_off field in the platform data (and
> also implements getting the same information from device tree). When set
> the initial backlight power mode will be set to "off".
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> I've been meaning to send this for a while but was always holding back
> because of the indoctrination that this type of configuration shouldn't
> be part of device tree. However this issue was recently raised again in
> the context of power up sequences for display panels. As described above
> the issue is that panel datasheets recommend that the backlight attached
> to a panel be turned on at the very last step to avoid visual glitches
> during the panel's power up sequence. With the current implementation it
> is typical for the backlight to be probed before the display panel. That
> has, in many cases, the side-effect of enabling the backlight, therefore
> making the screen content visible before it's actually initialized.
> 
> Some panels come up with random garbage when uninitialized, others show
> all white. With some luck the panel will be all black and users won't
> really notice.
> 
> This patch is an attempt to enable boards to override the default of
> turning on the backlight for the pwm-backlight driver. I'm not sure if
> there was a specific reason to turn on the backlight by default when
> this driver was initially written, but the fact is that since it has
> pretty much always been like this we can't really go and change the
> default, otherwise a lot of people may end up with no backlight and no
> clue as to how to enable it. So the only reasonable thing we can do is
> to keep the old behaviour and give new boards a way to override it if
> they know that some other part of the stack will enable it at the right
> moment.
> 
>  .../devicetree/bindings/video/backlight/pwm-backlight.txt         | 1 +
>  drivers/video/backlight/pwm_bl.c                                  | 8 ++++++++
>  include/linux/pwm_backlight.h                                     | 2 ++
>  3 files changed, 11 insertions(+)

Some people on the list are talking about this again.

What was the verdict?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* [PATCH v2 00/11] powerpc: kill PPC_OF
From: Kevin Hao @ 2015-02-26 12:08 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, linux-fbdev, linux-mmc, linux-serial

Hi,

v2:
   - Drop the following patches which were already merged.
	be802bf955a1 ("mtd: kconfig: replace PPC_OF with PPC")
	0a4a3529df40 ("gpio: kconfig: replace PPC_OF with PPC")
	c31316cb6c5a ("usb: kconfig: replace PPC_OF with PPC")
	f0b66a2cf68e ("PCI: Add pci_device_to_OF_node() stub for !CONFIG_OF")
   - Add the ack in v1 cycle.
   - Resolve the comments in v1 cycle.

We plan to merge this patch series via the powerpc tree in 4.1 cycle. So please
ack the corresponding patches if you are OK with these changes.

Kevin Hao (11):
  sata_svw: remove the dependency on PPC_OF
  fbdev: aty128fb: replace PPC_OF with PPC
  fbdev: radeon: replace PPC_OF with PPC
  fbdev: imsttfb: remove the dependency on PPC_OF
  fbdev: nvidia: remove the dependency on PPC_OF
  fbdev: riva: remove the dependency on PPC_OF
  fbdev: remove the unnecessary includes of ppc specific header files
  fbdev: kconfig: replace PPC_OF with PPC
  mmc: kconfig: replace PPC_OF with PPC
  tty: kconfig: remove the superfluous dependency on PPC_OF
  powerpc: kill PPC_OF

 arch/powerpc/Kconfig                     |  3 ---
 arch/powerpc/Kconfig.debug               |  2 +-
 arch/powerpc/kernel/Makefile             |  4 ++--
 drivers/ata/sata_svw.c                   | 11 +----------
 drivers/mmc/host/Kconfig                 |  4 ++--
 drivers/tty/serial/Kconfig               |  4 ++--
 drivers/video/fbdev/Kconfig              |  4 ++--
 drivers/video/fbdev/aty/aty128fb.c       |  4 ++--
 drivers/video/fbdev/aty/radeon_base.c    | 24 ++++++++++++------------
 drivers/video/fbdev/aty/radeon_monitor.c | 20 ++++++++++----------
 drivers/video/fbdev/aty/radeon_pm.c      | 16 ++++++++--------
 drivers/video/fbdev/aty/radeonfb.h       |  4 ++--
 drivers/video/fbdev/core/fbmon.c         |  4 ----
 drivers/video/fbdev/imsttfb.c            |  6 +-----
 drivers/video/fbdev/nvidia/Makefile      |  3 +--
 drivers/video/fbdev/nvidia/nv_of.c       |  3 ---
 drivers/video/fbdev/nvidia/nv_proto.h    |  8 --------
 drivers/video/fbdev/nvidia/nvidia.c      |  4 ----
 drivers/video/fbdev/riva/fbdev.c         | 17 +++++++----------
 19 files changed, 53 insertions(+), 92 deletions(-)

-- 
1.9.3


^ permalink raw reply

* [PATCH v2 02/11] fbdev: aty128fb: replace PPC_OF with PPC
From: Kevin Hao @ 2015-02-26 12:08 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Paul Mackerras, Tomi Valkeinen, Jean-Christophe Plagniol-Villard,
	linuxppc-dev, linux-fbdev
In-Reply-To: <1424952503-8247-1-git-send-email-haokexin@gmail.com>

The PPC_OF is a ppc specific option which is used to mean that the
firmware device tree access functions are available. Since all the
ppc platforms have a device tree, it is aways set to 'y' for ppc.
So it makes no sense to keep a such option in the current kernel.
Replace it with PPC.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v2: No change.

 drivers/video/fbdev/aty/aty128fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c
index aedf2fbf9bf6..0156954bf340 100644
--- a/drivers/video/fbdev/aty/aty128fb.c
+++ b/drivers/video/fbdev/aty/aty128fb.c
@@ -965,7 +965,7 @@ static void __iomem *aty128_find_mem_vbios(struct aty128fb_par *par)
 /* fill in known card constants if pll_block is not available */
 static void aty128_timings(struct aty128fb_par *par)
 {
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC
 	/* instead of a table lookup, assume OF has properly
 	 * setup the PLL registers and use their values
 	 * to set the XCLK values and reference divider values */
@@ -979,7 +979,7 @@ static void aty128_timings(struct aty128fb_par *par)
 	if (!par->constants.ref_clk)
 		par->constants.ref_clk = 2950;
 
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC
 	x_mpll_ref_fb_div = aty_ld_pll(X_MPLL_REF_FB_DIV);
 	xclk_cntl = aty_ld_pll(XCLK_CNTL) & 0x7;
 	Nx = (x_mpll_ref_fb_div & 0x00ff00) >> 8;
-- 
1.9.3


^ permalink raw reply related

* [PATCH v2 03/11] fbdev: radeon: replace PPC_OF with PPC
From: Kevin Hao @ 2015-02-26 12:08 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Jean-Christophe Plagniol-Villard, linux-fbdev, Tomi Valkeinen,
	linuxppc-dev
In-Reply-To: <1424952503-8247-1-git-send-email-haokexin@gmail.com>

The PPC_OF is a ppc specific option which is used to mean that the
firmware device tree access functions are available. Since all the
ppc platforms have a device tree, it is aways set to 'y' for ppc.
So it makes no sense to keep a such option in the current kernel.
Replace it with PPC.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v2: No change.

 drivers/video/fbdev/Kconfig              |  2 +-
 drivers/video/fbdev/aty/radeon_base.c    | 24 ++++++++++++------------
 drivers/video/fbdev/aty/radeon_monitor.c | 20 ++++++++++----------
 drivers/video/fbdev/aty/radeon_pm.c      | 16 ++++++++--------
 drivers/video/fbdev/aty/radeonfb.h       |  4 ++--
 5 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index b3dd417b4719..3b818d7a0983 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -1333,7 +1333,7 @@ config FB_RADEON
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
-	select FB_MACMODES if PPC_OF
+	select FB_MACMODES if PPC
 	help
 	  Choose this option if you want to use an ATI Radeon graphics card as
 	  a framebuffer device.  There are both PCI and AGP versions.  You
diff --git a/drivers/video/fbdev/aty/radeon_base.c b/drivers/video/fbdev/aty/radeon_base.c
index 26d80a4486fb..01237c8fcdc6 100644
--- a/drivers/video/fbdev/aty/radeon_base.c
+++ b/drivers/video/fbdev/aty/radeon_base.c
@@ -74,7 +74,7 @@
 #include <asm/io.h>
 #include <linux/uaccess.h>
 
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC
 
 #include <asm/pci-bridge.h>
 #include "../macmodes.h"
@@ -83,7 +83,7 @@
 #include <asm/btext.h>
 #endif
 
-#endif /* CONFIG_PPC_OF */
+#endif /* CONFIG_PPC */
 
 #ifdef CONFIG_MTRR
 #include <asm/mtrr.h>
@@ -418,7 +418,7 @@ static int  radeon_find_mem_vbios(struct radeonfb_info *rinfo)
 }
 #endif
 
-#if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_SPARC)
 /*
  * Read XTAL (ref clock), SCLK and MCLK from Open Firmware device
  * tree. Hopefully, ATI OF driver is kind enough to fill these
@@ -448,7 +448,7 @@ static int radeon_read_xtal_OF(struct radeonfb_info *rinfo)
 
        	return 0;
 }
-#endif /* CONFIG_PPC_OF || CONFIG_SPARC */
+#endif /* CONFIG_PPC || CONFIG_SPARC */
 
 /*
  * Read PLL infos from chip registers
@@ -653,7 +653,7 @@ static void radeon_get_pllinfo(struct radeonfb_info *rinfo)
 	rinfo->pll.ref_div = INPLL(PPLL_REF_DIV) & PPLL_REF_DIV_MASK;
 
 
-#if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_SPARC)
 	/*
 	 * Retrieve PLL infos from Open Firmware first
 	 */
@@ -661,7 +661,7 @@ static void radeon_get_pllinfo(struct radeonfb_info *rinfo)
        		printk(KERN_INFO "radeonfb: Retrieved PLL infos from Open Firmware\n");
 		goto found;
 	}
-#endif /* CONFIG_PPC_OF || CONFIG_SPARC */
+#endif /* CONFIG_PPC || CONFIG_SPARC */
 
 	/*
 	 * Check out if we have an X86 which gave us some PLL informations
@@ -1910,7 +1910,7 @@ static int radeon_set_fbinfo(struct radeonfb_info *rinfo)
  * I put the card's memory at 0 in card space and AGP at some random high
  * local (0xe0000000 for now) that will be changed by XFree/DRI anyway
  */
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC
 #undef SET_MC_FB_FROM_APERTURE
 static void fixup_memory_mappings(struct radeonfb_info *rinfo)
 {
@@ -1984,7 +1984,7 @@ static void fixup_memory_mappings(struct radeonfb_info *rinfo)
 		((aper_base + aper_size - 1) & 0xffff0000) | (aper_base >> 16),
 		0xffff0000 | (agp_base >> 16));
 }
-#endif /* CONFIG_PPC_OF */
+#endif /* CONFIG_PPC */
 
 
 static void radeon_identify_vram(struct radeonfb_info *rinfo)
@@ -2236,7 +2236,7 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
 	    rinfo->family = CHIP_FAMILY_RS200)
 		rinfo->errata |= CHIP_ERRATA_PLL_DELAY;
 
-#if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_SPARC)
 	/* On PPC, we obtain the OF device-node pointer to the firmware
 	 * data for this chip
 	 */
@@ -2245,14 +2245,14 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
 		printk(KERN_WARNING "radeonfb (%s): Cannot match card to OF node !\n",
 		       pci_name(rinfo->pdev));
 
-#endif /* CONFIG_PPC_OF || CONFIG_SPARC */
-#ifdef CONFIG_PPC_OF
+#endif /* CONFIG_PPC || CONFIG_SPARC */
+#ifdef CONFIG_PPC
 	/* On PPC, the firmware sets up a memory mapping that tends
 	 * to cause lockups when enabling the engine. We reconfigure
 	 * the card internal memory mappings properly
 	 */
 	fixup_memory_mappings(rinfo);
-#endif /* CONFIG_PPC_OF */
+#endif /* CONFIG_PPC */
 
 	/* Get VRAM size and type */
 	radeon_identify_vram(rinfo);
diff --git a/drivers/video/fbdev/aty/radeon_monitor.c b/drivers/video/fbdev/aty/radeon_monitor.c
index bc078d50d8f1..f1ce229de78d 100644
--- a/drivers/video/fbdev/aty/radeon_monitor.c
+++ b/drivers/video/fbdev/aty/radeon_monitor.c
@@ -55,7 +55,7 @@ static char *radeon_get_mon_name(int type)
 }
 
 
-#if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_SPARC)
 /*
  * Try to find monitor informations & EDID data out of the Open Firmware
  * device-tree. This also contains some "hacks" to work around a few machine
@@ -160,7 +160,7 @@ static int radeon_probe_OF_head(struct radeonfb_info *rinfo, int head_no,
 	}
         return MT_NONE;
 }
-#endif /* CONFIG_PPC_OF || CONFIG_SPARC */
+#endif /* CONFIG_PPC || CONFIG_SPARC */
 
 
 static int radeon_get_panel_info_BIOS(struct radeonfb_info *rinfo)
@@ -499,11 +499,11 @@ void radeon_probe_screens(struct radeonfb_info *rinfo,
 		 * Old single head cards
 		 */
 		if (!rinfo->has_CRTC2) {
-#if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_SPARC)
 			if (rinfo->mon1_type = MT_NONE)
 				rinfo->mon1_type = radeon_probe_OF_head(rinfo, 0,
 									&rinfo->mon1_EDID);
-#endif /* CONFIG_PPC_OF || CONFIG_SPARC */
+#endif /* CONFIG_PPC || CONFIG_SPARC */
 #ifdef CONFIG_FB_RADEON_I2C
 			if (rinfo->mon1_type = MT_NONE)
 				rinfo->mon1_type @@ -548,11 +548,11 @@ void radeon_probe_screens(struct radeonfb_info *rinfo,
 		/*
 		 * Probe primary head (DVI or laptop internal panel)
 		 */
-#if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_SPARC)
 		if (rinfo->mon1_type = MT_NONE)
 			rinfo->mon1_type = radeon_probe_OF_head(rinfo, 0,
 								&rinfo->mon1_EDID);
-#endif /* CONFIG_PPC_OF || CONFIG_SPARC */
+#endif /* CONFIG_PPC || CONFIG_SPARC */
 #ifdef CONFIG_FB_RADEON_I2C
 		if (rinfo->mon1_type = MT_NONE)
 			rinfo->mon1_type = radeon_probe_i2c_connector(rinfo, ddc_dvi,
@@ -576,11 +576,11 @@ void radeon_probe_screens(struct radeonfb_info *rinfo,
 		/*
 		 * Probe secondary head (mostly VGA, can be DVI)
 		 */
-#if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_SPARC)
 		if (rinfo->mon2_type = MT_NONE)
 			rinfo->mon2_type = radeon_probe_OF_head(rinfo, 1,
 								&rinfo->mon2_EDID);
-#endif /* CONFIG_PPC_OF || defined(CONFIG_SPARC) */
+#endif /* CONFIG_PPC || defined(CONFIG_SPARC) */
 #ifdef CONFIG_FB_RADEON_I2C
 		if (rinfo->mon2_type = MT_NONE)
 			rinfo->mon2_type = radeon_probe_i2c_connector(rinfo, ddc_vga,
@@ -653,7 +653,7 @@ void radeon_probe_screens(struct radeonfb_info *rinfo,
  */
 static void radeon_fixup_panel_info(struct radeonfb_info *rinfo)
 {
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC
 	/*
 	 * LCD Flat panels should use fixed dividers, we enfore that on
 	 * PPC only for now...
@@ -676,7 +676,7 @@ static void radeon_fixup_panel_info(struct radeonfb_info *rinfo)
 		       (rinfo->panel_info.post_divider << 16),
 		       ppll_div_sel);
 	}
-#endif /* CONFIG_PPC_OF */
+#endif /* CONFIG_PPC */
 }
 
 
diff --git a/drivers/video/fbdev/aty/radeon_pm.c b/drivers/video/fbdev/aty/radeon_pm.c
index 46a12f1a93c3..1417542738fc 100644
--- a/drivers/video/fbdev/aty/radeon_pm.c
+++ b/drivers/video/fbdev/aty/radeon_pm.c
@@ -523,7 +523,7 @@ static void radeon_pm_enable_dynamic_mode(struct radeonfb_info *rinfo)
 	OUTPLL(pllVCLK_ECP_CNTL, tmp);
 
 	/* X doesn't do that ... hrm, we do on mobility && Macs */
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC
 	if (rinfo->is_mobility) {
 		tmp  = INPLL(pllMCLK_CNTL);
 		tmp &= ~(MCLK_CNTL__FORCE_MCLKA |
@@ -541,7 +541,7 @@ static void radeon_pm_enable_dynamic_mode(struct radeonfb_info *rinfo)
 		OUTPLL(pllMCLK_MISC, tmp);
 		radeon_msleep(15);
 	}
-#endif /* CONFIG_PPC_OF */
+#endif /* CONFIG_PPC */
 }
 
 #ifdef CONFIG_PM
@@ -1288,7 +1288,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo)
        		radeon_pm_enable_dll_m10(rinfo);
 		radeon_pm_yclk_mclk_sync_m10(rinfo);
 
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC
 		if (rinfo->of_node != NULL) {
 			int size;
 
@@ -1298,7 +1298,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo)
 			else
 				mrtable = default_mrtable;
 		}
-#endif /* CONFIG_PPC_OF */
+#endif /* CONFIG_PPC */
 
 		/* Program the SDRAM */
 		sdram_mode_reg = mrtable[0];
@@ -1943,7 +1943,7 @@ static void radeon_reinitialize_M10(struct radeonfb_info *rinfo)
 }
 #endif
 
-#ifdef CONFIG_PPC_OF
+#ifdef CONFIG_PPC
 #ifdef CONFIG_PPC_PMAC
 static void radeon_pm_m9p_reconfigure_mc(struct radeonfb_info *rinfo)
 {
@@ -2512,7 +2512,7 @@ static void radeon_reinitialize_QW(struct radeonfb_info *rinfo)
 }
 #endif /* 0 */
 
-#endif /* CONFIG_PPC_OF */
+#endif /* CONFIG_PPC */
 
 static void radeonfb_whack_power_state(struct radeonfb_info *rinfo, pci_power_t state)
 {
@@ -2793,7 +2793,7 @@ int radeonfb_pci_resume(struct pci_dev *pdev)
 	return rc;
 }
 
-#ifdef CONFIG_PPC_OF__disabled
+#ifdef CONFIG_PPC__disabled
 static void radeonfb_early_resume(void *data)
 {
         struct radeonfb_info *rinfo = data;
@@ -2803,7 +2803,7 @@ static void radeonfb_early_resume(void *data)
 	radeonfb_pci_resume(rinfo->pdev);
 	rinfo->no_schedule = 0;
 }
-#endif /* CONFIG_PPC_OF */
+#endif /* CONFIG_PPC */
 
 #endif /* CONFIG_PM */
 
diff --git a/drivers/video/fbdev/aty/radeonfb.h b/drivers/video/fbdev/aty/radeonfb.h
index cb846044f57c..039def41c920 100644
--- a/drivers/video/fbdev/aty/radeonfb.h
+++ b/drivers/video/fbdev/aty/radeonfb.h
@@ -20,7 +20,7 @@
 
 #include <asm/io.h>
 
-#if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_SPARC)
 #include <asm/prom.h>
 #endif
 
@@ -301,7 +301,7 @@ struct radeonfb_info {
 	unsigned long		fb_local_base;
 
 	struct pci_dev		*pdev;
-#if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_SPARC)
 	struct device_node	*of_node;
 #endif
 
-- 
1.9.3


^ permalink raw reply related

* [PATCH v2 04/11] fbdev: imsttfb: remove the dependency on PPC_OF
From: Kevin Hao @ 2015-02-26 12:08 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Jean-Christophe Plagniol-Villard, linux-fbdev, Tomi Valkeinen,
	linuxppc-dev
In-Reply-To: <1424952503-8247-1-git-send-email-haokexin@gmail.com>

The OF functionality has moved to a common place and be used by many
archs. So we don't need to depend on PPC_OF option any more. This is
a preparation for killing PPC_OF.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v2: Only print the error log when CONFIG_OF is enabled.

 drivers/video/fbdev/imsttfb.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c
index aae10ce74f14..9b167f7ef6c6 100644
--- a/drivers/video/fbdev/imsttfb.c
+++ b/drivers/video/fbdev/imsttfb.c
@@ -1470,15 +1470,13 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	unsigned long addr, size;
 	struct imstt_par *par;
 	struct fb_info *info;
-#ifdef CONFIG_PPC_OF
 	struct device_node *dp;
 	
 	dp = pci_device_to_OF_node(pdev);
 	if(dp)
 		printk(KERN_INFO "%s: OF name %s\n",__func__, dp->name);
-	else
+	else if (IS_ENABLED(CONFIG_OF))
 		printk(KERN_ERR "imsttfb: no OF node for pci device\n");
-#endif /* CONFIG_PPC_OF */
 
 	info = framebuffer_alloc(sizeof(struct imstt_par), &pdev->dev);
 
@@ -1501,11 +1499,9 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	switch (pdev->device) {
 		case PCI_DEVICE_ID_IMS_TT128: /* IMS,tt128mbA */
 			par->ramdac = IBM;
-#ifdef CONFIG_PPC_OF
 			if (dp && ((strcmp(dp->name, "IMS,tt128mb8") = 0) ||
 				   (strcmp(dp->name, "IMS,tt128mb8A") = 0)))
 				par->ramdac = TVP;
-#endif /* CONFIG_PPC_OF */
 			break;
 		case PCI_DEVICE_ID_IMS_TT3D:  /* IMS,tt3d */
 			par->ramdac = TVP;
-- 
1.9.3


^ permalink raw reply related

* [PATCH v2 05/11] fbdev: nvidia: remove the dependency on PPC_OF
From: Kevin Hao @ 2015-02-26 12:08 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Jean-Christophe Plagniol-Villard, linux-fbdev, Tomi Valkeinen,
	linuxppc-dev, Antonino Daplas
In-Reply-To: <1424952503-8247-1-git-send-email-haokexin@gmail.com>

The OF functionality has moved to a common place and be used by many
archs. So we don't need to include the ppc arch specific header files
and depend on PPC_OF option any more. This is a preparation for
killing PPC_OF.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v2: No change.

 drivers/video/fbdev/nvidia/Makefile   | 3 +--
 drivers/video/fbdev/nvidia/nv_of.c    | 3 ---
 drivers/video/fbdev/nvidia/nv_proto.h | 8 --------
 drivers/video/fbdev/nvidia/nvidia.c   | 4 ----
 4 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/video/fbdev/nvidia/Makefile b/drivers/video/fbdev/nvidia/Makefile
index ca47432113e0..917d3eb05feb 100644
--- a/drivers/video/fbdev/nvidia/Makefile
+++ b/drivers/video/fbdev/nvidia/Makefile
@@ -5,9 +5,8 @@
 obj-$(CONFIG_FB_NVIDIA)          += nvidiafb.o
 
 nvidiafb-y                       := nvidia.o nv_hw.o nv_setup.o \
-			            nv_accel.o
+			            nv_accel.o nv_of.o
 nvidiafb-$(CONFIG_FB_NVIDIA_I2C) += nv_i2c.o
 nvidiafb-$(CONFIG_FB_NVIDIA_BACKLIGHT)  += nv_backlight.o
-nvidiafb-$(CONFIG_PPC_OF)	 += nv_of.o
 
 nvidiafb-objs                    := $(nvidiafb-y)
diff --git a/drivers/video/fbdev/nvidia/nv_of.c b/drivers/video/fbdev/nvidia/nv_of.c
index 3bc13df4b120..5f3e5179c25a 100644
--- a/drivers/video/fbdev/nvidia/nv_of.c
+++ b/drivers/video/fbdev/nvidia/nv_of.c
@@ -19,9 +19,6 @@
 
 #include <asm/io.h>
 
-#include <asm/prom.h>
-#include <asm/pci-bridge.h>
-
 #include "nv_type.h"
 #include "nv_local.h"
 #include "nv_proto.h"
diff --git a/drivers/video/fbdev/nvidia/nv_proto.h b/drivers/video/fbdev/nvidia/nv_proto.h
index ff5c410355ea..878a5ce02299 100644
--- a/drivers/video/fbdev/nvidia/nv_proto.h
+++ b/drivers/video/fbdev/nvidia/nv_proto.h
@@ -42,16 +42,8 @@ int nvidia_probe_i2c_connector(struct fb_info *info, int conn,
 #define nvidia_probe_i2c_connector(p, c, edid) (-1)
 #endif
 
-#ifdef CONFIG_PPC_OF
 int nvidia_probe_of_connector(struct fb_info *info, int conn,
 			      u8 ** out_edid);
-#else
-static inline int nvidia_probe_of_connector(struct fb_info *info, int conn,
-				      u8 ** out_edid)
-{
-	return -1;
-}
-#endif
 
 /* in nv_accel.c */
 extern void NVResetGraphics(struct fb_info *info);
diff --git a/drivers/video/fbdev/nvidia/nvidia.c b/drivers/video/fbdev/nvidia/nvidia.c
index def041204676..4273c6ee8cf6 100644
--- a/drivers/video/fbdev/nvidia/nvidia.c
+++ b/drivers/video/fbdev/nvidia/nvidia.c
@@ -24,10 +24,6 @@
 #ifdef CONFIG_MTRR
 #include <asm/mtrr.h>
 #endif
-#ifdef CONFIG_PPC_OF
-#include <asm/prom.h>
-#include <asm/pci-bridge.h>
-#endif
 #ifdef CONFIG_BOOTX_TEXT
 #include <asm/btext.h>
 #endif
-- 
1.9.3


^ permalink raw reply related

* [PATCH v2 06/11] fbdev: riva: remove the dependency on PPC_OF
From: Kevin Hao @ 2015-02-26 12:08 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Jean-Christophe Plagniol-Villard, linux-fbdev, Tomi Valkeinen,
	linuxppc-dev, Antonino Daplas
In-Reply-To: <1424952503-8247-1-git-send-email-haokexin@gmail.com>

The OF functionality has moved to a common place and be used by many
archs. So we don't need to include the ppc arch specific header files
and depend on PPC_OF option any more. This is a preparation for
killing PPC_OF.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v2: No change.

 drivers/video/fbdev/riva/fbdev.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c
index be73727c7227..294a80908c8c 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -44,10 +44,6 @@
 #ifdef CONFIG_MTRR
 #include <asm/mtrr.h>
 #endif
-#ifdef CONFIG_PPC_OF
-#include <asm/prom.h>
-#include <asm/pci-bridge.h>
-#endif
 #ifdef CONFIG_PMAC_BACKLIGHT
 #include <asm/machdep.h>
 #include <asm/backlight.h>
@@ -1735,7 +1731,6 @@ static int riva_set_fbinfo(struct fb_info *info)
 	return (rivafb_check_var(&info->var, info));
 }
 
-#ifdef CONFIG_PPC_OF
 static int riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
 {
 	struct riva_par *par = info->par;
@@ -1766,9 +1761,8 @@ static int riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
 	NVTRACE_LEAVE();
 	return 0;
 }
-#endif /* CONFIG_PPC_OF */
 
-#if defined(CONFIG_FB_RIVA_I2C) && !defined(CONFIG_PPC_OF)
+#if defined(CONFIG_FB_RIVA_I2C)
 static int riva_get_EDID_i2c(struct fb_info *info)
 {
 	struct riva_par *par = info->par;
@@ -1828,10 +1822,13 @@ static void riva_update_default_var(struct fb_var_screeninfo *var,
 static void riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
 {
 	NVTRACE_ENTER();
-#ifdef CONFIG_PPC_OF
-	if (!riva_get_EDID_OF(info, pdev))
+	if (riva_get_EDID_OF(info, pdev)) {
+		NVTRACE_LEAVE();
+		return;
+	}
+	if (IS_ENABLED(CONFIG_OF))
 		printk(PFX "could not retrieve EDID from OF\n");
-#elif defined(CONFIG_FB_RIVA_I2C)
+#if defined(CONFIG_FB_RIVA_I2C)
 	if (!riva_get_EDID_i2c(info))
 		printk(PFX "could not retrieve EDID from DDC/I2C\n");
 #endif
-- 
1.9.3


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox