linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] s3c24xx LCD controller driver cleanup
@ 2013-04-26 20:02 Sylwester Nawrocki
  2013-04-26 20:02 ` [PATCH 1/9] s3c2410fb: Move platform data declarations to include/linux/platform_data Sylwester Nawrocki
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series moves the s3c2410fb driver header files from 
arch/arm/mach-s3c24xx to the driver specific directories. It 
also includes couple cleanups to the driver itself and a patch 
actually enabling the display during initialization, so it works
with FRAMEBUFFER_CONSOLE disabled.

Patches 6...9 have no dependencies on rest of the series.

The whole series is also available at:
git://github.com/snawrocki/linux.git cleanup/s3c2410fb

It has been tested on the Micro2440 board.

Sylwester Nawrocki (9):
  s3c2410fb: Move platform data declarations to
    include/linux/platform_data
  s3c2410fb: Make most of register definitions local
  ARM: S3C24XX: Remove include/mach/regs-lcd.h header file
  s3c2410fb: Register single platform driver
  s3c2410fb: Use dev_pm_ops
  s3c2410fb: Enable display by default
  s3c2410fb: Use devm_ioremap_resource()
  s3c2410fb: Remove redundant platform_set_drvdata()
  s3c2410fb: Use module parameter instead of a sysfs entry

 arch/arm/mach-s3c24xx/dma-s3c2410.c             |    1 -
 arch/arm/mach-s3c24xx/dma-s3c2412.c             |    1 -
 arch/arm/mach-s3c24xx/dma-s3c2440.c             |    1 -
 arch/arm/mach-s3c24xx/dma-s3c2443.c             |    1 -
 arch/arm/mach-s3c24xx/include/mach/fb.h         |    1 -
 arch/arm/mach-s3c24xx/include/mach/regs-lcd.h   |  162 ----------------------
 arch/arm/mach-s3c24xx/mach-anubis.c             |    1 -
 arch/arm/mach-s3c24xx/mach-at2440evb.c          |    3 +-
 arch/arm/mach-s3c24xx/mach-bast.c               |    3 +-
 arch/arm/mach-s3c24xx/mach-gta02.c              |    2 +-
 arch/arm/mach-s3c24xx/mach-h1940.c              |    3 +-
 arch/arm/mach-s3c24xx/mach-jive.c               |    3 +-
 arch/arm/mach-s3c24xx/mach-mini2440.c           |    3 +-
 arch/arm/mach-s3c24xx/mach-n30.c                |    3 +-
 arch/arm/mach-s3c24xx/mach-osiris.c             |    1 -
 arch/arm/mach-s3c24xx/mach-qt2410.c             |    3 +-
 arch/arm/mach-s3c24xx/mach-rx1950.c             |    3 +-
 arch/arm/mach-s3c24xx/mach-smdk2413.c           |    3 +-
 arch/arm/mach-s3c24xx/mach-smdk2416.c           |    1 -
 arch/arm/mach-s3c24xx/mach-smdk2440.c           |    3 +-
 arch/arm/mach-s3c24xx/mach-smdk2443.c           |    3 +-
 arch/arm/mach-s3c24xx/mach-vstms.c              |    4 +-
 arch/arm/plat-samsung/devs.c                    |    2 +-
 arch/arm/plat-samsung/include/plat/fb-s3c2410.h |   72 ----------
 drivers/video/s3c2410fb.c                       |  165 ++++++-----------------
 drivers/video/s3c2410fb.h                       |  114 +++++++++++++++-
 include/linux/platform_data/fb-s3c2410.h        |  106 +++++++++++++++
 27 files changed, 272 insertions(+), 396 deletions(-)
 delete mode 100644 arch/arm/mach-s3c24xx/include/mach/fb.h
 delete mode 100644 arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
 delete mode 100644 arch/arm/plat-samsung/include/plat/fb-s3c2410.h
 create mode 100644 include/linux/platform_data/fb-s3c2410.h

-- 
1.7.4.1


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

* [PATCH 1/9] s3c2410fb: Move platform data declarations to include/linux/platform_data
  2013-04-26 20:02 [PATCH 0/9] s3c24xx LCD controller driver cleanup Sylwester Nawrocki
@ 2013-04-26 20:02 ` Sylwester Nawrocki
  2013-04-26 20:02 ` [PATCH 2/9] s3c2410fb: Make most of register definitions local Sylwester Nawrocki
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

Move the platform data structure declarations to include/linux/platform_data
where it's supposed to be placed, rather than in platform specific directories.

Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
 arch/arm/mach-s3c24xx/include/mach/fb.h         |    1 -
 arch/arm/mach-s3c24xx/mach-at2440evb.c          |    2 +-
 arch/arm/mach-s3c24xx/mach-bast.c               |    2 +-
 arch/arm/mach-s3c24xx/mach-gta02.c              |    2 +-
 arch/arm/mach-s3c24xx/mach-h1940.c              |    2 +-
 arch/arm/mach-s3c24xx/mach-jive.c               |    2 +-
 arch/arm/mach-s3c24xx/mach-mini2440.c           |    2 +-
 arch/arm/mach-s3c24xx/mach-n30.c                |    2 +-
 arch/arm/mach-s3c24xx/mach-qt2410.c             |    2 +-
 arch/arm/mach-s3c24xx/mach-rx1950.c             |    2 +-
 arch/arm/mach-s3c24xx/mach-smdk2413.c           |    2 +-
 arch/arm/mach-s3c24xx/mach-smdk2440.c           |    2 +-
 arch/arm/mach-s3c24xx/mach-smdk2443.c           |    2 +-
 arch/arm/mach-s3c24xx/mach-vstms.c              |    3 +-
 arch/arm/plat-samsung/devs.c                    |    2 +-
 arch/arm/plat-samsung/include/plat/fb-s3c2410.h |   72 -----------------------
 drivers/video/s3c2410fb.c                       |    2 +-
 include/linux/platform_data/fb-s3c2410.h        |   72 +++++++++++++++++++++++
 18 files changed, 87 insertions(+), 89 deletions(-)
 delete mode 100644 arch/arm/mach-s3c24xx/include/mach/fb.h
 delete mode 100644 arch/arm/plat-samsung/include/plat/fb-s3c2410.h
 create mode 100644 include/linux/platform_data/fb-s3c2410.h

diff --git a/arch/arm/mach-s3c24xx/include/mach/fb.h b/arch/arm/mach-s3c24xx/include/mach/fb.h
deleted file mode 100644
index a957bc8e..0000000
--- a/arch/arm/mach-s3c24xx/include/mach/fb.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <plat/fb-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c
index 6dfeeb7..e4d71d5 100644
--- a/arch/arm/mach-s3c24xx/mach-at2440evb.c
+++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c
@@ -29,7 +29,7 @@
 #include <asm/mach/irq.h>
 
 #include <mach/hardware.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
diff --git a/arch/arm/mach-s3c24xx/mach-bast.c b/arch/arm/mach-s3c24xx/mach-bast.c
index 22d6ae9..4402741 100644
--- a/arch/arm/mach-s3c24xx/mach-bast.c
+++ b/arch/arm/mach-s3c24xx/mach-bast.c
@@ -44,7 +44,7 @@
 #include <asm/mach/irq.h>
 #include <asm/mach-types.h>
 
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
 #include <mach/hardware.h>
 #include <mach/regs-gpio.h>
 #include <mach/regs-lcd.h>
diff --git a/arch/arm/mach-s3c24xx/mach-gta02.c b/arch/arm/mach-s3c24xx/mach-gta02.c
index 13d8d07..cdad542 100644
--- a/arch/arm/mach-s3c24xx/mach-gta02.c
+++ b/arch/arm/mach-s3c24xx/mach-gta02.c
@@ -71,7 +71,7 @@
 #include <linux/platform_data/usb-ohci-s3c2410.h>
 #include <linux/platform_data/usb-s3c2410_udc.h>
 
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
 #include <mach/hardware.h>
 #include <mach/regs-gpio.h>
 #include <mach/regs-irq.h>
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
index af4334d..39ce53a 100644
--- a/arch/arm/mach-s3c24xx/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -49,7 +49,7 @@
 
 #include <sound/uda1380.h>
 
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
 #include <mach/hardware.h>
 #include <mach/regs-clock.h>
 #include <mach/regs-gpio.h>
diff --git a/arch/arm/mach-s3c24xx/mach-jive.c b/arch/arm/mach-s3c24xx/mach-jive.c
index a45fcd8..81e8e8c 100644
--- a/arch/arm/mach-s3c24xx/mach-jive.c
+++ b/arch/arm/mach-s3c24xx/mach-jive.c
@@ -37,7 +37,7 @@
 
 #include <mach/regs-gpio.h>
 #include <mach/regs-lcd.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
 
 #include <asm/mach-types.h>
 
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
index a83db46..aa59f48 100644
--- a/arch/arm/mach-s3c24xx/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
@@ -34,7 +34,7 @@
 #include <asm/mach/map.h>
 
 #include <mach/hardware.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
 #include <asm/mach-types.h>
 
 #include <plat/regs-serial.h>
diff --git a/arch/arm/mach-s3c24xx/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c
index 2cb46c3..3a32a75 100644
--- a/arch/arm/mach-s3c24xx/mach-n30.c
+++ b/arch/arm/mach-s3c24xx/mach-n30.c
@@ -32,7 +32,7 @@
 #include <asm/irq.h>
 #include <asm/mach-types.h>
 
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
 #include <linux/platform_data/leds-s3c24xx.h>
 #include <mach/regs-gpio.h>
 #include <mach/regs-lcd.h>
diff --git a/arch/arm/mach-s3c24xx/mach-qt2410.c b/arch/arm/mach-s3c24xx/mach-qt2410.c
index f8feaea..65be582 100644
--- a/arch/arm/mach-s3c24xx/mach-qt2410.c
+++ b/arch/arm/mach-s3c24xx/mach-qt2410.c
@@ -50,7 +50,7 @@
 #include <linux/platform_data/leds-s3c24xx.h>
 #include <mach/regs-lcd.h>
 #include <plat/regs-serial.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
 #include <linux/platform_data/mtd-nand-s3c2410.h>
 #include <linux/platform_data/usb-s3c2410_udc.h>
 #include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c
index e4d67a3..17fad4b 100644
--- a/arch/arm/mach-s3c24xx/mach-rx1950.c
+++ b/arch/arm/mach-s3c24xx/mach-rx1950.c
@@ -48,7 +48,7 @@
 
 #include <sound/uda1380.h>
 
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
 #include <mach/regs-gpio.h>
 #include <mach/regs-lcd.h>
 
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2413.c b/arch/arm/mach-s3c24xx/mach-smdk2413.c
index 8146e92..d504272 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2413.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2413.c
@@ -39,7 +39,7 @@
 
 #include <linux/platform_data/usb-s3c2410_udc.h>
 #include <linux/platform_data/i2c-s3c2410.h>
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
 
 #include <plat/clock.h>
 #include <plat/devs.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c
index de2e5d3..8546941 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2440.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2440.c
@@ -35,7 +35,7 @@
 #include <mach/regs-gpio.h>
 #include <mach/regs-lcd.h>
 
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
 #include <linux/platform_data/i2c-s3c2410.h>
 
 #include <plat/clock.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2443.c b/arch/arm/mach-s3c24xx/mach-smdk2443.c
index 9435c3b..5baa2e2 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2443.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2443.c
@@ -35,7 +35,7 @@
 #include <mach/regs-gpio.h>
 #include <mach/regs-lcd.h>
 
-#include <mach/fb.h>
+#include <linux/platform_data/fb-s3c2410.h>
 #include <linux/platform_data/i2c-s3c2410.h>
 
 #include <plat/clock.h>
diff --git a/arch/arm/mach-s3c24xx/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c
index b665884..86c9199 100644
--- a/arch/arm/mach-s3c24xx/mach-vstms.c
+++ b/arch/arm/mach-s3c24xx/mach-vstms.c
@@ -36,8 +36,7 @@
 #include <mach/regs-gpio.h>
 #include <mach/regs-lcd.h>
 
-#include <mach/fb.h>
-
+#include <linux/platform_data/fb-s3c2410.h>
 #include <linux/platform_data/i2c-s3c2410.h>
 #include <linux/platform_data/mtd-nand-s3c2410.h>
 
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index e1124d9..33c39bb 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -50,7 +50,7 @@
 #include <linux/platform_data/ata-samsung_cf.h>
 #include <linux/platform_data/usb-ehci-s5p.h>
 #include <plat/fb.h>
-#include <plat/fb-s3c2410.h>
+#include <linux/platform_data/fb-s3c2410.h>
 #include <plat/hdmi.h>
 #include <linux/platform_data/hwmon-s3c.h>
 #include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/plat-samsung/include/plat/fb-s3c2410.h b/arch/arm/plat-samsung/include/plat/fb-s3c2410.h
deleted file mode 100644
index 4e5d958..0000000
--- a/arch/arm/plat-samsung/include/plat/fb-s3c2410.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* arch/arm/plat-samsung/include/plat/fb-s3c2410.h
- *
- * Copyright (c) 2004 Arnaud Patard <arnaud.patard@rtp-net.org>
- *
- * Inspired by pxafb.h
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#ifndef __ASM_PLAT_FB_S3C2410_H
-#define __ASM_PLAT_FB_S3C2410_H __FILE__
-
-struct s3c2410fb_hw {
-	unsigned long	lcdcon1;
-	unsigned long	lcdcon2;
-	unsigned long	lcdcon3;
-	unsigned long	lcdcon4;
-	unsigned long	lcdcon5;
-};
-
-/* LCD description */
-struct s3c2410fb_display {
-	/* LCD type */
-	unsigned type;
-
-	/* Screen size */
-	unsigned short width;
-	unsigned short height;
-
-	/* Screen info */
-	unsigned short xres;
-	unsigned short yres;
-	unsigned short bpp;
-
-	unsigned pixclock;		/* pixclock in picoseconds */
-	unsigned short left_margin;  /* value in pixels (TFT) or HCLKs (STN) */
-	unsigned short right_margin; /* value in pixels (TFT) or HCLKs (STN) */
-	unsigned short hsync_len;    /* value in pixels (TFT) or HCLKs (STN) */
-	unsigned short upper_margin;	/* value in lines (TFT) or 0 (STN) */
-	unsigned short lower_margin;	/* value in lines (TFT) or 0 (STN) */
-	unsigned short vsync_len;	/* value in lines (TFT) or 0 (STN) */
-
-	/* lcd configuration registers */
-	unsigned long	lcdcon5;
-};
-
-struct s3c2410fb_mach_info {
-
-	struct s3c2410fb_display *displays;	/* attached diplays info */
-	unsigned num_displays;			/* number of defined displays */
-	unsigned default_display;
-
-	/* GPIOs */
-
-	unsigned long	gpcup;
-	unsigned long	gpcup_mask;
-	unsigned long	gpccon;
-	unsigned long	gpccon_mask;
-	unsigned long	gpdup;
-	unsigned long	gpdup_mask;
-	unsigned long	gpdcon;
-	unsigned long	gpdcon_mask;
-
-	/* lpc3600 control register */
-	unsigned long	lpcsel;
-};
-
-extern void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *);
-
-#endif /* __ASM_PLAT_FB_S3C2410_H */
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 76a0e7f..dc10dbe 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -32,10 +32,10 @@
 
 #include <asm/div64.h>
 
+#include <linux/platform_data/fb-s3c2410.h>
 #include <asm/mach/map.h>
 #include <mach/regs-lcd.h>
 #include <mach/regs-gpio.h>
-#include <mach/fb.h>
 
 #ifdef CONFIG_PM
 #include <linux/pm.h>
diff --git a/include/linux/platform_data/fb-s3c2410.h b/include/linux/platform_data/fb-s3c2410.h
new file mode 100644
index 0000000..dbebc62
--- /dev/null
+++ b/include/linux/platform_data/fb-s3c2410.h
@@ -0,0 +1,72 @@
+/* arch/arm/plat-samsung/include/plat/fb-s3c2410.h
+ *
+ * Copyright (c) 2004 Arnaud Patard <arnaud.patard@rtp-net.org>
+ *
+ * Inspired by pxafb.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __FB_S3C2410_H
+#define __FB_S3C2410_H __FILE__
+
+struct s3c2410fb_hw {
+	unsigned long	lcdcon1;
+	unsigned long	lcdcon2;
+	unsigned long	lcdcon3;
+	unsigned long	lcdcon4;
+	unsigned long	lcdcon5;
+};
+
+/* LCD description */
+struct s3c2410fb_display {
+	/* LCD type */
+	unsigned type;
+
+	/* Screen size */
+	unsigned short width;
+	unsigned short height;
+
+	/* Screen info */
+	unsigned short xres;
+	unsigned short yres;
+	unsigned short bpp;
+
+	unsigned pixclock;		/* pixclock in picoseconds */
+	unsigned short left_margin;  /* value in pixels (TFT) or HCLKs (STN) */
+	unsigned short right_margin; /* value in pixels (TFT) or HCLKs (STN) */
+	unsigned short hsync_len;    /* value in pixels (TFT) or HCLKs (STN) */
+	unsigned short upper_margin;	/* value in lines (TFT) or 0 (STN) */
+	unsigned short lower_margin;	/* value in lines (TFT) or 0 (STN) */
+	unsigned short vsync_len;	/* value in lines (TFT) or 0 (STN) */
+
+	/* lcd configuration registers */
+	unsigned long	lcdcon5;
+};
+
+struct s3c2410fb_mach_info {
+
+	struct s3c2410fb_display *displays;	/* attached diplays info */
+	unsigned num_displays;			/* number of defined displays */
+	unsigned default_display;
+
+	/* GPIOs */
+
+	unsigned long	gpcup;
+	unsigned long	gpcup_mask;
+	unsigned long	gpccon;
+	unsigned long	gpccon_mask;
+	unsigned long	gpdup;
+	unsigned long	gpdup_mask;
+	unsigned long	gpdcon;
+	unsigned long	gpdcon_mask;
+
+	/* lpc3600 control register */
+	unsigned long	lpcsel;
+};
+
+extern void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *);
+
+#endif /* __FB_S3C2410_H */
-- 
1.7.4.1


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

* [PATCH 2/9] s3c2410fb: Make most of register definitions local
  2013-04-26 20:02 [PATCH 0/9] s3c24xx LCD controller driver cleanup Sylwester Nawrocki
  2013-04-26 20:02 ` [PATCH 1/9] s3c2410fb: Move platform data declarations to include/linux/platform_data Sylwester Nawrocki
@ 2013-04-26 20:02 ` Sylwester Nawrocki
  2013-04-26 20:02 ` [PATCH 3/9] ARM: S3C24XX: Remove include/mach/regs-lcd.h header file Sylwester Nawrocki
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

Move most of the register definitions to the driver's private header file.
Some of the register bit field definitions are used in the platform data
structure and will be moved to include/linux/platform_data/fb-s3c2410.h
in subsequent patch.

Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
 arch/arm/mach-s3c24xx/include/mach/regs-lcd.h |  110 ------------------------
 drivers/video/s3c2410fb.h                     |  114 ++++++++++++++++++++++++-
 2 files changed, 112 insertions(+), 112 deletions(-)

diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h b/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
index ee8f040..369511f 100644
--- a/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
@@ -12,16 +12,6 @@
 #ifndef ___ASM_ARCH_REGS_LCD_H
 #define ___ASM_ARCH_REGS_LCD_H
 
-#define S3C2410_LCDREG(x)	(x)
-
-/* LCD control registers */
-#define S3C2410_LCDCON1	    S3C2410_LCDREG(0x00)
-#define S3C2410_LCDCON2	    S3C2410_LCDREG(0x04)
-#define S3C2410_LCDCON3	    S3C2410_LCDREG(0x08)
-#define S3C2410_LCDCON4	    S3C2410_LCDREG(0x0C)
-#define S3C2410_LCDCON5	    S3C2410_LCDREG(0x10)
-
-#define S3C2410_LCDCON1_CLKVAL(x)  ((x) << 8)
 #define S3C2410_LCDCON1_MMODE	   (1<<7)
 #define S3C2410_LCDCON1_DSCAN4	   (0<<5)
 #define S3C2410_LCDCON1_STN4	   (1<<5)
@@ -45,32 +35,6 @@
 
 #define S3C2410_LCDCON1_MODEMASK    0x1E
 
-#define S3C2410_LCDCON2_VBPD(x)	    ((x) << 24)
-#define S3C2410_LCDCON2_LINEVAL(x)  ((x) << 14)
-#define S3C2410_LCDCON2_VFPD(x)	    ((x) << 6)
-#define S3C2410_LCDCON2_VSPW(x)	    ((x) << 0)
-
-#define S3C2410_LCDCON2_GET_VBPD(x) ( ((x) >> 24) & 0xFF)
-#define S3C2410_LCDCON2_GET_VFPD(x) ( ((x) >>  6) & 0xFF)
-#define S3C2410_LCDCON2_GET_VSPW(x) ( ((x) >>  0) & 0x3F)
-
-#define S3C2410_LCDCON3_HBPD(x)	    ((x) << 19)
-#define S3C2410_LCDCON3_WDLY(x)	    ((x) << 19)
-#define S3C2410_LCDCON3_HOZVAL(x)   ((x) << 8)
-#define S3C2410_LCDCON3_HFPD(x)	    ((x) << 0)
-#define S3C2410_LCDCON3_LINEBLANK(x)((x) << 0)
-
-#define S3C2410_LCDCON3_GET_HBPD(x) ( ((x) >> 19) & 0x7F)
-#define S3C2410_LCDCON3_GET_HFPD(x) ( ((x) >>  0) & 0xFF)
-
-/* LDCCON4 changes for STN mode on the S3C2412 */
-
-#define S3C2410_LCDCON4_MVAL(x)	    ((x) << 8)
-#define S3C2410_LCDCON4_HSPW(x)	    ((x) << 0)
-#define S3C2410_LCDCON4_WLH(x)	    ((x) << 0)
-
-#define S3C2410_LCDCON4_GET_HSPW(x) ( ((x) >>  0) & 0xFF)
-
 #define S3C2410_LCDCON5_BPP24BL	    (1<<12)
 #define S3C2410_LCDCON5_FRM565	    (1<<11)
 #define S3C2410_LCDCON5_INVVCLK	    (1<<10)
@@ -85,78 +49,4 @@
 #define S3C2410_LCDCON5_BSWP	    (1<<1)
 #define S3C2410_LCDCON5_HWSWP	    (1<<0)
 
-/* framebuffer start addressed */
-#define S3C2410_LCDSADDR1   S3C2410_LCDREG(0x14)
-#define S3C2410_LCDSADDR2   S3C2410_LCDREG(0x18)
-#define S3C2410_LCDSADDR3   S3C2410_LCDREG(0x1C)
-
-#define S3C2410_LCDBANK(x)	((x) << 21)
-#define S3C2410_LCDBASEU(x)	(x)
-
-#define S3C2410_OFFSIZE(x)	((x) << 11)
-#define S3C2410_PAGEWIDTH(x)	(x)
-
-/* colour lookup and miscellaneous controls */
-
-#define S3C2410_REDLUT	   S3C2410_LCDREG(0x20)
-#define S3C2410_GREENLUT   S3C2410_LCDREG(0x24)
-#define S3C2410_BLUELUT	   S3C2410_LCDREG(0x28)
-
-#define S3C2410_DITHMODE   S3C2410_LCDREG(0x4C)
-#define S3C2410_TPAL	   S3C2410_LCDREG(0x50)
-
-#define S3C2410_TPAL_EN		(1<<24)
-
-/* interrupt info */
-#define S3C2410_LCDINTPND  S3C2410_LCDREG(0x54)
-#define S3C2410_LCDSRCPND  S3C2410_LCDREG(0x58)
-#define S3C2410_LCDINTMSK  S3C2410_LCDREG(0x5C)
-#define S3C2410_LCDINT_FIWSEL	(1<<2)
-#define	S3C2410_LCDINT_FRSYNC	(1<<1)
-#define S3C2410_LCDINT_FICNT	(1<<0)
-
-/* s3c2442 extra stn registers */
-
-#define S3C2442_REDLUT		S3C2410_LCDREG(0x20)
-#define S3C2442_GREENLUT	S3C2410_LCDREG(0x24)
-#define S3C2442_BLUELUT		S3C2410_LCDREG(0x28)
-#define S3C2442_DITHMODE	S3C2410_LCDREG(0x20)
-
-#define S3C2410_LPCSEL	   S3C2410_LCDREG(0x60)
-
-#define S3C2410_TFTPAL(x)  S3C2410_LCDREG((0x400 + (x)*4))
-
-/* S3C2412 registers */
-
-#define S3C2412_TPAL		S3C2410_LCDREG(0x20)
-
-#define S3C2412_LCDINTPND	S3C2410_LCDREG(0x24)
-#define S3C2412_LCDSRCPND	S3C2410_LCDREG(0x28)
-#define S3C2412_LCDINTMSK	S3C2410_LCDREG(0x2C)
-
-#define S3C2412_TCONSEL		S3C2410_LCDREG(0x30)
-
-#define S3C2412_LCDCON6		S3C2410_LCDREG(0x34)
-#define S3C2412_LCDCON7		S3C2410_LCDREG(0x38)
-#define S3C2412_LCDCON8		S3C2410_LCDREG(0x3C)
-#define S3C2412_LCDCON9		S3C2410_LCDREG(0x40)
-
-#define S3C2412_REDLUT(x)	S3C2410_LCDREG(0x44 + ((x)*4))
-#define S3C2412_GREENLUT(x)	S3C2410_LCDREG(0x60 + ((x)*4))
-#define S3C2412_BLUELUT(x)	S3C2410_LCDREG(0x98 + ((x)*4))
-
-#define S3C2412_FRCPAT(x)	S3C2410_LCDREG(0xB4 + ((x)*4))
-
-/* general registers */
-
-/* base of the LCD registers, where INTPND, INTSRC and then INTMSK
- * are available. */
-
-#define S3C2410_LCDINTBASE	S3C2410_LCDREG(0x54)
-#define S3C2412_LCDINTBASE	S3C2410_LCDREG(0x24)
-
-#define S3C24XX_LCDINTPND	(0x00)
-#define S3C24XX_LCDSRCPND	(0x04)
-#define S3C24XX_LCDINTMSK	(0x08)
-
 #endif /* ___ASM_ARCH_REGS_LCD_H */
diff --git a/drivers/video/s3c2410fb.h b/drivers/video/s3c2410fb.h
index 47a17bd..4e56b77 100644
--- a/drivers/video/s3c2410fb.h
+++ b/drivers/video/s3c2410fb.h
@@ -7,12 +7,122 @@
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file COPYING in the main directory of this archive for
  * more details.
- *
-*/
+ */
 
 #ifndef __S3C2410FB_H
 #define __S3C2410FB_H
 
+/* LCD control registers */
+#define S3C2410_LCDCON1			0x00
+#define S3C2410_LCDCON1_CLKVAL(x)	((x) << 8)
+#define S3C2410_LCDCON1_ENVID		1
+#define S3C2410_LCDCON1_MODEMASK	0x1e
+#define S3C2410_LCDCON1_MMODE		(1 << 7)
+
+#define S3C2410_LCDCON2			0x04
+#define S3C2410_LCDCON2_VBPD(x)		((x) << 24)
+#define S3C2410_LCDCON2_LINEVAL(x)	((x) << 14)
+#define S3C2410_LCDCON2_VFPD(x)		((x) << 6)
+#define S3C2410_LCDCON2_VSPW(x)		((x) << 0)
+
+#define S3C2410_LCDCON2_GET_VBPD(x)	(((x) >> 24) & 0xff)
+#define S3C2410_LCDCON2_GET_VFPD(x)	(((x) >>  6) & 0xff)
+#define S3C2410_LCDCON2_GET_VSPW(x)	(((x) >>  0) & 0x3f)
+
+#define S3C2410_LCDCON3			0x08
+#define S3C2410_LCDCON3_HBPD(x)		((x) << 19)
+#define S3C2410_LCDCON3_WDLY(x)		((x) << 19)
+#define S3C2410_LCDCON3_HOZVAL(x)	((x) << 8)
+#define S3C2410_LCDCON3_HFPD(x)		((x) << 0)
+#define S3C2410_LCDCON3_LINEBLANK(x)	((x) << 0)
+
+#define S3C2410_LCDCON3_GET_HBPD(x)	(((x) >> 19) & 0x7f)
+#define S3C2410_LCDCON3_GET_HFPD(x)	(((x) >>  0) & 0xff)
+
+/* LDCCON4 changes for STN mode on the S3C2412 */
+
+#define S3C2410_LCDCON4			0x0c
+#define S3C2410_LCDCON4_MVAL(x)		((x) << 8)
+#define S3C2410_LCDCON4_HSPW(x)		((x) << 0)
+#define S3C2410_LCDCON4_WLH(x)		((x) << 0)
+#define S3C2410_LCDCON4_GET_HSPW(x)	(((x) >>  0) & 0xff)
+
+#define S3C2410_LCDCON5			0x10
+
+/* framebuffer start addressed */
+#define S3C2410_LCDSADDR1		0x14
+#define S3C2410_LCDSADDR2		0x18
+#define S3C2410_LCDSADDR3		0x1c
+
+#define S3C2410_LCDBANK(x)		((x) << 21)
+#define S3C2410_LCDBASEU(x)		(x)
+
+#define S3C2410_OFFSIZE(x)		((x) << 11)
+#define S3C2410_PAGEWIDTH(x)		(x)
+
+/* colour lookup and miscellaneous controls */
+
+#define S3C2410_REDLUT			0x20
+#define S3C2410_GREENLUT		0x24
+#define S3C2410_BLUELUT			0x28
+
+#define S3C2410_DITHMODE		0x4c
+#define S3C2410_TPAL			0x50
+
+#define S3C2410_TPAL_EN			(1 << 24)
+
+/* interrupt info */
+#define S3C2410_LCDINTPND		0x54
+#define S3C2410_LCDSRCPND		0x58
+#define S3C2410_LCDINTMSK		0x5c
+#define S3C2410_LCDINT_FIWSEL		(1 << 2)
+#define S3C2410_LCDINT_FRSYNC		(1 << 1)
+#define S3C2410_LCDINT_FICNT		(1 << 0)
+
+/* s3c2442 extra stn registers */
+
+#define S3C2442_REDLUT			0x20
+#define S3C2442_GREENLUT		0x24
+#define S3C2442_BLUELUT			0x28
+#define S3C2442_DITHMODE		0x20
+
+#define S3C2410_LPCSEL			0x60
+
+#define S3C2410_TFTPAL(x)		(0x400 + ((x) * 4))
+
+/* S3C2412 registers */
+
+#define S3C2412_TPAL			0x20
+
+#define S3C2412_LCDINTPND		0x24
+#define S3C2412_LCDSRCPND		0x28
+#define S3C2412_LCDINTMSK		0x2c
+#define S3C2412_TCONSEL			0x30
+#define S3C2412_LCDCON6			0x34
+#define S3C2412_LCDCON7			0x38
+#define S3C2412_LCDCON8			0x3c
+#define S3C2412_LCDCON9			0x40
+
+#define S3C2412_REDLUT(x)		(0x44 + ((x) * 4))
+#define S3C2412_GREENLUT(x)		(0x60 + ((x) * 4))
+#define S3C2412_BLUELUT(x)		(0x98 + ((x) * 4))
+
+#define S3C2412_FRCPAT(x)		(0xb4 + ((x)*4))
+
+/* General registers. */
+
+/*
+ * Base of the LCD registers, where INTPND, INTSRC and then INTMSK
+ * are available.
+ */
+#define S3C2410_LCDINTBASE		0x54
+#define S3C2412_LCDINTBASE		0x24
+
+#define S3C24XX_LCDINTPND		0x00
+#define S3C24XX_LCDSRCPND		0x04
+#define S3C24XX_LCDINTMSK		0x08
+
+
 enum s3c_drv_type {
 	DRV_S3C2410,
 	DRV_S3C2412,
-- 
1.7.4.1


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

* [PATCH 3/9] ARM: S3C24XX: Remove include/mach/regs-lcd.h header file
  2013-04-26 20:02 [PATCH 0/9] s3c24xx LCD controller driver cleanup Sylwester Nawrocki
  2013-04-26 20:02 ` [PATCH 1/9] s3c2410fb: Move platform data declarations to include/linux/platform_data Sylwester Nawrocki
  2013-04-26 20:02 ` [PATCH 2/9] s3c2410fb: Make most of register definitions local Sylwester Nawrocki
@ 2013-04-26 20:02 ` Sylwester Nawrocki
  2013-04-26 20:02 ` [PATCH 4/9] s3c2410fb: Register single platform driver Sylwester Nawrocki
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

Move remaining s3c2410 LCD controller register bit field definitions
to the platform data header. Now the regs-lcd.h header can be removed
and inclusion of the mach specific header dropped from the driver.
Next step could be to redefine platform data structure, so register
specific definitions are private to the driver. Another possibility
is to add DT support, however these platforms will likely use ATAGS
for some time yet.

Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
 arch/arm/mach-s3c24xx/dma-s3c2410.c           |    1 -
 arch/arm/mach-s3c24xx/dma-s3c2412.c           |    1 -
 arch/arm/mach-s3c24xx/dma-s3c2440.c           |    1 -
 arch/arm/mach-s3c24xx/dma-s3c2443.c           |    1 -
 arch/arm/mach-s3c24xx/include/mach/regs-lcd.h |   52 -------------------------
 arch/arm/mach-s3c24xx/mach-anubis.c           |    1 -
 arch/arm/mach-s3c24xx/mach-at2440evb.c        |    1 -
 arch/arm/mach-s3c24xx/mach-bast.c             |    1 -
 arch/arm/mach-s3c24xx/mach-h1940.c            |    1 -
 arch/arm/mach-s3c24xx/mach-jive.c             |    1 -
 arch/arm/mach-s3c24xx/mach-mini2440.c         |    1 -
 arch/arm/mach-s3c24xx/mach-n30.c              |    1 -
 arch/arm/mach-s3c24xx/mach-osiris.c           |    1 -
 arch/arm/mach-s3c24xx/mach-qt2410.c           |    1 -
 arch/arm/mach-s3c24xx/mach-rx1950.c           |    1 -
 arch/arm/mach-s3c24xx/mach-smdk2413.c         |    1 -
 arch/arm/mach-s3c24xx/mach-smdk2416.c         |    1 -
 arch/arm/mach-s3c24xx/mach-smdk2440.c         |    1 -
 arch/arm/mach-s3c24xx/mach-smdk2443.c         |    1 -
 arch/arm/mach-s3c24xx/mach-vstms.c            |    1 -
 drivers/video/s3c2410fb.c                     |    1 -
 include/linux/platform_data/fb-s3c2410.h      |   34 ++++++++++++++++
 22 files changed, 34 insertions(+), 72 deletions(-)
 delete mode 100644 arch/arm/mach-s3c24xx/include/mach/regs-lcd.h

diff --git a/arch/arm/mach-s3c24xx/dma-s3c2410.c b/arch/arm/mach-s3c24xx/dma-s3c2410.c
index a6c94b8..764556a 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2410.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2410.c
@@ -27,7 +27,6 @@
 #include <mach/regs-gpio.h>
 #include <plat/regs-ac97.h>
 #include <plat/regs-dma.h>
-#include <mach/regs-lcd.h>
 #include <plat/regs-iis.h>
 #include <plat/regs-spi.h>
 
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2412.c b/arch/arm/mach-s3c24xx/dma-s3c2412.c
index c0e8c3f..f02fc3c 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2412.c
@@ -27,7 +27,6 @@
 #include <mach/regs-gpio.h>
 #include <plat/regs-ac97.h>
 #include <plat/regs-dma.h>
-#include <mach/regs-lcd.h>
 #include <plat/regs-iis.h>
 #include <plat/regs-spi.h>
 
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2440.c b/arch/arm/mach-s3c24xx/dma-s3c2440.c
index 1c08eccd..b621563 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2440.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2440.c
@@ -27,7 +27,6 @@
 #include <mach/regs-gpio.h>
 #include <plat/regs-ac97.h>
 #include <plat/regs-dma.h>
-#include <mach/regs-lcd.h>
 #include <plat/regs-iis.h>
 #include <plat/regs-spi.h>
 
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2443.c b/arch/arm/mach-s3c24xx/dma-s3c2443.c
index 000e4c6..095e841 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2443.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2443.c
@@ -27,7 +27,6 @@
 #include <mach/regs-gpio.h>
 #include <plat/regs-ac97.h>
 #include <plat/regs-dma.h>
-#include <mach/regs-lcd.h>
 #include <plat/regs-iis.h>
 #include <plat/regs-spi.h>
 
diff --git a/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h b/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
deleted file mode 100644
index 369511f..0000000
--- a/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* arch/arm/mach-s3c2410/include/mach/regs-lcd.h
- *
- * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
- *		      http://www.simtec.co.uk/products/SWLINUX/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-
-#ifndef ___ASM_ARCH_REGS_LCD_H
-#define ___ASM_ARCH_REGS_LCD_H
-
-#define S3C2410_LCDCON1_MMODE	   (1<<7)
-#define S3C2410_LCDCON1_DSCAN4	   (0<<5)
-#define S3C2410_LCDCON1_STN4	   (1<<5)
-#define S3C2410_LCDCON1_STN8	   (2<<5)
-#define S3C2410_LCDCON1_TFT	   (3<<5)
-
-#define S3C2410_LCDCON1_STN1BPP	   (0<<1)
-#define S3C2410_LCDCON1_STN2GREY   (1<<1)
-#define S3C2410_LCDCON1_STN4GREY   (2<<1)
-#define S3C2410_LCDCON1_STN8BPP	   (3<<1)
-#define S3C2410_LCDCON1_STN12BPP   (4<<1)
-
-#define S3C2410_LCDCON1_TFT1BPP	   (8<<1)
-#define S3C2410_LCDCON1_TFT2BPP	   (9<<1)
-#define S3C2410_LCDCON1_TFT4BPP	   (10<<1)
-#define S3C2410_LCDCON1_TFT8BPP	   (11<<1)
-#define S3C2410_LCDCON1_TFT16BPP   (12<<1)
-#define S3C2410_LCDCON1_TFT24BPP   (13<<1)
-
-#define S3C2410_LCDCON1_ENVID	   (1)
-
-#define S3C2410_LCDCON1_MODEMASK    0x1E
-
-#define S3C2410_LCDCON5_BPP24BL	    (1<<12)
-#define S3C2410_LCDCON5_FRM565	    (1<<11)
-#define S3C2410_LCDCON5_INVVCLK	    (1<<10)
-#define S3C2410_LCDCON5_INVVLINE    (1<<9)
-#define S3C2410_LCDCON5_INVVFRAME   (1<<8)
-#define S3C2410_LCDCON5_INVVD	    (1<<7)
-#define S3C2410_LCDCON5_INVVDEN	    (1<<6)
-#define S3C2410_LCDCON5_INVPWREN    (1<<5)
-#define S3C2410_LCDCON5_INVLEND	    (1<<4)
-#define S3C2410_LCDCON5_PWREN	    (1<<3)
-#define S3C2410_LCDCON5_ENLEND	    (1<<2)
-#define S3C2410_LCDCON5_BSWP	    (1<<1)
-#define S3C2410_LCDCON5_HWSWP	    (1<<0)
-
-#endif /* ___ASM_ARCH_REGS_LCD_H */
diff --git a/arch/arm/mach-s3c24xx/mach-anubis.c b/arch/arm/mach-s3c24xx/mach-anubis.c
index c1fb6c3..d5e8cad 100644
--- a/arch/arm/mach-s3c24xx/mach-anubis.c
+++ b/arch/arm/mach-s3c24xx/mach-anubis.c
@@ -34,7 +34,6 @@
 
 #include <plat/regs-serial.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 #include <linux/platform_data/mtd-nand-s3c2410.h>
 #include <linux/platform_data/i2c-s3c2410.h>
 
diff --git a/arch/arm/mach-s3c24xx/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c
index e4d71d5..f151bf7 100644
--- a/arch/arm/mach-s3c24xx/mach-at2440evb.c
+++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c
@@ -35,7 +35,6 @@
 
 #include <plat/regs-serial.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 #include <linux/platform_data/mtd-nand-s3c2410.h>
 #include <linux/platform_data/i2c-s3c2410.h>
 
diff --git a/arch/arm/mach-s3c24xx/mach-bast.c b/arch/arm/mach-s3c24xx/mach-bast.c
index 4402741..a500b21 100644
--- a/arch/arm/mach-s3c24xx/mach-bast.c
+++ b/arch/arm/mach-s3c24xx/mach-bast.c
@@ -47,7 +47,6 @@
 #include <linux/platform_data/fb-s3c2410.h>
 #include <mach/hardware.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 
 #include <plat/clock.h>
 #include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
index 39ce53a..0236201 100644
--- a/arch/arm/mach-s3c24xx/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -53,7 +53,6 @@
 #include <mach/hardware.h>
 #include <mach/regs-clock.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 
 #include <plat/clock.h>
 #include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c24xx/mach-jive.c b/arch/arm/mach-s3c24xx/mach-jive.c
index 81e8e8c..d1347ec 100644
--- a/arch/arm/mach-s3c24xx/mach-jive.c
+++ b/arch/arm/mach-s3c24xx/mach-jive.c
@@ -36,7 +36,6 @@
 #include <linux/platform_data/i2c-s3c2410.h>
 
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 #include <linux/platform_data/fb-s3c2410.h>
 
 #include <asm/mach-types.h>
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
index aa59f48..d0f25a4 100644
--- a/arch/arm/mach-s3c24xx/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
@@ -40,7 +40,6 @@
 #include <plat/regs-serial.h>
 #include <mach/regs-gpio.h>
 #include <linux/platform_data/leds-s3c24xx.h>
-#include <mach/regs-lcd.h>
 #include <mach/irqs.h>
 #include <linux/platform_data/mtd-nand-s3c2410.h>
 #include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c
index 3a32a75..8b956b7 100644
--- a/arch/arm/mach-s3c24xx/mach-n30.c
+++ b/arch/arm/mach-s3c24xx/mach-n30.c
@@ -35,7 +35,6 @@
 #include <linux/platform_data/fb-s3c2410.h>
 #include <linux/platform_data/leds-s3c24xx.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/irq.h>
diff --git a/arch/arm/mach-s3c24xx/mach-osiris.c b/arch/arm/mach-s3c24xx/mach-osiris.c
index 58d6fbe..eeca631 100644
--- a/arch/arm/mach-s3c24xx/mach-osiris.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris.c
@@ -49,7 +49,6 @@
 
 #include <mach/hardware.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 
 #include "common.h"
 #include "osiris.h"
diff --git a/arch/arm/mach-s3c24xx/mach-qt2410.c b/arch/arm/mach-s3c24xx/mach-qt2410.c
index 65be582..7e11373 100644
--- a/arch/arm/mach-s3c24xx/mach-qt2410.c
+++ b/arch/arm/mach-s3c24xx/mach-qt2410.c
@@ -48,7 +48,6 @@
 #include <asm/mach-types.h>
 
 #include <linux/platform_data/leds-s3c24xx.h>
-#include <mach/regs-lcd.h>
 #include <plat/regs-serial.h>
 #include <linux/platform_data/fb-s3c2410.h>
 #include <linux/platform_data/mtd-nand-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c
index 17fad4b..1ea1ce8 100644
--- a/arch/arm/mach-s3c24xx/mach-rx1950.c
+++ b/arch/arm/mach-s3c24xx/mach-rx1950.c
@@ -50,7 +50,6 @@
 
 #include <linux/platform_data/fb-s3c2410.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 
 #include <plat/clock.h>
 #include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2413.c b/arch/arm/mach-s3c24xx/mach-smdk2413.c
index d504272..9b473cb 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2413.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2413.c
@@ -35,7 +35,6 @@
 //#include <asm/debug-ll.h>
 #include <plat/regs-serial.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 
 #include <linux/platform_data/usb-s3c2410_udc.h>
 #include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2416.c b/arch/arm/mach-s3c24xx/mach-smdk2416.c
index cb46847..5630d51 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2416.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2416.c
@@ -36,7 +36,6 @@
 
 #include <plat/regs-serial.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 #include <mach/regs-s3c2443-clock.h>
 
 #include <linux/platform_data/leds-s3c24xx.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c
index 8546941..040e39b 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2440.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2440.c
@@ -33,7 +33,6 @@
 
 #include <plat/regs-serial.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 
 #include <linux/platform_data/fb-s3c2410.h>
 #include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2443.c b/arch/arm/mach-s3c24xx/mach-smdk2443.c
index 5baa2e2..99a5c34 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2443.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2443.c
@@ -33,7 +33,6 @@
 
 #include <plat/regs-serial.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 
 #include <linux/platform_data/fb-s3c2410.h>
 #include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-s3c24xx/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c
index 86c9199..92cd9ec 100644
--- a/arch/arm/mach-s3c24xx/mach-vstms.c
+++ b/arch/arm/mach-s3c24xx/mach-vstms.c
@@ -34,7 +34,6 @@
 
 #include <plat/regs-serial.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 
 #include <linux/platform_data/fb-s3c2410.h>
 #include <linux/platform_data/i2c-s3c2410.h>
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index dc10dbe..12ac94e 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -34,7 +34,6 @@
 
 #include <linux/platform_data/fb-s3c2410.h>
 #include <asm/mach/map.h>
-#include <mach/regs-lcd.h>
 #include <mach/regs-gpio.h>
 
 #ifdef CONFIG_PM
diff --git a/include/linux/platform_data/fb-s3c2410.h b/include/linux/platform_data/fb-s3c2410.h
index dbebc62..8e04d49 100644
--- a/include/linux/platform_data/fb-s3c2410.h
+++ b/include/linux/platform_data/fb-s3c2410.h
@@ -12,6 +12,40 @@
 #ifndef __FB_S3C2410_H
 #define __FB_S3C2410_H __FILE__
 
+#define S3C2410_LCDCON1_DSCAN4		(0 << 5)
+#define S3C2410_LCDCON1_STN4		(1 << 5)
+#define S3C2410_LCDCON1_STN8		(2 << 5)
+#define S3C2410_LCDCON1_TFT		(3 << 5)
+
+#define S3C2410_LCDCON1_STN1BPP		(0 << 1)
+#define S3C2410_LCDCON1_STN2GREY	(1 << 1)
+#define S3C2410_LCDCON1_STN4GREY	(2 << 1)
+#define S3C2410_LCDCON1_STN8BPP		(3 << 1)
+#define S3C2410_LCDCON1_STN12BPP	(4 << 1)
+
+#define S3C2410_LCDCON1_TFT1BPP		(8 << 1)
+#define S3C2410_LCDCON1_TFT2BPP		(9 << 1)
+#define S3C2410_LCDCON1_TFT4BPP		(10 << 1)
+#define S3C2410_LCDCON1_TFT8BPP		(11 << 1)
+#define S3C2410_LCDCON1_TFT16BPP	(12 << 1)
+#define S3C2410_LCDCON1_TFT24BPP	(13 << 1)
+
+
+#define S3C2410_LCDCON5_BPP24BL		(1 << 12)
+#define S3C2410_LCDCON5_FRM565		(1 << 11)
+#define S3C2410_LCDCON5_INVVCLK		(1 << 10)
+#define S3C2410_LCDCON5_INVVLINE	(1 << 9)
+#define S3C2410_LCDCON5_INVVFRAME	(1 << 8)
+#define S3C2410_LCDCON5_INVVD		(1 << 7)
+#define S3C2410_LCDCON5_INVVDEN		(1 << 6)
+#define S3C2410_LCDCON5_INVPWREN	(1 << 5)
+#define S3C2410_LCDCON5_INVLEND		(1 << 4)
+#define S3C2410_LCDCON5_PWREN		(1 << 3)
+#define S3C2410_LCDCON5_ENLEND		(1 << 2)
+#define S3C2410_LCDCON5_BSWP		(1 << 1)
+#define S3C2410_LCDCON5_HWSWP		(1 << 0)
+
+
 struct s3c2410fb_hw {
 	unsigned long	lcdcon1;
 	unsigned long	lcdcon2;
-- 
1.7.4.1


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

* [PATCH 4/9] s3c2410fb: Register single platform driver
  2013-04-26 20:02 [PATCH 0/9] s3c24xx LCD controller driver cleanup Sylwester Nawrocki
                   ` (2 preceding siblings ...)
  2013-04-26 20:02 ` [PATCH 3/9] ARM: S3C24XX: Remove include/mach/regs-lcd.h header file Sylwester Nawrocki
@ 2013-04-26 20:02 ` Sylwester Nawrocki
  2013-04-26 20:02 ` [PATCH 5/9] s3c2410fb: Use dev_pm_ops Sylwester Nawrocki
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

Use the id_table instead of registering two separate platform drivers.
This allows then to declare the driver with module_platform_driver().

Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
 drivers/video/s3c2410fb.c |   59 +++++++++++---------------------------------
 1 files changed, 15 insertions(+), 44 deletions(-)

diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 12ac94e..d6706f7 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -818,8 +818,7 @@ static inline void s3c2410fb_cpufreq_deregister(struct s3c2410fb_info *info)
 
 static const char driver_name[] = "s3c2410fb";
 
-static int s3c24xxfb_probe(struct platform_device *pdev,
-			   enum s3c_drv_type drv_type)
+static int s3c2410fb_probe(struct platform_device *pdev)
 {
 	struct s3c2410fb_info *info;
 	struct s3c2410fb_display *display;
@@ -861,7 +860,7 @@ static int s3c24xxfb_probe(struct platform_device *pdev,
 
 	info = fbinfo->par;
 	info->dev = &pdev->dev;
-	info->drv_type = drv_type;
+	info->drv_type = platform_get_device_id(pdev)->driver_data;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (res = NULL) {
@@ -885,7 +884,7 @@ static int s3c24xxfb_probe(struct platform_device *pdev,
 		goto release_mem;
 	}
 
-	if (drv_type = DRV_S3C2412)
+	if (info->drv_type = DRV_S3C2412)
 		info->irq_base = info->io + S3C2412_LCDINTBASE;
 	else
 		info->irq_base = info->io + S3C2410_LCDINTBASE;
@@ -1009,17 +1008,6 @@ dealloc_fb:
 	return ret;
 }
 
-static int s3c2410fb_probe(struct platform_device *pdev)
-{
-	return s3c24xxfb_probe(pdev, DRV_S3C2410);
-}
-
-static int s3c2412fb_probe(struct platform_device *pdev)
-{
-	return s3c24xxfb_probe(pdev, DRV_S3C2412);
-}
-
-
 /*
  *  Cleanup
  */
@@ -1098,46 +1086,29 @@ static int s3c2410fb_resume(struct platform_device *dev)
 #define s3c2410fb_resume  NULL
 #endif
 
-static struct platform_driver s3c2410fb_driver = {
-	.probe		= s3c2410fb_probe,
-	.remove		= s3c2410fb_remove,
-	.suspend	= s3c2410fb_suspend,
-	.resume		= s3c2410fb_resume,
-	.driver		= {
-		.name	= "s3c2410-lcd",
-		.owner	= THIS_MODULE,
+static struct platform_device_id s3c2410fb_driver_ids[] = {
+	{
+		.name = "s3c2410-lcd",
+		.driver_data = (unsigned long)DRV_S3C2410,
+	}, {
+		.name = "s3c2412-lcd",
+		.driver_data = (unsigned long)DRV_S3C2412,
 	},
 };
 
-static struct platform_driver s3c2412fb_driver = {
-	.probe		= s3c2412fb_probe,
+static struct platform_driver s3c2410fb_driver = {
+	.probe		= s3c2410fb_probe,
 	.remove		= s3c2410fb_remove,
 	.suspend	= s3c2410fb_suspend,
 	.resume		= s3c2410fb_resume,
+	.id_table	= s3c2410fb_driver_ids,
 	.driver		= {
-		.name	= "s3c2412-lcd",
+		.name	= "s3c2410-lcd",
 		.owner	= THIS_MODULE,
 	},
 };
 
-int __init s3c2410fb_init(void)
-{
-	int ret = platform_driver_register(&s3c2410fb_driver);
-
-	if (ret = 0)
-		ret = platform_driver_register(&s3c2412fb_driver);
-
-	return ret;
-}
-
-static void __exit s3c2410fb_cleanup(void)
-{
-	platform_driver_unregister(&s3c2410fb_driver);
-	platform_driver_unregister(&s3c2412fb_driver);
-}
-
-module_init(s3c2410fb_init);
-module_exit(s3c2410fb_cleanup);
+module_platform_driver(s3c2410fb_driver);
 
 MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
 MODULE_AUTHOR("Ben Dooks <ben-linux@fluff.org>");
-- 
1.7.4.1


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

* [PATCH 5/9] s3c2410fb: Use dev_pm_ops
  2013-04-26 20:02 [PATCH 0/9] s3c24xx LCD controller driver cleanup Sylwester Nawrocki
                   ` (3 preceding siblings ...)
  2013-04-26 20:02 ` [PATCH 4/9] s3c2410fb: Register single platform driver Sylwester Nawrocki
@ 2013-04-26 20:02 ` Sylwester Nawrocki
  2013-04-26 20:02 ` [PATCH 6/9] s3c2410fb: Enable display by default Sylwester Nawrocki
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

Use the driver PM ops rather than legacy suspend/resume callbacks.
Also use CONFIG_PM_SLEEP switch to compile in the system sleep
code instead of CONFIG_PM.

Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
 drivers/video/s3c2410fb.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index d6706f7..479ab45 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -26,6 +26,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
+#include <linux/pm.h>
 #include <linux/clk.h>
 #include <linux/cpufreq.h>
 #include <linux/io.h>
@@ -36,10 +37,6 @@
 #include <asm/mach/map.h>
 #include <mach/regs-gpio.h>
 
-#ifdef CONFIG_PM
-#include <linux/pm.h>
-#endif
-
 #include "s3c2410fb.h"
 
 /* Debugging stuff */
@@ -1044,8 +1041,7 @@ static int s3c2410fb_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
-
+#ifdef CONFIG_PM_SLEEP
 /* suspend and resume support for the lcd controller */
 static int s3c2410fb_suspend(struct platform_device *dev, pm_message_t state)
 {
@@ -1081,9 +1077,14 @@ static int s3c2410fb_resume(struct platform_device *dev)
 	return 0;
 }
 
+static const struct dev_pm_ops s3c2410fb_pm_ops = {
+	.resume = s3c2410fb_resume,
+	.suspend = s3c2410fb_suspend,
+};
+
+#define S3C2410FB_PM_OPS (&s3c2410fb_pm_ops)
 #else
-#define s3c2410fb_suspend NULL
-#define s3c2410fb_resume  NULL
+#define S3C2410FB_PM_OPS (NULL)
 #endif
 
 static struct platform_device_id s3c2410fb_driver_ids[] = {
@@ -1099,12 +1100,11 @@ static struct platform_device_id s3c2410fb_driver_ids[] = {
 static struct platform_driver s3c2410fb_driver = {
 	.probe		= s3c2410fb_probe,
 	.remove		= s3c2410fb_remove,
-	.suspend	= s3c2410fb_suspend,
-	.resume		= s3c2410fb_resume,
 	.id_table	= s3c2410fb_driver_ids,
 	.driver		= {
 		.name	= "s3c2410-lcd",
 		.owner	= THIS_MODULE,
+		.pm	= S3C2410FB_PM_OPS,
 	},
 };
 
-- 
1.7.4.1


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

* [PATCH 6/9] s3c2410fb: Enable display by default
  2013-04-26 20:02 [PATCH 0/9] s3c24xx LCD controller driver cleanup Sylwester Nawrocki
                   ` (4 preceding siblings ...)
  2013-04-26 20:02 ` [PATCH 5/9] s3c2410fb: Use dev_pm_ops Sylwester Nawrocki
@ 2013-04-26 20:02 ` Sylwester Nawrocki
  2013-04-26 20:02 ` [PATCH 7/9] s3c2410fb: Use devm_ioremap_resource() Sylwester Nawrocki
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

Enable the display with default configuration at system start up.
This ensures the display is activated also when FRAMBUFFER_CONSOLE
is not set.

Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
 drivers/video/s3c2410fb.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 479ab45..da8b6c2 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -969,6 +969,8 @@ static int s3c2410fb_probe(struct platform_device *pdev)
 		goto free_video_memory;
 	}
 
+	s3c2410fb_set_par(fbinfo);
+
 	ret = register_framebuffer(fbinfo);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to register framebuffer device: %d\n",
-- 
1.7.4.1


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

* [PATCH 7/9] s3c2410fb: Use devm_ioremap_resource()
  2013-04-26 20:02 [PATCH 0/9] s3c24xx LCD controller driver cleanup Sylwester Nawrocki
                   ` (5 preceding siblings ...)
  2013-04-26 20:02 ` [PATCH 6/9] s3c2410fb: Enable display by default Sylwester Nawrocki
@ 2013-04-26 20:02 ` Sylwester Nawrocki
  2013-04-26 20:02 ` [PATCH 8/9] s3c2410fb: Remove redundant platform_set_drvdata() Sylwester Nawrocki
  2013-04-26 20:02 ` [PATCH 9/9] s3c2410fb: Use module parameter instead of a sysfs entry Sylwester Nawrocki
  8 siblings, 0 replies; 12+ messages in thread
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

Use devm_ioremap_resource instead of reques_mem_region()/ioremap().
This ensures more consistent error values and simplifies error paths.

Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
 drivers/video/s3c2410fb.c |   32 ++++----------------------------
 1 files changed, 4 insertions(+), 28 deletions(-)

diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index da8b6c2..11f98ca 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -825,7 +825,6 @@ static int s3c2410fb_probe(struct platform_device *pdev)
 	int ret;
 	int irq;
 	int i;
-	int size;
 	u32 lcdcon1;
 
 	mach_info = pdev->dev.platform_data;
@@ -860,27 +859,12 @@ static int s3c2410fb_probe(struct platform_device *pdev)
 	info->drv_type = platform_get_device_id(pdev)->driver_data;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (res = NULL) {
-		dev_err(&pdev->dev, "failed to get memory registers\n");
-		ret = -ENXIO;
+	info->io = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(info->io)) {
+		ret = PTR_ERR(info->io);
 		goto dealloc_fb;
 	}
 
-	size = resource_size(res);
-	info->mem = request_mem_region(res->start, size, pdev->name);
-	if (info->mem = NULL) {
-		dev_err(&pdev->dev, "failed to get memory region\n");
-		ret = -ENOENT;
-		goto dealloc_fb;
-	}
-
-	info->io = ioremap(res->start, size);
-	if (info->io = NULL) {
-		dev_err(&pdev->dev, "ioremap() of registers failed\n");
-		ret = -ENXIO;
-		goto release_mem;
-	}
-
 	if (info->drv_type = DRV_S3C2412)
 		info->irq_base = info->io + S3C2412_LCDINTBASE;
 	else
@@ -917,7 +901,7 @@ static int s3c2410fb_probe(struct platform_device *pdev)
 	if (ret) {
 		dev_err(&pdev->dev, "cannot get irq %d - err %d\n", irq, ret);
 		ret = -EBUSY;
-		goto release_regs;
+		goto dealloc_fb;
 	}
 
 	info->clk = clk_get(NULL, "lcd");
@@ -997,10 +981,6 @@ release_clock:
 	clk_put(info->clk);
 release_irq:
 	free_irq(irq, info);
-release_regs:
-	iounmap(info->io);
-release_mem:
-	release_mem_region(res->start, size);
 dealloc_fb:
 	platform_set_drvdata(pdev, NULL);
 	framebuffer_release(fbinfo);
@@ -1033,10 +1013,6 @@ static int s3c2410fb_remove(struct platform_device *pdev)
 	irq = platform_get_irq(pdev, 0);
 	free_irq(irq, info);
 
-	iounmap(info->io);
-
-	release_mem_region(info->mem->start, resource_size(info->mem));
-
 	platform_set_drvdata(pdev, NULL);
 	framebuffer_release(fbinfo);
 
-- 
1.7.4.1


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

* [PATCH 8/9] s3c2410fb: Remove redundant platform_set_drvdata()
  2013-04-26 20:02 [PATCH 0/9] s3c24xx LCD controller driver cleanup Sylwester Nawrocki
                   ` (6 preceding siblings ...)
  2013-04-26 20:02 ` [PATCH 7/9] s3c2410fb: Use devm_ioremap_resource() Sylwester Nawrocki
@ 2013-04-26 20:02 ` Sylwester Nawrocki
  2013-05-02  5:31   ` Jingoo Han
  2013-04-26 20:02 ` [PATCH 9/9] s3c2410fb: Use module parameter instead of a sysfs entry Sylwester Nawrocki
  8 siblings, 1 reply; 12+ messages in thread
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

driver_data field is being cleared by the driver core since
commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
device-core: Ensure drvdata = NULL when no driver is bound
hence there is no need to do it in the driver's remove() callback.

Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
 drivers/video/s3c2410fb.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 11f98ca..0439ed0 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -1013,7 +1013,6 @@ static int s3c2410fb_remove(struct platform_device *pdev)
 	irq = platform_get_irq(pdev, 0);
 	free_irq(irq, info);
 
-	platform_set_drvdata(pdev, NULL);
 	framebuffer_release(fbinfo);
 
 	return 0;
-- 
1.7.4.1


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

* [PATCH 9/9] s3c2410fb: Use module parameter instead of a sysfs entry
  2013-04-26 20:02 [PATCH 0/9] s3c24xx LCD controller driver cleanup Sylwester Nawrocki
                   ` (7 preceding siblings ...)
  2013-04-26 20:02 ` [PATCH 8/9] s3c2410fb: Remove redundant platform_set_drvdata() Sylwester Nawrocki
@ 2013-04-26 20:02 ` Sylwester Nawrocki
  8 siblings, 0 replies; 12+ messages in thread
From: Sylwester Nawrocki @ 2013-04-26 20:02 UTC (permalink / raw)
  To: linux-arm-kernel

Use module parameter to set debug level instead of a sysfs
entry. Replace pr_debug() with pr_info() so we can actually
control the debug traces without DYNAMIC_PRINTK. This fixes
a sort of regression introduced in commit 81c1655811e941af2
video: s3c2410: Use pr_* and dev_* instead of printk

Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
---
 drivers/video/s3c2410fb.c |   48 +++++++-------------------------------------
 1 files changed, 8 insertions(+), 40 deletions(-)

diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
index 0439ed0..c2ee75a 100644
--- a/drivers/video/s3c2410fb.c
+++ b/drivers/video/s3c2410fb.c
@@ -46,10 +46,13 @@ static int debug	= 1;
 static int debug;
 #endif
 
-#define dprintk(msg...) \
-do { \
-	if (debug) \
-		pr_debug(msg); \
+module_param(debug, int, 0644);
+MODULE_PARM_DESC(debug, "Debug level (0-1)");
+
+#define dprintk(msg...)		\
+do { 				\
+	if (debug)		\
+		pr_info(msg);	\
 } while (0)
 
 /* useful functions */
@@ -584,36 +587,6 @@ static int s3c2410fb_blank(int blank_mode, struct fb_info *info)
 	return 0;
 }
 
-static int s3c2410fb_debug_show(struct device *dev,
-				struct device_attribute *attr, char *buf)
-{
-	return snprintf(buf, PAGE_SIZE, "%s\n", debug ? "on" : "off");
-}
-
-static int s3c2410fb_debug_store(struct device *dev,
-				 struct device_attribute *attr,
-				 const char *buf, size_t len)
-{
-	if (len < 1)
-		return -EINVAL;
-
-	if (strnicmp(buf, "on", 2) = 0 ||
-	    strnicmp(buf, "1", 1) = 0) {
-		debug = 1;
-		dev_dbg(dev, "s3c2410fb: Debug On");
-	} else if (strnicmp(buf, "off", 3) = 0 ||
-		   strnicmp(buf, "0", 1) = 0) {
-		debug = 0;
-		dev_dbg(dev, "s3c2410fb: Debug Off");
-	} else {
-		return -EINVAL;
-	}
-
-	return len;
-}
-
-static DEVICE_ATTR(debug, 0666, s3c2410fb_debug_show, s3c2410fb_debug_store);
-
 static struct fb_ops s3c2410fb_ops = {
 	.owner		= THIS_MODULE,
 	.fb_check_var	= s3c2410fb_check_var,
@@ -962,17 +935,12 @@ static int s3c2410fb_probe(struct platform_device *pdev)
 		goto free_cpufreq;
 	}
 
-	/* create device files */
-	ret = device_create_file(&pdev->dev, &dev_attr_debug);
-	if (ret)
-		dev_err(&pdev->dev, "failed to add debug attribute\n");
-
 	dev_info(&pdev->dev, "fb%d: %s frame buffer device\n",
 		fbinfo->node, fbinfo->fix.id);
 
 	return 0;
 
- free_cpufreq:
+free_cpufreq:
 	s3c2410fb_cpufreq_deregister(info);
 free_video_memory:
 	s3c2410fb_unmap_video_memory(fbinfo);
-- 
1.7.4.1


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

* Re: [PATCH 8/9] s3c2410fb: Remove redundant platform_set_drvdata()
  2013-04-26 20:02 ` [PATCH 8/9] s3c2410fb: Remove redundant platform_set_drvdata() Sylwester Nawrocki
@ 2013-05-02  5:31   ` Jingoo Han
  2013-05-02 20:11     ` Sylwester Nawrocki
  0 siblings, 1 reply; 12+ messages in thread
From: Jingoo Han @ 2013-05-02  5:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Saturday, April 27, 2013 5:02 AM, Sylwester Nawrocki wrote:
> driver_data field is being cleared by the driver core since
> commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
> device-core: Ensure drvdata = NULL when no driver is bound
> hence there is no need to do it in the driver's remove() callback.
> 
> Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
> ---
>  drivers/video/s3c2410fb.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c
> index 11f98ca..0439ed0 100644
> --- a/drivers/video/s3c2410fb.c
> +++ b/drivers/video/s3c2410fb.c
> @@ -1013,7 +1013,6 @@ static int s3c2410fb_remove(struct platform_device *pdev)
>  	irq = platform_get_irq(pdev, 0);
>  	free_irq(irq, info);
> 
> -	platform_set_drvdata(pdev, NULL);
>  	framebuffer_release(fbinfo);

Hi Sylwester,

How about eliminating platform_set_drvdata(pdev, NULL)
in s3c24xxfb_probe() as well as s3c2410fb_remove()?

@@ -1005,7 +1005,6 @@ release_regs:
 release_mem:
        release_mem_region(res->start, size);
 dealloc_fb:
-       platform_set_drvdata(pdev, NULL);
        framebuffer_release(fbinfo);
        return ret;
 }

Best regards,
Jingoo Han

> 
>  	return 0;
> --
> 1.7.4.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	[flat|nested] 12+ messages in thread

* Re: [PATCH 8/9] s3c2410fb: Remove redundant platform_set_drvdata()
  2013-05-02  5:31   ` Jingoo Han
@ 2013-05-02 20:11     ` Sylwester Nawrocki
  0 siblings, 0 replies; 12+ messages in thread
From: Sylwester Nawrocki @ 2013-05-02 20:11 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Jingoo,

On 05/02/2013 07:31 AM, Jingoo Han wrote:
> On Saturday, April 27, 2013 5:02 AM, Sylwester Nawrocki wrote:
>> >  driver_data field is being cleared by the driver core since
>> >  commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
>> >  device-core: Ensure drvdata = NULL when no driver is bound
>> >  hence there is no need to do it in the driver's remove() callback.

> How about eliminating platform_set_drvdata(pdev, NULL)
> in s3c24xxfb_probe() as well as s3c2410fb_remove()?

Ah, thanks for pointing out. Indeed, that could be dropped too, I've
overlooked it somehow. Will update and resend this patch shortly.

Regards,
Sylwester

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

end of thread, other threads:[~2013-05-02 20:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-26 20:02 [PATCH 0/9] s3c24xx LCD controller driver cleanup Sylwester Nawrocki
2013-04-26 20:02 ` [PATCH 1/9] s3c2410fb: Move platform data declarations to include/linux/platform_data Sylwester Nawrocki
2013-04-26 20:02 ` [PATCH 2/9] s3c2410fb: Make most of register definitions local Sylwester Nawrocki
2013-04-26 20:02 ` [PATCH 3/9] ARM: S3C24XX: Remove include/mach/regs-lcd.h header file Sylwester Nawrocki
2013-04-26 20:02 ` [PATCH 4/9] s3c2410fb: Register single platform driver Sylwester Nawrocki
2013-04-26 20:02 ` [PATCH 5/9] s3c2410fb: Use dev_pm_ops Sylwester Nawrocki
2013-04-26 20:02 ` [PATCH 6/9] s3c2410fb: Enable display by default Sylwester Nawrocki
2013-04-26 20:02 ` [PATCH 7/9] s3c2410fb: Use devm_ioremap_resource() Sylwester Nawrocki
2013-04-26 20:02 ` [PATCH 8/9] s3c2410fb: Remove redundant platform_set_drvdata() Sylwester Nawrocki
2013-05-02  5:31   ` Jingoo Han
2013-05-02 20:11     ` Sylwester Nawrocki
2013-04-26 20:02 ` [PATCH 9/9] s3c2410fb: Use module parameter instead of a sysfs entry Sylwester Nawrocki

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