Commit d4a7dbfd authored by Florian Tobias Schandinat's avatar Florian Tobias Schandinat

Merge branch 'master' of...

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-3.x into fbdev-next

Conflicts:
	drivers/video/atmel_lcdfb.c
parents b5480ed7 fa514fbc
...@@ -66,8 +66,8 @@ struct fsl_diu_shared_fb { ...@@ -66,8 +66,8 @@ struct fsl_diu_shared_fb {
bool in_use; bool in_use;
}; };
unsigned int mpc512x_get_pixel_format(unsigned int bits_per_pixel, u32 mpc512x_get_pixel_format(enum fsl_diu_monitor_port port,
int monitor_port) unsigned int bits_per_pixel)
{ {
switch (bits_per_pixel) { switch (bits_per_pixel) {
case 32: case 32:
...@@ -80,11 +80,12 @@ unsigned int mpc512x_get_pixel_format(unsigned int bits_per_pixel, ...@@ -80,11 +80,12 @@ unsigned int mpc512x_get_pixel_format(unsigned int bits_per_pixel,
return 0x00000400; return 0x00000400;
} }
void mpc512x_set_gamma_table(int monitor_port, char *gamma_table_base) void mpc512x_set_gamma_table(enum fsl_diu_monitor_port port,
char *gamma_table_base)
{ {
} }
void mpc512x_set_monitor_port(int monitor_port) void mpc512x_set_monitor_port(enum fsl_diu_monitor_port port)
{ {
} }
...@@ -182,14 +183,10 @@ void mpc512x_set_pixel_clock(unsigned int pixclock) ...@@ -182,14 +183,10 @@ void mpc512x_set_pixel_clock(unsigned int pixclock)
iounmap(ccm); iounmap(ccm);
} }
ssize_t mpc512x_show_monitor_port(int monitor_port, char *buf) enum fsl_diu_monitor_port
mpc512x_valid_monitor_port(enum fsl_diu_monitor_port port)
{ {
return sprintf(buf, "0 - 5121 LCD\n"); return FSL_DIU_PORT_DVI;
}
int mpc512x_set_sysfs_monitor_port(int val)
{
return 0;
} }
static struct fsl_diu_shared_fb __attribute__ ((__aligned__(8))) diu_shared_fb; static struct fsl_diu_shared_fb __attribute__ ((__aligned__(8))) diu_shared_fb;
...@@ -332,8 +329,7 @@ void __init mpc512x_setup_diu(void) ...@@ -332,8 +329,7 @@ void __init mpc512x_setup_diu(void)
diu_ops.set_gamma_table = mpc512x_set_gamma_table; diu_ops.set_gamma_table = mpc512x_set_gamma_table;
diu_ops.set_monitor_port = mpc512x_set_monitor_port; diu_ops.set_monitor_port = mpc512x_set_monitor_port;
diu_ops.set_pixel_clock = mpc512x_set_pixel_clock; diu_ops.set_pixel_clock = mpc512x_set_pixel_clock;
diu_ops.show_monitor_port = mpc512x_show_monitor_port; diu_ops.valid_monitor_port = mpc512x_valid_monitor_port;
diu_ops.set_sysfs_monitor_port = mpc512x_set_sysfs_monitor_port;
diu_ops.release_bootmem = mpc512x_release_bootmem; diu_ops.release_bootmem = mpc512x_release_bootmem;
#endif #endif
} }
......
...@@ -93,8 +93,8 @@ ...@@ -93,8 +93,8 @@
* The Area Descriptor is a 32-bit value that determine which bits in each * The Area Descriptor is a 32-bit value that determine which bits in each
* pixel are to be used for each color. * pixel are to be used for each color.
*/ */
static unsigned int p1022ds_get_pixel_format(unsigned int bits_per_pixel, static u32 p1022ds_get_pixel_format(enum fsl_diu_monitor_port port,
int monitor_port) unsigned int bits_per_pixel)
{ {
switch (bits_per_pixel) { switch (bits_per_pixel) {
case 32: case 32:
...@@ -118,7 +118,8 @@ static unsigned int p1022ds_get_pixel_format(unsigned int bits_per_pixel, ...@@ -118,7 +118,8 @@ static unsigned int p1022ds_get_pixel_format(unsigned int bits_per_pixel,
* On some boards, the gamma table for some ports may need to be modified. * On some boards, the gamma table for some ports may need to be modified.
* This is not the case on the P1022DS, so we do nothing. * This is not the case on the P1022DS, so we do nothing.
*/ */
static void p1022ds_set_gamma_table(int monitor_port, char *gamma_table_base) static void p1022ds_set_gamma_table(enum fsl_diu_monitor_port port,
char *gamma_table_base)
{ {
} }
...@@ -126,7 +127,7 @@ static void p1022ds_set_gamma_table(int monitor_port, char *gamma_table_base) ...@@ -126,7 +127,7 @@ static void p1022ds_set_gamma_table(int monitor_port, char *gamma_table_base)
* p1022ds_set_monitor_port: switch the output to a different monitor port * p1022ds_set_monitor_port: switch the output to a different monitor port
* *
*/ */
static void p1022ds_set_monitor_port(int monitor_port) static void p1022ds_set_monitor_port(enum fsl_diu_monitor_port port)
{ {
struct device_node *pixis_node; struct device_node *pixis_node;
void __iomem *pixis; void __iomem *pixis;
...@@ -145,19 +146,21 @@ static void p1022ds_set_monitor_port(int monitor_port) ...@@ -145,19 +146,21 @@ static void p1022ds_set_monitor_port(int monitor_port)
} }
brdcfg1 = pixis + 9; /* BRDCFG1 is at offset 9 in the ngPIXIS */ brdcfg1 = pixis + 9; /* BRDCFG1 is at offset 9 in the ngPIXIS */
switch (monitor_port) { switch (port) {
case 0: /* DVI */ case FSL_DIU_PORT_DVI:
printk(KERN_INFO "%s:%u\n", __func__, __LINE__);
/* Enable the DVI port, disable the DFP and the backlight */ /* Enable the DVI port, disable the DFP and the backlight */
clrsetbits_8(brdcfg1, PX_BRDCFG1_DFPEN | PX_BRDCFG1_BACKLIGHT, clrsetbits_8(brdcfg1, PX_BRDCFG1_DFPEN | PX_BRDCFG1_BACKLIGHT,
PX_BRDCFG1_DVIEN); PX_BRDCFG1_DVIEN);
break; break;
case 1: /* Single link LVDS */ case FSL_DIU_PORT_LVDS:
printk(KERN_INFO "%s:%u\n", __func__, __LINE__);
/* Enable the DFP port, disable the DVI and the backlight */ /* Enable the DFP port, disable the DVI and the backlight */
clrsetbits_8(brdcfg1, PX_BRDCFG1_DVIEN | PX_BRDCFG1_BACKLIGHT, clrsetbits_8(brdcfg1, PX_BRDCFG1_DVIEN | PX_BRDCFG1_BACKLIGHT,
PX_BRDCFG1_DFPEN); PX_BRDCFG1_DFPEN);
break; break;
default: default:
pr_err("p1022ds: unsupported monitor port %i\n", monitor_port); pr_err("p1022ds: unsupported monitor port %i\n", port);
} }
iounmap(pixis); iounmap(pixis);
...@@ -214,23 +217,18 @@ void p1022ds_set_pixel_clock(unsigned int pixclock) ...@@ -214,23 +217,18 @@ void p1022ds_set_pixel_clock(unsigned int pixclock)
} }
/** /**
* p1022ds_show_monitor_port: show the current monitor * p1022ds_valid_monitor_port: set the monitor port for sysfs
*
* This function returns a string indicating whether the current monitor is
* set to DVI or LVDS.
*/
ssize_t p1022ds_show_monitor_port(int monitor_port, char *buf)
{
return sprintf(buf, "%c0 - DVI\n%c1 - Single link LVDS\n",
monitor_port == 0 ? '*' : ' ', monitor_port == 1 ? '*' : ' ');
}
/**
* p1022ds_set_sysfs_monitor_port: set the monitor port for sysfs
*/ */
int p1022ds_set_sysfs_monitor_port(int val) enum fsl_diu_monitor_port
p1022ds_valid_monitor_port(enum fsl_diu_monitor_port port)
{ {
return val < 2 ? val : 0; switch (port) {
case FSL_DIU_PORT_DVI:
case FSL_DIU_PORT_LVDS:
return port;
default:
return FSL_DIU_PORT_DVI; /* Dual-link LVDS is not supported */
}
} }
#endif #endif
...@@ -305,8 +303,7 @@ static void __init p1022_ds_setup_arch(void) ...@@ -305,8 +303,7 @@ static void __init p1022_ds_setup_arch(void)
diu_ops.set_gamma_table = p1022ds_set_gamma_table; diu_ops.set_gamma_table = p1022ds_set_gamma_table;
diu_ops.set_monitor_port = p1022ds_set_monitor_port; diu_ops.set_monitor_port = p1022ds_set_monitor_port;
diu_ops.set_pixel_clock = p1022ds_set_pixel_clock; diu_ops.set_pixel_clock = p1022ds_set_pixel_clock;
diu_ops.show_monitor_port = p1022ds_show_monitor_port; diu_ops.valid_monitor_port = p1022ds_valid_monitor_port;
diu_ops.set_sysfs_monitor_port = p1022ds_set_sysfs_monitor_port;
#endif #endif
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
......
...@@ -152,10 +152,10 @@ machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices); ...@@ -152,10 +152,10 @@ machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices);
(c2 << AD_COMP_2_SHIFT) | (c1 << AD_COMP_1_SHIFT) | \ (c2 << AD_COMP_2_SHIFT) | (c1 << AD_COMP_1_SHIFT) | \
(c0 << AD_COMP_0_SHIFT) | (size << AD_PIXEL_S_SHIFT)) (c0 << AD_COMP_0_SHIFT) | (size << AD_PIXEL_S_SHIFT))
unsigned int mpc8610hpcd_get_pixel_format(unsigned int bits_per_pixel, u32 mpc8610hpcd_get_pixel_format(enum fsl_diu_monitor_port port,
int monitor_port) unsigned int bits_per_pixel)
{ {
static const unsigned long pixelformat[][3] = { static const u32 pixelformat[][3] = {
{ {
MAKE_AD(3, 0, 2, 1, 3, 8, 8, 8, 8), MAKE_AD(3, 0, 2, 1, 3, 8, 8, 8, 8),
MAKE_AD(4, 2, 0, 1, 2, 8, 8, 8, 0), MAKE_AD(4, 2, 0, 1, 2, 8, 8, 8, 0),
...@@ -170,7 +170,8 @@ unsigned int mpc8610hpcd_get_pixel_format(unsigned int bits_per_pixel, ...@@ -170,7 +170,8 @@ unsigned int mpc8610hpcd_get_pixel_format(unsigned int bits_per_pixel,
unsigned int arch_monitor; unsigned int arch_monitor;
/* The DVI port is mis-wired on revision 1 of this board. */ /* The DVI port is mis-wired on revision 1 of this board. */
arch_monitor = ((*pixis_arch == 0x01) && (monitor_port == 0))? 0 : 1; arch_monitor =
((*pixis_arch == 0x01) && (port == FSL_DIU_PORT_DVI)) ? 0 : 1;
switch (bits_per_pixel) { switch (bits_per_pixel) {
case 32: case 32:
...@@ -185,10 +186,11 @@ unsigned int mpc8610hpcd_get_pixel_format(unsigned int bits_per_pixel, ...@@ -185,10 +186,11 @@ unsigned int mpc8610hpcd_get_pixel_format(unsigned int bits_per_pixel,
} }
} }
void mpc8610hpcd_set_gamma_table(int monitor_port, char *gamma_table_base) void mpc8610hpcd_set_gamma_table(enum fsl_diu_monitor_port port,
char *gamma_table_base)
{ {
int i; int i;
if (monitor_port == 2) { /* dual link LVDS */ if (port == FSL_DIU_PORT_DLVDS) {
for (i = 0; i < 256*3; i++) for (i = 0; i < 256*3; i++)
gamma_table_base[i] = (gamma_table_base[i] << 2) | gamma_table_base[i] = (gamma_table_base[i] << 2) |
((gamma_table_base[i] >> 6) & 0x03); ((gamma_table_base[i] >> 6) & 0x03);
...@@ -199,17 +201,21 @@ void mpc8610hpcd_set_gamma_table(int monitor_port, char *gamma_table_base) ...@@ -199,17 +201,21 @@ void mpc8610hpcd_set_gamma_table(int monitor_port, char *gamma_table_base)
#define PX_BRDCFG0_DLINK (1 << 4) #define PX_BRDCFG0_DLINK (1 << 4)
#define PX_BRDCFG0_DIU_MASK (PX_BRDCFG0_DVISEL | PX_BRDCFG0_DLINK) #define PX_BRDCFG0_DIU_MASK (PX_BRDCFG0_DVISEL | PX_BRDCFG0_DLINK)
void mpc8610hpcd_set_monitor_port(int monitor_port) void mpc8610hpcd_set_monitor_port(enum fsl_diu_monitor_port port)
{ {
static const u8 bdcfg[] = { switch (port) {
PX_BRDCFG0_DVISEL | PX_BRDCFG0_DLINK, case FSL_DIU_PORT_DVI:
PX_BRDCFG0_DLINK,
0,
};
if (monitor_port < 3)
clrsetbits_8(pixis_bdcfg0, PX_BRDCFG0_DIU_MASK, clrsetbits_8(pixis_bdcfg0, PX_BRDCFG0_DIU_MASK,
bdcfg[monitor_port]); PX_BRDCFG0_DVISEL | PX_BRDCFG0_DLINK);
break;
case FSL_DIU_PORT_LVDS:
clrsetbits_8(pixis_bdcfg0, PX_BRDCFG0_DIU_MASK,
PX_BRDCFG0_DLINK);
break;
case FSL_DIU_PORT_DLVDS:
clrbits8(pixis_bdcfg0, PX_BRDCFG0_DIU_MASK);
break;
}
} }
/** /**
...@@ -262,20 +268,10 @@ void mpc8610hpcd_set_pixel_clock(unsigned int pixclock) ...@@ -262,20 +268,10 @@ void mpc8610hpcd_set_pixel_clock(unsigned int pixclock)
iounmap(guts); iounmap(guts);
} }
ssize_t mpc8610hpcd_show_monitor_port(int monitor_port, char *buf) enum fsl_diu_monitor_port
{ mpc8610hpcd_valid_monitor_port(enum fsl_diu_monitor_port port)
return snprintf(buf, PAGE_SIZE,
"%c0 - DVI\n"
"%c1 - Single link LVDS\n"
"%c2 - Dual link LVDS\n",
monitor_port == 0 ? '*' : ' ',
monitor_port == 1 ? '*' : ' ',
monitor_port == 2 ? '*' : ' ');
}
int mpc8610hpcd_set_sysfs_monitor_port(int val)
{ {
return val < 3 ? val : 0; return port;
} }
#endif #endif
...@@ -307,8 +303,7 @@ static void __init mpc86xx_hpcd_setup_arch(void) ...@@ -307,8 +303,7 @@ static void __init mpc86xx_hpcd_setup_arch(void)
diu_ops.set_gamma_table = mpc8610hpcd_set_gamma_table; diu_ops.set_gamma_table = mpc8610hpcd_set_gamma_table;
diu_ops.set_monitor_port = mpc8610hpcd_set_monitor_port; diu_ops.set_monitor_port = mpc8610hpcd_set_monitor_port;
diu_ops.set_pixel_clock = mpc8610hpcd_set_pixel_clock; diu_ops.set_pixel_clock = mpc8610hpcd_set_pixel_clock;
diu_ops.show_monitor_port = mpc8610hpcd_show_monitor_port; diu_ops.valid_monitor_port = mpc8610hpcd_valid_monitor_port;
diu_ops.set_sysfs_monitor_port = mpc8610hpcd_set_sysfs_monitor_port;
#endif #endif
pixis_node = of_find_compatible_node(NULL, NULL, "fsl,fpga-pixis"); pixis_node = of_find_compatible_node(NULL, NULL, "fsl,fpga-pixis");
......
...@@ -22,15 +22,24 @@ struct device_node; ...@@ -22,15 +22,24 @@ struct device_node;
extern void fsl_rstcr_restart(char *cmd); extern void fsl_rstcr_restart(char *cmd);
#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
/* The different ports that the DIU can be connected to */
enum fsl_diu_monitor_port {
FSL_DIU_PORT_DVI, /* DVI */
FSL_DIU_PORT_LVDS, /* Single-link LVDS */
FSL_DIU_PORT_DLVDS /* Dual-link LVDS */
};
struct platform_diu_data_ops { struct platform_diu_data_ops {
unsigned int (*get_pixel_format) (unsigned int bits_per_pixel, u32 (*get_pixel_format)(enum fsl_diu_monitor_port port,
int monitor_port); unsigned int bpp);
void (*set_gamma_table) (int monitor_port, char *gamma_table_base); void (*set_gamma_table)(enum fsl_diu_monitor_port port,
void (*set_monitor_port) (int monitor_port); char *gamma_table_base);
void (*set_pixel_clock) (unsigned int pixclock); void (*set_monitor_port)(enum fsl_diu_monitor_port port);
ssize_t (*show_monitor_port) (int monitor_port, char *buf); void (*set_pixel_clock)(unsigned int pixclock);
int (*set_sysfs_monitor_port) (int val); enum fsl_diu_monitor_port (*valid_monitor_port)
void (*release_bootmem) (void); (enum fsl_diu_monitor_port port);
void (*release_bootmem)(void);
}; };
extern struct platform_diu_data_ops diu_ops; extern struct platform_diu_data_ops diu_ops;
......
...@@ -259,6 +259,15 @@ config FB_TILEBLITTING ...@@ -259,6 +259,15 @@ config FB_TILEBLITTING
comment "Frame buffer hardware drivers" comment "Frame buffer hardware drivers"
depends on FB depends on FB
config FB_GRVGA
tristate "Aeroflex Gaisler framebuffer support"
depends on FB && SPARC
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
---help---
This enables support for the SVGACTRL framebuffer in the GRLIB IP library from Aeroflex Gaisler.
config FB_CIRRUS config FB_CIRRUS
tristate "Cirrus Logic support" tristate "Cirrus Logic support"
depends on FB && (ZORRO || PCI) depends on FB && (ZORRO || PCI)
...@@ -1756,9 +1765,10 @@ config FB_AU1100 ...@@ -1756,9 +1765,10 @@ config FB_AU1100
config FB_AU1200 config FB_AU1200
bool "Au1200 LCD Driver" bool "Au1200 LCD Driver"
depends on (FB = y) && MIPS && SOC_AU1200 depends on (FB = y) && MIPS && SOC_AU1200
select FB_CFB_FILLRECT select FB_SYS_FILLRECT
select FB_CFB_COPYAREA select FB_SYS_COPYAREA
select FB_CFB_IMAGEBLIT select FB_SYS_IMAGEBLIT
select FB_SYS_FOPS
help help
This is the framebuffer driver for the AMD Au1200 SOC. It can drive This is the framebuffer driver for the AMD Au1200 SOC. It can drive
various panels and CRTs by passing in kernel cmd line option various panels and CRTs by passing in kernel cmd line option
......
...@@ -33,6 +33,7 @@ obj-$(CONFIG_FB_AMIGA) += amifb.o c2p_planar.o ...@@ -33,6 +33,7 @@ obj-$(CONFIG_FB_AMIGA) += amifb.o c2p_planar.o
obj-$(CONFIG_FB_ARC) += arcfb.o obj-$(CONFIG_FB_ARC) += arcfb.o
obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o
obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o
obj-$(CONFIG_FB_GRVGA) += grvga.o
obj-$(CONFIG_FB_PM2) += pm2fb.o obj-$(CONFIG_FB_PM2) += pm2fb.o
obj-$(CONFIG_FB_PM3) += pm3fb.o obj-$(CONFIG_FB_PM3) += pm3fb.o
......
This diff is collapsed.
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/version.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/pm.h> #include <linux/pm.h>
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/version.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/pm.h> #include <linux/pm.h>
......
...@@ -32,11 +32,11 @@ ...@@ -32,11 +32,11 @@
#define CARMINEFB_DEFAULT_VIDEO_MODE 1 #define CARMINEFB_DEFAULT_VIDEO_MODE 1
static unsigned int fb_mode = CARMINEFB_DEFAULT_VIDEO_MODE; static unsigned int fb_mode = CARMINEFB_DEFAULT_VIDEO_MODE;
module_param(fb_mode, uint, 444); module_param(fb_mode, uint, 0444);
MODULE_PARM_DESC(fb_mode, "Initial video mode as integer."); MODULE_PARM_DESC(fb_mode, "Initial video mode as integer.");
static char *fb_mode_str; static char *fb_mode_str;
module_param(fb_mode_str, charp, 444); module_param(fb_mode_str, charp, 0444);
MODULE_PARM_DESC(fb_mode_str, "Initial video mode in characters."); MODULE_PARM_DESC(fb_mode_str, "Initial video mode in characters.");
/* /*
...@@ -46,7 +46,7 @@ MODULE_PARM_DESC(fb_mode_str, "Initial video mode in characters."); ...@@ -46,7 +46,7 @@ MODULE_PARM_DESC(fb_mode_str, "Initial video mode in characters.");
* 0b010 Display 1 * 0b010 Display 1
*/ */
static int fb_displays = CARMINE_USE_DISPLAY0 | CARMINE_USE_DISPLAY1; static int fb_displays = CARMINE_USE_DISPLAY0 | CARMINE_USE_DISPLAY1;
module_param(fb_displays, int, 444); module_param(fb_displays, int, 0444);
MODULE_PARM_DESC(fb_displays, "Bit mode, which displays are used"); MODULE_PARM_DESC(fb_displays, "Bit mode, which displays are used");
struct carmine_hw { struct carmine_hw {
......
...@@ -550,7 +550,7 @@ static void control_set_hardware(struct fb_info_control *p, struct fb_par_contro ...@@ -550,7 +550,7 @@ static void control_set_hardware(struct fb_info_control *p, struct fb_par_contro
/* /*
* Parse user speficied options (`video=controlfb:') * Parse user specified options (`video=controlfb:')
*/ */
static void __init control_setup(char *options) static void __init control_setup(char *options)
{ {
......
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
#define DRIVER_NAME "da8xx_lcdc" #define DRIVER_NAME "da8xx_lcdc"
#define LCD_VERSION_1 1
#define LCD_VERSION_2 2
/* LCD Status Register */ /* LCD Status Register */
#define LCD_END_OF_FRAME1 BIT(9) #define LCD_END_OF_FRAME1 BIT(9)
#define LCD_END_OF_FRAME0 BIT(8) #define LCD_END_OF_FRAME0 BIT(8)
...@@ -49,7 +52,9 @@ ...@@ -49,7 +52,9 @@
#define LCD_DMA_BURST_4 0x2 #define LCD_DMA_BURST_4 0x2
#define LCD_DMA_BURST_8 0x3 #define LCD_DMA_BURST_8 0x3
#define LCD_DMA_BURST_16 0x4 #define LCD_DMA_BURST_16 0x4
#define LCD_END_OF_FRAME_INT_ENA BIT(2) #define LCD_V1_END_OF_FRAME_INT_ENA BIT(2)
#define LCD_V2_END_OF_FRAME0_INT_ENA BIT(8)
#define LCD_V2_END_OF_FRAME1_INT_ENA BIT(9)
#define LCD_DUAL_FRAME_BUFFER_ENABLE BIT(0) #define LCD_DUAL_FRAME_BUFFER_ENABLE BIT(0)
/* LCD Control Register */ /* LCD Control Register */
...@@ -65,12 +70,18 @@ ...@@ -65,12 +70,18 @@
#define LCD_MONO_8BIT_MODE BIT(9) #define LCD_MONO_8BIT_MODE BIT(9)
#define LCD_RASTER_ORDER BIT(8) #define LCD_RASTER_ORDER BIT(8)
#define LCD_TFT_MODE BIT(7) #define LCD_TFT_MODE BIT(7)
#define LCD_UNDERFLOW_INT_ENA BIT(6) #define LCD_V1_UNDERFLOW_INT_ENA BIT(6)
#define LCD_PL_ENABLE BIT(4) #define LCD_V2_UNDERFLOW_INT_ENA BIT(5)
#define LCD_V1_PL_INT_ENA BIT(4)
#define LCD_V2_PL_INT_ENA BIT(6)
#define LCD_MONOCHROME_MODE BIT(1) #define LCD_MONOCHROME_MODE BIT(1)
#define LCD_RASTER_ENABLE BIT(0) #define LCD_RASTER_ENABLE BIT(0)
#define LCD_TFT_ALT_ENABLE BIT(23) #define LCD_TFT_ALT_ENABLE BIT(23)
#define LCD_STN_565_ENABLE BIT(24) #define LCD_STN_565_ENABLE BIT(24)
#define LCD_V2_DMA_CLK_EN BIT(2)
#define LCD_V2_LIDD_CLK_EN BIT(1)
#define LCD_V2_CORE_CLK_EN BIT(0)
#define LCD_V2_LPP_B10 26
/* LCD Raster Timing 2 Register */ /* LCD Raster Timing 2 Register */
#define LCD_AC_BIAS_TRANSITIONS_PER_INT(x) ((x) << 16) #define LCD_AC_BIAS_TRANSITIONS_PER_INT(x) ((x) << 16)
...@@ -82,6 +93,7 @@ ...@@ -82,6 +93,7 @@
#define LCD_INVERT_FRAME_CLOCK BIT(20) #define LCD_INVERT_FRAME_CLOCK BIT(20)
/* LCD Block */ /* LCD Block */
#define LCD_PID_REG 0x0
#define LCD_CTRL_REG 0x4 #define LCD_CTRL_REG 0x4
#define LCD_STAT_REG 0x8 #define LCD_STAT_REG 0x8
#define LCD_RASTER_CTRL_REG 0x28 #define LCD_RASTER_CTRL_REG 0x28
...@@ -94,6 +106,17 @@ ...@@ -94,6 +106,17 @@
#define LCD_DMA_FRM_BUF_BASE_ADDR_1_REG 0x4C #define LCD_DMA_FRM_BUF_BASE_ADDR_1_REG 0x4C
#define LCD_DMA_FRM_BUF_CEILING_ADDR_1_REG 0x50 #define LCD_DMA_FRM_BUF_CEILING_ADDR_1_REG 0x50
/* Interrupt Registers available only in Version 2 */
#define LCD_RAW_STAT_REG 0x58
#define LCD_MASKED_STAT_REG 0x5c
#define LCD_INT_ENABLE_SET_REG 0x60
#define LCD_INT_ENABLE_CLR_REG 0x64
#define LCD_END_OF_INT_IND_REG 0x68
/* Clock registers available only on Version 2 */
#define LCD_CLK_ENABLE_REG 0x6c
#define LCD_CLK_RESET_REG 0x70
#define LCD_NUM_BUFFERS 2 #define LCD_NUM_BUFFERS 2
#define WSI_TIMEOUT 50 #define WSI_TIMEOUT 50
...@@ -105,6 +128,8 @@ ...@@ -105,6 +128,8 @@
static resource_size_t da8xx_fb_reg_base; static resource_size_t da8xx_fb_reg_base;
static struct resource *lcdc_regs; static struct resource *lcdc_regs;
static unsigned int lcd_revision;
static irq_handler_t lcdc_irq_handler;
static inline unsigned int lcdc_read(unsigned int addr) static inline unsigned int lcdc_read(unsigned int addr)
{ {
...@@ -240,6 +265,7 @@ static void lcd_blit(int load_mode, struct da8xx_fb_par *par) ...@@ -240,6 +265,7 @@ static void lcd_blit(int load_mode, struct da8xx_fb_par *par)
u32 end; u32 end;
u32 reg_ras; u32 reg_ras;
u32 reg_dma; u32 reg_dma;
u32 reg_int;
/* init reg to clear PLM (loading mode) fields */ /* init reg to clear PLM (loading mode) fields */
reg_ras = lcdc_read(LCD_RASTER_CTRL_REG); reg_ras = lcdc_read(LCD_RASTER_CTRL_REG);
...@@ -252,7 +278,14 @@ static void lcd_blit(int load_mode, struct da8xx_fb_par *par) ...@@ -252,7 +278,14 @@ static void lcd_blit(int load_mode, struct da8xx_fb_par *par)
end = par->dma_end; end = par->dma_end;
reg_ras |= LCD_PALETTE_LOAD_MODE(DATA_ONLY); reg_ras |= LCD_PALETTE_LOAD_MODE(DATA_ONLY);
reg_dma |= LCD_END_OF_FRAME_INT_ENA; if (lcd_revision == LCD_VERSION_1) {
reg_dma |= LCD_V1_END_OF_FRAME_INT_ENA;
} else {
reg_int = lcdc_read(LCD_INT_ENABLE_SET_REG) |
LCD_V2_END_OF_FRAME0_INT_ENA |
LCD_V2_END_OF_FRAME1_INT_ENA;
lcdc_write(reg_int, LCD_INT_ENABLE_SET_REG);
}
reg_dma |= LCD_DUAL_FRAME_BUFFER_ENABLE; reg_dma |= LCD_DUAL_FRAME_BUFFER_ENABLE;
lcdc_write(start, LCD_DMA_FRM_BUF_BASE_ADDR_0_REG); lcdc_write(start, LCD_DMA_FRM_BUF_BASE_ADDR_0_REG);
...@@ -264,7 +297,14 @@ static void lcd_blit(int load_mode, struct da8xx_fb_par *par) ...@@ -264,7 +297,14 @@ static void lcd_blit(int load_mode, struct da8xx_fb_par *par)
end = start + par->palette_sz - 1; end = start + par->palette_sz - 1;
reg_ras |= LCD_PALETTE_LOAD_MODE(PALETTE_ONLY); reg_ras |= LCD_PALETTE_LOAD_MODE(PALETTE_ONLY);
reg_ras |= LCD_PL_ENABLE;
if (lcd_revision == LCD_VERSION_1) {
reg_ras |= LCD_V1_PL_INT_ENA;
} else {
reg_int = lcdc_read(LCD_INT_ENABLE_SET_REG) |
LCD_V2_PL_INT_ENA;
lcdc_write(reg_int, LCD_INT_ENABLE_SET_REG);
}
lcdc_write(start, LCD_DMA_FRM_BUF_BASE_ADDR_0_REG); lcdc_write(start, LCD_DMA_FRM_BUF_BASE_ADDR_0_REG);
lcdc_write(end, LCD_DMA_FRM_BUF_CEILING_ADDR_0_REG); lcdc_write(end, LCD_DMA_FRM_BUF_CEILING_ADDR_0_REG);
...@@ -348,6 +388,7 @@ static void lcd_cfg_vertical_sync(int back_porch, int pulse_width, ...@@ -348,6 +388,7 @@ static void lcd_cfg_vertical_sync(int back_porch, int pulse_width,
static int lcd_cfg_display(const struct lcd_ctrl_config *cfg) static int lcd_cfg_display(const struct lcd_ctrl_config *cfg)
{ {
u32 reg; u32 reg;
u32 reg_int;
reg = lcdc_read(LCD_RASTER_CTRL_REG) & ~(LCD_TFT_MODE | reg = lcdc_read(LCD_RASTER_CTRL_REG) & ~(LCD_TFT_MODE |
LCD_MONO_8BIT_MODE | LCD_MONO_8BIT_MODE |
...@@ -375,7 +416,13 @@ static int lcd_cfg_display(const struct lcd_ctrl_config *cfg) ...@@ -375,7 +416,13 @@ static int lcd_cfg_display(const struct lcd_ctrl_config *cfg)
} }
/* enable additional interrupts here */ /* enable additional interrupts here */
reg |= LCD_UNDERFLOW_INT_ENA; if (lcd_revision == LCD_VERSION_1) {
reg |= LCD_V1_UNDERFLOW_INT_ENA;
} else {
reg_int = lcdc_read(LCD_INT_ENABLE_SET_REG) |
LCD_V2_UNDERFLOW_INT_ENA;
lcdc_write(reg_int, LCD_INT_ENABLE_SET_REG);
}
lcdc_write(reg, LCD_RASTER_CTRL_REG); lcdc_write(reg, LCD_RASTER_CTRL_REG);
...@@ -511,6 +558,9 @@ static void lcd_reset(struct da8xx_fb_par *par) ...@@ -511,6 +558,9 @@ static void lcd_reset(struct da8xx_fb_par *par)
/* DMA has to be disabled */ /* DMA has to be disabled */
lcdc_write(0, LCD_DMA_CTRL_REG); lcdc_write(0, LCD_DMA_CTRL_REG);
lcdc_write(0, LCD_RASTER_CTRL_REG); lcdc_write(0, LCD_RASTER_CTRL_REG);
if (lcd_revision == LCD_VERSION_2)
lcdc_write(0, LCD_INT_ENABLE_SET_REG);
} }
static void lcd_calc_clk_divider(struct da8xx_fb_par *par) static void lcd_calc_clk_divider(struct da8xx_fb_par *par)
...@@ -523,6 +573,11 @@ static void lcd_calc_clk_divider(struct da8xx_fb_par *par) ...@@ -523,6 +573,11 @@ static void lcd_calc_clk_divider(struct da8xx_fb_par *par)
/* Configure the LCD clock divisor. */ /* Configure the LCD clock divisor. */
lcdc_write(LCD_CLK_DIVISOR(div) | lcdc_write(LCD_CLK_DIVISOR(div) |
(LCD_RASTER_MODE & 0x1), LCD_CTRL_REG); (LCD_RASTER_MODE & 0x1), LCD_CTRL_REG);
if (lcd_revision == LCD_VERSION_2)
lcdc_write(LCD_V2_DMA_CLK_EN | LCD_V2_LIDD_CLK_EN |
LCD_V2_CORE_CLK_EN, LCD_CLK_ENABLE_REG);
} }
static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg,
...@@ -583,7 +638,63 @@ static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, ...@@ -583,7 +638,63 @@ static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg,
return 0; return 0;
} }
static irqreturn_t lcdc_irq_handler(int irq, void *arg) /* IRQ handler for version 2 of LCDC */
static irqreturn_t lcdc_irq_handler_rev02(int irq, void *arg)
{
struct da8xx_fb_par *par = arg;
u32 stat = lcdc_read(LCD_MASKED_STAT_REG);
u32 reg_int;
if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) {
lcd_disable_raster();
lcdc_write(stat, LCD_MASKED_STAT_REG);
lcd_enable_raster();
} else if (stat & LCD_PL_LOAD_DONE) {
/*
* Must disable raster before changing state of any control bit.
* And also must be disabled before clearing the PL loading
* interrupt via the following write to the status register. If
* this is done after then one gets multiple PL done interrupts.
*/
lcd_disable_raster();
lcdc_write(stat, LCD_MASKED_STAT_REG);
/* Disable PL completion inerrupt */
reg_int = lcdc_read(LCD_INT_ENABLE_CLR_REG) |
(LCD_V2_PL_INT_ENA);
lcdc_write(reg_int, LCD_INT_ENABLE_CLR_REG);
/* Setup and start data loading mode */
lcd_blit(LOAD_DATA, par);
} else {
lcdc_write(stat, LCD_MASKED_STAT_REG);
if (stat & LCD_END_OF_FRAME0) {
lcdc_write(par->dma_start,
LCD_DMA_FRM_BUF_BASE_ADDR_0_REG);
lcdc_write(par->dma_end,
LCD_DMA_FRM_BUF_CEILING_ADDR_0_REG);
par->vsync_flag = 1;
wake_up_interruptible(&par->vsync_wait);
}
if (stat & LCD_END_OF_FRAME1) {
lcdc_write(par->dma_start,
LCD_DMA_FRM_BUF_BASE_ADDR_1_REG);
lcdc_write(par->dma_end,
LCD_DMA_FRM_BUF_CEILING_ADDR_1_REG);
par->vsync_flag = 1;
wake_up_interruptible(&par->vsync_wait);
}
}
lcdc_write(0, LCD_END_OF_INT_IND_REG);
return IRQ_HANDLED;
}
/* IRQ handler for version 1 LCDC */
static irqreturn_t lcdc_irq_handler_rev01(int irq, void *arg)
{ {
struct da8xx_fb_par *par = arg; struct da8xx_fb_par *par = arg;
u32 stat = lcdc_read(LCD_STAT_REG); u32 stat = lcdc_read(LCD_STAT_REG);
...@@ -606,7 +717,7 @@ static irqreturn_t lcdc_irq_handler(int irq, void *arg) ...@@ -606,7 +717,7 @@ static irqreturn_t lcdc_irq_handler(int irq, void *arg)
/* Disable PL completion inerrupt */ /* Disable PL completion inerrupt */
reg_ras = lcdc_read(LCD_RASTER_CTRL_REG); reg_ras = lcdc_read(LCD_RASTER_CTRL_REG);
reg_ras &= ~LCD_PL_ENABLE; reg_ras &= ~LCD_V1_PL_INT_ENA;
lcdc_write(reg_ras, LCD_RASTER_CTRL_REG); lcdc_write(reg_ras, LCD_RASTER_CTRL_REG);
/* Setup and start data loading mode */ /* Setup and start data loading mode */
...@@ -945,6 +1056,22 @@ static int __devinit fb_probe(struct platform_device *device) ...@@ -945,6 +1056,22 @@ static int __devinit fb_probe(struct platform_device *device)
if (ret) if (ret)
goto err_clk_put; goto err_clk_put;
/* Determine LCD IP Version */
switch (lcdc_read(LCD_PID_REG)) {
case 0x4C100102:
lcd_revision = LCD_VERSION_1;
break;
case 0x4F200800:
lcd_revision = LCD_VERSION_2;
break;
default:
dev_warn(&device->dev, "Unknown PID Reg value 0x%x, "
"defaulting to LCD revision 1\n",
lcdc_read(LCD_PID_REG));
lcd_revision = LCD_VERSION_1;
break;
}
for (i = 0, lcdc_info = known_lcd_panels; for (i = 0, lcdc_info = known_lcd_panels;
i < ARRAY_SIZE(known_lcd_panels); i < ARRAY_SIZE(known_lcd_panels);
i++, lcdc_info++) { i++, lcdc_info++) {
...@@ -1085,7 +1212,13 @@ static int __devinit fb_probe(struct platform_device *device) ...@@ -1085,7 +1212,13 @@ static int __devinit fb_probe(struct platform_device *device)
} }
#endif #endif
ret = request_irq(par->irq, lcdc_irq_handler, 0, DRIVER_NAME, par); if (lcd_revision == LCD_VERSION_1)
lcdc_irq_handler = lcdc_irq_handler_rev01;
else
lcdc_irq_handler = lcdc_irq_handler_rev02;
ret = request_irq(par->irq, lcdc_irq_handler, 0,
DRIVER_NAME, par);
if (ret) if (ret)
goto irq_freq; goto irq_freq;
return 0; return 0;
......
...@@ -223,8 +223,7 @@ void fb_deferred_io_cleanup(struct fb_info *info) ...@@ -223,8 +223,7 @@ void fb_deferred_io_cleanup(struct fb_info *info)
int i; int i;
BUG_ON(!fbdefio); BUG_ON(!fbdefio);
cancel_delayed_work(&info->deferred_work); cancel_delayed_work_sync(&info->deferred_work);
flush_scheduled_work();
/* clear out the mapping that we setup */ /* clear out the mapping that we setup */
for (i = 0 ; i < info->fix.smem_len; i += PAGE_SIZE) { for (i = 0 ; i < info->fix.smem_len; i += PAGE_SIZE) {
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/of_platform.h>
#include <sysdev/fsl_soc.h> #include <sysdev/fsl_soc.h>
#include <linux/fsl-diu-fb.h> #include <linux/fsl-diu-fb.h>
#include "edid.h" #include "edid.h"
...@@ -183,7 +181,8 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = { ...@@ -183,7 +181,8 @@ static struct fb_videomode __devinitdata fsl_diu_mode_db[] = {
static char *fb_mode = "1024x768-32@60"; static char *fb_mode = "1024x768-32@60";
static unsigned long default_bpp = 32; static unsigned long default_bpp = 32;
static int monitor_port; static enum fsl_diu_monitor_port monitor_port;
static char *monitor_string;
#if defined(CONFIG_NOT_COHERENT_CACHE) #if defined(CONFIG_NOT_COHERENT_CACHE)
static u8 *coherence_data; static u8 *coherence_data;
...@@ -201,7 +200,7 @@ struct fsl_diu_data { ...@@ -201,7 +200,7 @@ struct fsl_diu_data {
void *dummy_aoi_virt; void *dummy_aoi_virt;
unsigned int irq; unsigned int irq;
int fb_enabled; int fb_enabled;
int monitor_port; enum fsl_diu_monitor_port monitor_port;
}; };
struct mfb_info { struct mfb_info {
...@@ -281,6 +280,37 @@ static struct diu_hw dr = { ...@@ -281,6 +280,37 @@ static struct diu_hw dr = {
static struct diu_pool pool; static struct diu_pool pool;
/**
* fsl_diu_name_to_port - convert a port name to a monitor port enum
*
* Takes the name of a monitor port ("dvi", "lvds", or "dlvds") and returns
* the enum fsl_diu_monitor_port that corresponds to that string.
*
* For compatibility with older versions, a number ("0", "1", or "2") is also
* supported.
*
* If the string is unknown, DVI is assumed.
*
* If the particular port is not supported by the platform, another port
* (platform-specific) is chosen instead.
*/
static enum fsl_diu_monitor_port fsl_diu_name_to_port(const char *s)
{
enum fsl_diu_monitor_port port = FSL_DIU_PORT_DVI;
unsigned long val;
if (s) {
if (!strict_strtoul(s, 10, &val) && (val <= 2))
port = (enum fsl_diu_monitor_port) val;
else if (strncmp(s, "lvds", 4) == 0)
port = FSL_DIU_PORT_LVDS;
else if (strncmp(s, "dlvds", 5) == 0)
port = FSL_DIU_PORT_DLVDS;
}
return diu_ops.valid_monitor_port(port);
}
/** /**
* fsl_diu_alloc - allocate memory for the DIU * fsl_diu_alloc - allocate memory for the DIU
* @size: number of bytes to allocate * @size: number of bytes to allocate
...@@ -831,9 +861,8 @@ static int fsl_diu_set_par(struct fb_info *info) ...@@ -831,9 +861,8 @@ static int fsl_diu_set_par(struct fb_info *info)
} }
} }
ad->pix_fmt = ad->pix_fmt = diu_ops.get_pixel_format(machine_data->monitor_port,
diu_ops.get_pixel_format(var->bits_per_pixel, var->bits_per_pixel);
machine_data->monitor_port);
ad->addr = cpu_to_le32(info->fix.smem_start); ad->addr = cpu_to_le32(info->fix.smem_start);
ad->src_size_g_alpha = cpu_to_le32((var->yres_virtual << 12) | ad->src_size_g_alpha = cpu_to_le32((var->yres_virtual << 12) |
var->xres_virtual) | mfbi->g_alpha; var->xres_virtual) | mfbi->g_alpha;
...@@ -1439,16 +1468,12 @@ static void free_buf(struct device *dev, struct diu_addr *buf, u32 size, ...@@ -1439,16 +1468,12 @@ static void free_buf(struct device *dev, struct diu_addr *buf, u32 size,
static ssize_t store_monitor(struct device *device, static ssize_t store_monitor(struct device *device,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr, const char *buf, size_t count)
{ {
int old_monitor_port; enum fsl_diu_monitor_port old_monitor_port;
unsigned long val;
struct fsl_diu_data *machine_data = struct fsl_diu_data *machine_data =
container_of(attr, struct fsl_diu_data, dev_attr); container_of(attr, struct fsl_diu_data, dev_attr);
if (strict_strtoul(buf, 10, &val))
return 0;
old_monitor_port = machine_data->monitor_port; old_monitor_port = machine_data->monitor_port;
machine_data->monitor_port = diu_ops.set_sysfs_monitor_port(val); machine_data->monitor_port = fsl_diu_name_to_port(buf);
if (old_monitor_port != machine_data->monitor_port) { if (old_monitor_port != machine_data->monitor_port) {
/* All AOIs need adjust pixel format /* All AOIs need adjust pixel format
...@@ -1468,7 +1493,17 @@ static ssize_t show_monitor(struct device *device, ...@@ -1468,7 +1493,17 @@ static ssize_t show_monitor(struct device *device,
{ {
struct fsl_diu_data *machine_data = struct fsl_diu_data *machine_data =
container_of(attr, struct fsl_diu_data, dev_attr); container_of(attr, struct fsl_diu_data, dev_attr);
return diu_ops.show_monitor_port(machine_data->monitor_port, buf);
switch (machine_data->monitor_port) {
case FSL_DIU_PORT_DVI:
return sprintf(buf, "DVI\n");
case FSL_DIU_PORT_LVDS:
return sprintf(buf, "Single-link LVDS\n");
case FSL_DIU_PORT_DLVDS:
return sprintf(buf, "Dual-link LVDS\n");
}
return 0;
} }
static int __devinit fsl_diu_probe(struct platform_device *ofdev) static int __devinit fsl_diu_probe(struct platform_device *ofdev)
...@@ -1692,8 +1727,7 @@ static int __init fsl_diu_setup(char *options) ...@@ -1692,8 +1727,7 @@ static int __init fsl_diu_setup(char *options)
if (!*opt) if (!*opt)
continue; continue;
if (!strncmp(opt, "monitor=", 8)) { if (!strncmp(opt, "monitor=", 8)) {
if (!strict_strtoul(opt + 8, 10, &val) && (val <= 2)) monitor_port = fsl_diu_name_to_port(opt + 8);
monitor_port = val;
} else if (!strncmp(opt, "bpp=", 4)) { } else if (!strncmp(opt, "bpp=", 4)) {
if (!strict_strtoul(opt + 4, 10, &val)) if (!strict_strtoul(opt + 4, 10, &val))
default_bpp = val; default_bpp = val;
...@@ -1746,6 +1780,8 @@ static int __init fsl_diu_init(void) ...@@ -1746,6 +1780,8 @@ static int __init fsl_diu_init(void)
if (fb_get_options("fslfb", &option)) if (fb_get_options("fslfb", &option))
return -ENODEV; return -ENODEV;
fsl_diu_setup(option); fsl_diu_setup(option);
#else
monitor_port = fsl_diu_name_to_port(monitor_string);
#endif #endif
printk(KERN_INFO "Freescale DIU driver\n"); printk(KERN_INFO "Freescale DIU driver\n");
...@@ -1812,7 +1848,7 @@ MODULE_PARM_DESC(mode, ...@@ -1812,7 +1848,7 @@ MODULE_PARM_DESC(mode,
"Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" "); "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
module_param_named(bpp, default_bpp, ulong, 0); module_param_named(bpp, default_bpp, ulong, 0);
MODULE_PARM_DESC(bpp, "Specify bit-per-pixel if not specified mode"); MODULE_PARM_DESC(bpp, "Specify bit-per-pixel if not specified mode");
module_param_named(monitor, monitor_port, int, 0); module_param_named(monitor, monitor_string, charp, 0);
MODULE_PARM_DESC(monitor, MODULE_PARM_DESC(monitor, "Specify the monitor port "
"Specify the monitor port (0, 1 or 2) if supported by the platform"); "(\"dvi\", \"lvds\", or \"dlvds\") if supported by the platform");
This diff is collapsed.
...@@ -421,7 +421,8 @@ int mdp_probe(struct platform_device *pdev) ...@@ -421,7 +421,8 @@ int mdp_probe(struct platform_device *pdev)
clk = clk_get(&pdev->dev, "mdp_clk"); clk = clk_get(&pdev->dev, "mdp_clk");
if (IS_ERR(clk)) { if (IS_ERR(clk)) {
printk(KERN_INFO "mdp: failed to get mdp clk"); printk(KERN_INFO "mdp: failed to get mdp clk");
return PTR_ERR(clk); ret = PTR_ERR(clk);
goto error_get_clk;
} }
ret = request_irq(mdp->irq, mdp_isr, IRQF_DISABLED, "msm_mdp", mdp); ret = request_irq(mdp->irq, mdp_isr, IRQF_DISABLED, "msm_mdp", mdp);
...@@ -495,6 +496,7 @@ int mdp_probe(struct platform_device *pdev) ...@@ -495,6 +496,7 @@ int mdp_probe(struct platform_device *pdev)
error_device_register: error_device_register:
free_irq(mdp->irq, mdp); free_irq(mdp->irq, mdp);
error_request_irq: error_request_irq:
error_get_clk:
iounmap(mdp->base); iounmap(mdp->base);
error_get_irq: error_get_irq:
error_ioremap: error_ioremap:
......
...@@ -490,7 +490,7 @@ static int platinum_var_to_par(struct fb_var_screeninfo *var, ...@@ -490,7 +490,7 @@ static int platinum_var_to_par(struct fb_var_screeninfo *var,
/* /*
* Parse user speficied options (`video=platinumfb:') * Parse user specified options (`video=platinumfb:')
*/ */
static int __init platinumfb_setup(char *options) static int __init platinumfb_setup(char *options)
{ {
......
...@@ -1773,7 +1773,7 @@ MODULE_DEVICE_TABLE(pci, pm2fb_id_table); ...@@ -1773,7 +1773,7 @@ MODULE_DEVICE_TABLE(pci, pm2fb_id_table);
#ifndef MODULE #ifndef MODULE
/** /**
* Parse user speficied options. * Parse user specified options.
* *
* This is, comma-separated options following `video=pm2fb:'. * This is, comma-separated options following `video=pm2fb:'.
*/ */
......
...@@ -1525,7 +1525,7 @@ static int __init pm3fb_setup(char *options) ...@@ -1525,7 +1525,7 @@ static int __init pm3fb_setup(char *options)
{ {
char *this_opt; char *this_opt;
/* Parse user speficied options (`video=pm3fb:') */ /* Parse user specified options (`video=pm3fb:') */
if (!options || !*options) if (!options || !*options)
return 0; return 0;
......
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/version.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
......
...@@ -767,7 +767,6 @@ static irqreturn_t s3c2410fb_irq(int irq, void *dev_id) ...@@ -767,7 +767,6 @@ static irqreturn_t s3c2410fb_irq(int irq, void *dev_id)
static int s3c2410fb_cpufreq_transition(struct notifier_block *nb, static int s3c2410fb_cpufreq_transition(struct notifier_block *nb,
unsigned long val, void *data) unsigned long val, void *data)
{ {
struct cpufreq_freqs *freqs = data;
struct s3c2410fb_info *info; struct s3c2410fb_info *info;
struct fb_info *fbinfo; struct fb_info *fbinfo;
long delta_f; long delta_f;
......
...@@ -1505,7 +1505,7 @@ static struct pci_driver s3fb_pci_driver = { ...@@ -1505,7 +1505,7 @@ static struct pci_driver s3fb_pci_driver = {
.resume = s3_pci_resume, .resume = s3_pci_resume,
}; };
/* Parse user speficied options */ /* Parse user specified options */
#ifndef MODULE #ifndef MODULE
static int __init s3fb_setup(char *options) static int __init s3fb_setup(char *options)
......
...@@ -989,7 +989,7 @@ static struct platform_device *xxxfb_device; ...@@ -989,7 +989,7 @@ static struct platform_device *xxxfb_device;
*/ */
int __init xxxfb_setup(char *options) int __init xxxfb_setup(char *options)
{ {
/* Parse user speficied options (`video=xxxfb:') */ /* Parse user specified options (`video=xxxfb:') */
} }
#endif /* MODULE */ #endif /* MODULE */
......
...@@ -48,13 +48,22 @@ static const u32 udlfb_info_flags = FBINFO_DEFAULT | FBINFO_READS_FAST | ...@@ -48,13 +48,22 @@ static const u32 udlfb_info_flags = FBINFO_DEFAULT | FBINFO_READS_FAST |
FBINFO_HWACCEL_COPYAREA | FBINFO_MISC_ALWAYS_SETPAR; FBINFO_HWACCEL_COPYAREA | FBINFO_MISC_ALWAYS_SETPAR;
/* /*
* There are many DisplayLink-based products, all with unique PIDs. We are able * There are many DisplayLink-based graphics products, all with unique PIDs.
* to support all volume ones (circa 2009) with a single driver, so we match * So we match on DisplayLink's VID + Vendor-Defined Interface Class (0xff)
* globally on VID. TODO: Probe() needs to detect when we might be running * We also require a match on SubClass (0x00) and Protocol (0x00),
* "future" chips, and bail on those, so a compatible driver can match. * which is compatible with all known USB 2.0 era graphics chips and firmware,
* but allows DisplayLink to increment those for any future incompatible chips
*/ */
static struct usb_device_id id_table[] = { static struct usb_device_id id_table[] = {
{.idVendor = 0x17e9, .match_flags = USB_DEVICE_ID_MATCH_VENDOR,}, {.idVendor = 0x17e9,
.bInterfaceClass = 0xff,
.bInterfaceSubClass = 0x00,
.bInterfaceProtocol = 0x00,
.match_flags = USB_DEVICE_ID_MATCH_VENDOR |
USB_DEVICE_ID_MATCH_INT_CLASS |
USB_DEVICE_ID_MATCH_INT_SUBCLASS |
USB_DEVICE_ID_MATCH_INT_PROTOCOL,
},
{}, {},
}; };
MODULE_DEVICE_TABLE(usb, id_table); MODULE_DEVICE_TABLE(usb, id_table);
...@@ -1613,7 +1622,7 @@ static int dlfb_usb_probe(struct usb_interface *interface, ...@@ -1613,7 +1622,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
/* We don't register a new USB class. Our client interface is fbdev */ /* We don't register a new USB class. Our client interface is fbdev */
/* allocates framebuffer driver structure, not framebuffer memory */ /* allocates framebuffer driver structure, not framebuffer memory */
info = framebuffer_alloc(0, &usbdev->dev); info = framebuffer_alloc(0, &interface->dev);
if (!info) { if (!info) {
retval = -ENOMEM; retval = -ENOMEM;
pr_err("framebuffer_alloc failed\n"); pr_err("framebuffer_alloc failed\n");
......
...@@ -555,7 +555,7 @@ static int __init valkyrie_init_info(struct fb_info *info, ...@@ -555,7 +555,7 @@ static int __init valkyrie_init_info(struct fb_info *info,
/* /*
* Parse user speficied options (`video=valkyriefb:') * Parse user specified options (`video=valkyriefb:')
*/ */
int __init valkyriefb_setup(char *options) int __init valkyriefb_setup(char *options)
{ {
......
...@@ -28,6 +28,11 @@ ...@@ -28,6 +28,11 @@
#include <linux/types.h> #include <linux/types.h>
#define VIA_PITCH_SIZE (1<<3)
#define VIA_PITCH_MAX 0x3FF8
void via_set_primary_address(u32 addr); void via_set_primary_address(u32 addr);
void via_set_secondary_address(u32 addr); void via_set_secondary_address(u32 addr);
void via_set_primary_pitch(u32 pitch); void via_set_primary_pitch(u32 pitch);
......
...@@ -151,7 +151,8 @@ static void viafb_update_fix(struct fb_info *info) ...@@ -151,7 +151,8 @@ static void viafb_update_fix(struct fb_info *info)
info->fix.visual = info->fix.visual =
bpp == 8 ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; bpp == 8 ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
info->fix.line_length = (info->var.xres_virtual * bpp / 8 + 7) & ~7; info->fix.line_length = ALIGN(info->var.xres_virtual * bpp / 8,
VIA_PITCH_SIZE);
} }
static void viafb_setup_fixinfo(struct fb_fix_screeninfo *fix, static void viafb_setup_fixinfo(struct fb_fix_screeninfo *fix,
...@@ -238,8 +239,12 @@ static int viafb_check_var(struct fb_var_screeninfo *var, ...@@ -238,8 +239,12 @@ static int viafb_check_var(struct fb_var_screeninfo *var,
depth = 24; depth = 24;
viafb_fill_var_color_info(var, depth); viafb_fill_var_color_info(var, depth);
line = (var->xres_virtual * var->bits_per_pixel / 8 + 7) & ~7; if (var->xres_virtual < var->xres)
if (line * var->yres_virtual > ppar->memsize) var->xres_virtual = var->xres;
line = ALIGN(var->xres_virtual * var->bits_per_pixel / 8,
VIA_PITCH_SIZE);
if (line > VIA_PITCH_MAX || line * var->yres_virtual > ppar->memsize)
return -EINVAL; return -EINVAL;
/* Based on var passed in to calculate the refresh, /* Based on var passed in to calculate the refresh,
...@@ -348,8 +353,9 @@ static int viafb_pan_display(struct fb_var_screeninfo *var, ...@@ -348,8 +353,9 @@ static int viafb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info) struct fb_info *info)
{ {
struct viafb_par *viapar = info->par; struct viafb_par *viapar = info->par;
u32 vram_addr = (var->yoffset * var->xres_virtual + var->xoffset) u32 vram_addr = viapar->vram_addr
* (var->bits_per_pixel / 8) + viapar->vram_addr; + var->yoffset * info->fix.line_length
+ var->xoffset * info->var.bits_per_pixel / 8;
DEBUG_MSG(KERN_DEBUG "viafb_pan_display, address = %d\n", vram_addr); DEBUG_MSG(KERN_DEBUG "viafb_pan_display, address = %d\n", vram_addr);
if (!viafb_dual_fb) { if (!viafb_dual_fb) {
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/version.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/mm.h> #include <linux/mm.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment