Path: blob/master/arch/arm/mach-omap2/board-rx51-video.c
10817 views
/*1* linux/arch/arm/mach-omap2/board-rx51-video.c2*3* Copyright (C) 2010 Nokia4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License version 2 as7* published by the Free Software Foundation.8*/910#include <linux/kernel.h>11#include <linux/init.h>12#include <linux/platform_device.h>13#include <linux/gpio.h>14#include <linux/spi/spi.h>15#include <linux/mm.h>16#include <asm/mach-types.h>17#include <video/omapdss.h>18#include <plat/vram.h>19#include <plat/mcspi.h>2021#include <mach/board-rx51.h>2223#include "mux.h"2425#define RX51_LCD_RESET_GPIO 902627#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)2829static int rx51_lcd_enable(struct omap_dss_device *dssdev)30{31gpio_set_value(dssdev->reset_gpio, 1);32return 0;33}3435static void rx51_lcd_disable(struct omap_dss_device *dssdev)36{37gpio_set_value(dssdev->reset_gpio, 0);38}3940static struct omap_dss_device rx51_lcd_device = {41.name = "lcd",42.driver_name = "panel-acx565akm",43.type = OMAP_DISPLAY_TYPE_SDI,44.phy.sdi.datapairs = 2,45.reset_gpio = RX51_LCD_RESET_GPIO,46.platform_enable = rx51_lcd_enable,47.platform_disable = rx51_lcd_disable,48};4950static struct omap_dss_device rx51_tv_device = {51.name = "tv",52.type = OMAP_DISPLAY_TYPE_VENC,53.driver_name = "venc",54.phy.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE,55};5657static struct omap_dss_device *rx51_dss_devices[] = {58&rx51_lcd_device,59&rx51_tv_device,60};6162static struct omap_dss_board_info rx51_dss_board_info = {63.num_devices = ARRAY_SIZE(rx51_dss_devices),64.devices = rx51_dss_devices,65.default_device = &rx51_lcd_device,66};6768static int __init rx51_video_init(void)69{70if (!machine_is_nokia_rx51())71return 0;7273if (omap_mux_init_gpio(RX51_LCD_RESET_GPIO, OMAP_PIN_OUTPUT)) {74pr_err("%s cannot configure MUX for LCD RESET\n", __func__);75return 0;76}7778if (gpio_request_one(RX51_LCD_RESET_GPIO, GPIOF_OUT_INIT_HIGH,79"LCD ACX565AKM reset")) {80pr_err("%s failed to get LCD Reset GPIO\n", __func__);81return 0;82}8384omap_display_init(&rx51_dss_board_info);85return 0;86}8788subsys_initcall(rx51_video_init);8990void __init rx51_video_mem_init(void)91{92/*93* GFX 864x480x32bpp94* VID1/2 1280x720x32bpp double buffered95*/96omap_vram_set_sdram_vram(PAGE_ALIGN(864 * 480 * 4) +972 * PAGE_ALIGN(1280 * 720 * 4 * 2), 0);98}99100#else101void __init rx51_video_mem_init(void) { }102#endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */103104105