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