diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-30 15:30:01 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-30 15:30:01 -0700 |
commit | acff987d94cbdb4049f3706bed1f1792f8ef6837 (patch) | |
tree | 36bded977aab5d80cf9aeb5467f83dd554a25d01 /arch | |
parent | ce949717b559709423c1ef716a9db16d1dcadaed (diff) | |
parent | b57287ba497b63a0d87a058631bbddfed9392e9f (diff) |
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)
Diffstat (limited to 'arch')
25 files changed, 584 insertions, 276 deletions
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 87f43ade440..f8ce84b69eb 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -39,6 +39,9 @@ #include <plat/usb.h> #include <plat/gpmc-smc91x.h> +#include <video/omapdss.h> +#include <video/omap-panel-generic-dpi.h> + #include "mux.h" #include "hsmmc.h" #include "common-board-devices.h" @@ -99,20 +102,72 @@ static struct platform_device sdp2430_flash_device = { .resource = &sdp2430_flash_resource, }; -static struct platform_device sdp2430_lcd_device = { - .name = "sdp2430_lcd", - .id = -1, -}; - static struct platform_device *sdp2430_devices[] __initdata = { &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, }; -static struct omap_lcd_config sdp2430_lcd_config __initdata = { - .ctrl_name = "internal", +static struct omap_dss_board_info sdp2430_dss_data = { + .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) static struct omap_smc91x_platform_data board_smc91x_data = { @@ -137,10 +192,6 @@ static inline void board_smc91x_init(void) #endif -static struct omap_board_config_kernel sdp2430_config[] __initdata = { - {OMAP_TAG_LCD, &sdp2430_lcd_config}, -}; - static void __init omap_2430sdp_init_early(void) { omap2_init_common_infrastructure(); @@ -229,9 +280,6 @@ static void __init omap_2430sdp_init(void) { omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); - omap_board_config = sdp2430_config; - omap_board_config_size = ARRAY_SIZE(sdp2430_config); - omap2430_i2c_init(); platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); @@ -247,6 +295,8 @@ static void __init omap_2430sdp_init(void) /* Turn off secondary LCD backlight */ gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW, "Secondary LCD backlight"); + + sdp2430_display_init(); } static void __init omap_2430sdp_map_io(void) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 2430531b223..204beddcb94 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -37,7 +37,7 @@ #include <plat/dma.h> #include <plat/gpmc.h> #include <video/omapdss.h> -#include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h> #include <plat/gpmc-smc91x.h> @@ -186,8 +186,7 @@ static struct omap_dss_device sdp3430_lcd_device = { .platform_disable = sdp3430_panel_disable_lcd, }; -static struct panel_generic_dpi_data dvi_panel = { - .name = "generic", +static struct panel_dvi_platform_data dvi_panel = { .platform_enable = sdp3430_panel_enable_dvi, .platform_disable = sdp3430_panel_disable_dvi, }; @@ -195,7 +194,7 @@ static struct panel_generic_dpi_data dvi_panel = { static struct omap_dss_device sdp3430_dvi_device = { .name = "dvi", .type = OMAP_DISPLAY_TYPE_DPI, - .driver_name = "generic_dpi_panel", + .driver_name = "dvi", .data = &dvi_panel, .phy.dpi.data_lines = 24, }; diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index be931105d68..484cec54882 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -38,6 +38,8 @@ #include <plat/mmc.h> #include <plat/omap4-keypad.h> #include <video/omapdss.h> +#include <video/omap-panel-nokia-dsi.h> +#include <video/omap-panel-picodlp.h> #include <linux/wl12xx.h> #include "mux.h" @@ -52,6 +54,8 @@ #define OMAP4_SFH7741_ENABLE_GPIO 188 #define HDMI_GPIO_HPD 60 /* Hot plug pin 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_IRQ 53 @@ -340,11 +344,6 @@ static int __init omap_ethernet_init(void) return status; } -static struct platform_device sdp4430_lcd_device = { - .name = "sdp4430_lcd", - .id = -1, -}; - static struct regulator_consumer_supply sdp4430_vbat_supply[] = { REGULATOR_SUPPLY("vddvibl", "twl6040-vibra"), REGULATOR_SUPPLY("vddvibr", "twl6040-vibra"), @@ -374,21 +373,12 @@ static struct platform_device sdp4430_vbat = { }; static struct platform_device *sdp4430_devices[] __initdata = { - &sdp4430_lcd_device, &sdp4430_gpio_keys_device, &sdp4430_leds_gpio, &sdp4430_leds_pwm, &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) { omap2_init_common_infrastructure(); @@ -648,37 +638,202 @@ static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev) gpio_free(HDMI_GPIO_HPD); } -static struct omap_dss_device sdp4430_hdmi_device = { - .name = "hdmi", - .driver_name = "hdmi_panel", - .type = OMAP_DISPLAY_TYPE_HDMI, - .clocks = { - .dispc = { +static struct nokia_dsi_panel_data dsi1_panel = { + .name = "taal", + .reset_gpio = 102, + .use_ext_te = false, + .ext_te_gpio = 101, + .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, }, - .hdmi = { - .regn = 15, - .regm2 = 1, + + .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_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_disable = sdp4430_panel_disable_hdmi, .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[] = { + &sdp4430_lcd_device, + &sdp4430_lcd2_device, &sdp4430_hdmi_device, + &sdp4430_picodlp_device, }; static struct omap_dss_board_info sdp4430_dss_data = { .num_devices = ARRAY_SIZE(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_picodlp_init(); omap_display_init(&sdp4430_dss_data); } @@ -802,9 +957,6 @@ static void __init omap_4430sdp_init(void) package = OMAP_PACKAGE_CBL; omap4_mux_init(board_mux, NULL, package); - omap_board_config = sdp4430_config; - omap_board_config_size = ARRAY_SIZE(sdp4430_config); - omap4_i2c_init(); omap_sfh7741prox_init(); platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 1325085e453..ab10f75984d 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -36,6 +36,7 @@ #include <plat/usb.h> #include <video/omapdss.h> #include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h> #include "mux.h" #include "control.h" @@ -333,8 +334,7 @@ static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) dvi_enabled = 0; } -static struct panel_generic_dpi_data dvi_panel = { - .name = "generic", +static struct panel_dvi_platform_data dvi_panel = { .platform_enable = am3517_evm_panel_enable_dvi, .platform_disable = am3517_evm_panel_disable_dvi, }; @@ -342,7 +342,7 @@ static struct panel_generic_dpi_data dvi_panel = { static struct omap_dss_device am3517_evm_dvi_device = { .type = OMAP_DISPLAY_TYPE_DPI, .name = "dvi", - .driver_name = "generic_dpi_panel", + .driver_name = "dvi", .data = &dvi_panel, .phy.dpi.data_lines = 24, }; diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 67800e647d7..ad55351e0ca 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -40,6 +40,9 @@ #include <plat/common.h> #include <plat/gpmc.h> +#include <video/omapdss.h> +#include <video/omap-panel-generic-dpi.h> + #include "mux.h" #include "control.h" @@ -149,11 +152,6 @@ static struct platform_device apollon_smc91x_device = { .resource = apollon_smc91x_resources, }; -static struct platform_device apollon_lcd_device = { - .name = "apollon_lcd", - .id = -1, -}; - static struct omap_led_config apollon_led_config[] = { { .cdev = { @@ -191,7 +189,6 @@ static struct platform_device apollon_led_device = { static struct platform_device *apollon_devices[] __initdata = { &apollon_onenand_device, &apollon_smc91x_device, - &apollon_lcd_device, &apollon_led_device, }; @@ -265,12 +262,26 @@ static struct omap_usb_config apollon_usb_config __initdata = { .pins[0] = 6, }; -static struct omap_lcd_config apollon_lcd_config __initdata = { - .ctrl_name = "internal", +static struct panel_generic_dpi_data apollon_panel_data = { + .name = "apollon", }; -static struct omap_board_config_kernel apollon_config[] __initdata = { - { OMAP_TAG_LCD, &apollon_lcd_config }, +static struct omap_dss_device apollon_lcd_device = { + .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) @@ -314,8 +325,6 @@ static void __init omap_apollon_init(void) u32 v; 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_led_init(); @@ -340,6 +349,8 @@ static void __init omap_apollon_init(void) */ platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices)); omap_serial_init(); + + omap_display_init(&apollon_dss_data); } static void __init omap_apollon_map_io(void) diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 38179c17550..6e0f0d2e39b 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -43,6 +43,7 @@ #include <plat/usb.h> #include <video/omapdss.h> #include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h> #include <plat/mcspi.h> #include <mach/hardware.h> @@ -242,8 +243,7 @@ static struct omap_dss_device cm_t35_lcd_device = { .phy.dpi.data_lines = 18, }; -static struct panel_generic_dpi_data dvi_panel = { - .name = "generic", +static struct panel_dvi_platform_data dvi_panel = { .platform_enable = cm_t35_panel_enable_dvi, .platform_disable = cm_t35_panel_disable_dvi, }; @@ -251,7 +251,7 @@ static struct panel_generic_dpi_data dvi_panel = { static struct omap_dss_device cm_t35_dvi_device = { .name = "dvi", .type = OMAP_DISPLAY_TYPE_DPI, - .driver_name = "generic_dpi_panel", + .driver_name = "dvi", .data = &dvi_panel, .phy.dpi.data_lines = 24, }; diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 99a42432ac9..d9bfe54917e 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c @@ -47,6 +47,7 @@ #include <plat/usb.h> #include <video/omapdss.h> #include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h> #include <plat/mcspi.h> #include <linux/input/matrix_keypad.h> @@ -139,7 +140,7 @@ static struct regulator_consumer_supply devkit8000_vio_supply[] = { }; static struct panel_generic_dpi_data lcd_panel = { - .name = "generic", + .name = "innolux_at070tn83", .platform_enable = devkit8000_panel_enable_lcd, .platform_disable = devkit8000_panel_disable_lcd, }; @@ -152,8 +153,7 @@ static struct omap_dss_device devkit8000_lcd_device = { .phy.dpi.data_lines = 24, }; -static struct panel_generic_dpi_data dvi_panel = { - .name = "generic", +static struct panel_dvi_platform_data dvi_panel = { .platform_enable = devkit8000_panel_enable_dvi, .platform_disable = devkit8000_panel_disable_dvi, }; @@ -161,7 +161,7 @@ static struct panel_generic_dpi_data dvi_panel = { static struct omap_dss_device devkit8000_dvi_device = { .name = "dvi", .type = OMAP_DISPLAY_TYPE_DPI, - .driver_name = "generic_dpi_panel", + .driver_name = "dvi", .data = &dvi_panel, .phy.dpi.data_lines = 24, }; @@ -267,7 +267,7 @@ static struct twl4030_gpio_platform_data devkit8000_gpio_data = { static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = { 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) */ diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 82421a4cfa9..8fcf79628ca 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -39,6 +39,9 @@ #include <plat/dma.h> #include <plat/gpmc.h> +#include <video/omapdss.h> +#include <video/omap-panel-generic-dpi.h> + #include "mux.h" #include "control.h" @@ -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 = { &h4_flash_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, }; +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) */ static u32 get_sysboot_value(void) { @@ -270,10 +289,6 @@ static void __init h4_init_flash(void) 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 = { /* S1.10 OFF -- usb "download port" * usb0 switched to Mini-B port and isp1105 transceiver; @@ -285,10 +300,6 @@ static struct omap_usb_config h4_usb_config __initdata = { .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) { omap2_init_common_infrastructure(); @@ -330,9 +341,6 @@ static void __init omap_h4_init(void) { 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. * You have to mux them off in device drivers later on @@ -371,6 +379,8 @@ static void __init omap_h4_init(void) omap2_usbfs_init(&h4_usb_config); omap_serial_init(); h4_init_flash(); + + omap_display_init(&h4_dss_data); } static void __init omap_h4_map_io(void) diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 7040352b16b..96f9ef34d2f 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c @@ -32,7 +32,7 @@ #include <plat/gpmc.h> #include <plat/usb.h> #include <video/omapdss.h> -#include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h> #include <plat/onenand.h> #include "mux.h" @@ -455,16 +455,16 @@ static void igep2_disable_dvi(struct omap_dss_device *dssdev) gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0); } -static struct panel_generic_dpi_data dvi_panel = { - .name = "generic", +static struct panel_dvi_platform_data dvi_panel = { .platform_enable = igep2_enable_dvi, .platform_disable = igep2_disable_dvi, + .i2c_bus_num = 3, }; static struct omap_dss_device igep2_dvi_device = { .type = OMAP_DISPLAY_TYPE_DPI, .name = "dvi", - .driver_name = "generic_dpi_panel", + .driver_name = "dvi", .data = &dvi_panel, .phy.dpi.data_lines = 24, }; diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index abe8c7e496a..f8f8a68a489 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -27,6 +27,7 @@ #include <linux/io.h> #include <linux/smsc911x.h> #include <linux/mmc/host.h> +#include <linux/gpio.h> #include <mach/hardware.h> #include <asm/mach-types.h> @@ -43,6 +44,9 @@ #include <plat/usb.h> #include <plat/gpmc-smsc911x.h> +#include <video/omapdss.h> +#include <video/omap-panel-generic-dpi.h> + #include "board-flash.h" #include "mux.h" #include "hsmmc.h" @@ -179,29 +183,108 @@ static inline void __init ldp_init_smsc911x(void) gpmc_smsc911x_init(&smsc911x_cfg); } -static struct platform_device ldp_lcd_device = { - .name = "ldp_lcd", - .id = -1, +/* LCD */ + +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 = { - .ctrl_name = "internal", +static struct omap_dss_device ldp_lcd_device = { + .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 = { - { OMAP_TAG_LCD, &ldp_lcd_config }, +static struct omap_dss_board_info ldp_dss_data = { + .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) { omap2_init_common_infrastructure(); 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 = { .gpio_base = OMAP_MAX_GPIO_LINES, .irq_base = TWL4030_GPIO_IRQ_BASE, .irq_end = TWL4030_GPIO_IRQ_END, + .setup = ldp_twl_gpio_setup, }; static struct regulator_consumer_supply ldp_vmmc1_supply[] = { @@ -243,10 +326,31 @@ static struct regulator_init_data ldp_vaux1 = { .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 = { /* platform_data for children goes here */ .vmmc1 = &ldp_vmmc1, .vaux1 = &ldp_vaux1, + .vpll2 = &ldp_vpll2, .gpio = &ldp_gpio_data, .keypad = &ldp_kp_twl4030_data, }; @@ -272,7 +376,6 @@ static struct omap2_hsmmc_info mmc[] __initdata = { }; static struct platform_device *ldp_devices[] __initdata = { - &ldp_lcd_device, &ldp_gpio_keys_device, }; @@ -317,8 +420,6 @@ static struct mtd_partition ldp_nand_partitions[] = { static void __init omap_ldp_init(void) { omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); - omap_board_config = ldp_config; - omap_board_config_size = ARRAY_SIZE(ldp_config); ldp_init_smsc911x(); omap_i2c_init(); platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); @@ -329,6 +430,7 @@ static void __init omap_ldp_init(void) ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); omap2_hsmmc_init(mmc); + ldp_display_init(); } MACHINE_START(OMAP_LDP, "OMAP LDP board") diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 1fde8a0474b..928933ba28c 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -42,7 +42,7 @@ #include <plat/board.h> #include <plat/common.h> #include <video/omapdss.h> -#include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h> #include <plat/gpmc.h> #include <plat/nand.h> #include <plat/usb.h> @@ -203,16 +203,16 @@ static void beagle_disable_dvi(struct omap_dss_device *dssdev) gpio_set_value(dssdev->reset_gpio, 0); } -static struct panel_generic_dpi_data dvi_panel = { - .name = "generic", +static struct panel_dvi_platform_data dvi_panel = { .platform_enable = beagle_enable_dvi, .platform_disable = beagle_disable_dvi, + .i2c_bus_num = 3, }; static struct omap_dss_device beagle_dvi_device = { .type = OMAP_DISPLAY_TYPE_DPI, .name = "dvi", - .driver_name = "generic_dpi_panel", + .driver_name = "dvi", .data = &dvi_panel, .phy.dpi.data_lines = 24, .reset_gpio = -EINVAL, diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 15c69a0c1ce..0d5a9e46a6a 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -45,7 +45,7 @@ #include <plat/common.h> #include <plat/mcspi.h> #include <video/omapdss.h> -#include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h> #include "mux.h" #include "sdram-micron-mt46h32m32lf-6.h" @@ -247,8 +247,7 @@ static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev) dvi_enabled = 0; } -static struct panel_generic_dpi_data dvi_panel = { - .name = "generic", +static struct panel_dvi_platform_data dvi_panel = { .platform_enable = omap3_evm_enable_dvi, .platform_disable = omap3_evm_disable_dvi, }; @@ -256,7 +255,7 @@ static struct panel_generic_dpi_data dvi_panel = { static struct omap_dss_device omap3_evm_dvi_device = { .name = "dvi", .type = OMAP_DISPLAY_TYPE_DPI, - .driver_name = "generic_dpi_panel", + .driver_name = "dvi", .data = &dvi_panel, .phy.dpi.data_lines = 24, }; diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index ace56938dd3..cca523eb73b 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -335,7 +335,7 @@ static struct regulator_consumer_supply pandora_vmmc3_supply[] = { static struct regulator_consumer_supply pandora_vdds_supplies[] = { REGULATOR_SUPPLY("vdds_sdi", "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[] = { diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index ba13e1d5d0a..4732589ad97 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c @@ -41,6 +41,7 @@ #include <plat/usb.h> #include <video/omapdss.h> #include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h> #include <plat/mcspi.h> #include <linux/input/matrix_keypad.h> @@ -107,39 +108,6 @@ static void __init omap3_stalker_display_init(void) 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) { return 0; @@ -179,8 +147,7 @@ static void omap3_stalker_disable_dvi(struct omap_dss_device *dssdev) dvi_enabled = 0; } -static struct panel_generic_dpi_data dvi_panel = { - .name = "generic", +static struct panel_dvi_platform_data dvi_panel = { .platform_enable = omap3_stalker_enable_dvi, .platform_disable = omap3_stalker_disable_dvi, }; @@ -188,13 +155,12 @@ static struct panel_generic_dpi_data dvi_panel = { static struct omap_dss_device omap3_stalker_dvi_device = { .name = "dvi", .type = OMAP_DISPLAY_TYPE_DPI, - .driver_name = "generic_dpi_panel", + .driver_name = "dvi", .data = &dvi_panel, .phy.dpi.data_lines = 24, }; static struct omap_dss_device *omap3_stalker_dss_devices[] = { - &omap3_stalker_lcd_device, &omap3_stalker_tv_device, &omap3_stalker_dvi_device, }; diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 49e4bd207cb..abb68913e04 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c @@ -104,15 +104,6 @@ static struct omap2_hsmmc_info mmc[] = { {} /* 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[] = { REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), }; @@ -165,14 +156,12 @@ static struct twl4030_gpio_platform_data touchbook_gpio_data = { static struct regulator_consumer_supply touchbook_vdac_supply[] = { { .supply = "vdac", - .dev = &omap3_touchbook_lcd_device.dev, }, }; static struct regulator_consumer_supply touchbook_vdvi_supply[] = { { .supply = "vdvi", - .dev = &omap3_touchbook_lcd_device.dev, }, }; @@ -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 static struct omap_board_mux board_mux[] __initdata = { { .reg_offset = OMAP_MUX_TERMINATOR }, @@ -339,7 +324,6 @@ static void __init omap3_touchbook_init_irq(void) } static struct platform_device *omap3_touchbook_devices[] __initdata = { - &omap3_touchbook_lcd_device, &leds_gpio, &keys_gpio, }; @@ -376,8 +360,6 @@ early_param("tbr", early_touchbook_revision); static void __init omap3_touchbook_init(void) { 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; diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 683bede73d5..ed38d8fd090 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -40,7 +40,7 @@ #include <plat/common.h> #include <plat/usb.h> #include <plat/mmc.h> -#include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h> #include "hsmmc.h" #include "control.h" @@ -455,16 +455,16 @@ static void omap4_panda_disable_dvi(struct omap_dss_device *dssdev) } /* Using generic display panel */ -static struct panel_generic_dpi_data omap4_dvi_panel = { - .name = "generic", +static struct panel_dvi_platform_data omap4_dvi_panel = { .platform_enable = omap4_panda_enable_dvi, .platform_disable = omap4_panda_disable_dvi, + .i2c_bus_num = 3, }; struct omap_dss_device omap4_panda_dvi_device = { .type = OMAP_DISPLAY_TYPE_DPI, .name = "dvi", - .driver_name = "generic_dpi_panel", + .driver_name = "dvi", .data = &omap4_dvi_panel, .phy.dpi.data_lines = 24, .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO, diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index e592fb134c4..ec0f60c1cb7 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -46,6 +46,7 @@ #include <plat/common.h> #include <video/omapdss.h> #include <video/omap-panel-generic-dpi.h> +#include <video/omap-panel-dvi.h> #include <plat/gpmc.h> #include <mach/hardware.h> #include <plat/nand.h> @@ -182,16 +183,16 @@ static void overo_panel_disable_dvi(struct omap_dss_device *dssdev) dvi_enabled = 0; } -static struct panel_generic_dpi_data dvi_panel = { - .name = "generic", +static struct panel_dvi_platform_data dvi_panel = { .platform_enable = overo_panel_enable_dvi, .platform_disable = overo_panel_disable_dvi, + .i2c_bus_num = 3, }; static struct omap_dss_device overo_dvi_device = { .name = "dvi", .type = OMAP_DISPLAY_TYPE_DPI, - .driver_name = "generic_dpi_panel", + .driver_name = "dvi", .data = &dvi_panel, .phy.dpi.data_lines = 24, }; diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index a6c473bbb3d..faa2a8e28de 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c @@ -79,29 +79,6 @@ static struct cpuidle_params rx51_cpuidle_params[] = { {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) { struct omap_sdrc_params *sdrc_params; @@ -128,8 +105,6 @@ static struct omap_musb_board_data musb_board_data = { static void __init rx51_init(void) { 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); omap_serial_init(); usb_musb_init(&musb_board_data); diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index a5b7a236aa5..62510ec863c 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -27,6 +27,8 @@ #include <plat/omap_device.h> #include <plat/omap-pm.h> +#include "control.h" + static struct platform_device omap_display_device = { .name = "omapdss", .id = -1, @@ -61,7 +63,7 @@ static const struct omap_dss_hwmod_data omap3_dss_hwmod_data[] __initdata = { { "dss_dispc", "omapdss_dispc", -1 }, { "dss_rfbi", "omapdss_rfbi", -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 = { @@ -69,11 +71,58 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initdata = { { "dss_dispc", "omapdss_dispc", -1 }, { "dss_rfbi", "omapdss_rfbi", -1 }, { "dss_venc", "omapdss_venc", -1 }, - { "dss_dsi1", "omapdss_dsi1", -1 }, - { "dss_dsi2", "omapdss_dsi2", -1 }, + { "dss_dsi1", "omapdss_dsi", 0 }, + { "dss_dsi2", "omapdss_dsi", 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 r = 0; @@ -96,6 +145,11 @@ int __init omap_display_init(struct omap_dss_board_info *board_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->get_context_loss_count = omap_pm_get_dev_context_loss_count; diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index daa056ed873..52243577216 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c @@ -99,7 +99,7 @@ static struct regulator_init_data omap3_vdac_idata = { static struct regulator_consumer_supply omap3_vpll2_supplies[] = { 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 = { @@ -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 = { .constraints = { .min_uV = 1800000, @@ -243,7 +249,10 @@ static struct regulator_init_data omap4_vcxio_idata = { | REGULATOR_MODE_STANDBY, .valid_ops_mask = REGULATOR_CHANGE_MODE | 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 = { diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index 4de92dc570b..3689ad2e915 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c @@ -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, &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_a3sp, &usbhs0_device); sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs1_device); diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c index e41ebbdb3e1..cfe958e94e1 100644 --- a/arch/powerpc/platforms/512x/mpc512x_shared.c +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c @@ -66,8 +66,8 @@ struct fsl_diu_shared_fb { bool in_use; }; -unsigned int mpc512x_get_pixel_format(unsigned int bits_per_pixel, - int monitor_port) +u32 mpc512x_get_pixel_format(enum fsl_diu_monitor_port port, + unsigned int bits_per_pixel) { switch (bits_per_pixel) { case 32: @@ -80,11 +80,12 @@ unsigned int mpc512x_get_pixel_format(unsigned int bits_per_pixel, 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) 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"); -} - -int mpc512x_set_sysfs_monitor_port(int val) -{ - return 0; + return FSL_DIU_PORT_DVI; } static struct fsl_diu_shared_fb __attribute__ ((__aligned__(8))) diu_shared_fb; @@ -256,7 +253,7 @@ void __init mpc512x_init_diu(void) } mode = in_be32(&diu_reg->diu_mode); - if (mode != MFB_MODE1) { + if (mode == MFB_MODE0) { pr_info("%s: DIU OFF\n", __func__); goto out; } @@ -332,8 +329,7 @@ void __init mpc512x_setup_diu(void) diu_ops.set_gamma_table = mpc512x_set_gamma_table; diu_ops.set_monitor_port = mpc512x_set_monitor_port; diu_ops.set_pixel_clock = mpc512x_set_pixel_clock; - diu_ops.show_monitor_port = mpc512x_show_monitor_port; - diu_ops.set_sysfs_monitor_port = mpc512x_set_sysfs_monitor_port; + diu_ops.valid_monitor_port = mpc512x_valid_monitor_port; diu_ops.release_bootmem = mpc512x_release_bootmem; #endif } diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c index 266b3aadfe5..c01c7277888 100644 --- a/arch/powerpc/platforms/85xx/p1022_ds.c +++ b/arch/powerpc/platforms/85xx/p1022_ds.c @@ -93,8 +93,8 @@ * The Area Descriptor is a 32-bit value that determine which bits in each * pixel are to be used for each color. */ -static unsigned int p1022ds_get_pixel_format(unsigned int bits_per_pixel, - int monitor_port) +static u32 p1022ds_get_pixel_format(enum fsl_diu_monitor_port port, + unsigned int bits_per_pixel) { switch (bits_per_pixel) { case 32: @@ -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. * 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) * 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; void __iomem *pixis; @@ -145,19 +146,21 @@ static void p1022ds_set_monitor_port(int monitor_port) } brdcfg1 = pixis + 9; /* BRDCFG1 is at offset 9 in the ngPIXIS */ - switch (monitor_port) { - case 0: /* DVI */ + switch (port) { + case FSL_DIU_PORT_DVI: + printk(KERN_INFO "%s:%u\n", __func__, __LINE__); /* Enable the DVI port, disable the DFP and the backlight */ clrsetbits_8(brdcfg1, PX_BRDCFG1_DFPEN | PX_BRDCFG1_BACKLIGHT, PX_BRDCFG1_DVIEN); 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 */ clrsetbits_8(brdcfg1, PX_BRDCFG1_DVIEN | PX_BRDCFG1_BACKLIGHT, PX_BRDCFG1_DFPEN); break; default: - pr_err("p1022ds: unsupported monitor port %i\n", monitor_port); + pr_err("p1022ds: unsupported monitor port %i\n", port); } iounmap(pixis); @@ -214,23 +217,18 @@ void p1022ds_set_pixel_clock(unsigned int pixclock) } /** - * p1022ds_show_monitor_port: show the current monitor - * - * 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 + * p1022ds_valid_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 @@ -305,8 +303,7 @@ static void __init p1022_ds_setup_arch(void) diu_ops.set_gamma_table = p1022ds_set_gamma_table; diu_ops.set_monitor_port = p1022ds_set_monitor_port; diu_ops.set_pixel_clock = p1022ds_set_pixel_clock; - diu_ops.show_monitor_port = p1022ds_show_monitor_port; - diu_ops.set_sysfs_monitor_port = p1022ds_set_sysfs_monitor_port; + diu_ops.valid_monitor_port = p1022ds_valid_monitor_port; #endif #ifdef CONFIG_SMP diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c index 74e018ef724..13fa9a6403e 100644 --- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c +++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c @@ -152,10 +152,10 @@ machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices); (c2 << AD_COMP_2_SHIFT) | (c1 << AD_COMP_1_SHIFT) | \ (c0 << AD_COMP_0_SHIFT) | (size << AD_PIXEL_S_SHIFT)) -unsigned int mpc8610hpcd_get_pixel_format(unsigned int bits_per_pixel, - int monitor_port) +u32 mpc8610hpcd_get_pixel_format(enum fsl_diu_monitor_port 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(4, 2, 0, 1, 2, 8, 8, 8, 0), @@ -170,7 +170,8 @@ unsigned int mpc8610hpcd_get_pixel_format(unsigned int bits_per_pixel, unsigned int arch_monitor; /* 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) { case 32: @@ -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; - if (monitor_port == 2) { /* dual link LVDS */ + if (port == FSL_DIU_PORT_DLVDS) { for (i = 0; i < 256*3; i++) gamma_table_base[i] = (gamma_table_base[i] << 2) | ((gamma_table_base[i] >> 6) & 0x03); @@ -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_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[] = { - PX_BRDCFG0_DVISEL | PX_BRDCFG0_DLINK, - PX_BRDCFG0_DLINK, - 0, - }; - - if (monitor_port < 3) + switch (port) { + case FSL_DIU_PORT_DVI: 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) iounmap(guts); } -ssize_t mpc8610hpcd_show_monitor_port(int monitor_port, char *buf) -{ - 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) +enum fsl_diu_monitor_port +mpc8610hpcd_valid_monitor_port(enum fsl_diu_monitor_port port) { - return val < 3 ? val : 0; + return port; } #endif @@ -307,8 +303,7 @@ static void __init mpc86xx_hpcd_setup_arch(void) diu_ops.set_gamma_table = mpc8610hpcd_set_gamma_table; diu_ops.set_monitor_port = mpc8610hpcd_set_monitor_port; diu_ops.set_pixel_clock = mpc8610hpcd_set_pixel_clock; - diu_ops.show_monitor_port = mpc8610hpcd_show_monitor_port; - diu_ops.set_sysfs_monitor_port = mpc8610hpcd_set_sysfs_monitor_port; + diu_ops.valid_monitor_port = mpc8610hpcd_valid_monitor_port; #endif pixis_node = of_find_compatible_node(NULL, NULL, "fsl,fpga-pixis"); diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h index 2ece02beb8f..c6d00736f07 100644 --- a/arch/powerpc/sysdev/fsl_soc.h +++ b/arch/powerpc/sysdev/fsl_soc.h @@ -22,15 +22,24 @@ struct device_node; extern void fsl_rstcr_restart(char *cmd); #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 { - unsigned int (*get_pixel_format) (unsigned int bits_per_pixel, - int monitor_port); - void (*set_gamma_table) (int monitor_port, char *gamma_table_base); - void (*set_monitor_port) (int monitor_port); - void (*set_pixel_clock) (unsigned int pixclock); - ssize_t (*show_monitor_port) (int monitor_port, char *buf); - int (*set_sysfs_monitor_port) (int val); - void (*release_bootmem) (void); + u32 (*get_pixel_format)(enum fsl_diu_monitor_port port, + unsigned int bpp); + void (*set_gamma_table)(enum fsl_diu_monitor_port port, + char *gamma_table_base); + void (*set_monitor_port)(enum fsl_diu_monitor_port port); + void (*set_pixel_clock)(unsigned int pixclock); + enum fsl_diu_monitor_port (*valid_monitor_port) + (enum fsl_diu_monitor_port port); + void (*release_bootmem)(void); }; extern struct platform_diu_data_ops diu_ops; |