/*
* broadsheetfb.c -- FB driver for E-Ink Broadsheet controller
*
* Copyright (C) 2008, Jaya Kumar
*
* 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.
*
* Layout is based on skeletonfb.c by James Simmons and Geert Uytterhoeven.
*
* This driver is written to be used with the Broadsheet display controller.
*
* It is intended to be architecture independent. A board specific driver
* must be used to perform all the physical IO interactions.
*
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/list.h>
#include <linux/firmware.h>
#include <linux/uaccess.h>
#include <video/broadsheetfb.h>
/* track panel specific parameters */
struct panel_info {
int w;
int h;
u16 sdcfg;
u16 gdcfg;
u16 lutfmt;
u16 fsynclen;
u16 fendfbegin;
u16 lsynclen;
u16 lendlbegin;
u16 pixclk;
};
/* table of panel specific parameters to be indexed into by the board drivers */
static struct panel_info panel_table[] = {
{ /* standard 6" on TFT backplane */
.w = 800,
.h = 600,
.sdcfg = (100 | (1 << 8) | (1 << 9)),
.gdcfg = 2,
.lutfmt = (4 | (1 << 7)),
.fsynclen = 4,
.fendfbegin = (10 << 8) | 4,
.lsynclen = 10,
.lendlbegin = (100 << 8) | 4,
.pixclk = 6,
},
{ /* custom 3.7" flexible on PET or steel */
.w = 320,
.h = 240,
.sdcfg = (67 | (0 << 8) | (0 << 9) | (0 << 10) | (0 << 12)),
.gdcfg = 3,
.lutfmt = (4 | (1 << 7)),
.fsynclen = 0,
.fendfbegin = (80 << 8) | 4,
.lsynclen = 10,
.lendlbegin = (80 << 8) | 20,
.pixclk = 14,
},
{ /* standard 9.7" on TFT backplane */
.w = 1200,
.h = 825,
.sdcfg = (100 | (1 << 8) | (1 << 9) | (0 << 10) | (0 << 12)),
.gdcfg = 2,