diff options
| author | Koen Kooi <koen.kooi@gmail.com> | 2010-04-22 04:23:42 -0400 |
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-05-18 08:06:07 -0400 |
| commit | 044d32ffbcb4a1d400088e3575508f46c0a9face (patch) | |
| tree | cca02cf6ae97b6dd8e7bc7d4223e77ebd4b7734a | |
| parent | a3bb67a75c0fe5c48def0fd39d2fe9ec043241d4 (diff) | |
board-omap3-beagle: add DSS2 support
This patch adds DSS2 support to the beagleboard boardfile. DVI and
TV-out are supported.
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
| -rw-r--r-- | arch/arm/mach-omap2/board-omap3beagle.c | 101 |
1 files changed, 75 insertions, 26 deletions
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 962d377970e9..69b154cdc75d 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | 39 | ||
| 40 | #include <plat/board.h> | 40 | #include <plat/board.h> |
| 41 | #include <plat/common.h> | 41 | #include <plat/common.h> |
| 42 | #include <plat/display.h> | ||
| 42 | #include <plat/gpmc.h> | 43 | #include <plat/gpmc.h> |
| 43 | #include <plat/nand.h> | 44 | #include <plat/nand.h> |
| 44 | #include <plat/usb.h> | 45 | #include <plat/usb.h> |
| @@ -106,6 +107,77 @@ static struct platform_device omap3beagle_nand_device = { | |||
| 106 | .resource = &omap3beagle_nand_resource, | 107 | .resource = &omap3beagle_nand_resource, |
| 107 | }; | 108 | }; |
| 108 | 109 | ||
| 110 | /* DSS */ | ||
| 111 | |||
| 112 | static int beagle_enable_dvi(struct omap_dss_device *dssdev) | ||
| 113 | { | ||
| 114 | if (gpio_is_valid(dssdev->reset_gpio)) | ||
| 115 | gpio_set_value(dssdev->reset_gpio, 1); | ||
| 116 | |||
| 117 | return 0; | ||
| 118 | } | ||
| 119 | |||
| 120 | static void beagle_disable_dvi(struct omap_dss_device *dssdev) | ||
| 121 | { | ||
| 122 | if (gpio_is_valid(dssdev->reset_gpio)) | ||
| 123 | gpio_set_value(dssdev->reset_gpio, 0); | ||
| 124 | } | ||
| 125 | |||
| 126 | static struct omap_dss_device beagle_dvi_device = { | ||
| 127 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
| 128 | .name = "dvi", | ||
| 129 | .driver_name = "generic_panel", | ||
| 130 | .phy.dpi.data_lines = 24, | ||
| 131 | .reset_gpio = 170, | ||
| 132 | .platform_enable = beagle_enable_dvi, | ||
| 133 | .platform_disable = beagle_disable_dvi, | ||
| 134 | }; | ||
| 135 | |||
| 136 | static struct omap_dss_device beagle_tv_device = { | ||
| 137 | .name = "tv", | ||
| 138 | .driver_name = "venc", | ||
| 139 | .type = OMAP_DISPLAY_TYPE_VENC, | ||
| 140 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
| 141 | }; | ||
| 142 | |||
| 143 | static struct omap_dss_device *beagle_dss_devices[] = { | ||
| 144 | &beagle_dvi_device, | ||
| 145 | &beagle_tv_device, | ||
| 146 | }; | ||
| 147 | |||
| 148 | static struct omap_dss_board_info beagle_dss_data = { | ||
| 149 | .num_devices = ARRAY_SIZE(beagle_dss_devices), | ||
| 150 | .devices = beagle_dss_devices, | ||
| 151 | .default_device = &beagle_dvi_device, | ||
| 152 | }; | ||
| 153 | |||
| 154 | static struct platform_device beagle_dss_device = { | ||
| 155 | .name = "omapdss", | ||
| 156 | .id = -1, | ||
| 157 | .dev = { | ||
| 158 | .platform_data = &beagle_dss_data, | ||
| 159 | }, | ||
| 160 | }; | ||
| 161 | |||
| 162 | static struct regulator_consumer_supply beagle_vdac_supply = | ||
| 163 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); | ||
| 164 | |||
| 165 | static struct regulator_consumer_supply beagle_vdvi_supply = | ||
| 166 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"); | ||
| 167 | |||
| 168 | static void __init beagle_display_init(void) | ||
| 169 | { | ||
| 170 | int r; | ||
| 171 | |||
| 172 | r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset"); | ||
| 173 | if (r < 0) { | ||
| 174 | printk(KERN_ERR "Unable to get DVI reset GPIO\n"); | ||
| 175 | return; | ||
| 176 | } | ||
| 177 | |||
| 178 | gpio_direction_output(beagle_dvi_device.reset_gpio, 0); | ||
| 179 | } | ||
| 180 | |||
| 109 | #include "sdram-micron-mt46h32m32lf-6.h" | 181 | #include "sdram-micron-mt46h32m32lf-6.h" |
| 110 | 182 | ||
| 111 | static struct omap2_hsmmc_info mmc[] = { | 183 | static struct omap2_hsmmc_info mmc[] = { |
| @@ -117,15 +189,6 @@ static struct omap2_hsmmc_info mmc[] = { | |||
| 117 | {} /* Terminator */ | 189 | {} /* Terminator */ |
| 118 | }; | 190 | }; |
| 119 | 191 | ||
| 120 | static struct platform_device omap3_beagle_lcd_device = { | ||
| 121 | .name = "omap3beagle_lcd", | ||
| 122 | .id = -1, | ||
| 123 | }; | ||
| 124 | |||
| 125 | static struct omap_lcd_config omap3_beagle_lcd_config __initdata = { | ||
| 126 | .ctrl_name = "internal", | ||
| 127 | }; | ||
| 128 | |||
| 129 | static struct regulator_consumer_supply beagle_vmmc1_supply = { | 192 | static struct regulator_consumer_supply beagle_vmmc1_supply = { |
| 130 | .supply = "vmmc", | 193 | .supply = "vmmc", |
| 131 | }; | 194 | }; |
| @@ -181,16 +244,6 @@ static struct twl4030_gpio_platform_data beagle_gpio_data = { | |||
| 181 | .setup = beagle_twl_gpio_setup, | 244 | .setup = beagle_twl_gpio_setup, |
| 182 | }; | 245 | }; |
| 183 | 246 | ||
| 184 | static struct regulator_consumer_supply beagle_vdac_supply = { | ||
| 185 | .supply = "vdac", | ||
| 186 | .dev = &omap3_beagle_lcd_device.dev, | ||
| 187 | }; | ||
| 188 | |||
| 189 | static struct regulator_consumer_supply beagle_vdvi_supply = { | ||
| 190 | .supply = "vdvi", | ||
| 191 | .dev = &omap3_beagle_lcd_device.dev, | ||
| 192 | }; | ||
| 193 | |||
| 194 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 247 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
| 195 | static struct regulator_init_data beagle_vmmc1 = { | 248 | static struct regulator_init_data beagle_vmmc1 = { |
| 196 | .constraints = { | 249 | .constraints = { |
| @@ -349,14 +402,8 @@ static struct platform_device keys_gpio = { | |||
| 349 | }, | 402 | }, |
| 350 | }; | 403 | }; |
| 351 | 404 | ||
| 352 | static struct omap_board_config_kernel omap3_beagle_config[] __initdata = { | ||
| 353 | { OMAP_TAG_LCD, &omap3_beagle_lcd_config }, | ||
| 354 | }; | ||
| 355 | |||
| 356 | static void __init omap3_beagle_init_irq(void) | 405 | static void __init omap3_beagle_init_irq(void) |
| 357 | { | 406 | { |
| 358 | omap_board_config = omap3_beagle_config; | ||
| 359 | omap_board_config_size = ARRAY_SIZE(omap3_beagle_config); | ||
| 360 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, | 407 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, |
| 361 | mt46h32m32lf6_sdrc_params); | 408 | mt46h32m32lf6_sdrc_params); |
| 362 | omap_init_irq(); | 409 | omap_init_irq(); |
| @@ -367,9 +414,9 @@ static void __init omap3_beagle_init_irq(void) | |||
| 367 | } | 414 | } |
| 368 | 415 | ||
| 369 | static struct platform_device *omap3_beagle_devices[] __initdata = { | 416 | static struct platform_device *omap3_beagle_devices[] __initdata = { |
| 370 | &omap3_beagle_lcd_device, | ||
| 371 | &leds_gpio, | 417 | &leds_gpio, |
| 372 | &keys_gpio, | 418 | &keys_gpio, |
| 419 | &beagle_dss_device, | ||
| 373 | }; | 420 | }; |
| 374 | 421 | ||
| 375 | static void __init omap3beagle_flash_init(void) | 422 | static void __init omap3beagle_flash_init(void) |
| @@ -456,6 +503,8 @@ static void __init omap3_beagle_init(void) | |||
| 456 | /* Ensure SDRC pins are mux'd for self-refresh */ | 503 | /* Ensure SDRC pins are mux'd for self-refresh */ |
| 457 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 504 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
| 458 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 505 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
| 506 | |||
| 507 | beagle_display_init(); | ||
| 459 | } | 508 | } |
| 460 | 509 | ||
| 461 | static void __init omap3_beagle_map_io(void) | 510 | static void __init omap3_beagle_map_io(void) |
