2006-12-08 05:58:10 +08: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-03 00:46:26 +08:00
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/kernel.h>
|
2008-07-24 12:28:13 +08:00
|
|
|
#include <linux/mm.h>
|
2006-04-03 00:46:26 +08:00
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/platform_device.h>
|
2010-05-23 06:59:11 +08:00
|
|
|
#include <linux/memblock.h>
|
2008-09-06 19:10:45 +08:00
|
|
|
#include <linux/io.h>
|
2009-08-03 20:06:36 +08:00
|
|
|
#include <linux/omapfb.h>
|
2006-04-03 00:46:26 +08:00
|
|
|
|
2008-08-05 23:14:15 +08:00
|
|
|
#include <mach/hardware.h>
|
2006-04-03 00:46:26 +08:00
|
|
|
#include <asm/mach/map.h>
|
|
|
|
|
|
|
|
#if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
|
|
|
|
|
2011-09-20 20:23:13 +08:00
|
|
|
static bool omapfb_lcd_configured;
|
2006-04-03 00:46:26 +08: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 20:23:13 +08:00
|
|
|
void __init omapfb_set_lcd_config(const struct omap_lcd_config *config)
|
2006-04-03 00:46:26 +08:00
|
|
|
{
|
2011-09-20 20:23:13 +08:00
|
|
|
omapfb_config.lcd = *config;
|
|
|
|
omapfb_lcd_configured = true;
|
|
|
|
}
|
2006-04-03 00:46:26 +08:00
|
|
|
|
2011-09-20 20:23:13 +08: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-03 00:46:26 +08:00
|
|
|
return 0;
|
2011-09-20 19:12:43 +08:00
|
|
|
|
2006-04-03 00:46:26 +08:00
|
|
|
return platform_device_register(&omap_fb_device);
|
|
|
|
}
|
|
|
|
|
|
|
|
arch_initcall(omap_init_fb);
|
|
|
|
|
2009-08-04 21:12:50 +08: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 16:03:38 +08:00
|
|
|
static int __init omap_init_fb(void)
|
2009-08-04 21:12:50 +08:00
|
|
|
{
|
|
|
|
return platform_device_register(&omap_fb_device);
|
|
|
|
}
|
|
|
|
|
|
|
|
arch_initcall(omap_init_fb);
|
2006-04-03 00:46:26 +08:00
|
|
|
|
2011-09-20 20:23:13 +08:00
|
|
|
#else
|
|
|
|
|
2012-03-09 04:43:28 +08:00
|
|
|
void __init omapfb_set_lcd_config(const struct omap_lcd_config *config)
|
|
|
|
{
|
|
|
|
}
|
2011-09-20 20:23:13 +08:00
|
|
|
|
2006-04-03 00:46:26 +08:00
|
|
|
#endif
|