s3c24xx LCD controller driver cleanup
Subsystems (5)
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
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
@@ -1 +0,0 @@ -#include <plat/fb-s3c2410.h>
arch/arm/mach-s3c24xx/mach-at2440evb.c +1 -1
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH 2/9 s3c2410fb: Make most of register definitions local
In reply to Sylwester NawrockiMove 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
@@ -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
PATCH 3/9 ARM: S3C24XX: Remove include/mach/regs-lcd.h header file
In reply to Sylwester NawrockiMove 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH 4/9 s3c2410fb: Register single platform driver
In reply to Sylwester NawrockiUse 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
@@ -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
PATCH 5/9 s3c2410fb: Use dev_pm_ops
In reply to Sylwester NawrockiUse 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
@@ -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
PATCH 6/9 s3c2410fb: Enable display by default
In reply to Sylwester NawrockiEnable 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
@@ -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
PATCH 7/9 s3c2410fb: Use devm_ioremap_resource()
In reply to Sylwester NawrockiUse 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
@@ -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
PATCH 8/9 s3c2410fb: Remove redundant platform_set_drvdata()
In reply to Sylwester Nawrockidriver_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
@@ -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
PATCH 8/9 s3c2410fb: Remove redundant platform_set_drvdata()
Quoted 15 lines · Sylwester Nawrocki
driver_datafield is being cleared by the driver core since commit0998d0631001288a5974afc0b2a5f568bcdecb4d
device-core: Ensure drvdata = NULL when no driver is bound hence there is no need to do it in the driver'sremove()callback.Signed-off-by Sylwester Nawrocki <[email protected]>--- drivers/video/s3c2410fb.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)drivers/video/s3c2410fb.c +0
-0
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
-1return 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
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_datafield is being cleared by the driver core since commit0998d0631001288a5974afc0b2a5f568bcdecb4d
device-core: Ensure drvdata = NULL when no driver is bound hence there is no need to do it in the driver'sremove()callback.How about eliminating
platform_set_drvdata(pdev, NULL)ins3c24xxfb_probe()as well ass3c2410fb_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
PATCH 9/9 s3c2410fb: Use module parameter instead of a sysfs entry
In reply to Sylwester NawrockiUse 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
@@ -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