2006-12-07 21:58:10 +00:00
|
|
|
/*
|
|
|
|
* File: arch/arm/plat-omap/fb.c
|
|
|
|
*
|
|
|
|
* Framebuffer device registration for TI OMAP platforms
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Nokia Corporation
|
|
|
|
* Author: Imre Deak <imre.deak@nokia.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2006-04-02 16:46:26 +00:00
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/kernel.h>
|
2008-07-24 04:28:13 +00:00
|
|
|
#include <linux/mm.h>
|
2006-04-02 16:46:26 +00:00
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/platform_device.h>
|
2010-05-22 22:59:11 +00:00
|
|
|
#include <linux/memblock.h>
|
2008-09-06 11:10:45 +00:00
|
|
|
#include <linux/io.h>
|
2009-08-03 12:06:36 +00:00
|
|
|
#include <linux/omapfb.h>
|
2006-04-02 16:46:26 +00:00
|
|
|
|
2008-08-05 15:14:15 +00:00
|
|
|
#include <mach/hardware.h>
|
2006-04-02 16:46:26 +00:00
|
|
|
#include <asm/mach/map.h>
|
|
|
|
|
2009-10-20 16:40:47 +00:00
|
|
|
#include <plat/board.h>
|
2010-10-08 17:00:19 +00:00
|
|
|
|
2006-04-02 16:46:26 +00:00
|
|
|
#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
|
|
|
|
|
2011-09-20 12:23:13 +00:00
|
|
|
static bool omapfb_lcd_configured;
|
2006-04-02 16:46:26 +00:00
|
|
|
static struct omapfb_platform_data omapfb_config;
|
|
|
|
|
|
|
|
static u64 omap_fb_dma_mask = ~(u32)0;
|
|
|
|
|
|
|
|
static struct platform_device omap_fb_device = {
|
|
|
|
.name = "omapfb",
|
|
|
|
.id = -1,
|
|
|
|
.dev = {
|
|
|
|
.dma_mask = &omap_fb_dma_mask,
|
|
|
|
.coherent_dma_mask = ~(u32)0,
|
|
|
|
.platform_data = &omapfb_config,
|
|
|
|
},
|
|
|
|
.num_resources = 0,
|
|
|
|
};
|
|
|
|
|
2011-09-20 12:23:13 +00:00
|
|
|
void __init omapfb_set_lcd_config(const struct omap_lcd_config *config)
|
2006-04-02 16:46:26 +00:00
|
|
|
{
|
2011-09-20 12:23:13 +00:00
|
|
|
omapfb_config.lcd = *config;
|
|
|
|
omapfb_lcd_configured = true;
|
|
|
|
}
|
2006-04-02 16:46:26 +00:00
|
|
|
|
2011-09-20 12:23:13 +00:00
|
|
|
static int __init omap_init_fb(void)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* If the board file has not set the lcd config with
|
|
|
|
* omapfb_set_lcd_config(), don't bother registering the omapfb device
|
|
|
|
*/
|
|
|
|
if (!omapfb_lcd_configured)
|
2006-04-02 16:46:26 +00:00
|
|
|
return 0;
|
2011-09-20 11:12:43 +00:00
|
|
|
|
2006-04-02 16:46:26 +00:00
|
|
|
return platform_device_register(&omap_fb_device);
|
|
|
|
}
|
|
|
|
|
|
|
|
arch_initcall(omap_init_fb);
|
|
|
|
|
2009-08-04 13:12:50 +00:00
|
|
|
#elif defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
|
|
|
|
|
|
|
|
static u64 omap_fb_dma_mask = ~(u32)0;
|
|
|
|
static struct omapfb_platform_data omapfb_config;
|
|
|
|
|
|
|
|
static struct platform_device omap_fb_device = {
|
|
|
|
.name = "omapfb",
|
|
|
|
.id = -1,
|
|
|
|
.dev = {
|
|
|
|
.dma_mask = &omap_fb_dma_mask,
|
|
|
|
.coherent_dma_mask = ~(u32)0,
|
|
|
|
.platform_data = &omapfb_config,
|
|
|
|
},
|
|
|
|
.num_resources = 0,
|
|
|
|
};
|
|
|
|
|
2010-09-02 08:03:38 +00:00
|
|
|
static int __init omap_init_fb(void)
|
2009-08-04 13:12:50 +00:00
|
|
|
{
|
|
|
|
return platform_device_register(&omap_fb_device);
|
|
|
|
}
|
|
|
|
|
|
|
|
arch_initcall(omap_init_fb);
|
2006-04-02 16:46:26 +00:00
|
|
|
|
2011-09-20 12:23:13 +00:00
|
|
|
#else
|
|
|
|
|
2012-03-08 20:43:28 +00:00
|
|
|
void __init omapfb_set_lcd_config(const struct omap_lcd_config *config)
|
|
|
|
{
|
|
|
|
}
|
2011-09-20 12:23:13 +00:00
|
|
|
|
2006-04-02 16:46:26 +00:00
|
|
|
#endif
|