linux/drivers/video/fbdev/atmel_lcdfb.c

/*
 *  Driver for AT91 LCD Controller
 *
 *  Copyright (C) 2007 Atmel Corporation
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file COPYING in the main directory of this archive for
 * more details.
 */

#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/clk.h>
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/backlight.h>
#include <linux/gfp.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <video/of_videomode.h>
#include <video/of_display_timing.h>
#include <linux/regulator/consumer.h>
#include <video/videomode.h>

#include <video/atmel_lcdc.h>

struct atmel_lcdfb_config {};

 /* LCD Controller info data structure, stored in device platform_data */
struct atmel_lcdfb_info {};

struct atmel_lcdfb_power_ctrl_gpio {};

#define lcdc_readl(sinfo, reg)
#define lcdc_writel(sinfo, reg, val)

/* configurable parameters */
#define ATMEL_LCDC_CVAL_DEFAULT
#define ATMEL_LCDC_DMA_BURST_LEN
#define ATMEL_LCDC_FIFO_SIZE

static struct atmel_lcdfb_config at91sam9261_config =;

static struct atmel_lcdfb_config at91sam9263_config =;

static struct atmel_lcdfb_config at91sam9g10_config =;

static struct atmel_lcdfb_config at91sam9g45_config =;

static struct atmel_lcdfb_config at91sam9g45es_config =;

static struct atmel_lcdfb_config at91sam9rl_config =;

static u32 contrast_ctr =;

#ifdef CONFIG_BACKLIGHT_ATMEL_LCDC

/* some bl->props field just changed */
static int atmel_bl_update_status(struct backlight_device *bl)
{}

static int atmel_bl_get_brightness(struct backlight_device *bl)
{}

static const struct backlight_ops atmel_lcdc_bl_ops =;

static void init_backlight(struct atmel_lcdfb_info *sinfo)
{}

static void exit_backlight(struct atmel_lcdfb_info *sinfo)
{}

#else

static void init_backlight(struct atmel_lcdfb_info *sinfo)
{
	dev_warn(&sinfo->pdev->dev, "backlight control is not available\n");
}

static void exit_backlight(struct atmel_lcdfb_info *sinfo)
{
}

#endif

static void init_contrast(struct atmel_lcdfb_info *sinfo)
{}

static inline void atmel_lcdfb_power_control(struct atmel_lcdfb_info *sinfo, int on)
{}

static const struct fb_fix_screeninfo atmel_lcdfb_fix =;

static unsigned long compute_hozval(struct atmel_lcdfb_info *sinfo,
							unsigned long xres)
{}

static void atmel_lcdfb_stop_nowait(struct atmel_lcdfb_info *sinfo)
{}

static void atmel_lcdfb_stop(struct atmel_lcdfb_info *sinfo)
{}

static void atmel_lcdfb_start(struct atmel_lcdfb_info *sinfo)
{}

static void atmel_lcdfb_update_dma(struct fb_info *info,
			       struct fb_var_screeninfo *var)
{}

static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo)
{}

/**
 *	atmel_lcdfb_alloc_video_memory - Allocate framebuffer memory
 *	@sinfo: the frame buffer to allocate memory for
 *
 * 	This function is called only from the atmel_lcdfb_probe()
 * 	so no locking by fb_info->mm_lock around smem_len setting is needed.
 */
static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo)
{}

static const struct fb_videomode *atmel_lcdfb_choose_mode(struct fb_var_screeninfo *var,
						     struct fb_info *info)
{}


/**
 *      atmel_lcdfb_check_var - Validates a var passed in.
 *      @var: frame buffer variable screen structure
 *      @info: frame buffer structure that represents a single frame buffer
 *
 *	Checks to see if the hardware supports the state requested by
 *	var passed in. This function does not alter the hardware
 *	state!!!  This means the data stored in struct fb_info and
 *	struct atmel_lcdfb_info do not change. This includes the var
 *	inside of struct fb_info.  Do NOT change these. This function
 *	can be called on its own if we intent to only test a mode and
 *	not actually set it. The stuff in modedb.c is a example of
 *	this. 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. You don't need
 *	to implement this function then. If you hardware doesn't
 *	support changing the resolution then this function is not
 *	needed. In this case the driver would just provide a var that
 *	represents the static state the screen is in.
 *
 *	Returns negative errno on error, or zero on success.
 */
static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
			     struct fb_info *info)
{}

/*
 * LCD reset sequence
 */
static void atmel_lcdfb_reset(struct atmel_lcdfb_info *sinfo)
{}

/**
 *      atmel_lcdfb_set_par - Alters the hardware state.
 *      @info: frame buffer structure that represents a single frame buffer
 *
 *	Using the fb_var_screeninfo in fb_info we set the resolution
 *	of the this particular framebuffer. This function alters the
 *	par AND 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.  atmel_lcdfb_check_var is always called
 *	before atmel_lcdfb_set_par to ensure this.  Again if you can't
 *	change the resolution you don't need this function.
 *
 */
static int atmel_lcdfb_set_par(struct fb_info *info)
{}

static inline unsigned int chan_to_field(unsigned int chan, const struct fb_bitfield *bf)
{}

/**
 *  	atmel_lcdfb_setcolreg - Optional function. Sets a color register.
 *      @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
 *
 *  	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 pseudo palette is created
 *	which we store the value in pseudo_palette in struct fb_info. For
 *	pseudocolor mode we have a limited color palette. To deal with this
 *	we can program what color is displayed for a particular pixel value.
 *	DirectColor is similar in that we can program each color field. If
 *	we have a static colormap we don't need to implement this function.
 *
 *	Returns negative errno on error, or zero on success. In an
 *	ideal world, this would have been the case, but as it turns
 *	out, the other drivers return 1 on failure, so that's what
 *	we're going to do.
 */
static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red,
			     unsigned int green, unsigned int blue,
			     unsigned int transp, struct fb_info *info)
{}

static int atmel_lcdfb_pan_display(struct fb_var_screeninfo *var,
			       struct fb_info *info)
{}

static int atmel_lcdfb_blank(int blank_mode, struct fb_info *info)
{}

static const struct fb_ops atmel_lcdfb_ops =;

static irqreturn_t atmel_lcdfb_interrupt(int irq, void *dev_id)
{}

/*
 * LCD controller task (to reset the LCD)
 */
static void atmel_lcdfb_task(struct work_struct *work)
{}

static int atmel_lcdfb_init_fbinfo(struct atmel_lcdfb_info *sinfo)
{}

static void atmel_lcdfb_start_clock(struct atmel_lcdfb_info *sinfo)
{}

static void atmel_lcdfb_stop_clock(struct atmel_lcdfb_info *sinfo)
{}

static const struct of_device_id atmel_lcdfb_dt_ids[] =;

MODULE_DEVICE_TABLE(of, atmel_lcdfb_dt_ids);

static const char *atmel_lcdfb_wiring_modes[] =;

static int atmel_lcdfb_get_of_wiring_modes(struct device_node *np)
{}

static void atmel_lcdfb_power_control_gpio(struct atmel_lcdfb_pdata *pdata, int on)
{}

static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
{}

static int atmel_lcdfb_probe(struct platform_device *pdev)
{}

static void atmel_lcdfb_remove(struct platform_device *pdev)
{}

#ifdef CONFIG_PM

static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
{}

static int atmel_lcdfb_resume(struct platform_device *pdev)
{}

#else
#define atmel_lcdfb_suspend
#define atmel_lcdfb_resume
#endif

static struct platform_driver atmel_lcdfb_driver =;
module_platform_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();