提交 acff987d 编写于 作者: L Linus Torvalds

Merge branch 'fbdev-next' of git://github.com/schandinat/linux-2.6

* 'fbdev-next' of git://github.com/schandinat/linux-2.6: (270 commits)
  video: platinumfb: Add __devexit_p at necessary place
  drivers/video: fsl-diu-fb: merge diu_pool into fsl_diu_data
  drivers/video: fsl-diu-fb: merge diu_hw into fsl_diu_data
  drivers/video: fsl-diu-fb: only DIU modes 0 and 1 are supported
  drivers/video: fsl-diu-fb: remove unused panel operating mode support
  drivers/video: fsl-diu-fb: use an enum for the AOI index
  drivers/video: fsl-diu-fb: add several new video modes
  drivers/video: fsl-diu-fb: remove broken screen blanking support
  drivers/video: fsl-diu-fb: move some definitions out of the header file
  drivers/video: fsl-diu-fb: fix some ioctls
  video: da8xx-fb: Increased resolution configuration of revised LCDC IP
  OMAPDSS: picodlp: add missing #include <linux/module.h>
  fb: fix au1100fb bitrot.
  mx3fb: fix NULL pointer dereference in screen blanking.
  video: irq: Remove IRQF_DISABLED
  smscufx: change edid data to u8 instead of char
  OMAPDSS: DISPC: zorder support for DSS overlays
  OMAPDSS: DISPC: VIDEO3 pipeline support
  OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting
  video/omap: fix build dependencies
  ...

Fix up conflicts in:
 - drivers/staging/xgifb/XGI_main_26.c
	Changes to XGIfb_pan_var()
 - drivers/video/omap/{lcd_apollon.c,lcd_ldp.c,lcd_overo.c}
	Removed (or in the case of apollon.c, merged into the generic
	DSS panel in drivers/video/omap2/displays/panel-generic-dpi.c)
...@@ -87,23 +87,38 @@ Special configuration for udlfb is usually unnecessary. There are a few ...@@ -87,23 +87,38 @@ Special configuration for udlfb is usually unnecessary. There are a few
options, however. options, however.
From the command line, pass options to modprobe From the command line, pass options to modprobe
modprobe udlfb defio=1 console=1 modprobe udlfb fb_defio=0 console=1 shadow=1
Or for permanent option, create file like /etc/modprobe.d/options with text Or modify options on the fly at /sys/module/udlfb/parameters directory via
options udlfb defio=1 console=1 sudo nano fb_defio
change the parameter in place, and save the file.
Accepted options: Unplug/replug USB device to apply with new settings
Or for permanent option, create file like /etc/modprobe.d/udlfb.conf with text
options udlfb fb_defio=0 console=1 shadow=1
Accepted boolean options:
fb_defio Make use of the fb_defio (CONFIG_FB_DEFERRED_IO) kernel fb_defio Make use of the fb_defio (CONFIG_FB_DEFERRED_IO) kernel
module to track changed areas of the framebuffer by page faults. module to track changed areas of the framebuffer by page faults.
Standard fbdev applications that use mmap but that do not Standard fbdev applications that use mmap but that do not
report damage, may be able to work with this enabled. report damage, should be able to work with this enabled.
Disabled by default because of overhead and other issues. Disable when running with X server that supports reporting
changed regions via ioctl, as this method is simpler,
console Allow fbcon to attach to udlfb provided framebuffers. This more stable, and higher performance.
is disabled by default because fbcon will aggressively consume default: fb_defio=1
the first framebuffer it finds, which isn't usually what the
user wants in the case of USB displays. console Allow fbcon to attach to udlfb provided framebuffers.
Can be disabled if fbcon and other clients
(e.g. X with --shared-vt) are in conflict.
default: console=1
shadow Allocate a 2nd framebuffer to shadow what's currently across
the USB bus in device memory. If any pixels are unchanged,
do not transmit. Spends host memory to save USB transfers.
Enabled by default. Only disable on very low memory systems.
default: shadow=1
Sysfs Attributes Sysfs Attributes
================ ================
......
...@@ -5970,6 +5970,12 @@ L: netdev@vger.kernel.org ...@@ -5970,6 +5970,12 @@ L: netdev@vger.kernel.org
S: Supported S: Supported
F: drivers/net/ethernet/smsc/smsc9420.* F: drivers/net/ethernet/smsc/smsc9420.*
SMSC UFX6000 and UFX7000 USB to VGA DRIVER
M: Steve Glendinning <steve.glendinning@smsc.com>
L: linux-fbdev@vger.kernel.org
S: Supported
F: drivers/video/smscufx.c
SN-IA64 (Itanium) SUB-PLATFORM SN-IA64 (Itanium) SUB-PLATFORM
M: Jes Sorensen <jes@sgi.com> M: Jes Sorensen <jes@sgi.com>
L: linux-altix@sgi.com L: linux-altix@sgi.com
......
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
#include <plat/usb.h> #include <plat/usb.h>
#include <plat/gpmc-smc91x.h> #include <plat/gpmc-smc91x.h>
#include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h>
#include "mux.h" #include "mux.h"
#include "hsmmc.h" #include "hsmmc.h"
#include "common-board-devices.h" #include "common-board-devices.h"
...@@ -99,20 +102,72 @@ static struct platform_device sdp2430_flash_device = { ...@@ -99,20 +102,72 @@ static struct platform_device sdp2430_flash_device = {
.resource = &sdp2430_flash_resource, .resource = &sdp2430_flash_resource,
}; };
static struct platform_device sdp2430_lcd_device = {
.name = "sdp2430_lcd",
.id = -1,
};
static struct platform_device *sdp2430_devices[] __initdata = { static struct platform_device *sdp2430_devices[] __initdata = {
&sdp2430_flash_device, &sdp2430_flash_device,
};
/* LCD */
#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91
#define SDP2430_LCD_PANEL_ENABLE_GPIO 154
static int sdp2430_panel_enable_lcd(struct omap_dss_device *dssdev)
{
gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 1);
gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 1);
return 0;
}
static void sdp2430_panel_disable_lcd(struct omap_dss_device *dssdev)
{
gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 0);
gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 0);
}
static struct panel_generic_dpi_data sdp2430_panel_data = {
.name = "nec_nl2432dr22-11b",
.platform_enable = sdp2430_panel_enable_lcd,
.platform_disable = sdp2430_panel_disable_lcd,
};
static struct omap_dss_device sdp2430_lcd_device = {
.name = "lcd",
.driver_name = "generic_dpi_panel",
.type = OMAP_DISPLAY_TYPE_DPI,
.phy.dpi.data_lines = 16,
.data = &sdp2430_panel_data,
};
static struct omap_dss_device *sdp2430_dss_devices[] = {
&sdp2430_lcd_device, &sdp2430_lcd_device,
}; };
static struct omap_lcd_config sdp2430_lcd_config __initdata = { static struct omap_dss_board_info sdp2430_dss_data = {
.ctrl_name = "internal", .num_devices = ARRAY_SIZE(sdp2430_dss_devices),
.devices = sdp2430_dss_devices,
.default_device = &sdp2430_lcd_device,
}; };
static void __init sdp2430_display_init(void)
{
int r;
static struct gpio gpios[] __initdata = {
{ SDP2430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW,
"LCD reset" },
{ SDP2430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW,
"LCD Backlight" },
};
r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
if (r) {
pr_err("Cannot request LCD GPIOs, error %d\n", r);
return;
}
omap_display_init(&sdp2430_dss_data);
}
#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE) #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91x_MODULE)
static struct omap_smc91x_platform_data board_smc91x_data = { static struct omap_smc91x_platform_data board_smc91x_data = {
...@@ -137,10 +192,6 @@ static inline void board_smc91x_init(void) ...@@ -137,10 +192,6 @@ static inline void board_smc91x_init(void)
#endif #endif
static struct omap_board_config_kernel sdp2430_config[] __initdata = {
{OMAP_TAG_LCD, &sdp2430_lcd_config},
};
static void __init omap_2430sdp_init_early(void) static void __init omap_2430sdp_init_early(void)
{ {
omap2_init_common_infrastructure(); omap2_init_common_infrastructure();
...@@ -229,9 +280,6 @@ static void __init omap_2430sdp_init(void) ...@@ -229,9 +280,6 @@ static void __init omap_2430sdp_init(void)
{ {
omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC);
omap_board_config = sdp2430_config;
omap_board_config_size = ARRAY_SIZE(sdp2430_config);
omap2430_i2c_init(); omap2430_i2c_init();
platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
...@@ -247,6 +295,8 @@ static void __init omap_2430sdp_init(void) ...@@ -247,6 +295,8 @@ static void __init omap_2430sdp_init(void)
/* Turn off secondary LCD backlight */ /* Turn off secondary LCD backlight */
gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW, gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW,
"Secondary LCD backlight"); "Secondary LCD backlight");
sdp2430_display_init();
} }
static void __init omap_2430sdp_map_io(void) static void __init omap_2430sdp_map_io(void)
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <plat/dma.h> #include <plat/dma.h>
#include <plat/gpmc.h> #include <plat/gpmc.h>
#include <video/omapdss.h> #include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h> #include <video/omap-panel-dvi.h>
#include <plat/gpmc-smc91x.h> #include <plat/gpmc-smc91x.h>
...@@ -186,8 +186,7 @@ static struct omap_dss_device sdp3430_lcd_device = { ...@@ -186,8 +186,7 @@ static struct omap_dss_device sdp3430_lcd_device = {
.platform_disable = sdp3430_panel_disable_lcd, .platform_disable = sdp3430_panel_disable_lcd,
}; };
static struct panel_generic_dpi_data dvi_panel = { static struct panel_dvi_platform_data dvi_panel = {
.name = "generic",
.platform_enable = sdp3430_panel_enable_dvi, .platform_enable = sdp3430_panel_enable_dvi,
.platform_disable = sdp3430_panel_disable_dvi, .platform_disable = sdp3430_panel_disable_dvi,
}; };
...@@ -195,7 +194,7 @@ static struct panel_generic_dpi_data dvi_panel = { ...@@ -195,7 +194,7 @@ static struct panel_generic_dpi_data dvi_panel = {
static struct omap_dss_device sdp3430_dvi_device = { static struct omap_dss_device sdp3430_dvi_device = {
.name = "dvi", .name = "dvi",
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.driver_name = "generic_dpi_panel", .driver_name = "dvi",
.data = &dvi_panel, .data = &dvi_panel,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
}; };
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#include <plat/mmc.h> #include <plat/mmc.h>
#include <plat/omap4-keypad.h> #include <plat/omap4-keypad.h>
#include <video/omapdss.h> #include <video/omapdss.h>
#include <video/omap-panel-nokia-dsi.h>
#include <video/omap-panel-picodlp.h>
#include <linux/wl12xx.h> #include <linux/wl12xx.h>
#include "mux.h" #include "mux.h"
...@@ -52,6 +54,8 @@ ...@@ -52,6 +54,8 @@
#define OMAP4_SFH7741_ENABLE_GPIO 188 #define OMAP4_SFH7741_ENABLE_GPIO 188
#define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */ #define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
#define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
#define DLP_POWER_ON_GPIO 40
#define GPIO_WIFI_PMENA 54 #define GPIO_WIFI_PMENA 54
#define GPIO_WIFI_IRQ 53 #define GPIO_WIFI_IRQ 53
...@@ -340,11 +344,6 @@ static int __init omap_ethernet_init(void) ...@@ -340,11 +344,6 @@ static int __init omap_ethernet_init(void)
return status; return status;
} }
static struct platform_device sdp4430_lcd_device = {
.name = "sdp4430_lcd",
.id = -1,
};
static struct regulator_consumer_supply sdp4430_vbat_supply[] = { static struct regulator_consumer_supply sdp4430_vbat_supply[] = {
REGULATOR_SUPPLY("vddvibl", "twl6040-vibra"), REGULATOR_SUPPLY("vddvibl", "twl6040-vibra"),
REGULATOR_SUPPLY("vddvibr", "twl6040-vibra"), REGULATOR_SUPPLY("vddvibr", "twl6040-vibra"),
...@@ -374,21 +373,12 @@ static struct platform_device sdp4430_vbat = { ...@@ -374,21 +373,12 @@ static struct platform_device sdp4430_vbat = {
}; };
static struct platform_device *sdp4430_devices[] __initdata = { static struct platform_device *sdp4430_devices[] __initdata = {
&sdp4430_lcd_device,
&sdp4430_gpio_keys_device, &sdp4430_gpio_keys_device,
&sdp4430_leds_gpio, &sdp4430_leds_gpio,
&sdp4430_leds_pwm, &sdp4430_leds_pwm,
&sdp4430_vbat, &sdp4430_vbat,
}; };
static struct omap_lcd_config sdp4430_lcd_config __initdata = {
.ctrl_name = "internal",
};
static struct omap_board_config_kernel sdp4430_config[] __initdata = {
{ OMAP_TAG_LCD, &sdp4430_lcd_config },
};
static void __init omap_4430sdp_init_early(void) static void __init omap_4430sdp_init_early(void)
{ {
omap2_init_common_infrastructure(); omap2_init_common_infrastructure();
...@@ -648,37 +638,202 @@ static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev) ...@@ -648,37 +638,202 @@ static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)
gpio_free(HDMI_GPIO_HPD); gpio_free(HDMI_GPIO_HPD);
} }
static struct omap_dss_device sdp4430_hdmi_device = { static struct nokia_dsi_panel_data dsi1_panel = {
.name = "hdmi", .name = "taal",
.driver_name = "hdmi_panel", .reset_gpio = 102,
.type = OMAP_DISPLAY_TYPE_HDMI, .use_ext_te = false,
.clocks = { .ext_te_gpio = 101,
.dispc = { .esd_interval = 0,
};
static struct omap_dss_device sdp4430_lcd_device = {
.name = "lcd",
.driver_name = "taal",
.type = OMAP_DISPLAY_TYPE_DSI,
.data = &dsi1_panel,
.phy.dsi = {
.clk_lane = 1,
.clk_pol = 0,
.data1_lane = 2,
.data1_pol = 0,
.data2_lane = 3,
.data2_pol = 0,
.module = 0,
},
.clocks = {
.dispc = {
.channel = {
/* Logic Clock = 172.8 MHz */
.lck_div = 1,
/* Pixel Clock = 34.56 MHz */
.pck_div = 5,
.lcd_clk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC,
},
.dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK, .dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,
}, },
.hdmi = {
.regn = 15, .dsi = {
.regm2 = 1, .regn = 16, /* Fint = 2.4 MHz */
.regm = 180, /* DDR Clock = 216 MHz */
.regm_dispc = 5, /* PLL1_CLK1 = 172.8 MHz */
.regm_dsi = 5, /* PLL1_CLK2 = 172.8 MHz */
.lp_clk_div = 10, /* LP Clock = 8.64 MHz */
.dsi_fclk_src = OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI,
},
},
.channel = OMAP_DSS_CHANNEL_LCD,
};
static struct nokia_dsi_panel_data dsi2_panel = {
.name = "taal",
.reset_gpio = 104,
.use_ext_te = false,
.ext_te_gpio = 103,
.esd_interval = 0,
};
static struct omap_dss_device sdp4430_lcd2_device = {
.name = "lcd2",
.driver_name = "taal",
.type = OMAP_DISPLAY_TYPE_DSI,
.data = &dsi2_panel,
.phy.dsi = {
.clk_lane = 1,
.clk_pol = 0,
.data1_lane = 2,
.data1_pol = 0,
.data2_lane = 3,
.data2_pol = 0,
.module = 1,
},
.clocks = {
.dispc = {
.channel = {
/* Logic Clock = 172.8 MHz */
.lck_div = 1,
/* Pixel Clock = 34.56 MHz */
.pck_div = 5,
.lcd_clk_src = OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC,
},
.dispc_fclk_src = OMAP_DSS_CLK_SRC_FCK,
},
.dsi = {
.regn = 16, /* Fint = 2.4 MHz */
.regm = 180, /* DDR Clock = 216 MHz */
.regm_dispc = 5, /* PLL1_CLK1 = 172.8 MHz */
.regm_dsi = 5, /* PLL1_CLK2 = 172.8 MHz */
.lp_clk_div = 10, /* LP Clock = 8.64 MHz */
.dsi_fclk_src = OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI,
}, },
}, },
.channel = OMAP_DSS_CHANNEL_LCD2,
};
static void sdp4430_lcd_init(void)
{
int r;
r = gpio_request_one(dsi1_panel.reset_gpio, GPIOF_DIR_OUT,
"lcd1_reset_gpio");
if (r)
pr_err("%s: Could not get lcd1_reset_gpio\n", __func__);
r = gpio_request_one(dsi2_panel.reset_gpio, GPIOF_DIR_OUT,
"lcd2_reset_gpio");
if (r)
pr_err("%s: Could not get lcd2_reset_gpio\n", __func__);
}
static struct omap_dss_device sdp4430_hdmi_device = {
.name = "hdmi",
.driver_name = "hdmi_panel",
.type = OMAP_DISPLAY_TYPE_HDMI,
.platform_enable = sdp4430_panel_enable_hdmi, .platform_enable = sdp4430_panel_enable_hdmi,
.platform_disable = sdp4430_panel_disable_hdmi, .platform_disable = sdp4430_panel_disable_hdmi,
.channel = OMAP_DSS_CHANNEL_DIGIT, .channel = OMAP_DSS_CHANNEL_DIGIT,
}; };
static struct picodlp_panel_data sdp4430_picodlp_pdata = {
.picodlp_adapter_id = 2,
.emu_done_gpio = 44,
.pwrgood_gpio = 45,
};
static void sdp4430_picodlp_init(void)
{
int r;
const struct gpio picodlp_gpios[] = {
{DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
"DLP POWER ON"},
{sdp4430_picodlp_pdata.emu_done_gpio, GPIOF_IN,
"DLP EMU DONE"},
{sdp4430_picodlp_pdata.pwrgood_gpio, GPIOF_OUT_INIT_LOW,
"DLP PWRGOOD"},
};
r = gpio_request_array(picodlp_gpios, ARRAY_SIZE(picodlp_gpios));
if (r)
pr_err("Cannot request PicoDLP GPIOs, error %d\n", r);
}
static int sdp4430_panel_enable_picodlp(struct omap_dss_device *dssdev)
{
gpio_set_value(DISPLAY_SEL_GPIO, 0);
gpio_set_value(DLP_POWER_ON_GPIO, 1);
return 0;
}
static void sdp4430_panel_disable_picodlp(struct omap_dss_device *dssdev)
{
gpio_set_value(DLP_POWER_ON_GPIO, 0);
gpio_set_value(DISPLAY_SEL_GPIO, 1);
}
static struct omap_dss_device sdp4430_picodlp_device = {
.name = "picodlp",
.driver_name = "picodlp_panel",
.type = OMAP_DISPLAY_TYPE_DPI,
.phy.dpi.data_lines = 24,
.channel = OMAP_DSS_CHANNEL_LCD2,
.platform_enable = sdp4430_panel_enable_picodlp,
.platform_disable = sdp4430_panel_disable_picodlp,
.data = &sdp4430_picodlp_pdata,
};
static struct omap_dss_device *sdp4430_dss_devices[] = { static struct omap_dss_device *sdp4430_dss_devices[] = {
&sdp4430_lcd_device,
&sdp4430_lcd2_device,
&sdp4430_hdmi_device, &sdp4430_hdmi_device,
&sdp4430_picodlp_device,
}; };
static struct omap_dss_board_info sdp4430_dss_data = { static struct omap_dss_board_info sdp4430_dss_data = {
.num_devices = ARRAY_SIZE(sdp4430_dss_devices), .num_devices = ARRAY_SIZE(sdp4430_dss_devices),
.devices = sdp4430_dss_devices, .devices = sdp4430_dss_devices,
.default_device = &sdp4430_hdmi_device, .default_device = &sdp4430_lcd_device,
}; };
void omap_4430sdp_display_init(void) static void omap_4430sdp_display_init(void)
{ {
int r;
/* Enable LCD2 by default (instead of Pico DLP) */
r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
"display_sel");
if (r)
pr_err("%s: Could not get display_sel GPIO\n", __func__);
sdp4430_lcd_init();
sdp4430_hdmi_mux_init(); sdp4430_hdmi_mux_init();
sdp4430_picodlp_init();
omap_display_init(&sdp4430_dss_data); omap_display_init(&sdp4430_dss_data);
} }
...@@ -802,9 +957,6 @@ static void __init omap_4430sdp_init(void) ...@@ -802,9 +957,6 @@ static void __init omap_4430sdp_init(void)
package = OMAP_PACKAGE_CBL; package = OMAP_PACKAGE_CBL;
omap4_mux_init(board_mux, NULL, package); omap4_mux_init(board_mux, NULL, package);
omap_board_config = sdp4430_config;
omap_board_config_size = ARRAY_SIZE(sdp4430_config);
omap4_i2c_init(); omap4_i2c_init();
omap_sfh7741prox_init(); omap_sfh7741prox_init();
platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <plat/usb.h> #include <plat/usb.h>
#include <video/omapdss.h> #include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h> #include <video/omap-panel-generic-dpi.h>
#include <video/omap-panel-dvi.h>
#include "mux.h" #include "mux.h"
#include "control.h" #include "control.h"
...@@ -333,8 +334,7 @@ static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) ...@@ -333,8 +334,7 @@ static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev)
dvi_enabled = 0; dvi_enabled = 0;
} }
static struct panel_generic_dpi_data dvi_panel = { static struct panel_dvi_platform_data dvi_panel = {
.name = "generic",
.platform_enable = am3517_evm_panel_enable_dvi, .platform_enable = am3517_evm_panel_enable_dvi,
.platform_disable = am3517_evm_panel_disable_dvi, .platform_disable = am3517_evm_panel_disable_dvi,
}; };
...@@ -342,7 +342,7 @@ static struct panel_generic_dpi_data dvi_panel = { ...@@ -342,7 +342,7 @@ static struct panel_generic_dpi_data dvi_panel = {
static struct omap_dss_device am3517_evm_dvi_device = { static struct omap_dss_device am3517_evm_dvi_device = {
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.name = "dvi", .name = "dvi",
.driver_name = "generic_dpi_panel", .driver_name = "dvi",
.data = &dvi_panel, .data = &dvi_panel,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
}; };
......
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
#include <plat/common.h> #include <plat/common.h>
#include <plat/gpmc.h> #include <plat/gpmc.h>
#include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h>
#include "mux.h" #include "mux.h"
#include "control.h" #include "control.h"
...@@ -149,11 +152,6 @@ static struct platform_device apollon_smc91x_device = { ...@@ -149,11 +152,6 @@ static struct platform_device apollon_smc91x_device = {
.resource = apollon_smc91x_resources, .resource = apollon_smc91x_resources,
}; };
static struct platform_device apollon_lcd_device = {
.name = "apollon_lcd",
.id = -1,
};
static struct omap_led_config apollon_led_config[] = { static struct omap_led_config apollon_led_config[] = {
{ {
.cdev = { .cdev = {
...@@ -191,7 +189,6 @@ static struct platform_device apollon_led_device = { ...@@ -191,7 +189,6 @@ static struct platform_device apollon_led_device = {
static struct platform_device *apollon_devices[] __initdata = { static struct platform_device *apollon_devices[] __initdata = {
&apollon_onenand_device, &apollon_onenand_device,
&apollon_smc91x_device, &apollon_smc91x_device,
&apollon_lcd_device,
&apollon_led_device, &apollon_led_device,
}; };
...@@ -265,12 +262,26 @@ static struct omap_usb_config apollon_usb_config __initdata = { ...@@ -265,12 +262,26 @@ static struct omap_usb_config apollon_usb_config __initdata = {
.pins[0] = 6, .pins[0] = 6,
}; };
static struct omap_lcd_config apollon_lcd_config __initdata = { static struct panel_generic_dpi_data apollon_panel_data = {
.ctrl_name = "internal", .name = "apollon",
}; };
static struct omap_board_config_kernel apollon_config[] __initdata = { static struct omap_dss_device apollon_lcd_device = {
{ OMAP_TAG_LCD, &apollon_lcd_config }, .name = "lcd",
.driver_name = "generic_dpi_panel",
.type = OMAP_DISPLAY_TYPE_DPI,
.phy.dpi.data_lines = 18,
.data = &apollon_panel_data,
};
static struct omap_dss_device *apollon_dss_devices[] = {
&apollon_lcd_device,
};
static struct omap_dss_board_info apollon_dss_data = {
.num_devices = ARRAY_SIZE(apollon_dss_devices),
.devices = apollon_dss_devices,
.default_device = &apollon_lcd_device,
}; };
static void __init omap_apollon_init_early(void) static void __init omap_apollon_init_early(void)
...@@ -314,8 +325,6 @@ static void __init omap_apollon_init(void) ...@@ -314,8 +325,6 @@ static void __init omap_apollon_init(void)
u32 v; u32 v;
omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
omap_board_config = apollon_config;
omap_board_config_size = ARRAY_SIZE(apollon_config);
apollon_init_smc91x(); apollon_init_smc91x();
apollon_led_init(); apollon_led_init();
...@@ -340,6 +349,8 @@ static void __init omap_apollon_init(void) ...@@ -340,6 +349,8 @@ static void __init omap_apollon_init(void)
*/ */
platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices)); platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices));
omap_serial_init(); omap_serial_init();
omap_display_init(&apollon_dss_data);
} }
static void __init omap_apollon_map_io(void) static void __init omap_apollon_map_io(void)
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <plat/usb.h> #include <plat/usb.h>
#include <video/omapdss.h> #include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h> #include <video/omap-panel-generic-dpi.h>
#include <video/omap-panel-dvi.h>
#include <plat/mcspi.h> #include <plat/mcspi.h>
#include <mach/hardware.h> #include <mach/hardware.h>
...@@ -242,8 +243,7 @@ static struct omap_dss_device cm_t35_lcd_device = { ...@@ -242,8 +243,7 @@ static struct omap_dss_device cm_t35_lcd_device = {
.phy.dpi.data_lines = 18, .phy.dpi.data_lines = 18,
}; };
static struct panel_generic_dpi_data dvi_panel = { static struct panel_dvi_platform_data dvi_panel = {
.name = "generic",
.platform_enable = cm_t35_panel_enable_dvi, .platform_enable = cm_t35_panel_enable_dvi,
.platform_disable = cm_t35_panel_disable_dvi, .platform_disable = cm_t35_panel_disable_dvi,
}; };
...@@ -251,7 +251,7 @@ static struct panel_generic_dpi_data dvi_panel = { ...@@ -251,7 +251,7 @@ static struct panel_generic_dpi_data dvi_panel = {
static struct omap_dss_device cm_t35_dvi_device = { static struct omap_dss_device cm_t35_dvi_device = {
.name = "dvi", .name = "dvi",
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.driver_name = "generic_dpi_panel", .driver_name = "dvi",
.data = &dvi_panel, .data = &dvi_panel,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
}; };
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <plat/usb.h> #include <plat/usb.h>
#include <video/omapdss.h> #include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h> #include <video/omap-panel-generic-dpi.h>
#include <video/omap-panel-dvi.h>
#include <plat/mcspi.h> #include <plat/mcspi.h>
#include <linux/input/matrix_keypad.h> #include <linux/input/matrix_keypad.h>
...@@ -139,7 +140,7 @@ static struct regulator_consumer_supply devkit8000_vio_supply[] = { ...@@ -139,7 +140,7 @@ static struct regulator_consumer_supply devkit8000_vio_supply[] = {
}; };
static struct panel_generic_dpi_data lcd_panel = { static struct panel_generic_dpi_data lcd_panel = {
.name = "generic", .name = "innolux_at070tn83",
.platform_enable = devkit8000_panel_enable_lcd, .platform_enable = devkit8000_panel_enable_lcd,
.platform_disable = devkit8000_panel_disable_lcd, .platform_disable = devkit8000_panel_disable_lcd,
}; };
...@@ -152,8 +153,7 @@ static struct omap_dss_device devkit8000_lcd_device = { ...@@ -152,8 +153,7 @@ static struct omap_dss_device devkit8000_lcd_device = {
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
}; };
static struct panel_generic_dpi_data dvi_panel = { static struct panel_dvi_platform_data dvi_panel = {
.name = "generic",
.platform_enable = devkit8000_panel_enable_dvi, .platform_enable = devkit8000_panel_enable_dvi,
.platform_disable = devkit8000_panel_disable_dvi, .platform_disable = devkit8000_panel_disable_dvi,
}; };
...@@ -161,7 +161,7 @@ static struct panel_generic_dpi_data dvi_panel = { ...@@ -161,7 +161,7 @@ static struct panel_generic_dpi_data dvi_panel = {
static struct omap_dss_device devkit8000_dvi_device = { static struct omap_dss_device devkit8000_dvi_device = {
.name = "dvi", .name = "dvi",
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.driver_name = "generic_dpi_panel", .driver_name = "dvi",
.data = &dvi_panel, .data = &dvi_panel,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
}; };
...@@ -267,7 +267,7 @@ static struct twl4030_gpio_platform_data devkit8000_gpio_data = { ...@@ -267,7 +267,7 @@ static struct twl4030_gpio_platform_data devkit8000_gpio_data = {
static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = { static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = {
REGULATOR_SUPPLY("vdds_dsi", "omapdss"), REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),
}; };
/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
......
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
#include <plat/dma.h> #include <plat/dma.h>
#include <plat/gpmc.h> #include <plat/gpmc.h>
#include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h>
#include "mux.h" #include "mux.h"
#include "control.h" #include "control.h"
...@@ -156,17 +159,33 @@ static struct platform_device h4_kp_device = { ...@@ -156,17 +159,33 @@ static struct platform_device h4_kp_device = {
}, },
}; };
static struct platform_device h4_lcd_device = {
.name = "lcd_h4",
.id = -1,
};
static struct platform_device *h4_devices[] __initdata = { static struct platform_device *h4_devices[] __initdata = {
&h4_flash_device, &h4_flash_device,
&h4_kp_device, &h4_kp_device,
};
static struct panel_generic_dpi_data h4_panel_data = {
.name = "h4",
};
static struct omap_dss_device h4_lcd_device = {
.name = "lcd",
.driver_name = "generic_dpi_panel",
.type = OMAP_DISPLAY_TYPE_DPI,
.phy.dpi.data_lines = 16,
.data = &h4_panel_data,
};
static struct omap_dss_device *h4_dss_devices[] = {
&h4_lcd_device, &h4_lcd_device,
}; };
static struct omap_dss_board_info h4_dss_data = {
.num_devices = ARRAY_SIZE(h4_dss_devices),
.devices = h4_dss_devices,
.default_device = &h4_lcd_device,
};
/* 2420 Sysboot setup (2430 is different) */ /* 2420 Sysboot setup (2430 is different) */
static u32 get_sysboot_value(void) static u32 get_sysboot_value(void)
{ {
...@@ -270,10 +289,6 @@ static void __init h4_init_flash(void) ...@@ -270,10 +289,6 @@ static void __init h4_init_flash(void)
h4_flash_resource.end = base + SZ_64M - 1; h4_flash_resource.end = base + SZ_64M - 1;
} }
static struct omap_lcd_config h4_lcd_config __initdata = {
.ctrl_name = "internal",
};
static struct omap_usb_config h4_usb_config __initdata = { static struct omap_usb_config h4_usb_config __initdata = {
/* S1.10 OFF -- usb "download port" /* S1.10 OFF -- usb "download port"
* usb0 switched to Mini-B port and isp1105 transceiver; * usb0 switched to Mini-B port and isp1105 transceiver;
...@@ -285,10 +300,6 @@ static struct omap_usb_config h4_usb_config __initdata = { ...@@ -285,10 +300,6 @@ static struct omap_usb_config h4_usb_config __initdata = {
.hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable */ .hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable */
}; };
static struct omap_board_config_kernel h4_config[] __initdata = {
{ OMAP_TAG_LCD, &h4_lcd_config },
};
static void __init omap_h4_init_early(void) static void __init omap_h4_init_early(void)
{ {
omap2_init_common_infrastructure(); omap2_init_common_infrastructure();
...@@ -330,9 +341,6 @@ static void __init omap_h4_init(void) ...@@ -330,9 +341,6 @@ static void __init omap_h4_init(void)
{ {
omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF);
omap_board_config = h4_config;
omap_board_config_size = ARRAY_SIZE(h4_config);
/* /*
* Make sure the serial ports are muxed on at this point. * Make sure the serial ports are muxed on at this point.
* You have to mux them off in device drivers later on * You have to mux them off in device drivers later on
...@@ -371,6 +379,8 @@ static void __init omap_h4_init(void) ...@@ -371,6 +379,8 @@ static void __init omap_h4_init(void)
omap2_usbfs_init(&h4_usb_config); omap2_usbfs_init(&h4_usb_config);
omap_serial_init(); omap_serial_init();
h4_init_flash(); h4_init_flash();
omap_display_init(&h4_dss_data);
} }
static void __init omap_h4_map_io(void) static void __init omap_h4_map_io(void)
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <plat/gpmc.h> #include <plat/gpmc.h>
#include <plat/usb.h> #include <plat/usb.h>
#include <video/omapdss.h> #include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h> #include <video/omap-panel-dvi.h>
#include <plat/onenand.h> #include <plat/onenand.h>
#include "mux.h" #include "mux.h"
...@@ -455,16 +455,16 @@ static void igep2_disable_dvi(struct omap_dss_device *dssdev) ...@@ -455,16 +455,16 @@ static void igep2_disable_dvi(struct omap_dss_device *dssdev)
gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0); gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0);
} }
static struct panel_generic_dpi_data dvi_panel = { static struct panel_dvi_platform_data dvi_panel = {
.name = "generic",
.platform_enable = igep2_enable_dvi, .platform_enable = igep2_enable_dvi,
.platform_disable = igep2_disable_dvi, .platform_disable = igep2_disable_dvi,
.i2c_bus_num = 3,
}; };
static struct omap_dss_device igep2_dvi_device = { static struct omap_dss_device igep2_dvi_device = {
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.name = "dvi", .name = "dvi",
.driver_name = "generic_dpi_panel", .driver_name = "dvi",
.data = &dvi_panel, .data = &dvi_panel,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
}; };
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/smsc911x.h> #include <linux/smsc911x.h>
#include <linux/mmc/host.h> #include <linux/mmc/host.h>
#include <linux/gpio.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -43,6 +44,9 @@ ...@@ -43,6 +44,9 @@
#include <plat/usb.h> #include <plat/usb.h>
#include <plat/gpmc-smsc911x.h> #include <plat/gpmc-smsc911x.h>
#include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h>
#include "board-flash.h" #include "board-flash.h"
#include "mux.h" #include "mux.h"
#include "hsmmc.h" #include "hsmmc.h"
...@@ -179,29 +183,108 @@ static inline void __init ldp_init_smsc911x(void) ...@@ -179,29 +183,108 @@ static inline void __init ldp_init_smsc911x(void)
gpmc_smsc911x_init(&smsc911x_cfg); gpmc_smsc911x_init(&smsc911x_cfg);
} }
static struct platform_device ldp_lcd_device = { /* LCD */
.name = "ldp_lcd",
.id = -1, static int ldp_backlight_gpio;
static int ldp_lcd_enable_gpio;
#define LCD_PANEL_RESET_GPIO 55
#define LCD_PANEL_QVGA_GPIO 56
static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
{
if (gpio_is_valid(ldp_lcd_enable_gpio))
gpio_direction_output(ldp_lcd_enable_gpio, 1);
if (gpio_is_valid(ldp_backlight_gpio))
gpio_direction_output(ldp_backlight_gpio, 1);
return 0;
}
static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
{
if (gpio_is_valid(ldp_lcd_enable_gpio))
gpio_direction_output(ldp_lcd_enable_gpio, 0);
if (gpio_is_valid(ldp_backlight_gpio))
gpio_direction_output(ldp_backlight_gpio, 0);
}
static struct panel_generic_dpi_data ldp_panel_data = {
.name = "nec_nl2432dr22-11b",
.platform_enable = ldp_panel_enable_lcd,
.platform_disable = ldp_panel_disable_lcd,
}; };
static struct omap_lcd_config ldp_lcd_config __initdata = { static struct omap_dss_device ldp_lcd_device = {
.ctrl_name = "internal", .name = "lcd",
.driver_name = "generic_dpi_panel",
.type = OMAP_DISPLAY_TYPE_DPI,
.phy.dpi.data_lines = 18,
.data = &ldp_panel_data,
};
static struct omap_dss_device *ldp_dss_devices[] = {
&ldp_lcd_device,
}; };
static struct omap_board_config_kernel ldp_config[] __initdata = { static struct omap_dss_board_info ldp_dss_data = {
{ OMAP_TAG_LCD, &ldp_lcd_config }, .num_devices = ARRAY_SIZE(ldp_dss_devices),
.devices = ldp_dss_devices,
.default_device = &ldp_lcd_device,
}; };
static void __init ldp_display_init(void)
{
int r;
static struct gpio gpios[] __initdata = {
{LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
{LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
};
r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
if (r) {
pr_err("Cannot request LCD GPIOs, error %d\n", r);
return;
}
omap_display_init(&ldp_dss_data);
}
static void __init omap_ldp_init_early(void) static void __init omap_ldp_init_early(void)
{ {
omap2_init_common_infrastructure(); omap2_init_common_infrastructure();
omap2_init_common_devices(NULL, NULL); omap2_init_common_devices(NULL, NULL);
} }
static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
{
int r;
struct gpio gpios[] = {
{gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"},
{gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"},
};
r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
if (r) {
pr_err("Cannot request LCD GPIOs, error %d\n", r);
ldp_backlight_gpio = -EINVAL;
ldp_lcd_enable_gpio = -EINVAL;
return r;
}
ldp_backlight_gpio = gpio + 15;
ldp_lcd_enable_gpio = gpio + 7;
return 0;
}
static struct twl4030_gpio_platform_data ldp_gpio_data = { static struct twl4030_gpio_platform_data ldp_gpio_data = {
.gpio_base = OMAP_MAX_GPIO_LINES, .gpio_base = OMAP_MAX_GPIO_LINES,
.irq_base = TWL4030_GPIO_IRQ_BASE, .irq_base = TWL4030_GPIO_IRQ_BASE,
.irq_end = TWL4030_GPIO_IRQ_END, .irq_end = TWL4030_GPIO_IRQ_END,
.setup = ldp_twl_gpio_setup,
}; };
static struct regulator_consumer_supply ldp_vmmc1_supply[] = { static struct regulator_consumer_supply ldp_vmmc1_supply[] = {
...@@ -243,10 +326,31 @@ static struct regulator_init_data ldp_vaux1 = { ...@@ -243,10 +326,31 @@ static struct regulator_init_data ldp_vaux1 = {
.consumer_supplies = ldp_vaux1_supplies, .consumer_supplies = ldp_vaux1_supplies,
}; };
static struct regulator_consumer_supply ldp_vpll2_supplies[] = {
REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
};
static struct regulator_init_data ldp_vpll2 = {
.constraints = {
.name = "VDVI",
.min_uV = 1800000,
.max_uV = 1800000,
.apply_uV = true,
.valid_modes_mask = REGULATOR_MODE_NORMAL
| REGULATOR_MODE_STANDBY,
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = ARRAY_SIZE(ldp_vpll2_supplies),
.consumer_supplies = ldp_vpll2_supplies,
};
static struct twl4030_platform_data ldp_twldata = { static struct twl4030_platform_data ldp_twldata = {
/* platform_data for children goes here */ /* platform_data for children goes here */
.vmmc1 = &ldp_vmmc1, .vmmc1 = &ldp_vmmc1,
.vaux1 = &ldp_vaux1, .vaux1 = &ldp_vaux1,
.vpll2 = &ldp_vpll2,
.gpio = &ldp_gpio_data, .gpio = &ldp_gpio_data,
.keypad = &ldp_kp_twl4030_data, .keypad = &ldp_kp_twl4030_data,
}; };
...@@ -272,7 +376,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = { ...@@ -272,7 +376,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
}; };
static struct platform_device *ldp_devices[] __initdata = { static struct platform_device *ldp_devices[] __initdata = {
&ldp_lcd_device,
&ldp_gpio_keys_device, &ldp_gpio_keys_device,
}; };
...@@ -317,8 +420,6 @@ static struct mtd_partition ldp_nand_partitions[] = { ...@@ -317,8 +420,6 @@ static struct mtd_partition ldp_nand_partitions[] = {
static void __init omap_ldp_init(void) static void __init omap_ldp_init(void)
{ {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
omap_board_config = ldp_config;
omap_board_config_size = ARRAY_SIZE(ldp_config);
ldp_init_smsc911x(); ldp_init_smsc911x();
omap_i2c_init(); omap_i2c_init();
platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
...@@ -329,6 +430,7 @@ static void __init omap_ldp_init(void) ...@@ -329,6 +430,7 @@ static void __init omap_ldp_init(void)
ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);
omap2_hsmmc_init(mmc); omap2_hsmmc_init(mmc);
ldp_display_init();
} }
MACHINE_START(OMAP_LDP, "OMAP LDP board") MACHINE_START(OMAP_LDP, "OMAP LDP board")
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include <plat/board.h> #include <plat/board.h>
#include <plat/common.h> #include <plat/common.h>
#include <video/omapdss.h> #include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h> #include <video/omap-panel-dvi.h>
#include <plat/gpmc.h> #include <plat/gpmc.h>
#include <plat/nand.h> #include <plat/nand.h>
#include <plat/usb.h> #include <plat/usb.h>
...@@ -203,16 +203,16 @@ static void beagle_disable_dvi(struct omap_dss_device *dssdev) ...@@ -203,16 +203,16 @@ static void beagle_disable_dvi(struct omap_dss_device *dssdev)
gpio_set_value(dssdev->reset_gpio, 0); gpio_set_value(dssdev->reset_gpio, 0);
} }
static struct panel_generic_dpi_data dvi_panel = { static struct panel_dvi_platform_data dvi_panel = {
.name = "generic",
.platform_enable = beagle_enable_dvi, .platform_enable = beagle_enable_dvi,
.platform_disable = beagle_disable_dvi, .platform_disable = beagle_disable_dvi,
.i2c_bus_num = 3,
}; };
static struct omap_dss_device beagle_dvi_device = { static struct omap_dss_device beagle_dvi_device = {
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.name = "dvi", .name = "dvi",
.driver_name = "generic_dpi_panel", .driver_name = "dvi",
.data = &dvi_panel, .data = &dvi_panel,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
.reset_gpio = -EINVAL, .reset_gpio = -EINVAL,
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <plat/common.h> #include <plat/common.h>
#include <plat/mcspi.h> #include <plat/mcspi.h>
#include <video/omapdss.h> #include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h> #include <video/omap-panel-dvi.h>
#include "mux.h" #include "mux.h"
#include "sdram-micron-mt46h32m32lf-6.h" #include "sdram-micron-mt46h32m32lf-6.h"
...@@ -247,8 +247,7 @@ static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev) ...@@ -247,8 +247,7 @@ static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev)
dvi_enabled = 0; dvi_enabled = 0;
} }
static struct panel_generic_dpi_data dvi_panel = { static struct panel_dvi_platform_data dvi_panel = {
.name = "generic",
.platform_enable = omap3_evm_enable_dvi, .platform_enable = omap3_evm_enable_dvi,
.platform_disable = omap3_evm_disable_dvi, .platform_disable = omap3_evm_disable_dvi,
}; };
...@@ -256,7 +255,7 @@ static struct panel_generic_dpi_data dvi_panel = { ...@@ -256,7 +255,7 @@ static struct panel_generic_dpi_data dvi_panel = {
static struct omap_dss_device omap3_evm_dvi_device = { static struct omap_dss_device omap3_evm_dvi_device = {
.name = "dvi", .name = "dvi",
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.driver_name = "generic_dpi_panel", .driver_name = "dvi",
.data = &dvi_panel, .data = &dvi_panel,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
}; };
......
...@@ -335,7 +335,7 @@ static struct regulator_consumer_supply pandora_vmmc3_supply[] = { ...@@ -335,7 +335,7 @@ static struct regulator_consumer_supply pandora_vmmc3_supply[] = {
static struct regulator_consumer_supply pandora_vdds_supplies[] = { static struct regulator_consumer_supply pandora_vdds_supplies[] = {
REGULATOR_SUPPLY("vdds_sdi", "omapdss"), REGULATOR_SUPPLY("vdds_sdi", "omapdss"),
REGULATOR_SUPPLY("vdds_dsi", "omapdss"), REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),
}; };
static struct regulator_consumer_supply pandora_vcc_lcd_supply[] = { static struct regulator_consumer_supply pandora_vcc_lcd_supply[] = {
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <plat/usb.h> #include <plat/usb.h>
#include <video/omapdss.h> #include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h> #include <video/omap-panel-generic-dpi.h>
#include <video/omap-panel-dvi.h>
#include <plat/mcspi.h> #include <plat/mcspi.h>
#include <linux/input/matrix_keypad.h> #include <linux/input/matrix_keypad.h>
...@@ -107,39 +108,6 @@ static void __init omap3_stalker_display_init(void) ...@@ -107,39 +108,6 @@ static void __init omap3_stalker_display_init(void)
return; return;
} }
static int omap3_stalker_enable_lcd(struct omap_dss_device *dssdev)
{
if (dvi_enabled) {
printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
return -EINVAL;
}
gpio_set_value(DSS_ENABLE_GPIO, 1);
gpio_set_value(LCD_PANEL_BKLIGHT_GPIO, 1);
lcd_enabled = 1;
return 0;
}
static void omap3_stalker_disable_lcd(struct omap_dss_device *dssdev)
{
gpio_set_value(DSS_ENABLE_GPIO, 0);
gpio_set_value(LCD_PANEL_BKLIGHT_GPIO, 0);
lcd_enabled = 0;
}
static struct panel_generic_dpi_data lcd_panel = {
.name = "generic",
.platform_enable = omap3_stalker_enable_lcd,
.platform_disable = omap3_stalker_disable_lcd,
};
static struct omap_dss_device omap3_stalker_lcd_device = {
.name = "lcd",
.driver_name = "generic_dpi_panel",
.data = &lcd_panel,
.phy.dpi.data_lines = 24,
.type = OMAP_DISPLAY_TYPE_DPI,
};
static int omap3_stalker_enable_tv(struct omap_dss_device *dssdev) static int omap3_stalker_enable_tv(struct omap_dss_device *dssdev)
{ {
return 0; return 0;
...@@ -179,8 +147,7 @@ static void omap3_stalker_disable_dvi(struct omap_dss_device *dssdev) ...@@ -179,8 +147,7 @@ static void omap3_stalker_disable_dvi(struct omap_dss_device *dssdev)
dvi_enabled = 0; dvi_enabled = 0;
} }
static struct panel_generic_dpi_data dvi_panel = { static struct panel_dvi_platform_data dvi_panel = {
.name = "generic",
.platform_enable = omap3_stalker_enable_dvi, .platform_enable = omap3_stalker_enable_dvi,
.platform_disable = omap3_stalker_disable_dvi, .platform_disable = omap3_stalker_disable_dvi,
}; };
...@@ -188,13 +155,12 @@ static struct panel_generic_dpi_data dvi_panel = { ...@@ -188,13 +155,12 @@ static struct panel_generic_dpi_data dvi_panel = {
static struct omap_dss_device omap3_stalker_dvi_device = { static struct omap_dss_device omap3_stalker_dvi_device = {
.name = "dvi", .name = "dvi",
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.driver_name = "generic_dpi_panel", .driver_name = "dvi",
.data = &dvi_panel, .data = &dvi_panel,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
}; };
static struct omap_dss_device *omap3_stalker_dss_devices[] = { static struct omap_dss_device *omap3_stalker_dss_devices[] = {
&omap3_stalker_lcd_device,
&omap3_stalker_tv_device, &omap3_stalker_tv_device,
&omap3_stalker_dvi_device, &omap3_stalker_dvi_device,
}; };
......
...@@ -104,15 +104,6 @@ static struct omap2_hsmmc_info mmc[] = { ...@@ -104,15 +104,6 @@ static struct omap2_hsmmc_info mmc[] = {
{} /* Terminator */ {} /* Terminator */
}; };
static struct platform_device omap3_touchbook_lcd_device = {
.name = "omap3touchbook_lcd",
.id = -1,
};
static struct omap_lcd_config omap3_touchbook_lcd_config __initdata = {
.ctrl_name = "internal",
};
static struct regulator_consumer_supply touchbook_vmmc1_supply[] = { static struct regulator_consumer_supply touchbook_vmmc1_supply[] = {
REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
}; };
...@@ -165,14 +156,12 @@ static struct twl4030_gpio_platform_data touchbook_gpio_data = { ...@@ -165,14 +156,12 @@ static struct twl4030_gpio_platform_data touchbook_gpio_data = {
static struct regulator_consumer_supply touchbook_vdac_supply[] = { static struct regulator_consumer_supply touchbook_vdac_supply[] = {
{ {
.supply = "vdac", .supply = "vdac",
.dev = &omap3_touchbook_lcd_device.dev,
}, },
}; };
static struct regulator_consumer_supply touchbook_vdvi_supply[] = { static struct regulator_consumer_supply touchbook_vdvi_supply[] = {
{ {
.supply = "vdvi", .supply = "vdvi",
.dev = &omap3_touchbook_lcd_device.dev,
}, },
}; };
...@@ -316,10 +305,6 @@ static struct platform_device keys_gpio = { ...@@ -316,10 +305,6 @@ static struct platform_device keys_gpio = {
}, },
}; };
static struct omap_board_config_kernel omap3_touchbook_config[] __initdata = {
{ OMAP_TAG_LCD, &omap3_touchbook_lcd_config },
};
#ifdef CONFIG_OMAP_MUX #ifdef CONFIG_OMAP_MUX
static struct omap_board_mux board_mux[] __initdata = { static struct omap_board_mux board_mux[] __initdata = {
{ .reg_offset = OMAP_MUX_TERMINATOR }, { .reg_offset = OMAP_MUX_TERMINATOR },
...@@ -339,7 +324,6 @@ static void __init omap3_touchbook_init_irq(void) ...@@ -339,7 +324,6 @@ static void __init omap3_touchbook_init_irq(void)
} }
static struct platform_device *omap3_touchbook_devices[] __initdata = { static struct platform_device *omap3_touchbook_devices[] __initdata = {
&omap3_touchbook_lcd_device,
&leds_gpio, &leds_gpio,
&keys_gpio, &keys_gpio,
}; };
...@@ -376,8 +360,6 @@ early_param("tbr", early_touchbook_revision); ...@@ -376,8 +360,6 @@ early_param("tbr", early_touchbook_revision);
static void __init omap3_touchbook_init(void) static void __init omap3_touchbook_init(void)
{ {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
omap_board_config = omap3_touchbook_config;
omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
pm_power_off = omap3_touchbook_poweroff; pm_power_off = omap3_touchbook_poweroff;
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include <plat/common.h> #include <plat/common.h>
#include <plat/usb.h> #include <plat/usb.h>
#include <plat/mmc.h> #include <plat/mmc.h>
#include <video/omap-panel-generic-dpi.h> #include <video/omap-panel-dvi.h>
#include "hsmmc.h" #include "hsmmc.h"
#include "control.h" #include "control.h"
...@@ -455,16 +455,16 @@ static void omap4_panda_disable_dvi(struct omap_dss_device *dssdev) ...@@ -455,16 +455,16 @@ static void omap4_panda_disable_dvi(struct omap_dss_device *dssdev)
} }
/* Using generic display panel */ /* Using generic display panel */
static struct panel_generic_dpi_data omap4_dvi_panel = { static struct panel_dvi_platform_data omap4_dvi_panel = {
.name = "generic",
.platform_enable = omap4_panda_enable_dvi, .platform_enable = omap4_panda_enable_dvi,
.platform_disable = omap4_panda_disable_dvi, .platform_disable = omap4_panda_disable_dvi,
.i2c_bus_num = 3,
}; };
struct omap_dss_device omap4_panda_dvi_device = { struct omap_dss_device omap4_panda_dvi_device = {
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.name = "dvi", .name = "dvi",
.driver_name = "generic_dpi_panel", .driver_name = "dvi",
.data = &omap4_dvi_panel, .data = &omap4_dvi_panel,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
.reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO, .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include <plat/common.h> #include <plat/common.h>
#include <video/omapdss.h> #include <video/omapdss.h>
#include <video/omap-panel-generic-dpi.h> #include <video/omap-panel-generic-dpi.h>
#include <video/omap-panel-dvi.h>
#include <plat/gpmc.h> #include <plat/gpmc.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <plat/nand.h> #include <plat/nand.h>
...@@ -182,16 +183,16 @@ static void overo_panel_disable_dvi(struct omap_dss_device *dssdev) ...@@ -182,16 +183,16 @@ static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
dvi_enabled = 0; dvi_enabled = 0;
} }
static struct panel_generic_dpi_data dvi_panel = { static struct panel_dvi_platform_data dvi_panel = {
.name = "generic",
.platform_enable = overo_panel_enable_dvi, .platform_enable = overo_panel_enable_dvi,
.platform_disable = overo_panel_disable_dvi, .platform_disable = overo_panel_disable_dvi,
.i2c_bus_num = 3,
}; };
static struct omap_dss_device overo_dvi_device = { static struct omap_dss_device overo_dvi_device = {
.name = "dvi", .name = "dvi",
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.driver_name = "generic_dpi_panel", .driver_name = "dvi",
.data = &dvi_panel, .data = &dvi_panel,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
}; };
......
...@@ -79,29 +79,6 @@ static struct cpuidle_params rx51_cpuidle_params[] = { ...@@ -79,29 +79,6 @@ static struct cpuidle_params rx51_cpuidle_params[] = {
{7505 + 15274, 484329, 1}, {7505 + 15274, 484329, 1},
}; };
static struct omap_lcd_config rx51_lcd_config = {
.ctrl_name = "internal",
};
static struct omap_fbmem_config rx51_fbmem0_config = {
.size = 752 * 1024,
};
static struct omap_fbmem_config rx51_fbmem1_config = {
.size = 752 * 1024,
};
static struct omap_fbmem_config rx51_fbmem2_config = {
.size = 752 * 1024,
};
static struct omap_board_config_kernel rx51_config[] = {
{ OMAP_TAG_FBMEM, &rx51_fbmem0_config },
{ OMAP_TAG_FBMEM, &rx51_fbmem1_config },
{ OMAP_TAG_FBMEM, &rx51_fbmem2_config },
{ OMAP_TAG_LCD, &rx51_lcd_config },
};
static void __init rx51_init_early(void) static void __init rx51_init_early(void)
{ {
struct omap_sdrc_params *sdrc_params; struct omap_sdrc_params *sdrc_params;
...@@ -128,8 +105,6 @@ static struct omap_musb_board_data musb_board_data = { ...@@ -128,8 +105,6 @@ static struct omap_musb_board_data musb_board_data = {
static void __init rx51_init(void) static void __init rx51_init(void)
{ {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
omap_board_config = rx51_config;
omap_board_config_size = ARRAY_SIZE(rx51_config);
omap3_pm_init_cpuidle(rx51_cpuidle_params); omap3_pm_init_cpuidle(rx51_cpuidle_params);
omap_serial_init(); omap_serial_init();
usb_musb_init(&musb_board_data); usb_musb_init(&musb_board_data);
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <plat/omap_device.h> #include <plat/omap_device.h>
#include <plat/omap-pm.h> #include <plat/omap-pm.h>
#include "control.h"
static struct platform_device omap_display_device = { static struct platform_device omap_display_device = {
.name = "omapdss", .name = "omapdss",
.id = -1, .id = -1,
...@@ -61,7 +63,7 @@ static const struct omap_dss_hwmod_data omap3_dss_hwmod_data[] __initdata = { ...@@ -61,7 +63,7 @@ static const struct omap_dss_hwmod_data omap3_dss_hwmod_data[] __initdata = {
{ "dss_dispc", "omapdss_dispc", -1 }, { "dss_dispc", "omapdss_dispc", -1 },
{ "dss_rfbi", "omapdss_rfbi", -1 }, { "dss_rfbi", "omapdss_rfbi", -1 },
{ "dss_venc", "omapdss_venc", -1 }, { "dss_venc", "omapdss_venc", -1 },
{ "dss_dsi1", "omapdss_dsi1", -1 }, { "dss_dsi1", "omapdss_dsi", 0 },
}; };
static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = { static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = {
...@@ -69,11 +71,58 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = { ...@@ -69,11 +71,58 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = {
{ "dss_dispc", "omapdss_dispc", -1 }, { "dss_dispc", "omapdss_dispc", -1 },
{ "dss_rfbi", "omapdss_rfbi", -1 }, { "dss_rfbi", "omapdss_rfbi", -1 },
{ "dss_venc", "omapdss_venc", -1 }, { "dss_venc", "omapdss_venc", -1 },
{ "dss_dsi1", "omapdss_dsi1", -1 }, { "dss_dsi1", "omapdss_dsi", 0 },
{ "dss_dsi2", "omapdss_dsi2", -1 }, { "dss_dsi2", "omapdss_dsi", 1 },
{ "dss_hdmi", "omapdss_hdmi", -1 }, { "dss_hdmi", "omapdss_hdmi", -1 },
}; };
static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
{
u32 enable_mask, enable_shift;
u32 pipd_mask, pipd_shift;
u32 reg;
if (dsi_id == 0) {
enable_mask = OMAP4_DSI1_LANEENABLE_MASK;
enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT;
pipd_mask = OMAP4_DSI1_PIPD_MASK;
pipd_shift = OMAP4_DSI1_PIPD_SHIFT;
} else if (dsi_id == 1) {
enable_mask = OMAP4_DSI2_LANEENABLE_MASK;
enable_shift = OMAP4_DSI2_LANEENABLE_SHIFT;
pipd_mask = OMAP4_DSI2_PIPD_MASK;
pipd_shift = OMAP4_DSI2_PIPD_SHIFT;
} else {
return -ENODEV;
}
reg = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
reg &= ~enable_mask;
reg &= ~pipd_mask;
reg |= (lanes << enable_shift) & enable_mask;
reg |= (lanes << pipd_shift) & pipd_mask;
omap4_ctrl_pad_writel(reg, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_DSIPHY);
return 0;
}
static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask)
{
if (cpu_is_omap44xx())
return omap4_dsi_mux_pads(dsi_id, lane_mask);
return 0;
}
static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask)
{
if (cpu_is_omap44xx())
omap4_dsi_mux_pads(dsi_id, 0);
}
int __init omap_display_init(struct omap_dss_board_info *board_data) int __init omap_display_init(struct omap_dss_board_info *board_data)
{ {
int r = 0; int r = 0;
...@@ -96,6 +145,11 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) ...@@ -96,6 +145,11 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
oh_count = ARRAY_SIZE(omap4_dss_hwmod_data); oh_count = ARRAY_SIZE(omap4_dss_hwmod_data);
} }
if (board_data->dsi_enable_pads == NULL)
board_data->dsi_enable_pads = omap_dsi_enable_pads;
if (board_data->dsi_disable_pads == NULL)
board_data->dsi_disable_pads = omap_dsi_disable_pads;
pdata.board_data = board_data; pdata.board_data = board_data;
pdata.board_data->get_context_loss_count = pdata.board_data->get_context_loss_count =
omap_pm_get_dev_context_loss_count; omap_pm_get_dev_context_loss_count;
......
...@@ -99,7 +99,7 @@ static struct regulator_init_data omap3_vdac_idata = { ...@@ -99,7 +99,7 @@ static struct regulator_init_data omap3_vdac_idata = {
static struct regulator_consumer_supply omap3_vpll2_supplies[] = { static struct regulator_consumer_supply omap3_vpll2_supplies[] = {
REGULATOR_SUPPLY("vdds_dsi", "omapdss"), REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),
}; };
static struct regulator_init_data omap3_vpll2_idata = { static struct regulator_init_data omap3_vpll2_idata = {
...@@ -235,6 +235,12 @@ static struct regulator_init_data omap4_vana_idata = { ...@@ -235,6 +235,12 @@ static struct regulator_init_data omap4_vana_idata = {
}, },
}; };
static struct regulator_consumer_supply omap4_vcxio_supply[] = {
REGULATOR_SUPPLY("vdds_dsi", "omapdss_dss"),
REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),
REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.1"),
};
static struct regulator_init_data omap4_vcxio_idata = { static struct regulator_init_data omap4_vcxio_idata = {
.constraints = { .constraints = {
.min_uV = 1800000, .min_uV = 1800000,
...@@ -243,7 +249,10 @@ static struct regulator_init_data omap4_vcxio_idata = { ...@@ -243,7 +249,10 @@ static struct regulator_init_data omap4_vcxio_idata = {
| REGULATOR_MODE_STANDBY, | REGULATOR_MODE_STANDBY,
.valid_ops_mask = REGULATOR_CHANGE_MODE .valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS, | REGULATOR_CHANGE_STATUS,
.always_on = true,
}, },
.num_consumer_supplies = ARRAY_SIZE(omap4_vcxio_supply),
.consumer_supplies = omap4_vcxio_supply,
}; };
static struct regulator_init_data omap4_vusb_idata = { static struct regulator_init_data omap4_vusb_idata = {
......
...@@ -1597,6 +1597,7 @@ static void __init mackerel_init(void) ...@@ -1597,6 +1597,7 @@ static void __init mackerel_init(void)
sh7372_add_device_to_domain(&sh7372_a4lc, &lcdc_device); sh7372_add_device_to_domain(&sh7372_a4lc, &lcdc_device);
sh7372_add_device_to_domain(&sh7372_a4lc, &hdmi_lcdc_device); sh7372_add_device_to_domain(&sh7372_a4lc, &hdmi_lcdc_device);
sh7372_add_device_to_domain(&sh7372_a4lc, &meram_device);
sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device); sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs0_device); sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs0_device);
sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs1_device); sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs1_device);
......
...@@ -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;
...@@ -256,7 +253,7 @@ void __init mpc512x_init_diu(void) ...@@ -256,7 +253,7 @@ void __init mpc512x_init_diu(void)
} }
mode = in_be32(&diu_reg->diu_mode); mode = in_be32(&diu_reg->diu_mode);
if (mode != MFB_MODE1) { if (mode == MFB_MODE0) {
pr_info("%s: DIU OFF\n", __func__); pr_info("%s: DIU OFF\n", __func__);
goto out; goto out;
} }
...@@ -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;
......
...@@ -400,7 +400,6 @@ static int omapvid_setup_overlay(struct omap_vout_device *vout, ...@@ -400,7 +400,6 @@ static int omapvid_setup_overlay(struct omap_vout_device *vout,
ovl->get_overlay_info(ovl, &info); ovl->get_overlay_info(ovl, &info);
info.paddr = addr; info.paddr = addr;
info.vaddr = NULL;
info.width = cropwidth; info.width = cropwidth;
info.height = cropheight; info.height = cropheight;
info.color_mode = vout->dss_mode; info.color_mode = vout->dss_mode;
...@@ -1165,12 +1164,17 @@ static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, ...@@ -1165,12 +1164,17 @@ static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh,
{ {
int ret = 0; int ret = 0;
struct omap_vout_device *vout = fh; struct omap_vout_device *vout = fh;
struct omap_overlay *ovl;
struct omapvideo_info *ovid;
struct v4l2_window *win = &f->fmt.win; struct v4l2_window *win = &f->fmt.win;
ovid = &vout->vid_info;
ovl = ovid->overlays[0];
ret = omap_vout_try_window(&vout->fbuf, win); ret = omap_vout_try_window(&vout->fbuf, win);
if (!ret) { if (!ret) {
if (vout->vid == OMAP_VIDEO1) if ((ovl->caps & OMAP_DSS_OVL_CAP_GLOBAL_ALPHA) == 0)
win->global_alpha = 255; win->global_alpha = 255;
else else
win->global_alpha = f->fmt.win.global_alpha; win->global_alpha = f->fmt.win.global_alpha;
...@@ -1194,8 +1198,8 @@ static int vidioc_s_fmt_vid_overlay(struct file *file, void *fh, ...@@ -1194,8 +1198,8 @@ static int vidioc_s_fmt_vid_overlay(struct file *file, void *fh,
ret = omap_vout_new_window(&vout->crop, &vout->win, &vout->fbuf, win); ret = omap_vout_new_window(&vout->crop, &vout->win, &vout->fbuf, win);
if (!ret) { if (!ret) {
/* Video1 plane does not support global alpha */ /* Video1 plane does not support global alpha on OMAP3 */
if (ovl->id == OMAP_DSS_VIDEO1) if ((ovl->caps & OMAP_DSS_OVL_CAP_GLOBAL_ALPHA) == 0)
vout->win.global_alpha = 255; vout->win.global_alpha = 255;
else else
vout->win.global_alpha = f->fmt.win.global_alpha; vout->win.global_alpha = f->fmt.win.global_alpha;
...@@ -1788,7 +1792,9 @@ static int vidioc_s_fbuf(struct file *file, void *fh, ...@@ -1788,7 +1792,9 @@ static int vidioc_s_fbuf(struct file *file, void *fh,
if (ovl->manager && ovl->manager->get_manager_info && if (ovl->manager && ovl->manager->get_manager_info &&
ovl->manager->set_manager_info) { ovl->manager->set_manager_info) {
ovl->manager->get_manager_info(ovl->manager, &info); ovl->manager->get_manager_info(ovl->manager, &info);
info.alpha_enabled = enable; /* enable this only if there is no zorder cap */
if ((ovl->caps & OMAP_DSS_OVL_CAP_ZORDER) == 0)
info.partial_alpha_enabled = enable;
if (ovl->manager->set_manager_info(ovl->manager, &info)) if (ovl->manager->set_manager_info(ovl->manager, &info))
return -EINVAL; return -EINVAL;
} }
...@@ -1820,7 +1826,7 @@ static int vidioc_g_fbuf(struct file *file, void *fh, ...@@ -1820,7 +1826,7 @@ static int vidioc_g_fbuf(struct file *file, void *fh,
} }
if (ovl->manager && ovl->manager->get_manager_info) { if (ovl->manager && ovl->manager->get_manager_info) {
ovl->manager->get_manager_info(ovl->manager, &info); ovl->manager->get_manager_info(ovl->manager, &info);
if (info.alpha_enabled) if (info.partial_alpha_enabled)
a->flags |= V4L2_FBUF_FLAG_LOCAL_ALPHA; a->flags |= V4L2_FBUF_FLAG_LOCAL_ALPHA;
} }
......
...@@ -1300,27 +1300,17 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive, ...@@ -1300,27 +1300,17 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
return 0; return 0;
} }
static int XGIfb_pan_var(struct xgifb_video_info *xgifb_info, static int XGIfb_pan_var(struct fb_var_screeninfo *var, struct fb_info *info)
struct fb_var_screeninfo *var)
{ {
struct xgifb_video_info *xgifb_info = info->par;
unsigned int base; unsigned int base;
/* printk("Inside pan_var"); */ /* printk("Inside pan_var"); */
if (var->xoffset > (var->xres_virtual - var->xres)) { base = var->yoffset * info->var.xres_virtual + var->xoffset;
/* printk("Pan: xo: %d xv %d xr %d\n",
var->xoffset, var->xres_virtual, var->xres); */
return -EINVAL;
}
if (var->yoffset > (var->yres_virtual - var->yres)) {
/* printk("Pan: yo: %d yv %d yr %d\n",
var->yoffset, var->yres_virtual, var->yres); */
return -EINVAL;
}
base = var->yoffset * var->xres_virtual + var->xoffset;
/* calculate base bpp dep. */ /* calculate base bpp dep. */
switch (var->bits_per_pixel) { switch (info->var.bits_per_pixel) {
case 16: case 16:
base >>= 1; base >>= 1;
break; break;
...@@ -1615,13 +1605,12 @@ static int XGIfb_pan_display(struct fb_var_screeninfo *var, ...@@ -1615,13 +1605,12 @@ static int XGIfb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info) struct fb_info *info)
{ {
int err; int err;
struct xgifb_video_info *xgifb_info = info->par;
/* printk("\nInside pan_display:\n"); */ /* printk("\nInside pan_display:\n"); */
if (var->xoffset > (var->xres_virtual - var->xres)) if (var->xoffset > (info->var.xres_virtual - info->var.xres))
return -EINVAL; return -EINVAL;
if (var->yoffset > (var->yres_virtual - var->yres)) if (var->yoffset > (info->var.yres_virtual - info->var.yres))
return -EINVAL; return -EINVAL;
if (var->vmode & FB_VMODE_YWRAP) { if (var->vmode & FB_VMODE_YWRAP) {
...@@ -1634,7 +1623,7 @@ static int XGIfb_pan_display(struct fb_var_screeninfo *var, ...@@ -1634,7 +1623,7 @@ static int XGIfb_pan_display(struct fb_var_screeninfo *var,
> info->var.yres_virtual) > info->var.yres_virtual)
return -EINVAL; return -EINVAL;
} }
err = XGIfb_pan_var(xgifb_info, var); err = XGIfb_pan_var(var, info);
if (err < 0) if (err < 0)
return err; return err;
......
...@@ -378,8 +378,8 @@ static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, ...@@ -378,8 +378,8 @@ static int mc68x328fb_pan_display(struct fb_var_screeninfo *var,
|| var->xoffset) || var->xoffset)
return -EINVAL; return -EINVAL;
} else { } else {
if (var->xoffset + var->xres > info->var.xres_virtual || if (var->xoffset + info->var.xres > info->var.xres_virtual ||
var->yoffset + var->yres > info->var.yres_virtual) var->yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL; return -EINVAL;
} }
info->var.xoffset = var->xoffset; info->var.xoffset = var->xoffset;
......
...@@ -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
...@@ -2027,7 +2037,7 @@ config FB_TMIO_ACCELL ...@@ -2027,7 +2037,7 @@ config FB_TMIO_ACCELL
config FB_S3C config FB_S3C
tristate "Samsung S3C framebuffer support" tristate "Samsung S3C framebuffer support"
depends on FB && S3C_DEV_FB depends on FB && (S3C_DEV_FB || S5P_DEV_FIMD0)
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT select FB_CFB_IMAGEBLIT
...@@ -2110,6 +2120,22 @@ config FB_SM501 ...@@ -2110,6 +2120,22 @@ config FB_SM501
If unsure, say N. If unsure, say N.
config FB_SMSCUFX
tristate "SMSC UFX6000/7000 USB Framebuffer support"
depends on FB && USB
select FB_MODE_HELPERS
select FB_SYS_FILLRECT
select FB_SYS_COPYAREA
select FB_SYS_IMAGEBLIT
select FB_SYS_FOPS
select FB_DEFERRED_IO
---help---
This is a kernel framebuffer driver for SMSC UFX USB devices.
Supports fbdev clients like xf86-video-fbdev, kdrive, fbi, and
mplayer -vo fbdev. Supports both UFX6000 (USB 2.0) and UFX7000
(USB 3.0) devices.
To compile as a module, choose M here: the module name is smscufx.
config FB_UDL config FB_UDL
tristate "Displaylink USB Framebuffer support" tristate "Displaylink USB Framebuffer support"
depends on FB && USB depends on FB && USB
......
...@@ -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
...@@ -127,6 +128,7 @@ obj-$(CONFIG_FB_IBM_GXT4500) += gxt4500.o ...@@ -127,6 +128,7 @@ obj-$(CONFIG_FB_IBM_GXT4500) += gxt4500.o
obj-$(CONFIG_FB_PS3) += ps3fb.o obj-$(CONFIG_FB_PS3) += ps3fb.o
obj-$(CONFIG_FB_SM501) += sm501fb.o obj-$(CONFIG_FB_SM501) += sm501fb.o
obj-$(CONFIG_FB_UDL) += udlfb.o obj-$(CONFIG_FB_UDL) += udlfb.o
obj-$(CONFIG_FB_SMSCUFX) += smscufx.o
obj-$(CONFIG_FB_XILINX) += xilinxfb.o obj-$(CONFIG_FB_XILINX) += xilinxfb.o
obj-$(CONFIG_SH_MIPI_DSI) += sh_mipi_dsi.o obj-$(CONFIG_SH_MIPI_DSI) += sh_mipi_dsi.o
obj-$(CONFIG_FB_SH_MOBILE_HDMI) += sh_mobile_hdmi.o obj-$(CONFIG_FB_SH_MOBILE_HDMI) += sh_mobile_hdmi.o
......
...@@ -850,9 +850,10 @@ acornfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -850,9 +850,10 @@ acornfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
u_int y_bottom = var->yoffset; u_int y_bottom = var->yoffset;
if (!(var->vmode & FB_VMODE_YWRAP)) if (!(var->vmode & FB_VMODE_YWRAP))
y_bottom += var->yres; y_bottom += info->var.yres;
BUG_ON(y_bottom > var->yres_virtual); if (y_bottom > info->var.yres_virtual)
return -EINVAL;
acornfb_update_dma(info, var); acornfb_update_dma(info, var);
......
...@@ -908,13 +908,14 @@ static int arkfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info ...@@ -908,13 +908,14 @@ static int arkfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info
unsigned int offset; unsigned int offset;
/* Calculate the offset */ /* Calculate the offset */
if (var->bits_per_pixel == 0) { if (info->var.bits_per_pixel == 0) {
offset = (var->yoffset / 16) * (var->xres_virtual / 2) + (var->xoffset / 2); offset = (var->yoffset / 16) * (info->var.xres_virtual / 2)
+ (var->xoffset / 2);
offset = offset >> 2; offset = offset >> 2;
} else { } else {
offset = (var->yoffset * info->fix.line_length) + offset = (var->yoffset * info->fix.line_length) +
(var->xoffset * var->bits_per_pixel / 8); (var->xoffset * info->var.bits_per_pixel / 8);
offset = offset >> ((var->bits_per_pixel == 4) ? 2 : 3); offset = offset >> ((info->var.bits_per_pixel == 4) ? 2 : 3);
} }
/* Set the offset */ /* Set the offset */
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
| FBINFO_HWACCEL_YPAN) | FBINFO_HWACCEL_YPAN)
static inline void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo, static inline void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
struct fb_var_screeninfo *var) struct fb_var_screeninfo *var,
struct fb_info *info)
{ {
} }
...@@ -50,14 +51,16 @@ static inline void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo, ...@@ -50,14 +51,16 @@ static inline void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
| FBINFO_HWACCEL_YPAN) | FBINFO_HWACCEL_YPAN)
static void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo, static void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
struct fb_var_screeninfo *var) struct fb_var_screeninfo *var,
struct fb_info *info)
{ {
u32 dma2dcfg; u32 dma2dcfg;
u32 pixeloff; u32 pixeloff;
pixeloff = (var->xoffset * var->bits_per_pixel) & 0x1f; pixeloff = (var->xoffset * info->var.bits_per_pixel) & 0x1f;
dma2dcfg = ((var->xres_virtual - var->xres) * var->bits_per_pixel) / 8; dma2dcfg = (info->var.xres_virtual - info->var.xres)
* info->var.bits_per_pixel / 8;
dma2dcfg |= pixeloff << ATMEL_LCDC_PIXELOFF_OFFSET; dma2dcfg |= pixeloff << ATMEL_LCDC_PIXELOFF_OFFSET;
lcdc_writel(sinfo, ATMEL_LCDC_DMA2DCFG, dma2dcfg); lcdc_writel(sinfo, ATMEL_LCDC_DMA2DCFG, dma2dcfg);
...@@ -249,14 +252,14 @@ static void atmel_lcdfb_update_dma(struct fb_info *info, ...@@ -249,14 +252,14 @@ static void atmel_lcdfb_update_dma(struct fb_info *info,
unsigned long dma_addr; unsigned long dma_addr;
dma_addr = (fix->smem_start + var->yoffset * fix->line_length dma_addr = (fix->smem_start + var->yoffset * fix->line_length
+ var->xoffset * var->bits_per_pixel / 8); + var->xoffset * info->var.bits_per_pixel / 8);
dma_addr &= ~3UL; dma_addr &= ~3UL;
/* Set framebuffer DMA base address and pixel offset */ /* Set framebuffer DMA base address and pixel offset */
lcdc_writel(sinfo, ATMEL_LCDC_DMABADDR1, dma_addr); lcdc_writel(sinfo, ATMEL_LCDC_DMABADDR1, dma_addr);
atmel_lcdfb_update_dma2d(sinfo, var); atmel_lcdfb_update_dma2d(sinfo, var, info);
} }
static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo) static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo)
......
...@@ -845,16 +845,16 @@ static int radeonfb_pan_display (struct fb_var_screeninfo *var, ...@@ -845,16 +845,16 @@ static int radeonfb_pan_display (struct fb_var_screeninfo *var,
{ {
struct radeonfb_info *rinfo = info->par; struct radeonfb_info *rinfo = info->par;
if ((var->xoffset + var->xres > var->xres_virtual) if ((var->xoffset + info->var.xres > info->var.xres_virtual)
|| (var->yoffset + var->yres > var->yres_virtual)) || (var->yoffset + info->var.yres > info->var.yres_virtual))
return -EINVAL; return -EINVAL;
if (rinfo->asleep) if (rinfo->asleep)
return 0; return 0;
radeon_fifo_wait(2); radeon_fifo_wait(2);
OUTREG(CRTC_OFFSET, ((var->yoffset * var->xres_virtual + var->xoffset) OUTREG(CRTC_OFFSET, (var->yoffset * info->fix.line_length +
* var->bits_per_pixel / 8) & ~7); var->xoffset * info->var.bits_per_pixel / 8) & ~7);
return 0; return 0;
} }
......
...@@ -110,12 +110,6 @@ static struct fb_var_screeninfo au1100fb_var __devinitdata = { ...@@ -110,12 +110,6 @@ static struct fb_var_screeninfo au1100fb_var __devinitdata = {
.vmode = FB_VMODE_NONINTERLACED, .vmode = FB_VMODE_NONINTERLACED,
}; };
static struct au1100fb_drv_info drv_info;
static int nocursor = 0;
module_param(nocursor, int, 0644);
MODULE_PARM_DESC(nocursor, "cursor enable/disable");
/* fb_blank /* fb_blank
* Blank the screen. Depending on the mode, the screen will be * Blank the screen. Depending on the mode, the screen will be
* activated with the backlight color, or desactivated * activated with the backlight color, or desactivated
...@@ -132,7 +126,7 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi) ...@@ -132,7 +126,7 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
/* Turn on panel */ /* Turn on panel */
fbdev->regs->lcd_control |= LCD_CONTROL_GO; fbdev->regs->lcd_control |= LCD_CONTROL_GO;
#ifdef CONFIG_MIPS_PB1100 #ifdef CONFIG_MIPS_PB1100
if (drv_info.panel_idx == 1) { if (fbdev->panel_idx == 1) {
au_writew(au_readw(PB1100_G_CONTROL) au_writew(au_readw(PB1100_G_CONTROL)
| (PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD), | (PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD),
PB1100_G_CONTROL); PB1100_G_CONTROL);
...@@ -147,7 +141,7 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi) ...@@ -147,7 +141,7 @@ static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi)
/* Turn off panel */ /* Turn off panel */
fbdev->regs->lcd_control &= ~LCD_CONTROL_GO; fbdev->regs->lcd_control &= ~LCD_CONTROL_GO;
#ifdef CONFIG_MIPS_PB1100 #ifdef CONFIG_MIPS_PB1100
if (drv_info.panel_idx == 1) { if (fbdev->panel_idx == 1) {
au_writew(au_readw(PB1100_G_CONTROL) au_writew(au_readw(PB1100_G_CONTROL)
& ~(PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD), & ~(PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD),
PB1100_G_CONTROL); PB1100_G_CONTROL);
...@@ -428,17 +422,6 @@ int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) ...@@ -428,17 +422,6 @@ int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
return 0; return 0;
} }
/* fb_cursor
* Used to disable cursor drawing...
*/
int au1100fb_fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
{
if (nocursor)
return 0;
else
return -EINVAL; /* just to force soft_cursor() call */
}
static struct fb_ops au1100fb_ops = static struct fb_ops au1100fb_ops =
{ {
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -450,13 +433,53 @@ static struct fb_ops au1100fb_ops = ...@@ -450,13 +433,53 @@ static struct fb_ops au1100fb_ops =
.fb_imageblit = cfb_imageblit, .fb_imageblit = cfb_imageblit,
.fb_rotate = au1100fb_fb_rotate, .fb_rotate = au1100fb_fb_rotate,
.fb_mmap = au1100fb_fb_mmap, .fb_mmap = au1100fb_fb_mmap,
.fb_cursor = au1100fb_fb_cursor,
}; };
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* AU1100 LCD controller device driver */ static int au1100fb_setup(struct au1100fb_device *fbdev)
{
char *this_opt, *options;
int num_panels = ARRAY_SIZE(known_lcd_panels);
if (num_panels <= 0) {
print_err("No LCD panels supported by driver!");
return -ENODEV;
}
if (fb_get_options(DRIVER_NAME, &options))
return -ENODEV;
if (!options)
return -ENODEV;
while ((this_opt = strsep(&options, ",")) != NULL) {
/* Panel option */
if (!strncmp(this_opt, "panel:", 6)) {
int i;
this_opt += 6;
for (i = 0; i < num_panels; i++) {
if (!strncmp(this_opt, known_lcd_panels[i].name,
strlen(this_opt))) {
fbdev->panel = &known_lcd_panels[i];
fbdev->panel_idx = i;
break;
}
}
if (i >= num_panels) {
print_warn("Panel '%s' not supported!", this_opt);
return -ENODEV;
}
}
/* Unsupported option */
else
print_warn("Unsupported option \"%s\"", this_opt);
}
print_info("Panel=%s", fbdev->panel->name);
return 0;
}
static int __devinit au1100fb_drv_probe(struct platform_device *dev) static int __devinit au1100fb_drv_probe(struct platform_device *dev)
{ {
...@@ -465,22 +488,21 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev) ...@@ -465,22 +488,21 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
unsigned long page; unsigned long page;
u32 sys_clksrc; u32 sys_clksrc;
if (!dev)
return -EINVAL;
/* Allocate new device private */ /* Allocate new device private */
if (!(fbdev = kzalloc(sizeof(struct au1100fb_device), GFP_KERNEL))) { fbdev = kzalloc(sizeof(struct au1100fb_device), GFP_KERNEL);
if (!fbdev) {
print_err("fail to allocate device private record"); print_err("fail to allocate device private record");
return -ENOMEM; return -ENOMEM;
} }
fbdev->panel = &known_lcd_panels[drv_info.panel_idx]; if (au1100fb_setup(fbdev))
goto failed;
platform_set_drvdata(dev, (void *)fbdev); platform_set_drvdata(dev, (void *)fbdev);
/* Allocate region for our registers and map them */ /* Allocate region for our registers and map them */
if (!(regs_res = platform_get_resource(to_platform_device(dev), regs_res = platform_get_resource(dev, IORESOURCE_MEM, 0);
IORESOURCE_MEM, 0))) { if (!regs_res) {
print_err("fail to retrieve registers resource"); print_err("fail to retrieve registers resource");
return -EFAULT; return -EFAULT;
} }
...@@ -500,13 +522,11 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev) ...@@ -500,13 +522,11 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
print_dbg("Register memory map at %p", fbdev->regs); print_dbg("Register memory map at %p", fbdev->regs);
print_dbg("phys=0x%08x, size=%d", fbdev->regs_phys, fbdev->regs_len); print_dbg("phys=0x%08x, size=%d", fbdev->regs_phys, fbdev->regs_len);
/* Allocate the framebuffer to the maximum screen size * nbr of video buffers */ /* Allocate the framebuffer to the maximum screen size * nbr of video buffers */
fbdev->fb_len = fbdev->panel->xres * fbdev->panel->yres * fbdev->fb_len = fbdev->panel->xres * fbdev->panel->yres *
(fbdev->panel->bpp >> 3) * AU1100FB_NBR_VIDEO_BUFFERS; (fbdev->panel->bpp >> 3) * AU1100FB_NBR_VIDEO_BUFFERS;
fbdev->fb_mem = dma_alloc_coherent(dev, PAGE_ALIGN(fbdev->fb_len), fbdev->fb_mem = dma_alloc_coherent(&dev->dev, PAGE_ALIGN(fbdev->fb_len),
&fbdev->fb_phys, GFP_KERNEL); &fbdev->fb_phys, GFP_KERNEL);
if (!fbdev->fb_mem) { if (!fbdev->fb_mem) {
print_err("fail to allocate frambuffer (size: %dK))", print_err("fail to allocate frambuffer (size: %dK))",
...@@ -525,7 +545,7 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev) ...@@ -525,7 +545,7 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
page < PAGE_ALIGN((unsigned long)fbdev->fb_mem + fbdev->fb_len); page < PAGE_ALIGN((unsigned long)fbdev->fb_mem + fbdev->fb_len);
page += PAGE_SIZE) { page += PAGE_SIZE) {
#if CONFIG_DMA_NONCOHERENT #if CONFIG_DMA_NONCOHERENT
SetPageReserved(virt_to_page(CAC_ADDR(page))); SetPageReserved(virt_to_page(CAC_ADDR((void *)page)));
#else #else
SetPageReserved(virt_to_page(page)); SetPageReserved(virt_to_page(page));
#endif #endif
...@@ -578,7 +598,8 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev) ...@@ -578,7 +598,8 @@ static int __devinit au1100fb_drv_probe(struct platform_device *dev)
release_mem_region(fbdev->regs_phys, fbdev->regs_len); release_mem_region(fbdev->regs_phys, fbdev->regs_len);
} }
if (fbdev->fb_mem) { if (fbdev->fb_mem) {
dma_free_noncoherent(dev, fbdev->fb_len, fbdev->fb_mem, fbdev->fb_phys); dma_free_noncoherent(&dev->dev, fbdev->fb_len, fbdev->fb_mem,
fbdev->fb_phys);
} }
if (fbdev->info.cmap.len != 0) { if (fbdev->info.cmap.len != 0) {
fb_dealloc_cmap(&fbdev->info.cmap); fb_dealloc_cmap(&fbdev->info.cmap);
...@@ -608,7 +629,8 @@ int au1100fb_drv_remove(struct platform_device *dev) ...@@ -608,7 +629,8 @@ int au1100fb_drv_remove(struct platform_device *dev)
release_mem_region(fbdev->regs_phys, fbdev->regs_len); release_mem_region(fbdev->regs_phys, fbdev->regs_len);
dma_free_coherent(dev, PAGE_ALIGN(fbdev->fb_len), fbdev->fb_mem, fbdev->fb_phys); dma_free_coherent(&dev->dev, PAGE_ALIGN(fbdev->fb_len), fbdev->fb_mem,
fbdev->fb_phys);
fb_dealloc_cmap(&fbdev->info.cmap); fb_dealloc_cmap(&fbdev->info.cmap);
kfree(fbdev->info.pseudo_palette); kfree(fbdev->info.pseudo_palette);
...@@ -675,101 +697,18 @@ static struct platform_driver au1100fb_driver = { ...@@ -675,101 +697,18 @@ static struct platform_driver au1100fb_driver = {
.resume = au1100fb_drv_resume, .resume = au1100fb_drv_resume,
}; };
/*-------------------------------------------------------------------------*/ static int __init au1100fb_load(void)
/* Kernel driver */
int au1100fb_setup(char *options)
{
char* this_opt;
int num_panels = ARRAY_SIZE(known_lcd_panels);
char* mode = NULL;
int panel_idx = 0;
if (num_panels <= 0) {
print_err("No LCD panels supported by driver!");
return -EFAULT;
}
if (options) {
while ((this_opt = strsep(&options,",")) != NULL) {
/* Panel option */
if (!strncmp(this_opt, "panel:", 6)) {
int i;
this_opt += 6;
for (i = 0; i < num_panels; i++) {
if (!strncmp(this_opt,
known_lcd_panels[i].name,
strlen(this_opt))) {
panel_idx = i;
break;
}
}
if (i >= num_panels) {
print_warn("Panel %s not supported!", this_opt);
}
}
if (!strncmp(this_opt, "nocursor", 8)) {
this_opt += 8;
nocursor = 1;
print_info("Cursor disabled");
}
/* Mode option (only option that start with digit) */
else if (isdigit(this_opt[0])) {
mode = kstrdup(this_opt, GFP_KERNEL);
if (!mode) {
print_err("memory allocation failed");
return -ENOMEM;
}
}
/* Unsupported option */
else {
print_warn("Unsupported option \"%s\"", this_opt);
}
}
}
drv_info.panel_idx = panel_idx;
drv_info.opt_mode = mode;
print_info("Panel=%s Mode=%s",
known_lcd_panels[drv_info.panel_idx].name,
drv_info.opt_mode ? drv_info.opt_mode : "default");
return 0;
}
int __init au1100fb_init(void)
{ {
char* options;
int ret;
print_info("" DRIVER_DESC "");
memset(&drv_info, 0, sizeof(drv_info));
if (fb_get_options(DRIVER_NAME, &options))
return -ENODEV;
/* Setup driver with options */
ret = au1100fb_setup(options);
if (ret < 0) {
print_err("Fail to setup driver");
return ret;
}
return platform_driver_register(&au1100fb_driver); return platform_driver_register(&au1100fb_driver);
} }
void __exit au1100fb_cleanup(void) static void __exit au1100fb_unload(void)
{ {
platform_driver_unregister(&au1100fb_driver); platform_driver_unregister(&au1100fb_driver);
kfree(drv_info.opt_mode);
} }
module_init(au1100fb_init); module_init(au1100fb_load);
module_exit(au1100fb_cleanup); module_exit(au1100fb_unload);
MODULE_DESCRIPTION(DRIVER_DESC); MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -108,6 +108,7 @@ struct au1100fb_device { ...@@ -108,6 +108,7 @@ struct au1100fb_device {
unsigned char* fb_mem; /* FrameBuffer memory map */ unsigned char* fb_mem; /* FrameBuffer memory map */
size_t fb_len; size_t fb_len;
dma_addr_t fb_phys; dma_addr_t fb_phys;
int panel_idx;
}; };
/********************************************************************/ /********************************************************************/
...@@ -364,11 +365,6 @@ static struct au1100fb_panel known_lcd_panels[] = ...@@ -364,11 +365,6 @@ static struct au1100fb_panel known_lcd_panels[] =
}, },
}; };
struct au1100fb_drv_info {
int panel_idx;
char *opt_mode;
};
/********************************************************************/ /********************************************************************/
/* Inline helpers */ /* Inline helpers */
......
...@@ -46,18 +46,10 @@ ...@@ -46,18 +46,10 @@
#include <asm/mach-au1x00/au1000.h> #include <asm/mach-au1x00/au1000.h>
#include "au1200fb.h" #include "au1200fb.h"
#ifdef CONFIG_PM
#include <asm/mach-au1x00/au1xxx_pm.h>
#endif
#ifndef CONFIG_FB_AU1200_DEVS
#define CONFIG_FB_AU1200_DEVS 4
#endif
#define DRIVER_NAME "au1200fb" #define DRIVER_NAME "au1200fb"
#define DRIVER_DESC "LCD controller driver for AU1200 processors" #define DRIVER_DESC "LCD controller driver for AU1200 processors"
#define DEBUG 1 #define DEBUG 0
#define print_err(f, arg...) printk(KERN_ERR DRIVER_NAME ": " f "\n", ## arg) #define print_err(f, arg...) printk(KERN_ERR DRIVER_NAME ": " f "\n", ## arg)
#define print_warn(f, arg...) printk(KERN_WARNING DRIVER_NAME ": " f "\n", ## arg) #define print_warn(f, arg...) printk(KERN_WARNING DRIVER_NAME ": " f "\n", ## arg)
...@@ -150,7 +142,7 @@ struct au1200_lcd_iodata_t { ...@@ -150,7 +142,7 @@ struct au1200_lcd_iodata_t {
/* Private, per-framebuffer management information (independent of the panel itself) */ /* Private, per-framebuffer management information (independent of the panel itself) */
struct au1200fb_device { struct au1200fb_device {
struct fb_info fb_info; /* FB driver info record */ struct fb_info *fb_info; /* FB driver info record */
int plane; int plane;
unsigned char* fb_mem; /* FrameBuffer memory map */ unsigned char* fb_mem; /* FrameBuffer memory map */
...@@ -158,7 +150,6 @@ struct au1200fb_device { ...@@ -158,7 +150,6 @@ struct au1200fb_device {
dma_addr_t fb_phys; dma_addr_t fb_phys;
}; };
static struct au1200fb_device _au1200fb_devices[CONFIG_FB_AU1200_DEVS];
/********************************************************************/ /********************************************************************/
/* LCD controller restrictions */ /* LCD controller restrictions */
...@@ -171,10 +162,18 @@ static struct au1200fb_device _au1200fb_devices[CONFIG_FB_AU1200_DEVS]; ...@@ -171,10 +162,18 @@ static struct au1200fb_device _au1200fb_devices[CONFIG_FB_AU1200_DEVS];
/* Default number of visible screen buffer to allocate */ /* Default number of visible screen buffer to allocate */
#define AU1200FB_NBR_VIDEO_BUFFERS 1 #define AU1200FB_NBR_VIDEO_BUFFERS 1
/* Default maximum number of fb devices to create */
#define MAX_DEVICE_COUNT 4
/* Default window configuration entry to use (see windows[]) */
#define DEFAULT_WINDOW_INDEX 2
/********************************************************************/ /********************************************************************/
static struct fb_info *_au1200fb_infos[MAX_DEVICE_COUNT];
static struct au1200_lcd *lcd = (struct au1200_lcd *) AU1200_LCD_ADDR; static struct au1200_lcd *lcd = (struct au1200_lcd *) AU1200_LCD_ADDR;
static int window_index = 2; /* default is zero */ static int device_count = MAX_DEVICE_COUNT;
static int window_index = DEFAULT_WINDOW_INDEX; /* default is zero */
static int panel_index = 2; /* default is zero */ static int panel_index = 2; /* default is zero */
static struct window_settings *win; static struct window_settings *win;
static struct panel_settings *panel; static struct panel_settings *panel;
...@@ -205,12 +204,6 @@ struct window_settings { ...@@ -205,12 +204,6 @@ struct window_settings {
extern int board_au1200fb_panel_init (void); extern int board_au1200fb_panel_init (void);
extern int board_au1200fb_panel_shutdown (void); extern int board_au1200fb_panel_shutdown (void);
#ifdef CONFIG_PM
int au1200fb_pm_callback(au1xxx_power_dev_t *dev,
au1xxx_request_t request, void *data);
au1xxx_power_dev_t *LCD_pm_dev;
#endif
/* /*
* Default window configurations * Default window configurations
*/ */
...@@ -652,25 +645,6 @@ static struct panel_settings known_lcd_panels[] = ...@@ -652,25 +645,6 @@ static struct panel_settings known_lcd_panels[] =
/********************************************************************/ /********************************************************************/
#ifdef CONFIG_PM
static int set_brightness(unsigned int brightness)
{
unsigned int hi1, divider;
/* limit brightness pwm duty to >= 30/1600 */
if (brightness < 30) {
brightness = 30;
}
divider = (lcd->pwmdiv & 0x3FFFF) + 1;
hi1 = (lcd->pwmhi >> 16) + 1;
hi1 = (((brightness & 0xFF) + 1) * divider >> 8);
lcd->pwmhi &= 0xFFFF;
lcd->pwmhi |= (hi1 << 16);
return brightness;
}
#endif /* CONFIG_PM */
static int winbpp (unsigned int winctrl1) static int winbpp (unsigned int winctrl1)
{ {
int bits = 0; int bits = 0;
...@@ -712,8 +686,8 @@ static int fbinfo2index (struct fb_info *fb_info) ...@@ -712,8 +686,8 @@ static int fbinfo2index (struct fb_info *fb_info)
{ {
int i; int i;
for (i = 0; i < CONFIG_FB_AU1200_DEVS; ++i) { for (i = 0; i < device_count; ++i) {
if (fb_info == (struct fb_info *)(&_au1200fb_devices[i].fb_info)) if (fb_info == _au1200fb_infos[i])
return i; return i;
} }
printk("au1200fb: ERROR: fbinfo2index failed!\n"); printk("au1200fb: ERROR: fbinfo2index failed!\n");
...@@ -962,7 +936,7 @@ static void au1200_setmode(struct au1200fb_device *fbdev) ...@@ -962,7 +936,7 @@ static void au1200_setmode(struct au1200fb_device *fbdev)
lcd->window[plane].winctrl2 = ( 0 lcd->window[plane].winctrl2 = ( 0
| LCD_WINCTRL2_CKMODE_00 | LCD_WINCTRL2_CKMODE_00
| LCD_WINCTRL2_DBM | LCD_WINCTRL2_DBM
| LCD_WINCTRL2_BX_N( fbdev->fb_info.fix.line_length) | LCD_WINCTRL2_BX_N(fbdev->fb_info->fix.line_length)
| LCD_WINCTRL2_SCX_1 | LCD_WINCTRL2_SCX_1
| LCD_WINCTRL2_SCY_1 | LCD_WINCTRL2_SCY_1
) ; ) ;
...@@ -1050,7 +1024,7 @@ static void au1200fb_update_fbinfo(struct fb_info *fbi) ...@@ -1050,7 +1024,7 @@ static void au1200fb_update_fbinfo(struct fb_info *fbi)
static int au1200fb_fb_check_var(struct fb_var_screeninfo *var, static int au1200fb_fb_check_var(struct fb_var_screeninfo *var,
struct fb_info *fbi) struct fb_info *fbi)
{ {
struct au1200fb_device *fbdev = (struct au1200fb_device *)fbi; struct au1200fb_device *fbdev = fbi->par;
u32 pixclock; u32 pixclock;
int screen_size, plane; int screen_size, plane;
...@@ -1142,7 +1116,7 @@ static int au1200fb_fb_check_var(struct fb_var_screeninfo *var, ...@@ -1142,7 +1116,7 @@ static int au1200fb_fb_check_var(struct fb_var_screeninfo *var,
*/ */
static int au1200fb_fb_set_par(struct fb_info *fbi) static int au1200fb_fb_set_par(struct fb_info *fbi)
{ {
struct au1200fb_device *fbdev = (struct au1200fb_device *)fbi; struct au1200fb_device *fbdev = fbi->par;
au1200fb_update_fbinfo(fbi); au1200fb_update_fbinfo(fbi);
au1200_setmode(fbdev); au1200_setmode(fbdev);
...@@ -1246,11 +1220,7 @@ static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) ...@@ -1246,11 +1220,7 @@ static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
{ {
unsigned int len; unsigned int len;
unsigned long start=0, off; unsigned long start=0, off;
struct au1200fb_device *fbdev = (struct au1200fb_device *) info; struct au1200fb_device *fbdev = info->par;
#ifdef CONFIG_PM
au1xxx_pm_access(LCD_pm_dev);
#endif
if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) { if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) {
return -EINVAL; return -EINVAL;
...@@ -1461,10 +1431,6 @@ static int au1200fb_ioctl(struct fb_info *info, unsigned int cmd, ...@@ -1461,10 +1431,6 @@ static int au1200fb_ioctl(struct fb_info *info, unsigned int cmd,
int plane; int plane;
int val; int val;
#ifdef CONFIG_PM
au1xxx_pm_access(LCD_pm_dev);
#endif
plane = fbinfo2index(info); plane = fbinfo2index(info);
print_dbg("au1200fb: ioctl %d on plane %d\n", cmd, plane); print_dbg("au1200fb: ioctl %d on plane %d\n", cmd, plane);
...@@ -1536,9 +1502,11 @@ static struct fb_ops au1200fb_fb_ops = { ...@@ -1536,9 +1502,11 @@ static struct fb_ops au1200fb_fb_ops = {
.fb_set_par = au1200fb_fb_set_par, .fb_set_par = au1200fb_fb_set_par,
.fb_setcolreg = au1200fb_fb_setcolreg, .fb_setcolreg = au1200fb_fb_setcolreg,
.fb_blank = au1200fb_fb_blank, .fb_blank = au1200fb_fb_blank,
.fb_fillrect = cfb_fillrect, .fb_fillrect = sys_fillrect,
.fb_copyarea = cfb_copyarea, .fb_copyarea = sys_copyarea,
.fb_imageblit = cfb_imageblit, .fb_imageblit = sys_imageblit,
.fb_read = fb_sys_read,
.fb_write = fb_sys_write,
.fb_sync = NULL, .fb_sync = NULL,
.fb_ioctl = au1200fb_ioctl, .fb_ioctl = au1200fb_ioctl,
.fb_mmap = au1200fb_fb_mmap, .fb_mmap = au1200fb_fb_mmap,
...@@ -1561,10 +1529,9 @@ static irqreturn_t au1200fb_handle_irq(int irq, void* dev_id) ...@@ -1561,10 +1529,9 @@ static irqreturn_t au1200fb_handle_irq(int irq, void* dev_id)
static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev) static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev)
{ {
struct fb_info *fbi = &fbdev->fb_info; struct fb_info *fbi = fbdev->fb_info;
int bpp; int bpp;
memset(fbi, 0, sizeof(struct fb_info));
fbi->fbops = &au1200fb_fb_ops; fbi->fbops = &au1200fb_fb_ops;
bpp = winbpp(win->w[fbdev->plane].mode_winctrl1); bpp = winbpp(win->w[fbdev->plane].mode_winctrl1);
...@@ -1623,24 +1590,36 @@ static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev) ...@@ -1623,24 +1590,36 @@ static int au1200fb_init_fbinfo(struct au1200fb_device *fbdev)
/* AU1200 LCD controller device driver */ /* AU1200 LCD controller device driver */
static int au1200fb_drv_probe(struct platform_device *dev) static int __devinit au1200fb_drv_probe(struct platform_device *dev)
{ {
struct au1200fb_device *fbdev; struct au1200fb_device *fbdev;
struct fb_info *fbi = NULL;
unsigned long page; unsigned long page;
int bpp, plane, ret; int bpp, plane, ret, irq;
if (!dev) /* shut gcc up */
return -EINVAL; ret = 0;
fbdev = NULL;
/* Kickstart the panel */
au1200_setpanel(panel);
for (plane = 0; plane < CONFIG_FB_AU1200_DEVS; ++plane) { for (plane = 0; plane < device_count; ++plane) {
bpp = winbpp(win->w[plane].mode_winctrl1); bpp = winbpp(win->w[plane].mode_winctrl1);
if (win->w[plane].xres == 0) if (win->w[plane].xres == 0)
win->w[plane].xres = panel->Xres; win->w[plane].xres = panel->Xres;
if (win->w[plane].yres == 0) if (win->w[plane].yres == 0)
win->w[plane].yres = panel->Yres; win->w[plane].yres = panel->Yres;
fbdev = &_au1200fb_devices[plane]; fbi = framebuffer_alloc(sizeof(struct au1200fb_device),
memset(fbdev, 0, sizeof(struct au1200fb_device)); &dev->dev);
if (!fbi)
goto failed;
_au1200fb_infos[plane] = fbi;
fbdev = fbi->par;
fbdev->fb_info = fbi;
fbdev->plane = plane; fbdev->plane = plane;
/* Allocate the framebuffer to the maximum screen size */ /* Allocate the framebuffer to the maximum screen size */
...@@ -1673,30 +1652,31 @@ static int au1200fb_drv_probe(struct platform_device *dev) ...@@ -1673,30 +1652,31 @@ static int au1200fb_drv_probe(struct platform_device *dev)
goto failed; goto failed;
/* Register new framebuffer */ /* Register new framebuffer */
if ((ret = register_framebuffer(&fbdev->fb_info)) < 0) { ret = register_framebuffer(fbi);
if (ret < 0) {
print_err("cannot register new framebuffer"); print_err("cannot register new framebuffer");
goto failed; goto failed;
} }
au1200fb_fb_set_par(&fbdev->fb_info); au1200fb_fb_set_par(fbi);
#if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO) #if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO)
if (plane == 0) if (plane == 0)
if (fb_prepare_logo(&fbdev->fb_info, FB_ROTATE_UR)) { if (fb_prepare_logo(fbi, FB_ROTATE_UR)) {
/* Start display and show logo on boot */ /* Start display and show logo on boot */
fb_set_cmap(&fbdev->fb_info.cmap, fb_set_cmap(&fbi->cmap, fbi);
&fbdev->fb_info); fb_show_logo(fbi, FB_ROTATE_UR);
fb_show_logo(&fbdev->fb_info, FB_ROTATE_UR);
} }
#endif #endif
} }
/* Now hook interrupt too */ /* Now hook interrupt too */
if ((ret = request_irq(AU1200_LCD_INT, au1200fb_handle_irq, irq = platform_get_irq(dev, 0);
IRQF_DISABLED | IRQF_SHARED, "lcd", (void *)dev)) < 0) { ret = request_irq(irq, au1200fb_handle_irq,
IRQF_SHARED, "lcd", (void *)dev);
if (ret) {
print_err("fail to request interrupt line %d (err: %d)", print_err("fail to request interrupt line %d (err: %d)",
AU1200_LCD_INT, ret); irq, ret);
goto failed; goto failed;
} }
...@@ -1705,84 +1685,108 @@ static int au1200fb_drv_probe(struct platform_device *dev) ...@@ -1705,84 +1685,108 @@ static int au1200fb_drv_probe(struct platform_device *dev)
failed: failed:
/* NOTE: This only does the current plane/window that failed; others are still active */ /* NOTE: This only does the current plane/window that failed; others are still active */
if (fbdev->fb_mem) if (fbdev->fb_mem)
dma_free_noncoherent(dev, PAGE_ALIGN(fbdev->fb_len), dma_free_noncoherent(&dev->dev, PAGE_ALIGN(fbdev->fb_len),
fbdev->fb_mem, fbdev->fb_phys); fbdev->fb_mem, fbdev->fb_phys);
if (fbdev->fb_info.cmap.len != 0) if (fbi) {
fb_dealloc_cmap(&fbdev->fb_info.cmap); if (fbi->cmap.len != 0)
if (fbdev->fb_info.pseudo_palette) fb_dealloc_cmap(&fbi->cmap);
kfree(fbdev->fb_info.pseudo_palette); kfree(fbi->pseudo_palette);
}
if (plane == 0) if (plane == 0)
free_irq(AU1200_LCD_INT, (void*)dev); free_irq(AU1200_LCD_INT, (void*)dev);
return ret; return ret;
} }
static int au1200fb_drv_remove(struct platform_device *dev) static int __devexit au1200fb_drv_remove(struct platform_device *dev)
{ {
struct au1200fb_device *fbdev; struct au1200fb_device *fbdev;
struct fb_info *fbi;
int plane; int plane;
if (!dev)
return -ENODEV;
/* Turn off the panel */ /* Turn off the panel */
au1200_setpanel(NULL); au1200_setpanel(NULL);
for (plane = 0; plane < CONFIG_FB_AU1200_DEVS; ++plane) for (plane = 0; plane < device_count; ++plane) {
{ fbi = _au1200fb_infos[plane];
fbdev = &_au1200fb_devices[plane]; fbdev = fbi->par;
/* Clean up all probe data */ /* Clean up all probe data */
unregister_framebuffer(&fbdev->fb_info); unregister_framebuffer(fbi);
if (fbdev->fb_mem) if (fbdev->fb_mem)
dma_free_noncoherent(&dev->dev, dma_free_noncoherent(&dev->dev,
PAGE_ALIGN(fbdev->fb_len), PAGE_ALIGN(fbdev->fb_len),
fbdev->fb_mem, fbdev->fb_phys); fbdev->fb_mem, fbdev->fb_phys);
if (fbdev->fb_info.cmap.len != 0) if (fbi->cmap.len != 0)
fb_dealloc_cmap(&fbdev->fb_info.cmap); fb_dealloc_cmap(&fbi->cmap);
if (fbdev->fb_info.pseudo_palette) kfree(fbi->pseudo_palette);
kfree(fbdev->fb_info.pseudo_palette);
framebuffer_release(fbi);
_au1200fb_infos[plane] = NULL;
} }
free_irq(AU1200_LCD_INT, (void *)dev); free_irq(platform_get_irq(dev, 0), (void *)dev);
return 0; return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int au1200fb_drv_suspend(struct platform_device *dev, u32 state) static int au1200fb_drv_suspend(struct device *dev)
{ {
/* TODO */ au1200_setpanel(NULL);
lcd->outmask = 0;
au_sync();
return 0; return 0;
} }
static int au1200fb_drv_resume(struct platform_device *dev) static int au1200fb_drv_resume(struct device *dev)
{ {
/* TODO */ struct fb_info *fbi;
int i;
/* Kickstart the panel */
au1200_setpanel(panel);
for (i = 0; i < device_count; i++) {
fbi = _au1200fb_infos[i];
au1200fb_fb_set_par(fbi);
}
return 0; return 0;
} }
static const struct dev_pm_ops au1200fb_pmops = {
.suspend = au1200fb_drv_suspend,
.resume = au1200fb_drv_resume,
.freeze = au1200fb_drv_suspend,
.thaw = au1200fb_drv_resume,
};
#define AU1200FB_PMOPS (&au1200fb_pmops)
#else
#define AU1200FB_PMOPS NULL
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
static struct platform_driver au1200fb_driver = { static struct platform_driver au1200fb_driver = {
.driver = { .driver = {
.name = "au1200-lcd", .name = "au1200-lcd",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = AU1200FB_PMOPS,
}, },
.probe = au1200fb_drv_probe, .probe = au1200fb_drv_probe,
.remove = au1200fb_drv_remove, .remove = __devexit_p(au1200fb_drv_remove),
#ifdef CONFIG_PM
.suspend = au1200fb_drv_suspend,
.resume = au1200fb_drv_resume,
#endif
}; };
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
/* Kernel driver */ /* Kernel driver */
static void au1200fb_setup(void) static int au1200fb_setup(void)
{ {
char* options = NULL; char *options = NULL;
char* this_opt; char *this_opt, *endptr;
int num_panels = ARRAY_SIZE(known_lcd_panels); int num_panels = ARRAY_SIZE(known_lcd_panels);
int panel_idx = -1; int panel_idx = -1;
...@@ -1827,70 +1831,42 @@ static void au1200fb_setup(void) ...@@ -1827,70 +1831,42 @@ static void au1200fb_setup(void)
nohwcursor = 1; nohwcursor = 1;
} }
/* Unsupported option */ else if (strncmp(this_opt, "devices:", 8) == 0) {
else { this_opt += 8;
print_warn("Unsupported option \"%s\"", this_opt); device_count = simple_strtol(this_opt,
&endptr, 0);
if ((device_count < 0) ||
(device_count > MAX_DEVICE_COUNT))
device_count = MAX_DEVICE_COUNT;
} }
}
}
}
#ifdef CONFIG_PM else if (strncmp(this_opt, "wincfg:", 7) == 0) {
static int au1200fb_pm_callback(au1xxx_power_dev_t *dev, this_opt += 7;
au1xxx_request_t request, void *data) { window_index = simple_strtol(this_opt,
int retval = -1; &endptr, 0);
unsigned int d = 0; if ((window_index < 0) ||
unsigned int brightness = 0; (window_index >= ARRAY_SIZE(windows)))
window_index = DEFAULT_WINDOW_INDEX;
if (request == AU1XXX_PM_SLEEP) {
board_au1200fb_panel_shutdown();
}
else if (request == AU1XXX_PM_WAKEUP) {
if(dev->prev_state == SLEEP_STATE)
{
int plane;
au1200_setpanel(panel);
for (plane = 0; plane < CONFIG_FB_AU1200_DEVS; ++plane) {
struct au1200fb_device *fbdev;
fbdev = &_au1200fb_devices[plane];
au1200fb_fb_set_par(&fbdev->fb_info);
} }
}
d = *((unsigned int*)data); else if (strncmp(this_opt, "off", 3) == 0)
if(d <=10) brightness = 26; return 1;
else if(d<=20) brightness = 51; /* Unsupported option */
else if(d<=30) brightness = 77; else {
else if(d<=40) brightness = 102; print_warn("Unsupported option \"%s\"", this_opt);
else if(d<=50) brightness = 128; }
else if(d<=60) brightness = 153;
else if(d<=70) brightness = 179;
else if(d<=80) brightness = 204;
else if(d<=90) brightness = 230;
else brightness = 255;
set_brightness(brightness);
} else if (request == AU1XXX_PM_GETSTATUS) {
return dev->cur_state;
} else if (request == AU1XXX_PM_ACCESS) {
if (dev->cur_state != SLEEP_STATE)
return retval;
else {
au1200_setpanel(panel);
} }
} else if (request == AU1XXX_PM_IDLE) {
} else if (request == AU1XXX_PM_CLEANUP) {
} }
return 0;
return retval;
} }
#endif
static int __init au1200fb_init(void) static int __init au1200fb_init(void)
{ {
print_info("" DRIVER_DESC ""); print_info("" DRIVER_DESC "");
/* Setup driver with options */ /* Setup driver with options */
au1200fb_setup(); if (au1200fb_setup())
return -ENODEV;
/* Point to the panel selected */ /* Point to the panel selected */
panel = &known_lcd_panels[panel_index]; panel = &known_lcd_panels[panel_index];
...@@ -1899,17 +1875,6 @@ static int __init au1200fb_init(void) ...@@ -1899,17 +1875,6 @@ static int __init au1200fb_init(void)
printk(DRIVER_NAME ": Panel %d %s\n", panel_index, panel->name); printk(DRIVER_NAME ": Panel %d %s\n", panel_index, panel->name);
printk(DRIVER_NAME ": Win %d %s\n", window_index, win->name); printk(DRIVER_NAME ": Win %d %s\n", window_index, win->name);
/* Kickstart the panel, the framebuffers/windows come soon enough */
au1200_setpanel(panel);
#ifdef CONFIG_PM
LCD_pm_dev = new_au1xxx_power_device("LCD", &au1200fb_pm_callback, NULL);
if ( LCD_pm_dev == NULL)
printk(KERN_INFO "Unable to create a power management device entry for the au1200fb.\n");
else
printk(KERN_INFO "Power management device entry for the au1200fb loaded.\n");
#endif
return platform_driver_register(&au1200fb_driver); return platform_driver_register(&au1200fb_driver);
} }
......
...@@ -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>
......
...@@ -633,7 +633,7 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev) ...@@ -633,7 +633,7 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
goto out7; goto out7;
} }
if (request_irq(info->irq, bfin_bf54x_irq_error, IRQF_DISABLED, if (request_irq(info->irq, bfin_bf54x_irq_error, 0,
"PPI ERROR", info) < 0) { "PPI ERROR", info) < 0) {
printk(KERN_ERR DRIVER_NAME printk(KERN_ERR DRIVER_NAME
": unable to request PPI ERROR IRQ\n"); ": unable to request PPI ERROR IRQ\n");
......
...@@ -695,7 +695,7 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev) ...@@ -695,7 +695,7 @@ static int __devinit bfin_lq035q1_probe(struct platform_device *pdev)
goto out7; goto out7;
} }
ret = request_irq(info->irq, bfin_lq035q1_irq_error, IRQF_DISABLED, ret = request_irq(info->irq, bfin_lq035q1_irq_error, 0,
DRIVER_NAME" PPI ERROR", info); DRIVER_NAME" PPI ERROR", info);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "unable to request PPI ERROR IRQ\n"); dev_err(&pdev->dev, "unable to request PPI ERROR IRQ\n");
......
...@@ -529,7 +529,7 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev) ...@@ -529,7 +529,7 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
goto out7; goto out7;
} }
ret = request_irq(info->irq, bfin_t350mcqb_irq_error, IRQF_DISABLED, ret = request_irq(info->irq, bfin_t350mcqb_irq_error, 0,
"PPI ERROR", info); "PPI ERROR", info);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR DRIVER_NAME printk(KERN_ERR DRIVER_NAME
......
...@@ -481,7 +481,7 @@ static int __devinit bfin_adv7393_fb_probe(struct i2c_client *client, ...@@ -481,7 +481,7 @@ static int __devinit bfin_adv7393_fb_probe(struct i2c_client *client,
goto out_4; goto out_4;
} }
if (request_irq(IRQ_PPI_ERROR, ppi_irq_error, IRQF_DISABLED, if (request_irq(IRQ_PPI_ERROR, ppi_irq_error, 0,
"PPI ERROR", fbdev) < 0) { "PPI ERROR", fbdev) < 0) {
dev_err(&client->dev, "unable to request PPI ERROR IRQ\n"); dev_err(&client->dev, "unable to request PPI ERROR IRQ\n");
ret = -EFAULT; ret = -EFAULT;
......
...@@ -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);
...@@ -413,18 +460,43 @@ static int lcd_cfg_frame_buffer(struct da8xx_fb_par *par, u32 width, u32 height, ...@@ -413,18 +460,43 @@ static int lcd_cfg_frame_buffer(struct da8xx_fb_par *par, u32 width, u32 height,
/* Set the Panel Width */ /* Set the Panel Width */
/* Pixels per line = (PPL + 1)*16 */ /* Pixels per line = (PPL + 1)*16 */
/*0x3F in bits 4..9 gives max horisontal resolution = 1024 pixels*/ if (lcd_revision == LCD_VERSION_1) {
width &= 0x3f0; /*
* 0x3F in bits 4..9 gives max horizontal resolution = 1024
* pixels.
*/
width &= 0x3f0;
} else {
/*
* 0x7F in bits 4..10 gives max horizontal resolution = 2048
* pixels.
*/
width &= 0x7f0;
}
reg = lcdc_read(LCD_RASTER_TIMING_0_REG); reg = lcdc_read(LCD_RASTER_TIMING_0_REG);
reg &= 0xfffffc00; reg &= 0xfffffc00;
reg |= ((width >> 4) - 1) << 4; if (lcd_revision == LCD_VERSION_1) {
reg |= ((width >> 4) - 1) << 4;
} else {
width = (width >> 4) - 1;
reg |= ((width & 0x3f) << 4) | ((width & 0x40) >> 3);
}
lcdc_write(reg, LCD_RASTER_TIMING_0_REG); lcdc_write(reg, LCD_RASTER_TIMING_0_REG);
/* Set the Panel Height */ /* Set the Panel Height */
/* Set bits 9:0 of Lines Per Pixel */
reg = lcdc_read(LCD_RASTER_TIMING_1_REG); reg = lcdc_read(LCD_RASTER_TIMING_1_REG);
reg = ((height - 1) & 0x3ff) | (reg & 0xfffffc00); reg = ((height - 1) & 0x3ff) | (reg & 0xfffffc00);
lcdc_write(reg, LCD_RASTER_TIMING_1_REG); lcdc_write(reg, LCD_RASTER_TIMING_1_REG);
/* Set bit 10 of Lines Per Pixel */
if (lcd_revision == LCD_VERSION_2) {
reg = lcdc_read(LCD_RASTER_TIMING_2_REG);
reg |= ((height - 1) & 0x400) << 16;
lcdc_write(reg, LCD_RASTER_TIMING_2_REG);
}
/* Set the Raster Order of the Frame Buffer */ /* Set the Raster Order of the Frame Buffer */
reg = lcdc_read(LCD_RASTER_CTRL_REG) & ~(1 << 8); reg = lcdc_read(LCD_RASTER_CTRL_REG) & ~(1 << 8);
if (raster_order) if (raster_order)
...@@ -511,6 +583,9 @@ static void lcd_reset(struct da8xx_fb_par *par) ...@@ -511,6 +583,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 +598,11 @@ static void lcd_calc_clk_divider(struct da8xx_fb_par *par) ...@@ -523,6 +598,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 +663,63 @@ static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, ...@@ -583,7 +663,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 +742,7 @@ static irqreturn_t lcdc_irq_handler(int irq, void *arg) ...@@ -606,7 +742,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 */
...@@ -877,8 +1013,8 @@ static int da8xx_pan_display(struct fb_var_screeninfo *var, ...@@ -877,8 +1013,8 @@ static int da8xx_pan_display(struct fb_var_screeninfo *var,
start = fix->smem_start + start = fix->smem_start +
new_var.yoffset * fix->line_length + new_var.yoffset * fix->line_length +
new_var.xoffset * var->bits_per_pixel / 8; new_var.xoffset * fbi->var.bits_per_pixel / 8;
end = start + var->yres * fix->line_length - 1; end = start + fbi->var.yres * fix->line_length - 1;
par->dma_start = start; par->dma_start = start;
par->dma_end = end; par->dma_end = end;
} }
...@@ -945,6 +1081,22 @@ static int __devinit fb_probe(struct platform_device *device) ...@@ -945,6 +1081,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 +1237,13 @@ static int __devinit fb_probe(struct platform_device *device) ...@@ -1085,7 +1237,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;
......
...@@ -624,8 +624,8 @@ static int unifb_pan_display(struct fb_var_screeninfo *var, ...@@ -624,8 +624,8 @@ static int unifb_pan_display(struct fb_var_screeninfo *var,
|| var->xoffset) || var->xoffset)
return -EINVAL; return -EINVAL;
} else { } else {
if (var->xoffset + var->xres > info->var.xres_virtual || if (var->xoffset + info->var.xres > info->var.xres_virtual ||
var->yoffset + var->yres > info->var.yres_virtual) var->yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL; return -EINVAL;
} }
info->var.xoffset = var->xoffset; info->var.xoffset = var->xoffset;
......
...@@ -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) {
......
...@@ -1738,8 +1738,6 @@ void fb_set_suspend(struct fb_info *info, int state) ...@@ -1738,8 +1738,6 @@ void fb_set_suspend(struct fb_info *info, int state)
{ {
struct fb_event event; struct fb_event event;
if (!lock_fb_info(info))
return;
event.info = info; event.info = info;
if (state) { if (state) {
fb_notifier_call_chain(FB_EVENT_SUSPEND, &event); fb_notifier_call_chain(FB_EVENT_SUSPEND, &event);
...@@ -1748,7 +1746,6 @@ void fb_set_suspend(struct fb_info *info, int state) ...@@ -1748,7 +1746,6 @@ void fb_set_suspend(struct fb_info *info, int state)
info->state = FBINFO_STATE_RUNNING; info->state = FBINFO_STATE_RUNNING;
fb_notifier_call_chain(FB_EVENT_RESUME, &event); fb_notifier_call_chain(FB_EVENT_RESUME, &event);
} }
unlock_fb_info(info);
} }
/** /**
......
...@@ -493,7 +493,8 @@ static int get_est_timing(unsigned char *block, struct fb_videomode *mode) ...@@ -493,7 +493,8 @@ static int get_est_timing(unsigned char *block, struct fb_videomode *mode)
return num; return num;
} }
static int get_std_timing(unsigned char *block, struct fb_videomode *mode) static int get_std_timing(unsigned char *block, struct fb_videomode *mode,
int ver, int rev)
{ {
int xres, yres = 0, refresh, ratio, i; int xres, yres = 0, refresh, ratio, i;
...@@ -504,7 +505,11 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode) ...@@ -504,7 +505,11 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode)
ratio = (block[1] & 0xc0) >> 6; ratio = (block[1] & 0xc0) >> 6;
switch (ratio) { switch (ratio) {
case 0: case 0:
yres = xres; /* in EDID 1.3 the meaning of 0 changed to 16:10 (prior 1:1) */
if (ver < 1 || (ver == 1 && rev < 3))
yres = xres;
else
yres = (xres * 10)/16;
break; break;
case 1: case 1:
yres = (xres * 3)/4; yres = (xres * 3)/4;
...@@ -533,12 +538,12 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode) ...@@ -533,12 +538,12 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode)
} }
static int get_dst_timing(unsigned char *block, static int get_dst_timing(unsigned char *block,
struct fb_videomode *mode) struct fb_videomode *mode, int ver, int rev)
{ {
int j, num = 0; int j, num = 0;
for (j = 0; j < 6; j++, block += STD_TIMING_DESCRIPTION_SIZE) for (j = 0; j < 6; j++, block += STD_TIMING_DESCRIPTION_SIZE)
num += get_std_timing(block, &mode[num]); num += get_std_timing(block, &mode[num], ver, rev);
return num; return num;
} }
...@@ -599,6 +604,10 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize) ...@@ -599,6 +604,10 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize)
struct fb_videomode *mode, *m; struct fb_videomode *mode, *m;
unsigned char *block; unsigned char *block;
int num = 0, i, first = 1; int num = 0, i, first = 1;
int ver, rev;
ver = edid[EDID_STRUCT_VERSION];
rev = edid[EDID_STRUCT_REVISION];
mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL); mode = kzalloc(50 * sizeof(struct fb_videomode), GFP_KERNEL);
if (mode == NULL) if (mode == NULL)
...@@ -632,12 +641,12 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize) ...@@ -632,12 +641,12 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize)
DPRINTK(" Standard Timings\n"); DPRINTK(" Standard Timings\n");
block = edid + STD_TIMING_DESCRIPTIONS_START; block = edid + STD_TIMING_DESCRIPTIONS_START;
for (i = 0; i < STD_TIMING; i++, block += STD_TIMING_DESCRIPTION_SIZE) for (i = 0; i < STD_TIMING; i++, block += STD_TIMING_DESCRIPTION_SIZE)
num += get_std_timing(block, &mode[num]); num += get_std_timing(block, &mode[num], ver, rev);
block = edid + DETAILED_TIMING_DESCRIPTIONS_START; block = edid + DETAILED_TIMING_DESCRIPTIONS_START;
for (i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) { for (i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) {
if (block[0] == 0x00 && block[1] == 0x00 && block[3] == 0xfa) if (block[0] == 0x00 && block[1] == 0x00 && block[3] == 0xfa)
num += get_dst_timing(block + 5, &mode[num]); num += get_dst_timing(block + 5, &mode[num], ver, rev);
} }
/* Yikes, EDID data is totally useless */ /* Yikes, EDID data is totally useless */
......
...@@ -399,9 +399,12 @@ static ssize_t store_fbstate(struct device *device, ...@@ -399,9 +399,12 @@ static ssize_t store_fbstate(struct device *device,
state = simple_strtoul(buf, &last, 0); state = simple_strtoul(buf, &last, 0);
if (!lock_fb_info(fb_info))
return -ENODEV;
console_lock(); console_lock();
fb_set_suspend(fb_info, (int)state); fb_set_suspend(fb_info, (int)state);
console_unlock(); console_unlock();
unlock_fb_info(fb_info);
return count; return count;
} }
......
此差异已折叠。
...@@ -149,10 +149,11 @@ int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor) ...@@ -149,10 +149,11 @@ int g364fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
static int g364fb_pan_display(struct fb_var_screeninfo *var, static int g364fb_pan_display(struct fb_var_screeninfo *var,
struct fb_info *info) struct fb_info *info)
{ {
if (var->xoffset || var->yoffset + var->yres > var->yres_virtual) if (var->xoffset ||
var->yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL; return -EINVAL;
*(unsigned int *) TOP_REG = var->yoffset * var->xres; *(unsigned int *) TOP_REG = var->yoffset * info->var.xres;
return 0; return 0;
} }
......
此差异已折叠。
...@@ -543,8 +543,8 @@ static int gxt4500_pan_display(struct fb_var_screeninfo *var, ...@@ -543,8 +543,8 @@ static int gxt4500_pan_display(struct fb_var_screeninfo *var,
if (var->xoffset & 7) if (var->xoffset & 7)
return -EINVAL; return -EINVAL;
if (var->xoffset + var->xres > var->xres_virtual || if (var->xoffset + info->var.xres > info->var.xres_virtual ||
var->yoffset + var->yres > var->yres_virtual) var->yoffset + info->var.yres > info->var.yres_virtual)
return -EINVAL; return -EINVAL;
writereg(par, REFRESH_START, (var->xoffset << 16) | var->yoffset); writereg(par, REFRESH_START, (var->xoffset << 16) | var->yoffset);
......
...@@ -422,8 +422,8 @@ static int hgafb_pan_display(struct fb_var_screeninfo *var, ...@@ -422,8 +422,8 @@ static int hgafb_pan_display(struct fb_var_screeninfo *var,
var->xoffset) var->xoffset)
return -EINVAL; return -EINVAL;
} else { } else {
if (var->xoffset + var->xres > info->var.xres_virtual if (var->xoffset + info->var.xres > info->var.xres_virtual
|| var->yoffset + var->yres > info->var.yres_virtual || var->yoffset + info->var.yres > info->var.yres_virtual
|| var->yoffset % 8) || var->yoffset % 8)
return -EINVAL; return -EINVAL;
} }
......
...@@ -749,7 +749,7 @@ set_offset (struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -749,7 +749,7 @@ set_offset (struct fb_var_screeninfo *var, struct fb_info *info)
{ {
struct imstt_par *par = info->par; struct imstt_par *par = info->par;
__u32 off = var->yoffset * (info->fix.line_length >> 3) __u32 off = var->yoffset * (info->fix.line_length >> 3)
+ ((var->xoffset * (var->bits_per_pixel >> 3)) >> 3); + ((var->xoffset * (info->var.bits_per_pixel >> 3)) >> 3);
write_reg_le32(par->dc_regs, SSR, off); write_reg_le32(par->dc_regs, SSR, off);
} }
......
...@@ -390,12 +390,12 @@ int intelfbhw_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) ...@@ -390,12 +390,12 @@ int intelfbhw_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
xoffset = ROUND_DOWN_TO(var->xoffset, 8); xoffset = ROUND_DOWN_TO(var->xoffset, 8);
yoffset = var->yoffset; yoffset = var->yoffset;
if ((xoffset + var->xres > var->xres_virtual) || if ((xoffset + info->var.xres > info->var.xres_virtual) ||
(yoffset + var->yres > var->yres_virtual)) (yoffset + info->var.yres > info->var.yres_virtual))
return -EINVAL; return -EINVAL;
offset = (yoffset * dinfo->pitch) + offset = (yoffset * dinfo->pitch) +
(xoffset * var->bits_per_pixel) / 8; (xoffset * info->var.bits_per_pixel) / 8;
offset += dinfo->fb.offset << 12; offset += dinfo->fb.offset << 12;
......
...@@ -23,7 +23,7 @@ static int mb862xx_i2c_wait_event(struct i2c_adapter *adap) ...@@ -23,7 +23,7 @@ static int mb862xx_i2c_wait_event(struct i2c_adapter *adap)
u32 reg; u32 reg;
do { do {
udelay(1); udelay(10);
reg = inreg(i2c, GC_I2C_BCR); reg = inreg(i2c, GC_I2C_BCR);
if (reg & (I2C_INT | I2C_BER)) if (reg & (I2C_INT | I2C_BER))
break; break;
......
...@@ -278,7 +278,7 @@ static int mb862xxfb_pan(struct fb_var_screeninfo *var, ...@@ -278,7 +278,7 @@ static int mb862xxfb_pan(struct fb_var_screeninfo *var,
reg = pack(var->yoffset, var->xoffset); reg = pack(var->yoffset, var->xoffset);
outreg(disp, GC_L0WY_L0WX, reg); outreg(disp, GC_L0WY_L0WX, reg);
reg = pack(var->yres_virtual, var->xres_virtual); reg = pack(info->var.yres_virtual, info->var.xres_virtual);
outreg(disp, GC_L0WH_L0WW, reg); outreg(disp, GC_L0WH_L0WW, reg);
return 0; return 0;
} }
...@@ -737,7 +737,7 @@ static int __devinit of_platform_mb862xx_probe(struct platform_device *ofdev) ...@@ -737,7 +737,7 @@ static int __devinit of_platform_mb862xx_probe(struct platform_device *ofdev)
if (mb862xx_gdc_init(par)) if (mb862xx_gdc_init(par))
goto io_unmap; goto io_unmap;
if (request_irq(par->irq, mb862xx_intr, IRQF_DISABLED, if (request_irq(par->irq, mb862xx_intr, 0,
DRV_NAME, (void *)par)) { DRV_NAME, (void *)par)) {
dev_err(dev, "Cannot request irq\n"); dev_err(dev, "Cannot request irq\n");
goto io_unmap; goto io_unmap;
...@@ -1073,7 +1073,7 @@ static int __devinit mb862xx_pci_probe(struct pci_dev *pdev, ...@@ -1073,7 +1073,7 @@ static int __devinit mb862xx_pci_probe(struct pci_dev *pdev,
if (mb862xx_pci_gdc_init(par)) if (mb862xx_pci_gdc_init(par))
goto io_unmap; goto io_unmap;
if (request_irq(par->irq, mb862xx_intr, IRQF_DISABLED | IRQF_SHARED, if (request_irq(par->irq, mb862xx_intr, IRQF_SHARED,
DRV_NAME, (void *)par)) { DRV_NAME, (void *)par)) {
dev_err(dev, "Cannot request irq\n"); dev_err(dev, "Cannot request irq\n");
goto io_unmap; goto io_unmap;
......
此差异已折叠。
...@@ -715,7 +715,7 @@ static int __devinit mddi_probe(struct platform_device *pdev) ...@@ -715,7 +715,7 @@ static int __devinit mddi_probe(struct platform_device *pdev)
mddi->int_enable = 0; mddi->int_enable = 0;
mddi_writel(mddi->int_enable, INTEN); mddi_writel(mddi->int_enable, INTEN);
ret = request_irq(mddi->irq, mddi_isr, IRQF_DISABLED, "mddi", ret = request_irq(mddi->irq, mddi_isr, 0, "mddi",
&mddi->client_data); &mddi->client_data);
if (ret) { if (ret) {
printk(KERN_ERR "mddi: failed to request enable irq!\n"); printk(KERN_ERR "mddi: failed to request enable irq!\n");
......
...@@ -421,10 +421,11 @@ int mdp_probe(struct platform_device *pdev) ...@@ -421,10 +421,11 @@ 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, 0, "msm_mdp", mdp);
if (ret) if (ret)
goto error_request_irq; goto error_request_irq;
disable_irq(mdp->irq); disable_irq(mdp->irq);
...@@ -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:
......
...@@ -382,6 +382,9 @@ static void sdc_disable_channel(struct mx3fb_info *mx3_fbi) ...@@ -382,6 +382,9 @@ static void sdc_disable_channel(struct mx3fb_info *mx3_fbi)
uint32_t enabled; uint32_t enabled;
unsigned long flags; unsigned long flags;
if (mx3_fbi->txd == NULL)
return;
spin_lock_irqsave(&mx3fb->lock, flags); spin_lock_irqsave(&mx3fb->lock, flags);
enabled = sdc_fb_uninit(mx3_fbi); enabled = sdc_fb_uninit(mx3_fbi);
...@@ -986,9 +989,19 @@ static void __blank(int blank, struct fb_info *fbi) ...@@ -986,9 +989,19 @@ static void __blank(int blank, struct fb_info *fbi)
{ {
struct mx3fb_info *mx3_fbi = fbi->par; struct mx3fb_info *mx3_fbi = fbi->par;
struct mx3fb_data *mx3fb = mx3_fbi->mx3fb; struct mx3fb_data *mx3fb = mx3_fbi->mx3fb;
int was_blank = mx3_fbi->blank;
mx3_fbi->blank = blank; mx3_fbi->blank = blank;
/* Attention!
* Do not call sdc_disable_channel() for a channel that is disabled
* already! This will result in a kernel NULL pointer dereference
* (mx3_fbi->txd is NULL). Hide the fact, that all blank modes are
* handled equally by this driver.
*/
if (blank > FB_BLANK_UNBLANK && was_blank > FB_BLANK_UNBLANK)
return;
switch (blank) { switch (blank) {
case FB_BLANK_POWERDOWN: case FB_BLANK_POWERDOWN:
case FB_BLANK_VSYNC_SUSPEND: case FB_BLANK_VSYNC_SUSPEND:
...@@ -1062,15 +1075,15 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var, ...@@ -1062,15 +1075,15 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
y_bottom = var->yoffset; y_bottom = var->yoffset;
if (!(var->vmode & FB_VMODE_YWRAP)) if (!(var->vmode & FB_VMODE_YWRAP))
y_bottom += var->yres; y_bottom += fbi->var.yres;
if (y_bottom > fbi->var.yres_virtual) if (y_bottom > fbi->var.yres_virtual)
return -EINVAL; return -EINVAL;
mutex_lock(&mx3_fbi->mutex); mutex_lock(&mx3_fbi->mutex);
offset = (var->yoffset * var->xres_virtual + var->xoffset) * offset = var->yoffset * fbi->fix.line_length
(var->bits_per_pixel / 8); + var->xoffset * (fbi->var.bits_per_pixel / 8);
base = fbi->fix.smem_start + offset; base = fbi->fix.smem_start + offset;
dev_dbg(fbi->device, "Updating SDC BG buf %d address=0x%08lX\n", dev_dbg(fbi->device, "Updating SDC BG buf %d address=0x%08lX\n",
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
* the required value in the imx_fb_videomode structure. * the required value in the imx_fb_videomode structure.
*/ */
#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/clk.h> #include <linux/clk.h>
......
...@@ -1185,8 +1185,8 @@ static int neofb_pan_display(struct fb_var_screeninfo *var, ...@@ -1185,8 +1185,8 @@ static int neofb_pan_display(struct fb_var_screeninfo *var,
DBG("neofb_update_start"); DBG("neofb_update_start");
Base = (var->yoffset * var->xres_virtual + var->xoffset) >> 2; Base = (var->yoffset * info->var.xres_virtual + var->xoffset) >> 2;
Base *= (var->bits_per_pixel + 7) / 8; Base *= (info->var.bits_per_pixel + 7) / 8;
neoUnlock(); neoUnlock();
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册