linux/drivers/video/mxc/mx2fb.c File Reference

Frame buffer driver for MX27 ADS. More...

Data Structures

struct  mx2fb_info
 Structure containing the MX2 specific framebuffer information. More...

Functions

static int mx2fb_check_var (struct fb_var_screeninfo *var, struct fb_info *info)
static int mx2fb_set_par (struct fb_info *info)
static int mx2fb_setcolreg (unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *info)
static int mx2fb_pan_display (struct fb_var_screeninfo *var, struct fb_info *info)
static int mx2fb_blank (int blank_mode, struct fb_info *info)
static int mx2fb_ioctl (struct fb_info *info, unsigned int cmd, unsigned long arg)
int __init mx2fb_init (void)
void __exit mx2fb_exit (void)
static int __init mx2fb_setup (char *options)
static int __init _init_fbinfo (struct fb_info *info, struct platform_device *pdev)
static int __init _install_fb (struct fb_info *info, struct platform_device *pdev)
static void __exit _uninstall_fb (struct fb_info *info)
static int _map_video_memory (struct fb_info *info)
static void _unmap_video_memory (struct fb_info *info)
static void _set_fix (struct fb_info *info)
static void _enable_lcdc (struct fb_info *info)
static void _disable_lcdc (struct fb_info *info)
static void _enable_graphic_window (struct fb_info *info)
static void _disable_graphic_window (struct fb_info *info)
static void _update_lcdc (struct fb_info *info)
static void _request_irq (void)
static void _free_irq (void)
static int mx2fb_probe (struct platform_device *pdev)
void mx2_gw_set (struct fb_gwinfo *gwinfo)
void mx2fb_set_brightness (uint8_t level)
int mx2fb_register_client (struct notifier_block *nb)
int mx2fb_unregister_client (struct notifier_block *nb)

Variables

static struct fb_gwinfo g_gwinfo
static struct fb_info mx2fb_info []
static struct platform_driver mx2fb_driver
static struct fb_ops mx2fb_ops

Detailed Description

Frame buffer driver for MX27 ADS.


Function Documentation

static void _disable_graphic_window ( struct fb_info *  info  )  [static]

Disable graphic window.

Parameters:
info framebuffer information pointer

References fb_gwinfo::enabled.

Referenced by _disable_lcdc(), _enable_lcdc(), mx2_gw_set(), and mx2fb_ioctl().

static void _disable_lcdc ( struct fb_info *  info  )  [static]

Disable LCD controller.

Parameters:
info framebuffer information pointer

References _disable_graphic_window().

Referenced by mx2fb_blank().

static void _enable_graphic_window ( struct fb_info *  info  )  [static]

Enable graphic window.

Parameters:
info framebuffer information pointer

References fb_gwinfo::enabled, and mx2_gw_set().

Referenced by _enable_lcdc(), _update_lcdc(), and mx2fb_ioctl().

static void _enable_lcdc ( struct fb_info *  info  )  [static]

Enable LCD controller.

Parameters:
info framebuffer information pointer

References _disable_graphic_window(), and _enable_graphic_window().

Referenced by mx2fb_blank().

static void _free_irq ( void   )  [static]

Free LCDC interrupt handler.

Referenced by mx2fb_exit().

static int __init _init_fbinfo ( struct fb_info *  info,
struct platform_device *  pdev 
) [static]

Initialize framebuffer information structure.

Parameters:
info framebuffer information pointer
pdev pointer to struct device
Returns:
Negative errno on error, or zero on success.

References mx2fb_ops.

Referenced by _install_fb().

static int __init _install_fb ( struct fb_info *  info,
struct platform_device *  pdev 
) [static]

Install framebuffer into the system.

Parameters:
info framebuffer information pointer
pdev pointer to struct device
Returns:
Negative errno on error, or zero on success.

References _init_fbinfo(), _unmap_video_memory(), and mx2fb_set_par().

Referenced by mx2fb_probe().

static int _map_video_memory ( struct fb_info *  info  )  [static]

Allocate memory for framebuffer.

Parameters:
info framebuffer information pointer
Returns:
Negative errno on error, or zero on success.

Referenced by mx2fb_set_par().

static void _request_irq ( void   )  [static]

Config and request LCDC interrupt.

Referenced by mx2fb_probe().

static void _set_fix ( struct fb_info *  info  )  [static]

Set fixed framebuffer parameters based on variable settings.

Parameters:
info framebuffer information pointer
Returns:
Negative errno on error, or zero on success.

Referenced by mx2fb_set_par().

static void __exit _uninstall_fb ( struct fb_info *  info  )  [static]

Uninstall framebuffer from the system.

Parameters:
info framebuffer information pointer

References _unmap_video_memory().

Referenced by mx2fb_exit().

static void _unmap_video_memory ( struct fb_info *  info  )  [static]

Release memory for framebuffer.

Parameters:
info framebuffer information pointer

Referenced by _install_fb(), _uninstall_fb(), and mx2fb_set_par().

static void _update_lcdc ( struct fb_info *  info  )  [static]

Update LCDC registers.

Parameters:
info framebuffer information pointer

References _enable_graphic_window().

Referenced by mx2fb_pan_display(), and mx2fb_set_par().

void mx2_gw_set ( struct fb_gwinfo gwinfo  ) 
static int mx2fb_blank ( int  blank_mode,
struct fb_info *  info 
) [static]

Blanks the display.

Parameters:
blank_mode The blank mode we want.
info Frame buffer structure that represents a single frame buffer
Returns:
Negative errno on error, or zero on success.

Blank the screen if blank_mode != 0, else unblank. Return 0 if blanking succeeded, != 0 if un-/blanking failed. blank_mode == 2: suspend vsync blank_mode == 3: suspend hsync blank_mode == 4: powerdown

References _disable_lcdc(), and _enable_lcdc().

static int mx2fb_check_var ( struct fb_var_screeninfo *  var,
struct fb_info *  info 
) [static]

Validates a var passed in.

Parameters:
var Frame buffer variable screen structure
info Frame buffer structure that represents a single frame buffer
Returns:
Negative errno on error, or zero on success.

Checks to see if the hardware supports the state requested by var passed in. This function does not alter the hardware state! If the var passed in is slightly off by what the hardware can support then we alter the var PASSED in to what we can do. If the hardware doesn't support mode change a -EINVAL will be returned by the upper layers.

void __exit mx2fb_exit ( void   ) 

Cleanup.

References _free_irq(), _uninstall_fb(), and mx2fb_driver.

int __init mx2fb_init ( void   ) 

Initialization.

References mx2fb_driver, and mx2fb_setup().

static int mx2fb_ioctl ( struct fb_info *  info,
unsigned int  cmd,
unsigned long  arg 
) [static]

Ioctl function to support customized ioctl operations.

Parameters:
info Framebuffer structure that represents a single frame buffer
cmd The command number
arg Argument which depends on cmd
Returns:
Negative errno on error, or zero on success.

References _disable_graphic_window(), _enable_graphic_window(), fb_gwinfo::alpha_value, fb_gwinfo::ck_blue, fb_gwinfo::ck_enabled, fb_gwinfo::ck_green, fb_gwinfo::ck_red, fb_gwinfo::enabled, FBIOGET_GWINFO, FBIOPUT_GWINFO, and mx2fb_set_par().

static int mx2fb_pan_display ( struct fb_var_screeninfo *  var,
struct fb_info *  info 
) [static]

Pans the display.

Parameters:
var Frame buffer variable screen structure
info Frame buffer structure that represents a single frame buffer
Returns:
Negative errno on error, or zero on success.

Pan (or wrap, depending on the `vmode' field) the display using the 'xoffset' and 'yoffset' fields of the 'var' structure. If the values don't fit, return -EINVAL.

References _update_lcdc().

static int mx2fb_probe ( struct platform_device *  pdev  )  [static]

Probe routine for the framebuffer driver. It is called during the driver binding process.

Returns:
Appropriate error code to the kernel common code

References _install_fb(), and _request_irq().

int mx2fb_register_client ( struct notifier_block *  nb  ) 

Register a client notifier.

Parameters:
nb notifier block to callback on events
void mx2fb_set_brightness ( uint8_t  level  ) 

Set LCD brightness.

Parameters:
level brightness level
static int mx2fb_set_par ( struct fb_info *  info  )  [static]

Alters the hardware state.

Parameters:
info Frame buffer structure that represents a single frame buffer
Returns:
Zero on success others on failure

Using the fb_var_screeninfo in fb_info we set the resolution of this particular framebuffer. This function alters the fb_fix_screeninfo stored in fb_info. It doesn't not alter var in fb_info since we are using that data. This means we depend on the data in var inside fb_info to be supported by the hardware. mx2fb_check_var is always called before mx2fb_set_par to ensure this.

References _map_video_memory(), _set_fix(), _unmap_video_memory(), and _update_lcdc().

Referenced by _install_fb(), and mx2fb_ioctl().

static int mx2fb_setcolreg ( unsigned  regno,
unsigned  red,
unsigned  green,
unsigned  blue,
unsigned  transp,
struct fb_info *  info 
) [static]

Sets a color register.

Parameters:
regno Which register in the CLUT we are programming
red The red value which can be up to 16 bits wide
green The green value which can be up to 16 bits wide
blue The blue value which can be up to 16 bits wide.
transp If supported the alpha value which can be up to 16 bits wide.
info Frame buffer info structure
Returns:
Negative errno on error, or zero on success.

Set a single color register. The values supplied have a 16 bit magnitude which needs to be scaled in this function for the hardware. Things to take into consideration are how many color registers, if any, are supported with the current color visual. With truecolor mode no color palettes are supported. Here a psuedo palette is created which we store the value in pseudo_palette in struct fb_info. For pseudocolor mode we have a limited color palette.

static int __init mx2fb_setup ( char *  options  )  [static]

Setup Parse user specified options Example: video=mxcfb:240x320,bpp=16,Sharp-QVGA.

Referenced by mx2fb_init().

int mx2fb_unregister_client ( struct notifier_block *  nb  ) 

Unregister a client notifier.

Parameters:
nb notifier block to callback on events

Variable Documentation

struct fb_gwinfo g_gwinfo [static]
Initial value:
 {
        .enabled = 0,
        .alpha_value = 255,
        .ck_enabled = 0,
        .ck_red = 0,
        .ck_green = 0,
        .ck_blue = 0,
        .xpos = 0,
        .ypos = 0,
}

Current graphic window information

struct platform_driver mx2fb_driver [static]
Initial value:
 {
        .driver = {
                   .name = "mxc_sdc_fb",
                   .owner = THIS_MODULE,
                   .bus = &platform_bus_type,
                   },
        .probe = mx2fb_probe,
        .suspend = mx2fb_suspend,
        .resume = mx2fb_resume,
}

This structure contains pointers to the power management callback functions.

Referenced by mx2fb_exit(), and mx2fb_init().

struct fb_info mx2fb_info[] [static]
Initial value:
 {
        {.par = &mx2fbi_bg},
        {.par = &mx2fbi_gw},
}

Framebuffer information structures. There are up to 3 framebuffers: background, TVout, and graphic window. If graphic window is configured, it must be the last framebuffer.

struct fb_ops mx2fb_ops [static]
Initial value:
 {
        .owner = THIS_MODULE,
        .fb_check_var = mx2fb_check_var,
        .fb_set_par = mx2fb_set_par,
        .fb_setcolreg = mx2fb_setcolreg,
        .fb_blank = mx2fb_blank,
        .fb_pan_display = mx2fb_pan_display,
        .fb_fillrect = cfb_fillrect,
        .fb_copyarea = cfb_copyarea,
        .fb_imageblit = cfb_imageblit,
        .fb_ioctl = mx2fb_ioctl,
}

Framebuffer file operations.

Referenced by _init_fbinfo().

footer
©  Freescale Semiconductor, Inc., 2007.  All rights reserved.
Freescale Confidential Proprietary
NDA Required
doxygen