linux/drivers/video/fbdev/tridentfb.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Frame buffer driver for Trident TGUI, Blade and Image series
 *
 * Copyright 2001, 2002 - Jani Monoses   <[email protected]>
 * Copyright 2009 Krzysztof Helt <[email protected]>
 *
 * CREDITS:(in order of appearance)
 *	skeletonfb.c by Geert Uytterhoeven and other fb code in drivers/video
 *	Special thanks ;) to Mattia Crivellini <[email protected]>
 *	much inspired by the XFree86 4.x Trident driver sources
 *	by Alan Hourihane the FreeVGA project
 *	Francesco Salvestrini <[email protected]> XP support,
 *	code, suggestions
 * TODO:
 *	timing value tweaking so it looks good on every monitor in every mode
 */

#include <linux/aperture.h>
#include <linux/module.h>
#include <linux/fb.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>

#include <linux/delay.h>
#include <video/vga.h>
#include <video/trident.h>

#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>

struct tridentfb_par {};

static struct fb_fix_screeninfo tridentfb_fix =;

/* defaults which are normally overriden by user values */

/* video mode */
static char *mode_option;
static int bpp =;

static int noaccel;

static int center;
static int stretch;

static int fp;
static int crt;

static int memsize;
static int memdiff;
static int nativex;

module_param(mode_option, charp, 0);
MODULE_PARM_DESC();
module_param_named(mode, mode_option, charp, 0);
MODULE_PARM_DESC();
module_param(bpp, int, 0);
module_param(center, int, 0);
module_param(stretch, int, 0);
module_param(noaccel, int, 0);
module_param(memsize, int, 0);
module_param(memdiff, int, 0);
module_param(nativex, int, 0);
module_param(fp, int, 0);
MODULE_PARM_DESC();
module_param(crt, int, 0);
MODULE_PARM_DESC();

static inline int is_oldclock(int id)
{}

static inline int is_oldprotect(int id)
{}

static inline int is_blade(int id)
{}

static inline int is_xp(int id)
{}

static inline int is3Dchip(int id)
{}

static inline int iscyber(int id)
{}

static inline void t_outb(struct tridentfb_par *p, u8 val, u16 reg)
{}

static inline u8 t_inb(struct tridentfb_par *p, u16 reg)
{}

static inline void writemmr(struct tridentfb_par *par, u16 r, u32 v)
{}

static inline u32 readmmr(struct tridentfb_par *par, u16 r)
{}

#define DDC_SDA_TGUI
#define DDC_SCL_TGUI
#define DDC_SCL_DRIVE_TGUI
#define DDC_SDA_DRIVE_TGUI
#define DDC_MASK_TGUI

static void tridentfb_ddc_setscl_tgui(void *data, int val)
{}

static void tridentfb_ddc_setsda_tgui(void *data, int val)
{}

static int tridentfb_ddc_getsda_tgui(void *data)
{}

#define DDC_SDA_IN
#define DDC_SCL_OUT
#define DDC_SDA_OUT
#define DDC_SCL_IN
#define DDC_MASK

static void tridentfb_ddc_setscl(void *data, int val)
{}

static void tridentfb_ddc_setsda(void *data, int val)
{}

static int tridentfb_ddc_getscl(void *data)
{}

static int tridentfb_ddc_getsda(void *data)
{}

static int tridentfb_setup_ddc_bus(struct fb_info *info)
{}

/*
 * Blade specific acceleration.
 */

#define point(x, y)

static void blade_init_accel(struct tridentfb_par *par, int pitch, int bpp)
{}

static void blade_wait_engine(struct tridentfb_par *par)
{}

static void blade_fill_rect(struct tridentfb_par *par,
			    u32 x, u32 y, u32 w, u32 h, u32 c, u32 rop)
{}

static void blade_image_blit(struct tridentfb_par *par, const char *data,
			     u32 x, u32 y, u32 w, u32 h, u32 c, u32 b)
{}

static void blade_copy_rect(struct tridentfb_par *par,
			    u32 x1, u32 y1, u32 x2, u32 y2, u32 w, u32 h)
{}

/*
 * BladeXP specific acceleration functions
 */

static void xp_init_accel(struct tridentfb_par *par, int pitch, int bpp)
{}

static void xp_wait_engine(struct tridentfb_par *par)
{}

static void xp_fill_rect(struct tridentfb_par *par,
			 u32 x, u32 y, u32 w, u32 h, u32 c, u32 rop)
{}

static void xp_copy_rect(struct tridentfb_par *par,
			 u32 x1, u32 y1, u32 x2, u32 y2, u32 w, u32 h)
{}

/*
 * Image specific acceleration functions
 */
static void image_init_accel(struct tridentfb_par *par, int pitch, int bpp)
{}

static void image_wait_engine(struct tridentfb_par *par)
{}

static void image_fill_rect(struct tridentfb_par *par,
			    u32 x, u32 y, u32 w, u32 h, u32 c, u32 rop)
{}

static void image_copy_rect(struct tridentfb_par *par,
			    u32 x1, u32 y1, u32 x2, u32 y2, u32 w, u32 h)
{}

/*
 * TGUI 9440/96XX acceleration
 */

static void tgui_init_accel(struct tridentfb_par *par, int pitch, int bpp)
{}

static void tgui_fill_rect(struct tridentfb_par *par,
			   u32 x, u32 y, u32 w, u32 h, u32 c, u32 rop)
{}

static void tgui_copy_rect(struct tridentfb_par *par,
			   u32 x1, u32 y1, u32 x2, u32 y2, u32 w, u32 h)
{}

/*
 * Accel functions called by the upper layers
 */
static void tridentfb_fillrect(struct fb_info *info,
			       const struct fb_fillrect *fr)
{}

static void tridentfb_imageblit(struct fb_info *info,
				const struct fb_image *img)
{}

static void tridentfb_copyarea(struct fb_info *info,
			       const struct fb_copyarea *ca)
{}

static int tridentfb_sync(struct fb_info *info)
{}

/*
 * Hardware access functions
 */

static inline unsigned char read3X4(struct tridentfb_par *par, int reg)
{}

static inline void write3X4(struct tridentfb_par *par, int reg,
			    unsigned char val)
{}

static inline unsigned char read3CE(struct tridentfb_par *par,
				    unsigned char reg)
{}

static inline void writeAttr(struct tridentfb_par *par, int reg,
			     unsigned char val)
{}

static inline void write3CE(struct tridentfb_par *par, int reg,
			    unsigned char val)
{}

static void enable_mmio(struct tridentfb_par *par)
{}

static void disable_mmio(struct tridentfb_par *par)
{}

static inline void crtc_unlock(struct tridentfb_par *par)
{}

/*  Return flat panel's maximum x resolution */
static int get_nativex(struct tridentfb_par *par)
{}

/* Set pitch */
static inline void set_lwidth(struct tridentfb_par *par, int width)
{}

/* For resolutions smaller than FP resolution stretch */
static void screen_stretch(struct tridentfb_par *par)
{}

/* For resolutions smaller than FP resolution center */
static inline void screen_center(struct tridentfb_par *par)
{}

/* Address of first shown pixel in display memory */
static void set_screen_start(struct tridentfb_par *par, int base)
{}

/* Set dotclock frequency */
static void set_vclk(struct tridentfb_par *par, unsigned long freq)
{}

/* Set number of lines for flat panels*/
static void set_number_of_lines(struct tridentfb_par *par, int lines)
{}

/*
 * If we see that FP is active we assume we have one.
 * Otherwise we have a CRT display. User can override.
 */
static int is_flatpanel(struct tridentfb_par *par)
{}

/* Try detecting the video memory size */
static unsigned int get_memsize(struct tridentfb_par *par)
{}

/* See if we can handle the video mode described in var */
static int tridentfb_check_var(struct fb_var_screeninfo *var,
			       struct fb_info *info)
{}

/* Pan the display */
static int tridentfb_pan_display(struct fb_var_screeninfo *var,
				 struct fb_info *info)
{}

static inline void shadowmode_on(struct tridentfb_par *par)
{}

/* Set the hardware to the requested video mode */
static int tridentfb_set_par(struct fb_info *info)
{}

/* Set one color register */
static int tridentfb_setcolreg(unsigned regno, unsigned red, unsigned green,
			       unsigned blue, unsigned transp,
			       struct fb_info *info)
{}

/* Try blanking the screen. For flat panels it does nothing */
static int tridentfb_blank(int blank_mode, struct fb_info *info)
{}

static const struct fb_ops tridentfb_ops =;

static int trident_pci_probe(struct pci_dev *dev,
			     const struct pci_device_id *id)
{}

static void trident_pci_remove(struct pci_dev *dev)
{}

/* List of boards that we are trying to support */
static const struct pci_device_id trident_devices[] =;

MODULE_DEVICE_TABLE(pci, trident_devices);

static struct pci_driver tridentfb_pci_driver =;

/*
 * Parse user specified options (`video=trident:')
 * example:
 *	video=trident:800x600,bpp=16,noaccel
 */
#ifndef MODULE
static int __init tridentfb_setup(char *options)
{}
#endif

static int __init tridentfb_init(void)
{}

static void __exit tridentfb_exit(void)
{}

module_init();
module_exit(tridentfb_exit);

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