Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-omap2/board-rx51-video.c |
| 3 | * |
| 4 | * Copyright (C) 2010 Nokia |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | */ |
| 10 | |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/platform_device.h> |
| 14 | #include <linux/gpio.h> |
| 15 | #include <linux/spi/spi.h> |
| 16 | #include <linux/mm.h> |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 17 | #include <asm/mach-types.h> |
Tomi Valkeinen | a0b38cc | 2011-05-11 14:05:07 +0300 | [diff] [blame] | 18 | #include <video/omapdss.h> |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 19 | #include <plat/vram.h> |
| 20 | #include <plat/mcspi.h> |
| 21 | |
Manjunath Kondaiah G | 04aeae7 | 2010-10-08 09:58:35 -0700 | [diff] [blame] | 22 | #include <mach/board-rx51.h> |
| 23 | |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 24 | #include "mux.h" |
| 25 | |
| 26 | #define RX51_LCD_RESET_GPIO 90 |
| 27 | |
| 28 | #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) |
| 29 | |
| 30 | static int rx51_lcd_enable(struct omap_dss_device *dssdev) |
| 31 | { |
| 32 | gpio_set_value(dssdev->reset_gpio, 1); |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | static void rx51_lcd_disable(struct omap_dss_device *dssdev) |
| 37 | { |
| 38 | gpio_set_value(dssdev->reset_gpio, 0); |
| 39 | } |
| 40 | |
| 41 | static struct omap_dss_device rx51_lcd_device = { |
| 42 | .name = "lcd", |
| 43 | .driver_name = "panel-acx565akm", |
| 44 | .type = OMAP_DISPLAY_TYPE_SDI, |
| 45 | .phy.sdi.datapairs = 2, |
| 46 | .reset_gpio = RX51_LCD_RESET_GPIO, |
| 47 | .platform_enable = rx51_lcd_enable, |
| 48 | .platform_disable = rx51_lcd_disable, |
| 49 | }; |
| 50 | |
Srikar | 60d24ee | 2010-12-20 18:48:16 -0800 | [diff] [blame] | 51 | static struct omap_dss_device rx51_tv_device = { |
| 52 | .name = "tv", |
| 53 | .type = OMAP_DISPLAY_TYPE_VENC, |
| 54 | .driver_name = "venc", |
| 55 | .phy.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE, |
Srikar | 60d24ee | 2010-12-20 18:48:16 -0800 | [diff] [blame] | 56 | }; |
| 57 | |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 58 | static struct omap_dss_device *rx51_dss_devices[] = { |
| 59 | &rx51_lcd_device, |
Srikar | 60d24ee | 2010-12-20 18:48:16 -0800 | [diff] [blame] | 60 | &rx51_tv_device, |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | static struct omap_dss_board_info rx51_dss_board_info = { |
| 64 | .num_devices = ARRAY_SIZE(rx51_dss_devices), |
| 65 | .devices = rx51_dss_devices, |
| 66 | .default_device = &rx51_lcd_device, |
| 67 | }; |
| 68 | |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 69 | static int __init rx51_video_init(void) |
| 70 | { |
| 71 | if (!machine_is_nokia_rx51()) |
| 72 | return 0; |
| 73 | |
| 74 | if (omap_mux_init_gpio(RX51_LCD_RESET_GPIO, OMAP_PIN_OUTPUT)) { |
| 75 | pr_err("%s cannot configure MUX for LCD RESET\n", __func__); |
| 76 | return 0; |
| 77 | } |
| 78 | |
Igor Grinberg | bc593f5 | 2011-05-03 18:22:09 +0300 | [diff] [blame] | 79 | if (gpio_request_one(RX51_LCD_RESET_GPIO, GPIOF_OUT_INIT_HIGH, |
| 80 | "LCD ACX565AKM reset")) { |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 81 | pr_err("%s failed to get LCD Reset GPIO\n", __func__); |
| 82 | return 0; |
| 83 | } |
| 84 | |
Senthilvadivu Guruswamy | d5e1322 | 2011-02-22 11:24:50 +0200 | [diff] [blame] | 85 | omap_display_init(&rx51_dss_board_info); |
Roger Quadros | 03e1110 | 2010-05-10 10:35:17 +0200 | [diff] [blame] | 86 | return 0; |
| 87 | } |
| 88 | |
| 89 | subsys_initcall(rx51_video_init); |
| 90 | |
| 91 | void __init rx51_video_mem_init(void) |
| 92 | { |
| 93 | /* |
| 94 | * GFX 864x480x32bpp |
| 95 | * VID1/2 1280x720x32bpp double buffered |
| 96 | */ |
| 97 | omap_vram_set_sdram_vram(PAGE_ALIGN(864 * 480 * 4) + |
| 98 | 2 * PAGE_ALIGN(1280 * 720 * 4 * 2), 0); |
| 99 | } |
| 100 | |
| 101 | #else |
| 102 | void __init rx51_video_mem_init(void) { } |
| 103 | #endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */ |