Skip to contentSkip to conversation

s3c24xx LCD controller driver cleanup

PATCH New Sylwester Nawrocki 2 participants 12 messages Apr 26, 2013 – May 2, 2013

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover s3c24xx LCD controller driver cleanup

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
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/9 s3c2410fb: Move platform data declarations to include/linux/platform_data

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

---
 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
arch/arm/mach-s3c24xx/include/mach/fb.h deleted +0 -1
deleted file mode 100644
index a957bc8e..0000000
@@ -1 +0,0 @@
-#include <plat/fb-s3c2410.h>
arch/arm/mach-s3c24xx/mach-at2440evb.c +1 -1
index 6dfeeb7..e4d71d5 100644
@@ -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>
 
arch/arm/mach-s3c24xx/mach-bast.c +1 -1
index 22d6ae9..4402741 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-gta02.c +1 -1
index 13d8d07..cdad542 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-h1940.c +1 -1
index af4334d..39ce53a 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-jive.c +1 -1
index a45fcd8..81e8e8c 100644
@@ -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>
 
arch/arm/mach-s3c24xx/mach-mini2440.c +1 -1
index a83db46..aa59f48 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-n30.c +1 -1
index 2cb46c3..3a32a75 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-qt2410.c +1 -1
index f8feaea..65be582 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-rx1950.c +1 -1
index e4d67a3..17fad4b 100644
@@ -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>
 
arch/arm/mach-s3c24xx/mach-smdk2413.c +1 -1
index 8146e92..d504272 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-smdk2440.c +1 -1
index de2e5d3..8546941 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-smdk2443.c +1 -1
index 9435c3b..5baa2e2 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-vstms.c +1 -2
index b665884..86c9199 100644
@@ -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>
 
arch/arm/plat-samsung/devs.c +1 -1
index e1124d9..33c39bb 100644
@@ -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>
arch/arm/plat-samsung/include/plat/fb-s3c2410.h deleted +0 -72

72 lines not on this page · raw message

drivers/video/s3c2410fb.c +1 -1
index 76a0e7f..dc10dbe 100644
@@ -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>
include/linux/platform_data/fb-s3c2410.h new file +72 -0

72 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 2/9 s3c2410fb: Make most of register definitions local

In reply to Sylwester Nawrocki

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.

---
 arch/arm/mach-s3c24xx/include/mach/regs-lcd.h |  110 ------------------------
 drivers/video/s3c2410fb.h                     |  114 ++++++++++++++++++++++++-
 2 files changed, 112 insertions(+), 112 deletions(-)
arch/arm/mach-s3c24xx/include/mach/regs-lcd.h +0 -110
index ee8f040..369511f 100644
@@ -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 */
drivers/video/s3c2410fb.h +112 -2

124 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#3 lore raw

PATCH 3/9 ARM: S3C24XX: Remove include/mach/regs-lcd.h header file

In reply to Sylwester Nawrocki

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.

---
 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
arch/arm/mach-s3c24xx/dma-s3c2410.c +0 -1
index a6c94b8..764556a 100644
@@ -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>
 
arch/arm/mach-s3c24xx/dma-s3c2412.c +0 -1
index c0e8c3f..f02fc3c 100644
@@ -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>
 
arch/arm/mach-s3c24xx/dma-s3c2440.c +0 -1
index 1c08eccd..b621563 100644
@@ -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>
 
arch/arm/mach-s3c24xx/dma-s3c2443.c +0 -1
index 000e4c6..095e841 100644
@@ -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>
 
arch/arm/mach-s3c24xx/include/mach/regs-lcd.h deleted +0 -52

52 lines not on this page · raw message

arch/arm/mach-s3c24xx/mach-anubis.c +0 -1
index c1fb6c3..d5e8cad 100644
@@ -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>
 
arch/arm/mach-s3c24xx/mach-at2440evb.c +0 -1
index e4d71d5..f151bf7 100644
@@ -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>
 
arch/arm/mach-s3c24xx/mach-bast.c +0 -1
index 4402741..a500b21 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-h1940.c +0 -1
index 39ce53a..0236201 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-jive.c +0 -1
index 81e8e8c..d1347ec 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-mini2440.c +0 -1
index aa59f48..d0f25a4 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-n30.c +0 -1
index 3a32a75..8b956b7 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-osiris.c +0 -1
index 58d6fbe..eeca631 100644
@@ -49,7 +49,6 @@
 
 #include <mach/hardware.h>
 #include <mach/regs-gpio.h>
-#include <mach/regs-lcd.h>
 
 #include "common.h"
 #include "osiris.h"
arch/arm/mach-s3c24xx/mach-qt2410.c +0 -1
index 65be582..7e11373 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-rx1950.c +0 -1
index 17fad4b..1ea1ce8 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-smdk2413.c +0 -1
index d504272..9b473cb 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-smdk2416.c +0 -1
index cb46847..5630d51 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-smdk2440.c +0 -1
index 8546941..040e39b 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-smdk2443.c +0 -1
index 5baa2e2..99a5c34 100644
@@ -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>
arch/arm/mach-s3c24xx/mach-vstms.c +0 -1
index 86c9199..92cd9ec 100644
@@ -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>
drivers/video/s3c2410fb.c +0 -1
index dc10dbe..12ac94e 100644
@@ -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
include/linux/platform_data/fb-s3c2410.h +34 -0
index dbebc62..8e04d49 100644
@@ -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;
Signature · 1 line
1.7.4.1
#4 lore raw

PATCH 4/9 s3c2410fb: Register single platform driver

In reply to Sylwester Nawrocki

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

---
 drivers/video/s3c2410fb.c |   59 +++++++++++---------------------------------
 1 files changed, 15 insertions(+), 44 deletions(-)
drivers/video/s3c2410fb.c +15 -44
index 12ac94e..d6706f7 100644
@@ -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 <[email protected]>");
 MODULE_AUTHOR("Ben Dooks <[email protected]>");
Signature · 1 line
1.7.4.1
#5 lore raw

PATCH 5/9 s3c2410fb: Use dev_pm_ops

In reply to Sylwester Nawrocki

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.

---
 drivers/video/s3c2410fb.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
drivers/video/s3c2410fb.c +10 -10
index d6706f7..479ab45 100644
@@ -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,
 	},
 };
 
Signature · 1 line
1.7.4.1
#6 lore raw

PATCH 6/9 s3c2410fb: Enable display by default

In reply to Sylwester Nawrocki

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

---
 drivers/video/s3c2410fb.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/video/s3c2410fb.c +2 -0
index 479ab45..da8b6c2 100644
@@ -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",
Signature · 1 line
1.7.4.1
#7 lore raw

PATCH 7/9 s3c2410fb: Use devm_ioremap_resource()

In reply to Sylwester Nawrocki

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

---
 drivers/video/s3c2410fb.c |   32 ++++----------------------------
 1 files changed, 4 insertions(+), 28 deletions(-)
drivers/video/s3c2410fb.c +4 -28
index da8b6c2..11f98ca 100644
@@ -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);
 
Signature · 1 line
1.7.4.1
#8 lore raw

PATCH 8/9 s3c2410fb: Remove redundant platform_set_drvdata()

In reply to Sylwester Nawrocki

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.

---
 drivers/video/s3c2410fb.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/video/s3c2410fb.c +0 -1
index 11f98ca..0439ed0 100644
@@ -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;
Signature · 1 line
1.7.4.1
#9 lore raw

PATCH 8/9 s3c2410fb: Remove redundant platform_set_drvdata()

Quoted 15 lines · Sylwester Nawrocki

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.

---
 drivers/video/s3c2410fb.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/video/s3c2410fb.c +0 -0
index 11f98ca..0439ed0 100644

drivers/video/s3c2410fb.c static int s3c2410fb_remove(struct platform_device *pdev) · line 1016

Quoted 5 lines
drivers/video/s3c2410fb.c +0 -1
@@ -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

Quoted 9 lines
drivers/video/s3c2410fb.c +0 -1
 	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 at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#10 lore raw

PATCH 8/9 s3c2410fb: Remove redundant platform_set_drvdata()

Hi Jingoo,

Quoted 8 lines · Jingoo Han
Quoted 4 lines · Sylwester Nawrocki
Quoted 4 lines

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

#11 lore raw

PATCH 9/9 s3c2410fb: Use module parameter instead of a sysfs entry

In reply to Sylwester Nawrocki

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

---
 drivers/video/s3c2410fb.c |   48 +++++++-------------------------------------
 1 files changed, 8 insertions(+), 40 deletions(-)
drivers/video/s3c2410fb.c +8 -40
index 0439ed0..c2ee75a 100644
@@ -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);
Signature · 1 line
1.7.4.1