linux/drivers/video/fbdev/arkfb.c

/*
 *  linux/drivers/video/arkfb.c -- Frame buffer device driver for ARK 2000PV
 *  with ICS 5342 dac (it is easy to add support for different dacs).
 *
 *  Copyright (c) 2007 Ondrej Zajicek <[email protected]>
 *
 *  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.
 *
 *  Code is based on s3fb
 */

#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/tty.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/fb.h>
#include <linux/svga.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */
#include <video/vga.h>

struct arkfb_info {};


/* ------------------------------------------------------------------------- */


static const struct svga_fb_format arkfb_formats[] =;


/* CRT timing register sets */

static const struct vga_regset ark_h_total_regs[]        =;
static const struct vga_regset ark_h_display_regs[]      =;
static const struct vga_regset ark_h_blank_start_regs[]  =;
static const struct vga_regset ark_h_blank_end_regs[]    =;
static const struct vga_regset ark_h_sync_start_regs[]   =;
static const struct vga_regset ark_h_sync_end_regs[]     =;

static const struct vga_regset ark_v_total_regs[]        =;
static const struct vga_regset ark_v_display_regs[]      =;
static const struct vga_regset ark_v_blank_start_regs[]  =;
// const struct vga_regset ark_v_blank_end_regs[]    = {{0x16, 0, 6}, VGA_REGSET_END};
static const struct vga_regset ark_v_blank_end_regs[]    =;
static const struct vga_regset ark_v_sync_start_regs[]   =;
static const struct vga_regset ark_v_sync_end_regs[]     =;

static const struct vga_regset ark_line_compare_regs[]   =;
static const struct vga_regset ark_start_address_regs[]  =;
static const struct vga_regset ark_offset_regs[]         =;

static const struct svga_timing_regs ark_timing_regs     =;


/* ------------------------------------------------------------------------- */


/* Module parameters */

static char *mode_option =;

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

module_param(mode_option, charp, 0444);
MODULE_PARM_DESC();
module_param_named(mode, mode_option, charp, 0444);
MODULE_PARM_DESC();

static int threshold =;

module_param(threshold, int, 0644);
MODULE_PARM_DESC();


/* ------------------------------------------------------------------------- */


static void arkfb_settile(struct fb_info *info, struct fb_tilemap *map)
{}

static void arkfb_tilecursor(struct fb_info *info, struct fb_tilecursor *cursor)
{}

static struct fb_tile_ops arkfb_tile_ops =;


/* ------------------------------------------------------------------------- */


/* image data is MSB-first, fb structure is MSB-first too */
static inline u32 expand_color(u32 c)
{}

/* arkfb_iplan_imageblit silently assumes that almost everything is 8-pixel aligned */
static void arkfb_iplan_imageblit(struct fb_info *info, const struct fb_image *image)
{}

/* arkfb_iplan_fillrect silently assumes that almost everything is 8-pixel aligned */
static void arkfb_iplan_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{}


/* image data is MSB-first, fb structure is high-nibble-in-low-byte-first */
static inline u32 expand_pixel(u32 c)
{}

/* arkfb_cfb4_imageblit silently assumes that almost everything is 8-pixel aligned */
static void arkfb_cfb4_imageblit(struct fb_info *info, const struct fb_image *image)
{}

static void arkfb_imageblit(struct fb_info *info, const struct fb_image *image)
{}

static void arkfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{}


/* ------------------------------------------------------------------------- */


enum
{};

struct dac_ops {};

dac_read_regs_t;
dac_write_regs_t;

struct dac_info
{};

static inline void dac_read_regs(struct dac_info *info, u8 *code, int count)
{}

static inline void dac_write_reg(struct dac_info *info, u8 reg, u8 val)
{}

static inline void dac_write_regs(struct dac_info *info, u8 *code, int count)
{}

static inline int dac_set_mode(struct dac_info *info, int mode)
{}

static inline int dac_set_freq(struct dac_info *info, int channel, u32 freq)
{}

static inline void dac_release(struct dac_info *info)
{}


/* ------------------------------------------------------------------------- */


/* ICS5342 DAC */

struct ics5342_info
{};

#define DAC_PAR(info)

/* LSB is set to distinguish unused slots */
static const u8 ics5342_mode_table[DAC_MAX] =;

static int ics5342_set_mode(struct dac_info *info, int mode)
{}

static const struct svga_pll ics5342_pll =;

/* pd4 - allow only posdivider 4 (r=2) */
static const struct svga_pll ics5342_pll_pd4 =;

/* 270 MHz should be upper bound for VCO clock according to specs,
   but that is too restrictive in pd4 case */

static int ics5342_set_freq(struct dac_info *info, int channel, u32 freq)
{}

static void ics5342_release(struct dac_info *info)
{}

static struct dac_ops ics5342_ops =;


static struct dac_info * ics5342_init(dac_read_regs_t drr, dac_write_regs_t dwr, void *data)
{}


/* ------------------------------------------------------------------------- */


static unsigned short dac_regs[4] =;

static void ark_dac_read_regs(void *data, u8 *code, int count)
{}

static void ark_dac_write_regs(void *data, u8 *code, int count)
{}


static void ark_set_pixclock(struct fb_info *info, u32 pixclock)
{}


/* Open framebuffer */

static int arkfb_open(struct fb_info *info, int user)
{}

/* Close framebuffer */

static int arkfb_release(struct fb_info *info, int user)
{}

/* Validate passed in var */

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

/* Set video mode from par */

static int arkfb_set_par(struct fb_info *info)
{}

/* Set a colour register */

static int arkfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
				u_int transp, struct fb_info *fb)
{}

/* Set the display blanking state */

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


/* Pan the display */

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


/* ------------------------------------------------------------------------- */


/* Frame buffer operations */

static const struct fb_ops arkfb_ops =;


/* ------------------------------------------------------------------------- */


/* PCI probe */
static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
{}

/* PCI remove */

static void ark_pci_remove(struct pci_dev *dev)
{}


/* PCI suspend */

static int __maybe_unused ark_pci_suspend(struct device *dev)
{}


/* PCI resume */

static int __maybe_unused ark_pci_resume(struct device *dev)
{}

static const struct dev_pm_ops ark_pci_pm_ops =;

/* List of boards that we are trying to support */

static const struct pci_device_id ark_devices[] =;


MODULE_DEVICE_TABLE(pci, ark_devices);

static struct pci_driver arkfb_pci_driver =;

/* Cleanup */

static void __exit arkfb_cleanup(void)
{}

/* Driver Initialisation */

static int __init arkfb_init(void)
{}

module_init();
module_exit(arkfb_cleanup);