linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal
@ 2013-02-08 16:35 Nicolas Ferre
  2013-02-08 16:35 ` [PATCH 1/5] atmel_lcdfb: fix 16-bpp modes on older SOCs Nicolas Ferre
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Nicolas Ferre @ 2013-02-08 16:35 UTC (permalink / raw)
  To: Olof Johansson, Arnd Bergmann, FlorianSchandinat
  Cc: Jean-Christophe PLAGNIOL-VILLARD, linux-arm-kernel, linux-kernel,
	linux-fbdev, jhovold, jacmet, Nicolas Ferre

These patches fix a regression in 16-bpp support for older SOCs which use
IBGR:555 rather than BGR:565 pixel layout. Use SOC-type to determine if the
controller uses the intensity-bit and restore the old layout in that case.

The last patch is a removal of uses of cpu_is_xxxx() macros in atmel_lcdfb with
a platform-device-id table and static configurations.


Patches from Johan Hovold taken from:
"[PATCH 0/3] atmel_lcdfb: fix 16-bpp regression"
and
"[PATCH v2 0/3] ARM: at91/avr32/atmel_lcdfb: remove cpu_is macros"
patch series to form a clean patch series with my signature.

Arnd, Olof,
as it seems that old fbdev drivers are not so much reviewed those days, can we
take the decision to queue this material through arm-soc with other AT91
drivers updates?

Best regards,

Johan Hovold (5):
  atmel_lcdfb: fix 16-bpp modes on older SOCs
  ARM: at91/neocore926: fix LCD-wiring mode
  ARM: at91/avr32/atmel_lcdfb: add bus-clock entry
  atmel_lcdfb: move lcdcon2 register access to compute_hozval
  ARM: at91/avr32/atmel_lcdfb: add platform device-id table

 arch/arm/mach-at91/at91sam9261.c         |   2 +
 arch/arm/mach-at91/at91sam9261_devices.c |   6 +-
 arch/arm/mach-at91/at91sam9263.c         |   1 +
 arch/arm/mach-at91/at91sam9263_devices.c |   2 +-
 arch/arm/mach-at91/at91sam9g45.c         |   2 +
 arch/arm/mach-at91/at91sam9g45_devices.c |   6 +-
 arch/arm/mach-at91/at91sam9rl.c          |   1 +
 arch/arm/mach-at91/at91sam9rl_devices.c  |   2 +-
 arch/arm/mach-at91/board-neocore926.c    |   2 +-
 arch/avr32/mach-at32ap/at32ap700x.c      |   6 +-
 drivers/video/atmel_lcdfb.c              | 130 ++++++++++++++++++++++++-------
 include/video/atmel_lcdc.h               |   4 +-
 12 files changed, 127 insertions(+), 37 deletions(-)

-- 
1.8.0


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

* [PATCH 1/5] atmel_lcdfb: fix 16-bpp modes on older SOCs
  2013-02-08 16:35 [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal Nicolas Ferre
@ 2013-02-08 16:35 ` Nicolas Ferre
  2013-02-08 16:35 ` [PATCH 2/5] ARM: at91/neocore926: fix LCD-wiring mode Nicolas Ferre
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Nicolas Ferre @ 2013-02-08 16:35 UTC (permalink / raw)
  To: Olof Johansson, Arnd Bergmann, FlorianSchandinat
  Cc: Jean-Christophe PLAGNIOL-VILLARD, linux-arm-kernel, linux-kernel,
	linux-fbdev, jhovold, jacmet, stable, Nicolas Ferre

From: Johan Hovold <jhovold@gmail.com>

Fix regression introduced by commit 787f9fd23283 ("atmel_lcdfb: support
16bit BGR:565 mode, remove unsupported 15bit modes") which broke 16-bpp
modes for older SOCs which use IBGR:555 (msb is intensity) rather
than BGR:565.

Use SOC-type to determine the pixel layout.

Tested on at91sam9263 and at91sam9g45.

Cc: <stable@vger.kernel.org>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/video/atmel_lcdfb.c | 22 +++++++++++++++-------
 include/video/atmel_lcdc.h  |  1 +
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 12cf5f3..025428e 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -422,17 +422,22 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
 			= var->bits_per_pixel;
 		break;
 	case 16:
+		/* Older SOCs use IBGR:555 rather than BGR:565. */
+		if (sinfo->have_intensity_bit)
+			var->green.length = 5;
+		else
+			var->green.length = 6;
+
 		if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) {
-			/* RGB:565 mode */
-			var->red.offset = 11;
+			/* RGB:5X5 mode */
+			var->red.offset = var->green.length + 5;
 			var->blue.offset = 0;
 		} else {
-			/* BGR:565 mode */
+			/* BGR:5X5 mode */
 			var->red.offset = 0;
-			var->blue.offset = 11;
+			var->blue.offset = var->green.length + 5;
 		}
 		var->green.offset = 5;
-		var->green.length = 6;
 		var->red.length = var->blue.length = 5;
 		break;
 	case 32:
@@ -679,8 +684,7 @@ static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red,
 
 	case FB_VISUAL_PSEUDOCOLOR:
 		if (regno < 256) {
-			if (cpu_is_at91sam9261() || cpu_is_at91sam9263()
-			    || cpu_is_at91sam9rl()) {
+			if (sinfo->have_intensity_bit) {
 				/* old style I+BGR:555 */
 				val  = ((red   >> 11) & 0x001f);
 				val |= ((green >>  6) & 0x03e0);
@@ -870,6 +874,10 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
 	}
 	sinfo->info = info;
 	sinfo->pdev = pdev;
+	if (cpu_is_at91sam9261() || cpu_is_at91sam9263() ||
+							cpu_is_at91sam9rl()) {
+		sinfo->have_intensity_bit = true;
+	}
 
 	strcpy(info->fix.id, sinfo->pdev->name);
 	info->flags = ATMEL_LCDFB_FBINFO_DEFAULT;
diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h
index 28447f1..5f0e234 100644
--- a/include/video/atmel_lcdc.h
+++ b/include/video/atmel_lcdc.h
@@ -62,6 +62,7 @@ struct atmel_lcdfb_info {
 	void (*atmel_lcdfb_power_control)(int on);
 	struct fb_monspecs	*default_monspecs;
 	u32			pseudo_palette[16];
+	bool			have_intensity_bit;
 };
 
 #define ATMEL_LCDC_DMABADDR1	0x00
-- 
1.8.0


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

* [PATCH 2/5] ARM: at91/neocore926: fix LCD-wiring mode
  2013-02-08 16:35 [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal Nicolas Ferre
  2013-02-08 16:35 ` [PATCH 1/5] atmel_lcdfb: fix 16-bpp modes on older SOCs Nicolas Ferre
@ 2013-02-08 16:35 ` Nicolas Ferre
  2013-02-08 16:35 ` [PATCH 3/5] ARM: at91/avr32/atmel_lcdfb: add bus-clock entry Nicolas Ferre
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Nicolas Ferre @ 2013-02-08 16:35 UTC (permalink / raw)
  To: Olof Johansson, Arnd Bergmann, FlorianSchandinat
  Cc: Jean-Christophe PLAGNIOL-VILLARD, linux-arm-kernel, linux-kernel,
	linux-fbdev, jhovold, jacmet, stable, Nicolas Ferre

From: Johan Hovold <jhovold@gmail.com>

Fix regression introduced by commit 787f9fd23283 ("atmel_lcdfb: support
16bit BGR:565 mode, remove unsupported 15bit modes") which broke 16-bpp
modes for older SOCs which use IBGR:555 (msb is intensity) rather than
BGR:565.

The above commit also removed the RGB:555-wiring hack without fixing the
neocore926 board which used it. Fix by specifying RGB-wiring and let the
driver handle the final SOC-dependant layout.

Remove the no longer used ATMEL_LCDC_WIRING_RGB555 define.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 arch/arm/mach-at91/board-neocore926.c | 2 +-
 include/video/atmel_lcdc.h            | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index bc7a1c4..4726297 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -266,7 +266,7 @@ static struct atmel_lcdfb_info __initdata neocore926_lcdc_data = {
 	.default_monspecs		= &at91fb_default_monspecs,
 	.atmel_lcdfb_power_control	= at91_lcdc_power_control,
 	.guard_time			= 1,
-	.lcd_wiring_mode		= ATMEL_LCDC_WIRING_RGB555,
+	.lcd_wiring_mode		= ATMEL_LCDC_WIRING_RGB,
 };
 
 #else
diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h
index 5f0e234..8deb226 100644
--- a/include/video/atmel_lcdc.h
+++ b/include/video/atmel_lcdc.h
@@ -30,7 +30,6 @@
  */
 #define ATMEL_LCDC_WIRING_BGR	0
 #define ATMEL_LCDC_WIRING_RGB	1
-#define ATMEL_LCDC_WIRING_RGB555	2
 
 
  /* LCD Controller info data structure, stored in device platform_data */
-- 
1.8.0


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

* [PATCH 3/5] ARM: at91/avr32/atmel_lcdfb: add bus-clock entry
  2013-02-08 16:35 [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal Nicolas Ferre
  2013-02-08 16:35 ` [PATCH 1/5] atmel_lcdfb: fix 16-bpp modes on older SOCs Nicolas Ferre
  2013-02-08 16:35 ` [PATCH 2/5] ARM: at91/neocore926: fix LCD-wiring mode Nicolas Ferre
@ 2013-02-08 16:35 ` Nicolas Ferre
  2013-02-08 16:35 ` [PATCH 4/5] atmel_lcdfb: move lcdcon2 register access to compute_hozval Nicolas Ferre
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Nicolas Ferre @ 2013-02-08 16:35 UTC (permalink / raw)
  To: Olof Johansson, Arnd Bergmann, FlorianSchandinat
  Cc: Jean-Christophe PLAGNIOL-VILLARD, linux-arm-kernel, linux-kernel,
	linux-fbdev, jhovold, jacmet, Nicolas Ferre

From: Johan Hovold <jhovold@gmail.com>

Add hclk entry for the atmel_lcdfb bus clock.

On at91sam9261, at91sam9g10 and at32ap the bus clock has to be enabled
as well as the peripheral clock. Add the appropriate lookup entries to
these SOCs and fake clocks to the SOCs that do not use it.

This allows us to get rid of the conditional enabling of the clocks in
the driver which relied on the cpu_is macros.

Tested on at91sam9263 and at91sam9g45, compile-tested for other
AT91-SOCs, and untested for AVR32.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 arch/arm/mach-at91/at91sam9261.c    |  1 +
 arch/arm/mach-at91/at91sam9263.c    |  1 +
 arch/arm/mach-at91/at91sam9g45.c    |  1 +
 arch/arm/mach-at91/at91sam9rl.c     |  1 +
 arch/avr32/mach-at32ap/at32ap700x.c |  4 ++--
 drivers/video/atmel_lcdfb.c         | 23 ++++++++---------------
 6 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 2998a08..5838f12 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -169,6 +169,7 @@ static struct clk *periph_clocks[] __initdata = {
 };
 
 static struct clk_lookup periph_clocks_lookups[] = {
+	CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &hck1),
 	CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
 	CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
 	CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index b9fc60d..520a63d 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -190,6 +190,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
 	CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
 	CLKDEV_CON_DEV_ID("pclk", "fff98000.ssc", &ssc0_clk),
 	CLKDEV_CON_DEV_ID("pclk", "fff9c000.ssc", &ssc1_clk),
+	CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &lcdc_clk),
 	CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
 	CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
 	CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index d3addee..ea6b62b 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -228,6 +228,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
 	CLKDEV_CON_ID("hclk", &macb_clk),
 	/* One additional fake clock for ohci */
 	CLKDEV_CON_ID("ohci_clk", &uhphs_clk),
+	CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &lcdc_clk),
 	CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk),
 	CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
 	CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index eb98704..4cd4fa9 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -179,6 +179,7 @@ static struct clk *periph_clocks[] __initdata = {
 };
 
 static struct clk_lookup periph_clocks_lookups[] = {
+	CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &lcdc_clk),
 	CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
 	CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
 	CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index b323d8d..cd25b01 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -1453,7 +1453,7 @@ static struct resource atmel_lcdfb0_resource[] = {
 	},
 };
 DEFINE_DEV_DATA(atmel_lcdfb, 0);
-DEV_CLK(hck1, atmel_lcdfb0, hsb, 7);
+DEV_CLK(hclk, atmel_lcdfb0, hsb, 7);
 static struct clk atmel_lcdfb0_pixclk = {
 	.name		= "lcdc_clk",
 	.dev		= &atmel_lcdfb0_device.dev,
@@ -2246,7 +2246,7 @@ static __initdata struct clk *init_clocks[] = {
 	&atmel_twi0_pclk,
 	&atmel_mci0_pclk,
 #if defined(CONFIG_CPU_AT32AP7000) || defined(CONFIG_CPU_AT32AP7002)
-	&atmel_lcdfb0_hck1,
+	&atmel_lcdfb0_hclk,
 	&atmel_lcdfb0_pixclk,
 #endif
 	&ssc0_pclk,
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 025428e..c5883ca 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -821,15 +821,13 @@ static int __init atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
 
 static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
 {
-	if (sinfo->bus_clk)
-		clk_enable(sinfo->bus_clk);
+	clk_enable(sinfo->bus_clk);
 	clk_enable(sinfo->lcdc_clk);
 }
 
 static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
 {
-	if (sinfo->bus_clk)
-		clk_disable(sinfo->bus_clk);
+	clk_disable(sinfo->bus_clk);
 	clk_disable(sinfo->lcdc_clk);
 }
 
@@ -888,13 +886,10 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
 	info->fix = atmel_lcdfb_fix;
 
 	/* Enable LCDC Clocks */
-	if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()
-	 || cpu_is_at32ap7000()) {
-		sinfo->bus_clk = clk_get(dev, "hck1");
-		if (IS_ERR(sinfo->bus_clk)) {
-			ret = PTR_ERR(sinfo->bus_clk);
-			goto free_info;
-		}
+	sinfo->bus_clk = clk_get(dev, "hclk");
+	if (IS_ERR(sinfo->bus_clk)) {
+		ret = PTR_ERR(sinfo->bus_clk);
+		goto free_info;
 	}
 	sinfo->lcdc_clk = clk_get(dev, "lcdc_clk");
 	if (IS_ERR(sinfo->lcdc_clk)) {
@@ -1055,8 +1050,7 @@ stop_clk:
 	atmel_lcdfb_stop_clock(sinfo);
 	clk_put(sinfo->lcdc_clk);
 put_bus_clk:
-	if (sinfo->bus_clk)
-		clk_put(sinfo->bus_clk);
+	clk_put(sinfo->bus_clk);
 free_info:
 	framebuffer_release(info);
 out:
@@ -1081,8 +1075,7 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
 	unregister_framebuffer(info);
 	atmel_lcdfb_stop_clock(sinfo);
 	clk_put(sinfo->lcdc_clk);
-	if (sinfo->bus_clk)
-		clk_put(sinfo->bus_clk);
+	clk_put(sinfo->bus_clk);
 	fb_dealloc_cmap(&info->cmap);
 	free_irq(sinfo->irq_base, info);
 	iounmap(sinfo->mmio);
-- 
1.8.0


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

* [PATCH 4/5] atmel_lcdfb: move lcdcon2 register access to compute_hozval
  2013-02-08 16:35 [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal Nicolas Ferre
                   ` (2 preceding siblings ...)
  2013-02-08 16:35 ` [PATCH 3/5] ARM: at91/avr32/atmel_lcdfb: add bus-clock entry Nicolas Ferre
@ 2013-02-08 16:35 ` Nicolas Ferre
  2013-02-08 16:35 ` [PATCH 5/5] ARM: at91/avr32/atmel_lcdfb: add platform device-id table Nicolas Ferre
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 14+ messages in thread
From: Nicolas Ferre @ 2013-02-08 16:35 UTC (permalink / raw)
  To: Olof Johansson, Arnd Bergmann, FlorianSchandinat
  Cc: Jean-Christophe PLAGNIOL-VILLARD, linux-arm-kernel, linux-kernel,
	linux-fbdev, jhovold, jacmet, Nicolas Ferre

From: Johan Hovold <jhovold@gmail.com>

Pass atmel_lcd_info structure to compute_hozval and only do the register
access on SOCs that actually use it.

This will also simplify the removal of the cpu_is macros.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/video/atmel_lcdfb.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index c5883ca..2effd35 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -193,14 +193,17 @@ static struct fb_fix_screeninfo atmel_lcdfb_fix __initdata = {
 	.accel		= FB_ACCEL_NONE,
 };
 
-static unsigned long compute_hozval(unsigned long xres, unsigned long lcdcon2)
+static unsigned long compute_hozval(struct atmel_lcdfb_info *sinfo,
+							unsigned long xres)
 {
+	unsigned long lcdcon2;
 	unsigned long value;
 
 	if (!(cpu_is_at91sam9261() || cpu_is_at91sam9g10()
 		|| cpu_is_at32ap7000()))
 		return xres;
 
+	lcdcon2 = lcdc_readl(sinfo, ATMEL_LCDC_LCDCON2);
 	value = xres;
 	if ((lcdcon2 & ATMEL_LCDC_DISTYPE) != ATMEL_LCDC_DISTYPE_TFT) {
 		/* STN display */
@@ -591,8 +594,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info)
 	lcdc_writel(sinfo, ATMEL_LCDC_TIM2, value);
 
 	/* Horizontal value (aka line size) */
-	hozval_linesz = compute_hozval(info->var.xres,
-					lcdc_readl(sinfo, ATMEL_LCDC_LCDCON2));
+	hozval_linesz = compute_hozval(sinfo, info->var.xres);
 
 	/* Display size */
 	value = (hozval_linesz - 1) << ATMEL_LCDC_HOZVAL_OFFSET;
-- 
1.8.0


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

* [PATCH 5/5] ARM: at91/avr32/atmel_lcdfb: add platform device-id table
  2013-02-08 16:35 [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal Nicolas Ferre
                   ` (3 preceding siblings ...)
  2013-02-08 16:35 ` [PATCH 4/5] atmel_lcdfb: move lcdcon2 register access to compute_hozval Nicolas Ferre
@ 2013-02-08 16:35 ` Nicolas Ferre
  2013-02-08 16:52 ` [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal Jean-Christophe PLAGNIOL-VILLARD
  2013-02-10  0:47 ` Olof Johansson
  6 siblings, 0 replies; 14+ messages in thread
From: Nicolas Ferre @ 2013-02-08 16:35 UTC (permalink / raw)
  To: Olof Johansson, Arnd Bergmann, FlorianSchandinat
  Cc: Jean-Christophe PLAGNIOL-VILLARD, linux-arm-kernel, linux-kernel,
	linux-fbdev, jhovold, jacmet, Nicolas Ferre

From: Johan Hovold <jhovold@gmail.com>

Add platform device-id table in order to identify the controller and
determine its configuration.

The currently used configuration parameters are:

have_alt_pixclock
 - SOC uses an alternate pixel-clock calculation formula (at91sam9g45
   non-ES)

have_hozval
 - SOC has a HOZVAL field in LCDFRMCFG which is used to determine the
   linesize for STN displays (at91sam9261, at921sam9g10 and at32ap)

have_intensity_bit
 - SOC uses IBGR:555 rather than BGR:565 16-bit pixel layout
   (at91sam9261, at91sam9263 and at91sam9rl)

This allows us to remove all the remaining uses of cpu_is macros from
the driver.

Tested on at91sam9263 and at91sam9g45, compile-tested for other
AT91-SOCs, and untested for AVR32.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 arch/arm/mach-at91/at91sam9261.c         |  3 +-
 arch/arm/mach-at91/at91sam9261_devices.c |  6 ++-
 arch/arm/mach-at91/at91sam9263.c         |  2 +-
 arch/arm/mach-at91/at91sam9263_devices.c |  2 +-
 arch/arm/mach-at91/at91sam9g45.c         |  3 +-
 arch/arm/mach-at91/at91sam9g45_devices.c |  6 ++-
 arch/arm/mach-at91/at91sam9rl.c          |  2 +-
 arch/arm/mach-at91/at91sam9rl_devices.c  |  2 +-
 arch/avr32/mach-at32ap/at32ap700x.c      |  2 +
 drivers/video/atmel_lcdfb.c              | 89 ++++++++++++++++++++++++++++----
 include/video/atmel_lcdc.h               |  4 +-
 11 files changed, 102 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 5838f12..0204f4c 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -169,7 +169,8 @@ static struct clk *periph_clocks[] __initdata = {
 };
 
 static struct clk_lookup periph_clocks_lookups[] = {
-	CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &hck1),
+	CLKDEV_CON_DEV_ID("hclk", "at91sam9261-lcdfb.0", &hck1),
+	CLKDEV_CON_DEV_ID("hclk", "at91sam9g10-lcdfb.0", &hck1),
 	CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
 	CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
 	CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 92e0f86..629ea5f 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -488,7 +488,6 @@ static struct resource lcdc_resources[] = {
 };
 
 static struct platform_device at91_lcdc_device = {
-	.name		= "atmel_lcdfb",
 	.id		= 0,
 	.dev		= {
 				.dma_mask		= &lcdc_dmamask,
@@ -505,6 +504,11 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
 		return;
 	}
 
+	if (cpu_is_at91sam9g10())
+		at91_lcdc_device.name = "at91sam9g10-lcdfb";
+	else
+		at91_lcdc_device.name = "at91sam9261-lcdfb";
+
 #if defined(CONFIG_FB_ATMEL_STN)
 	at91_set_A_periph(AT91_PIN_PB0, 0);     /* LCDVSYNC */
 	at91_set_A_periph(AT91_PIN_PB1, 0);     /* LCDHSYNC */
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 520a63d..2282fd7 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -190,7 +190,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
 	CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
 	CLKDEV_CON_DEV_ID("pclk", "fff98000.ssc", &ssc0_clk),
 	CLKDEV_CON_DEV_ID("pclk", "fff9c000.ssc", &ssc1_clk),
-	CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &lcdc_clk),
+	CLKDEV_CON_DEV_ID("hclk", "at91sam9263-lcdfb.0", &lcdc_clk),
 	CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
 	CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
 	CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index ed666f5..858c8aa 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -848,7 +848,7 @@ static struct resource lcdc_resources[] = {
 };
 
 static struct platform_device at91_lcdc_device = {
-	.name		= "atmel_lcdfb",
+	.name		= "at91sam9263-lcdfb",
 	.id		= 0,
 	.dev		= {
 				.dma_mask		= &lcdc_dmamask,
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index ea6b62b..c68960d 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -228,7 +228,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
 	CLKDEV_CON_ID("hclk", &macb_clk),
 	/* One additional fake clock for ohci */
 	CLKDEV_CON_ID("ohci_clk", &uhphs_clk),
-	CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &lcdc_clk),
+	CLKDEV_CON_DEV_ID("hclk", "at91sam9g45-lcdfb.0", &lcdc_clk),
+	CLKDEV_CON_DEV_ID("hclk", "at91sam9g45es-lcdfb.0", &lcdc_clk),
 	CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk),
 	CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
 	CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index 827c9f2..fe626d4 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -981,7 +981,6 @@ static struct resource lcdc_resources[] = {
 };
 
 static struct platform_device at91_lcdc_device = {
-	.name		= "atmel_lcdfb",
 	.id		= 0,
 	.dev		= {
 				.dma_mask		= &lcdc_dmamask,
@@ -997,6 +996,11 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
 	if (!data)
 		return;
 
+	if (cpu_is_at91sam9g45es())
+		at91_lcdc_device.name = "at91sam9g45es-lcdfb";
+	else
+		at91_lcdc_device.name = "at91sam9g45-lcdfb";
+
 	at91_set_A_periph(AT91_PIN_PE0, 0);	/* LCDDPWR */
 
 	at91_set_A_periph(AT91_PIN_PE2, 0);	/* LCDCC */
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 4cd4fa9..3de3e04 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -179,7 +179,7 @@ static struct clk *periph_clocks[] __initdata = {
 };
 
 static struct clk_lookup periph_clocks_lookups[] = {
-	CLKDEV_CON_DEV_ID("hclk", "atmel_lcdfb.0", &lcdc_clk),
+	CLKDEV_CON_DEV_ID("hclk", "at91sam9rl-lcdfb.0", &lcdc_clk),
 	CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
 	CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
 	CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index ddf223f..352468f 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -514,7 +514,7 @@ static struct resource lcdc_resources[] = {
 };
 
 static struct platform_device at91_lcdc_device = {
-	.name		= "atmel_lcdfb",
+	.name		= "at91sam9rl-lcdfb",
 	.id		= 0,
 	.dev		= {
 				.dma_mask		= &lcdc_dmamask,
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index cd25b01..7c2f668 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -1530,6 +1530,8 @@ at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,
 	memcpy(info, data, sizeof(struct atmel_lcdfb_info));
 	info->default_monspecs = monspecs;
 
+	pdev->name = "at32ap-lcdfb";
+
 	platform_device_register(pdev);
 	return pdev;
 
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 2effd35..c1a2914 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -34,6 +34,77 @@
 #define ATMEL_LCDC_DMA_BURST_LEN	8	/* words */
 #define ATMEL_LCDC_FIFO_SIZE		512	/* words */
 
+struct atmel_lcdfb_config {
+	bool have_alt_pixclock;
+	bool have_hozval;
+	bool have_intensity_bit;
+};
+
+static struct atmel_lcdfb_config at91sam9261_config = {
+	.have_hozval		= true,
+	.have_intensity_bit	= true,
+};
+
+static struct atmel_lcdfb_config at91sam9263_config = {
+	.have_intensity_bit	= true,
+};
+
+static struct atmel_lcdfb_config at91sam9g10_config = {
+	.have_hozval		= true,
+};
+
+static struct atmel_lcdfb_config at91sam9g45_config = {
+	.have_alt_pixclock	= true,
+};
+
+static struct atmel_lcdfb_config at91sam9g45es_config = {
+};
+
+static struct atmel_lcdfb_config at91sam9rl_config = {
+	.have_intensity_bit	= true,
+};
+
+static struct atmel_lcdfb_config at32ap_config = {
+	.have_hozval		= true,
+};
+
+static const struct platform_device_id atmel_lcdfb_devtypes[] = {
+	{
+		.name = "at91sam9261-lcdfb",
+		.driver_data = (unsigned long)&at91sam9261_config,
+	}, {
+		.name = "at91sam9263-lcdfb",
+		.driver_data = (unsigned long)&at91sam9263_config,
+	}, {
+		.name = "at91sam9g10-lcdfb",
+		.driver_data = (unsigned long)&at91sam9g10_config,
+	}, {
+		.name = "at91sam9g45-lcdfb",
+		.driver_data = (unsigned long)&at91sam9g45_config,
+	}, {
+		.name = "at91sam9g45es-lcdfb",
+		.driver_data = (unsigned long)&at91sam9g45es_config,
+	}, {
+		.name = "at91sam9rl-lcdfb",
+		.driver_data = (unsigned long)&at91sam9rl_config,
+	}, {
+		.name = "at32ap-lcdfb",
+		.driver_data = (unsigned long)&at32ap_config,
+	}, {
+		/* terminator */
+	}
+};
+
+static struct atmel_lcdfb_config *
+atmel_lcdfb_get_config(struct platform_device *pdev)
+{
+	unsigned long data;
+
+	data = platform_get_device_id(pdev)->driver_data;
+
+	return (struct atmel_lcdfb_config *)data;
+}
+
 #if defined(CONFIG_ARCH_AT91)
 #define	ATMEL_LCDFB_FBINFO_DEFAULT	(FBINFO_DEFAULT \
 					 | FBINFO_PARTIAL_PAN_OK \
@@ -199,8 +270,7 @@ static unsigned long compute_hozval(struct atmel_lcdfb_info *sinfo,
 	unsigned long lcdcon2;
 	unsigned long value;
 
-	if (!(cpu_is_at91sam9261() || cpu_is_at91sam9g10()
-		|| cpu_is_at32ap7000()))
+	if (!sinfo->config->have_hozval)
 		return xres;
 
 	lcdcon2 = lcdc_readl(sinfo, ATMEL_LCDC_LCDCON2);
@@ -426,7 +496,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
 		break;
 	case 16:
 		/* Older SOCs use IBGR:555 rather than BGR:565. */
-		if (sinfo->have_intensity_bit)
+		if (sinfo->config->have_intensity_bit)
 			var->green.length = 5;
 		else
 			var->green.length = 6;
@@ -534,7 +604,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info)
 	/* Now, the LCDC core... */
 
 	/* Set pixel clock */
-	if (cpu_is_at91sam9g45() && !cpu_is_at91sam9g45es())
+	if (sinfo->config->have_alt_pixclock)
 		pix_factor = 1;
 
 	clk_value_khz = clk_get_rate(sinfo->lcdc_clk) / 1000;
@@ -686,7 +756,7 @@ static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red,
 
 	case FB_VISUAL_PSEUDOCOLOR:
 		if (regno < 256) {
-			if (sinfo->have_intensity_bit) {
+			if (sinfo->config->have_intensity_bit) {
 				/* old style I+BGR:555 */
 				val  = ((red   >> 11) & 0x001f);
 				val |= ((green >>  6) & 0x03e0);
@@ -874,10 +944,9 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
 	}
 	sinfo->info = info;
 	sinfo->pdev = pdev;
-	if (cpu_is_at91sam9261() || cpu_is_at91sam9263() ||
-							cpu_is_at91sam9rl()) {
-		sinfo->have_intensity_bit = true;
-	}
+	sinfo->config = atmel_lcdfb_get_config(pdev);
+	if (!sinfo->config)
+		goto free_info;
 
 	strcpy(info->fix.id, sinfo->pdev->name);
 	info->flags = ATMEL_LCDFB_FBINFO_DEFAULT;
@@ -1146,7 +1215,7 @@ static struct platform_driver atmel_lcdfb_driver = {
 	.remove		= __exit_p(atmel_lcdfb_remove),
 	.suspend	= atmel_lcdfb_suspend,
 	.resume		= atmel_lcdfb_resume,
-
+	.id_table	= atmel_lcdfb_devtypes,
 	.driver		= {
 		.name	= "atmel_lcdfb",
 		.owner	= THIS_MODULE,
diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h
index 8deb226..0f5a2fc 100644
--- a/include/video/atmel_lcdc.h
+++ b/include/video/atmel_lcdc.h
@@ -31,6 +31,7 @@
 #define ATMEL_LCDC_WIRING_BGR	0
 #define ATMEL_LCDC_WIRING_RGB	1
 
+struct atmel_lcdfb_config;
 
  /* LCD Controller info data structure, stored in device platform_data */
 struct atmel_lcdfb_info {
@@ -61,7 +62,8 @@ struct atmel_lcdfb_info {
 	void (*atmel_lcdfb_power_control)(int on);
 	struct fb_monspecs	*default_monspecs;
 	u32			pseudo_palette[16];
-	bool			have_intensity_bit;
+
+	struct atmel_lcdfb_config *config;
 };
 
 #define ATMEL_LCDC_DMABADDR1	0x00
-- 
1.8.0


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

* Re: [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal
  2013-02-08 16:35 [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal Nicolas Ferre
                   ` (4 preceding siblings ...)
  2013-02-08 16:35 ` [PATCH 5/5] ARM: at91/avr32/atmel_lcdfb: add platform device-id table Nicolas Ferre
@ 2013-02-08 16:52 ` Jean-Christophe PLAGNIOL-VILLARD
  2013-02-10  0:47 ` Olof Johansson
  6 siblings, 0 replies; 14+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-02-08 16:52 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Olof Johansson, Arnd Bergmann, FlorianSchandinat,
	linux-arm-kernel, linux-kernel, linux-fbdev, jhovold, jacmet

HI,

on all

Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Best Regards,
J.
On 17:35 Fri 08 Feb     , Nicolas Ferre wrote:
> These patches fix a regression in 16-bpp support for older SOCs which use
> IBGR:555 rather than BGR:565 pixel layout. Use SOC-type to determine if the
> controller uses the intensity-bit and restore the old layout in that case.
> 
> The last patch is a removal of uses of cpu_is_xxxx() macros in atmel_lcdfb with
> a platform-device-id table and static configurations.
> 
> 
> Patches from Johan Hovold taken from:
> "[PATCH 0/3] atmel_lcdfb: fix 16-bpp regression"
> and
> "[PATCH v2 0/3] ARM: at91/avr32/atmel_lcdfb: remove cpu_is macros"
> patch series to form a clean patch series with my signature.
> 
> Arnd, Olof,
> as it seems that old fbdev drivers are not so much reviewed those days, can we
> take the decision to queue this material through arm-soc with other AT91
> drivers updates?
> 
> Best regards,
> 
> Johan Hovold (5):
>   atmel_lcdfb: fix 16-bpp modes on older SOCs
>   ARM: at91/neocore926: fix LCD-wiring mode
>   ARM: at91/avr32/atmel_lcdfb: add bus-clock entry
>   atmel_lcdfb: move lcdcon2 register access to compute_hozval
>   ARM: at91/avr32/atmel_lcdfb: add platform device-id table
> 
>  arch/arm/mach-at91/at91sam9261.c         |   2 +
>  arch/arm/mach-at91/at91sam9261_devices.c |   6 +-
>  arch/arm/mach-at91/at91sam9263.c         |   1 +
>  arch/arm/mach-at91/at91sam9263_devices.c |   2 +-
>  arch/arm/mach-at91/at91sam9g45.c         |   2 +
>  arch/arm/mach-at91/at91sam9g45_devices.c |   6 +-
>  arch/arm/mach-at91/at91sam9rl.c          |   1 +
>  arch/arm/mach-at91/at91sam9rl_devices.c  |   2 +-
>  arch/arm/mach-at91/board-neocore926.c    |   2 +-
>  arch/avr32/mach-at32ap/at32ap700x.c      |   6 +-
>  drivers/video/atmel_lcdfb.c              | 130 ++++++++++++++++++++++++-------
>  include/video/atmel_lcdc.h               |   4 +-
>  12 files changed, 127 insertions(+), 37 deletions(-)
> 
> -- 
> 1.8.0
> 

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

* Re: [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal
  2013-02-08 16:35 [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal Nicolas Ferre
                   ` (5 preceding siblings ...)
  2013-02-08 16:52 ` [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal Jean-Christophe PLAGNIOL-VILLARD
@ 2013-02-10  0:47 ` Olof Johansson
  2013-02-10 18:45   ` Johan Hovold
  2013-03-04 14:51   ` Johan Hovold
  6 siblings, 2 replies; 14+ messages in thread
From: Olof Johansson @ 2013-02-10  0:47 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Arnd Bergmann, FlorianSchandinat,
	Jean-Christophe PLAGNIOL-VILLARD, linux-arm-kernel, linux-kernel,
	linux-fbdev, jhovold, jacmet

On Fri, Feb 08, 2013 at 05:35:13PM +0100, Nicolas Ferre wrote:
> These patches fix a regression in 16-bpp support for older SOCs which use
> IBGR:555 rather than BGR:565 pixel layout. Use SOC-type to determine if the
> controller uses the intensity-bit and restore the old layout in that case.
> 
> The last patch is a removal of uses of cpu_is_xxxx() macros in atmel_lcdfb with
> a platform-device-id table and static configurations.
> 
> 
> Patches from Johan Hovold taken from:
> "[PATCH 0/3] atmel_lcdfb: fix 16-bpp regression"
> and
> "[PATCH v2 0/3] ARM: at91/avr32/atmel_lcdfb: remove cpu_is macros"
> patch series to form a clean patch series with my signature.
> 
> Arnd, Olof,
> as it seems that old fbdev drivers are not so much reviewed those days, can we
> take the decision to queue this material through arm-soc with other AT91
> drivers updates?

It would be beneficial to get an ack from Florian. Was he involved in the
review of the code that regressed 16-bpp support in the first place? When was
the regression introduced?


-Olof

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

* Re: [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal
  2013-02-10  0:47 ` Olof Johansson
@ 2013-02-10 18:45   ` Johan Hovold
  2013-03-08  9:37     ` Nicolas Ferre
  2013-03-04 14:51   ` Johan Hovold
  1 sibling, 1 reply; 14+ messages in thread
From: Johan Hovold @ 2013-02-10 18:45 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Nicolas Ferre, Arnd Bergmann, FlorianSchandinat,
	Jean-Christophe PLAGNIOL-VILLARD, linux-arm-kernel, linux-kernel,
	linux-fbdev, jacmet

On Sun, Feb 10, 2013 at 1:47 AM, Olof Johansson <olof@lixom.net> wrote:
> On Fri, Feb 08, 2013 at 05:35:13PM +0100, Nicolas Ferre wrote:
>> These patches fix a regression in 16-bpp support for older SOCs which
>> use IBGR:555 rather than BGR:565 pixel layout. Use SOC-type to
>> determine if the controller uses the intensity-bit and restore the
>> old layout in that case.
>>
>> The last patch is a removal of uses of cpu_is_xxxx() macros in
>> atmel_lcdfb with a platform-device-id table and static
>> configurations.
>>
>>
>> Patches from Johan Hovold taken from: "[PATCH 0/3] atmel_lcdfb: fix
>> 16-bpp regression" and "[PATCH v2 0/3] ARM: at91/avr32/atmel_lcdfb:
>> remove cpu_is macros" patch series to form a clean patch series with
>> my signature.
>>
>> Arnd, Olof, as it seems that old fbdev drivers are not so much
>> reviewed those days, can we take the decision to queue this material
>> through arm-soc with other AT91 drivers updates?
>
> It would be beneficial to get an ack from Florian. Was he involved in
> the review of the code that regressed 16-bpp support in the first
> place? When was the regression introduced?

In v3.4 by commit 787f9fd2328 ("atmel_lcdfb: support 16bit BGR:565 mode,
remove unsupported 15bit modes").

Johan

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

* Re: [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal
  2013-02-10  0:47 ` Olof Johansson
  2013-02-10 18:45   ` Johan Hovold
@ 2013-03-04 14:51   ` Johan Hovold
  1 sibling, 0 replies; 14+ messages in thread
From: Johan Hovold @ 2013-03-04 14:51 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Nicolas Ferre, Arnd Bergmann, FlorianSchandinat,
	Jean-Christophe PLAGNIOL-VILLARD, linux-arm-kernel, linux-kernel,
	linux-fbdev, jhovold, jacmet

On Sat, Feb 09, 2013 at 04:47:40PM -0800, Olof Johansson wrote:
> On Fri, Feb 08, 2013 at 05:35:13PM +0100, Nicolas Ferre wrote:
> > These patches fix a regression in 16-bpp support for older SOCs which use
> > IBGR:555 rather than BGR:565 pixel layout. Use SOC-type to determine if the
> > controller uses the intensity-bit and restore the old layout in that case.
> > 
> > The last patch is a removal of uses of cpu_is_xxxx() macros in atmel_lcdfb with
> > a platform-device-id table and static configurations.
> > 
> > 
> > Patches from Johan Hovold taken from:
> > "[PATCH 0/3] atmel_lcdfb: fix 16-bpp regression"
> > and
> > "[PATCH v2 0/3] ARM: at91/avr32/atmel_lcdfb: remove cpu_is macros"
> > patch series to form a clean patch series with my signature.
> > 
> > Arnd, Olof,
> > as it seems that old fbdev drivers are not so much reviewed those days, can we
> > take the decision to queue this material through arm-soc with other AT91
> > drivers updates?
> 
> It would be beneficial to get an ack from Florian. Was he involved in the
> review of the code that regressed 16-bpp support in the first place? When was
> the regression introduced?

Thought I'd send a reminder about these fixes. Has anyone picked them up
for 3.9-rc?

Thanks,
Johan

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

* Re: [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal
  2013-02-10 18:45   ` Johan Hovold
@ 2013-03-08  9:37     ` Nicolas Ferre
  2013-03-13 10:12       ` Nicolas Ferre
  0 siblings, 1 reply; 14+ messages in thread
From: Nicolas Ferre @ 2013-03-08  9:37 UTC (permalink / raw)
  To: Johan Hovold, Olof Johansson, Arnd Bergmann
  Cc: FlorianSchandinat, Jean-Christophe PLAGNIOL-VILLARD,
	linux-arm-kernel, linux-kernel, linux-fbdev, jacmet

On 02/10/2013 07:45 PM, Johan Hovold :
> On Sun, Feb 10, 2013 at 1:47 AM, Olof Johansson <olof@lixom.net> wrote:
>> On Fri, Feb 08, 2013 at 05:35:13PM +0100, Nicolas Ferre wrote:
>>> These patches fix a regression in 16-bpp support for older SOCs which
>>> use IBGR:555 rather than BGR:565 pixel layout. Use SOC-type to
>>> determine if the controller uses the intensity-bit and restore the
>>> old layout in that case.
>>>
>>> The last patch is a removal of uses of cpu_is_xxxx() macros in
>>> atmel_lcdfb with a platform-device-id table and static
>>> configurations.
>>>
>>>
>>> Patches from Johan Hovold taken from: "[PATCH 0/3] atmel_lcdfb: fix
>>> 16-bpp regression" and "[PATCH v2 0/3] ARM: at91/avr32/atmel_lcdfb:
>>> remove cpu_is macros" patch series to form a clean patch series with
>>> my signature.
>>>
>>> Arnd, Olof, as it seems that old fbdev drivers are not so much
>>> reviewed those days, can we take the decision to queue this material
>>> through arm-soc with other AT91 drivers updates?
>>
>> It would be beneficial to get an ack from Florian. Was he involved in
>> the review of the code that regressed 16-bpp support in the first
>> place? When was the regression introduced?
> 
> In v3.4 by commit 787f9fd2328 ("atmel_lcdfb: support 16bit BGR:565 mode,
> remove unsupported 15bit modes").

Arnd, Olof,

Please tell me if I can do something to ease the adoption of these
patches during 3.9-rc timeframe (I can rebase it on top of 3.9-rc1 to
avoid any conflict: the file board-neocore926.c was removed during the
merge window).
Johan has written the series a long time ago and we still do not have it
in mainline.

If the option to ask Andrew is better in your opinion, please tell me.

Best regards,
-- 
Nicolas Ferre

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

* Re: [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal
  2013-03-08  9:37     ` Nicolas Ferre
@ 2013-03-13 10:12       ` Nicolas Ferre
  2013-03-14 23:03         ` Arnd Bergmann
  0 siblings, 1 reply; 14+ messages in thread
From: Nicolas Ferre @ 2013-03-13 10:12 UTC (permalink / raw)
  To: Johan Hovold, Olof Johansson, Arnd Bergmann
  Cc: FlorianSchandinat, Jean-Christophe PLAGNIOL-VILLARD,
	linux-arm-kernel, linux-kernel, linux-fbdev, jacmet

On 03/08/2013 10:37 AM, Nicolas Ferre :
> On 02/10/2013 07:45 PM, Johan Hovold :
>> On Sun, Feb 10, 2013 at 1:47 AM, Olof Johansson <olof@lixom.net> wrote:
>>> On Fri, Feb 08, 2013 at 05:35:13PM +0100, Nicolas Ferre wrote:
>>>> These patches fix a regression in 16-bpp support for older SOCs which
>>>> use IBGR:555 rather than BGR:565 pixel layout. Use SOC-type to
>>>> determine if the controller uses the intensity-bit and restore the
>>>> old layout in that case.
>>>>
>>>> The last patch is a removal of uses of cpu_is_xxxx() macros in
>>>> atmel_lcdfb with a platform-device-id table and static
>>>> configurations.
>>>>
>>>>
>>>> Patches from Johan Hovold taken from: "[PATCH 0/3] atmel_lcdfb: fix
>>>> 16-bpp regression" and "[PATCH v2 0/3] ARM: at91/avr32/atmel_lcdfb:
>>>> remove cpu_is macros" patch series to form a clean patch series with
>>>> my signature.
>>>>
>>>> Arnd, Olof, as it seems that old fbdev drivers are not so much
>>>> reviewed those days, can we take the decision to queue this material
>>>> through arm-soc with other AT91 drivers updates?
>>>
>>> It would be beneficial to get an ack from Florian. Was he involved in
>>> the review of the code that regressed 16-bpp support in the first
>>> place? When was the regression introduced?
>>
>> In v3.4 by commit 787f9fd2328 ("atmel_lcdfb: support 16bit BGR:565 mode,
>> remove unsupported 15bit modes").
> 
> Arnd, Olof,
> 
> Please tell me if I can do something to ease the adoption of these
> patches during 3.9-rc timeframe (I can rebase it on top of 3.9-rc1 to
> avoid any conflict: the file board-neocore926.c was removed during the
> merge window).
> Johan has written the series a long time ago and we still do not have it
> in mainline.
> 
> If the option to ask Andrew is better in your opinion, please tell me.

In case we end-up with an agreement on the path those fixes should
follow, here is the location of my updated material rebased on top of 3.9-rc2:

The following changes since commit f6161aa153581da4a3867a2d1a7caf4be19b6ec9:

  Linux 3.9-rc2 (2013-03-10 16:54:19 -0700)

are available in the git repository at:

  git://github.com/at91linux/linux-at91.git at91-3.9-fixesLCD

for you to fetch changes up to bbd44f6bd9d1aa735b180b29b5719d63a8e87b55:

  ARM: at91/avr32/atmel_lcdfb: add platform device-id table (2013-03-13 11:05:12 +0100)

----------------------------------------------------------------
Johan Hovold (5):
      atmel_lcdfb: fix 16-bpp modes on older SOCs
      ARM: at91: fix LCD-wiring mode
      ARM: at91/avr32/atmel_lcdfb: add bus-clock entry
      atmel_lcdfb: move lcdcon2 register access to compute_hozval
      ARM: at91/avr32/atmel_lcdfb: add platform device-id table

 arch/arm/mach-at91/at91sam9261.c         |   2 +
 arch/arm/mach-at91/at91sam9261_devices.c |   6 +-
 arch/arm/mach-at91/at91sam9263.c         |   1 +
 arch/arm/mach-at91/at91sam9263_devices.c |   2 +-
 arch/arm/mach-at91/at91sam9g45.c         |   2 +
 arch/arm/mach-at91/at91sam9g45_devices.c |   6 +-
 arch/arm/mach-at91/at91sam9rl.c          |   1 +
 arch/arm/mach-at91/at91sam9rl_devices.c  |   2 +-
 arch/avr32/mach-at32ap/at32ap700x.c      |   6 +-
 drivers/video/atmel_lcdfb.c              | 130 +++++++++++++++++++++++++++--------
 include/video/atmel_lcdc.h               |   4 +-
 11 files changed, 126 insertions(+), 36 deletions(-)


Thanks, best regards,
-- 
Nicolas Ferre

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

* Re: [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal
  2013-03-13 10:12       ` Nicolas Ferre
@ 2013-03-14 23:03         ` Arnd Bergmann
  2013-03-15 10:16           ` Nicolas Ferre
  0 siblings, 1 reply; 14+ messages in thread
From: Arnd Bergmann @ 2013-03-14 23:03 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Johan Hovold, Olof Johansson, FlorianSchandinat,
	Jean-Christophe PLAGNIOL-VILLARD, linux-arm-kernel, linux-kernel,
	linux-fbdev, jacmet

On Wednesday 13 March 2013, Nicolas Ferre wrote:
> In case we end-up with an agreement on the path those fixes should
> follow, here is the location of my updated material rebased on top of 3.9-rc2:
> 
> The following changes since commit f6161aa153581da4a3867a2d1a7caf4be19b6ec9:
> 
>   Linux 3.9-rc2 (2013-03-10 16:54:19 -0700)
> 
> are available in the git repository at:
> 
>   git://github.com/at91linux/linux-at91.git at91-3.9-fixesLCD
> 
> for you to fetch changes up to bbd44f6bd9d1aa735b180b29b5719d63a8e87b55:
> 
>   ARM: at91/avr32/atmel_lcdfb: add platform device-id table (2013-03-13 11:05:12 +0100)
> 
> ----------------------------------------------------------------
> Johan Hovold (5):
>       atmel_lcdfb: fix 16-bpp modes on older SOCs
>       ARM: at91: fix LCD-wiring mode
>       ARM: at91/avr32/atmel_lcdfb: add bus-clock entry
>       atmel_lcdfb: move lcdcon2 register access to compute_hozval
>       ARM: at91/avr32/atmel_lcdfb: add platform device-id table
> 

I have merged the first two patches into the fixes branch now, from up to commit
67cf9c0a. Please resubmit the remaining ones on top of this commit for 3.10, either
through arm-soc or through the framebuffer tree.

	Arnd

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

* Re: [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal
  2013-03-14 23:03         ` Arnd Bergmann
@ 2013-03-15 10:16           ` Nicolas Ferre
  0 siblings, 0 replies; 14+ messages in thread
From: Nicolas Ferre @ 2013-03-15 10:16 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Johan Hovold, Olof Johansson, FlorianSchandinat,
	Jean-Christophe PLAGNIOL-VILLARD, linux-arm-kernel, linux-kernel,
	linux-fbdev, jacmet

On 03/15/2013 12:03 AM, Arnd Bergmann :
> On Wednesday 13 March 2013, Nicolas Ferre wrote:
>> In case we end-up with an agreement on the path those fixes should
>> follow, here is the location of my updated material rebased on top of 3.9-rc2:
>>
>> The following changes since commit f6161aa153581da4a3867a2d1a7caf4be19b6ec9:
>>
>>   Linux 3.9-rc2 (2013-03-10 16:54:19 -0700)
>>
>> are available in the git repository at:
>>
>>   git://github.com/at91linux/linux-at91.git at91-3.9-fixesLCD
>>
>> for you to fetch changes up to bbd44f6bd9d1aa735b180b29b5719d63a8e87b55:
>>
>>   ARM: at91/avr32/atmel_lcdfb: add platform device-id table (2013-03-13 11:05:12 +0100)
>>
>> ----------------------------------------------------------------
>> Johan Hovold (5):
>>       atmel_lcdfb: fix 16-bpp modes on older SOCs
>>       ARM: at91: fix LCD-wiring mode
>>       ARM: at91/avr32/atmel_lcdfb: add bus-clock entry
>>       atmel_lcdfb: move lcdcon2 register access to compute_hozval
>>       ARM: at91/avr32/atmel_lcdfb: add platform device-id table
>>
> 
> I have merged the first two patches into the fixes branch now, from up to commit
> 67cf9c0a. Please resubmit the remaining ones on top of this commit for 3.10, either
> through arm-soc or through the framebuffer tree.

Thanks a lot.
I have just sent the pull-request for remaining material. Tell me if it
is what you've expected.

Best regards,
-- 
Nicolas Ferre

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

end of thread, other threads:[~2013-03-15 10:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-08 16:35 [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal Nicolas Ferre
2013-02-08 16:35 ` [PATCH 1/5] atmel_lcdfb: fix 16-bpp modes on older SOCs Nicolas Ferre
2013-02-08 16:35 ` [PATCH 2/5] ARM: at91/neocore926: fix LCD-wiring mode Nicolas Ferre
2013-02-08 16:35 ` [PATCH 3/5] ARM: at91/avr32/atmel_lcdfb: add bus-clock entry Nicolas Ferre
2013-02-08 16:35 ` [PATCH 4/5] atmel_lcdfb: move lcdcon2 register access to compute_hozval Nicolas Ferre
2013-02-08 16:35 ` [PATCH 5/5] ARM: at91/avr32/atmel_lcdfb: add platform device-id table Nicolas Ferre
2013-02-08 16:52 ` [PATCH 0/5] at91: atmel_lcdfb: regression fixes and cpu_is removal Jean-Christophe PLAGNIOL-VILLARD
2013-02-10  0:47 ` Olof Johansson
2013-02-10 18:45   ` Johan Hovold
2013-03-08  9:37     ` Nicolas Ferre
2013-03-13 10:12       ` Nicolas Ferre
2013-03-14 23:03         ` Arnd Bergmann
2013-03-15 10:16           ` Nicolas Ferre
2013-03-04 14:51   ` Johan Hovold

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