linux/drivers/video/fbdev/via/viafbdev.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright 1998-2009 VIA Technologies, Inc. All Rights Reserved.
 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.

 */

#include <linux/compiler.h>
#include <linux/module.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/stat.h>
#include <linux/via-core.h>
#include <linux/via_i2c.h>

#define _MASTER_FILE
#include "global.h"

static char *viafb_name =;
static u32 pseudo_pal[17];

/* video mode */
static char *viafb_mode;
static char *viafb_mode1;
static int viafb_bpp =;
static int viafb_bpp1 =;

static unsigned int viafb_second_offset;
static int viafb_second_size;

static int viafb_accel =;

/* Added for specifying active devices.*/
static char *viafb_active_dev;

/*Added for specify lcd output port*/
static char *viafb_lcd_port =;
static char *viafb_dvi_port =;

static void retrieve_device_setting(struct viafb_ioctl_setting
	*setting_info);
static int viafb_pan_display(struct fb_var_screeninfo *var,
	struct fb_info *info);

static struct fb_ops viafb_ops;

/* supported output devices on each IGP
 * only CX700, VX800, VX855, VX900 were documented
 * VIA_CRT should be everywhere
 * VIA_6C can be onle pre-CX700 (probably only on CLE266) as 6C is used for PLL
 * source selection on CX700 and later
 * K400 seems to support VIA_96, VIA_DVP1, VIA_LVDS{1,2} as in viamode.c
 */
static const u32 supported_odev_map[] =;

static void viafb_fill_var_color_info(struct fb_var_screeninfo *var, u8 depth)
{}

static void viafb_update_fix(struct fb_info *info)
{}

static void viafb_setup_fixinfo(struct fb_fix_screeninfo *fix,
	struct viafb_par *viaparinfo)
{}
static int viafb_open(struct fb_info *info, int user)
{}

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

static inline int get_var_refresh(struct fb_var_screeninfo *var)
{}

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

static int viafb_set_par(struct fb_info *info)
{}

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

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

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

static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
{}

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

static void viafb_copyarea(struct fb_info *info,
	const struct fb_copyarea *area)
{}

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

static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
{}

static int viafb_sync(struct fb_info *info)
{}

static int get_primary_device(void)
{}

static void retrieve_device_setting(struct viafb_ioctl_setting
	*setting_info)
{}

static int __init parse_active_dev(void)
{}

static int parse_port(char *opt_str, int *output_interface)
{}

static void parse_lcd_port(void)
{}

static void parse_dvi_port(void)
{}

#ifdef CONFIG_FB_VIA_DIRECT_PROCFS

/*
 * The proc filesystem read/write function, a simple proc implement to
 * get/set the value of DPA  DVP0,   DVP0DataDriving,  DVP0ClockDriving, DVP1,
 * DVP1Driving, DFPHigh, DFPLow CR96,   SR2A[5], SR1B[1], SR2A[4], SR1E[2],
 * CR9B,    SR65,    CR97,    CR99
 */
static int viafb_dvp0_proc_show(struct seq_file *m, void *v)
{}

static int viafb_dvp0_proc_open(struct inode *inode, struct file *file)
{}

static ssize_t viafb_dvp0_proc_write(struct file *file,
	const char __user *buffer, size_t count, loff_t *pos)
{}

static const struct proc_ops viafb_dvp0_proc_ops =;

static int viafb_dvp1_proc_show(struct seq_file *m, void *v)
{}

static int viafb_dvp1_proc_open(struct inode *inode, struct file *file)
{}

static ssize_t viafb_dvp1_proc_write(struct file *file,
	const char __user *buffer, size_t count, loff_t *pos)
{}

static const struct proc_ops viafb_dvp1_proc_ops =;

static int viafb_dfph_proc_show(struct seq_file *m, void *v)
{}

static int viafb_dfph_proc_open(struct inode *inode, struct file *file)
{}

static ssize_t viafb_dfph_proc_write(struct file *file,
	const char __user *buffer, size_t count, loff_t *pos)
{}

static const struct proc_ops viafb_dfph_proc_ops =;

static int viafb_dfpl_proc_show(struct seq_file *m, void *v)
{}

static int viafb_dfpl_proc_open(struct inode *inode, struct file *file)
{}

static ssize_t viafb_dfpl_proc_write(struct file *file,
	const char __user *buffer, size_t count, loff_t *pos)
{}

static const struct proc_ops viafb_dfpl_proc_ops =;

static int viafb_vt1636_proc_show(struct seq_file *m, void *v)
{}

static int viafb_vt1636_proc_open(struct inode *inode, struct file *file)
{}

static ssize_t viafb_vt1636_proc_write(struct file *file,
	const char __user *buffer, size_t count, loff_t *pos)
{}

static const struct proc_ops viafb_vt1636_proc_ops =;

#endif /* CONFIG_FB_VIA_DIRECT_PROCFS */

static int __maybe_unused viafb_sup_odev_proc_show(struct seq_file *m, void *v)
{}

static ssize_t odev_update(const char __user *buffer, size_t count, u32 *odev)
{}

static int viafb_iga1_odev_proc_show(struct seq_file *m, void *v)
{}

static int viafb_iga1_odev_proc_open(struct inode *inode, struct file *file)
{}

static ssize_t viafb_iga1_odev_proc_write(struct file *file,
	const char __user *buffer, size_t count, loff_t *pos)
{}

static const struct proc_ops viafb_iga1_odev_proc_ops =;

static int viafb_iga2_odev_proc_show(struct seq_file *m, void *v)
{}

static int viafb_iga2_odev_proc_open(struct inode *inode, struct file *file)
{}

static ssize_t viafb_iga2_odev_proc_write(struct file *file,
	const char __user *buffer, size_t count, loff_t *pos)
{}

static const struct proc_ops viafb_iga2_odev_proc_ops =;

#define IS_VT1636
static void viafb_init_proc(struct viafb_shared *shared)
{}
static void viafb_remove_proc(struct viafb_shared *shared)
{}
#undef IS_VT1636

static int parse_mode(const char *str, u32 devices, u32 *xres, u32 *yres)
{}


#ifdef CONFIG_PM
static int viafb_suspend(void *unused)
{}

static int viafb_resume(void *unused)
{}

static struct viafb_pm_hooks viafb_fb_pm_hooks =;

#endif

static void i2c_bus_probe(struct viafb_shared *shared)
{}

static void i2c_bus_free(struct viafb_shared *shared)
{}

int via_fb_pci_probe(struct viafb_dev *vdev)
{}

void via_fb_pci_remove(struct pci_dev *pdev)
{}

#ifndef MODULE
static int __init viafb_setup(void)
{}
#endif

/*
 * These are called out of via-core for now.
 */
int __init viafb_init(void)
{}

void __exit viafb_exit(void)
{}

static struct fb_ops viafb_ops =;


#ifdef MODULE
module_param(viafb_mode, charp, S_IRUSR);
MODULE_PARM_DESC(viafb_mode, "Set resolution (default=640x480)");

module_param(viafb_mode1, charp, S_IRUSR);
MODULE_PARM_DESC(viafb_mode1, "Set resolution (default=640x480)");

module_param(viafb_bpp, int, S_IRUSR);
MODULE_PARM_DESC(viafb_bpp, "Set color depth (default=32bpp)");

module_param(viafb_bpp1, int, S_IRUSR);
MODULE_PARM_DESC(viafb_bpp1, "Set color depth (default=32bpp)");

module_param(viafb_refresh, int, S_IRUSR);
MODULE_PARM_DESC(viafb_refresh,
	"Set CRT viafb_refresh rate (default = 60)");

module_param(viafb_refresh1, int, S_IRUSR);
MODULE_PARM_DESC(viafb_refresh1,
	"Set CRT refresh rate (default = 60)");

module_param(viafb_lcd_panel_id, int, S_IRUSR);
MODULE_PARM_DESC(viafb_lcd_panel_id,
	"Set Flat Panel type(Default=1024x768)");

module_param(viafb_lcd_dsp_method, int, S_IRUSR);
MODULE_PARM_DESC(viafb_lcd_dsp_method,
	"Set Flat Panel display scaling method.(Default=Expansion)");

module_param(viafb_SAMM_ON, int, S_IRUSR);
MODULE_PARM_DESC(viafb_SAMM_ON,
	"Turn on/off flag of SAMM(Default=OFF)");

module_param(viafb_accel, int, S_IRUSR);
MODULE_PARM_DESC(viafb_accel,
	"Set 2D Hardware Acceleration: 0 = OFF, 1 = ON (default)");

module_param(viafb_active_dev, charp, S_IRUSR);
MODULE_PARM_DESC(viafb_active_dev, "Specify active devices.");

module_param(viafb_display_hardware_layout, int, S_IRUSR);
MODULE_PARM_DESC(viafb_display_hardware_layout,
	"Display Hardware Layout (LCD Only, DVI Only...,etc)");

module_param(viafb_second_size, int, S_IRUSR);
MODULE_PARM_DESC(viafb_second_size,
	"Set secondary device memory size");

module_param(viafb_dual_fb, int, S_IRUSR);
MODULE_PARM_DESC(viafb_dual_fb,
	"Turn on/off flag of dual framebuffer devices.(Default = OFF)");

module_param(viafb_platform_epia_dvi, int, S_IRUSR);
MODULE_PARM_DESC(viafb_platform_epia_dvi,
	"Turn on/off flag of DVI devices on EPIA board.(Default = OFF)");

module_param(viafb_device_lcd_dualedge, int, S_IRUSR);
MODULE_PARM_DESC(viafb_device_lcd_dualedge,
	"Turn on/off flag of dual edge panel.(Default = OFF)");

module_param(viafb_bus_width, int, S_IRUSR);
MODULE_PARM_DESC(viafb_bus_width,
	"Set bus width of panel.(Default = 12)");

module_param(viafb_lcd_mode, int, S_IRUSR);
MODULE_PARM_DESC(viafb_lcd_mode,
	"Set Flat Panel mode(Default=OPENLDI)");

module_param(viafb_lcd_port, charp, S_IRUSR);
MODULE_PARM_DESC(viafb_lcd_port, "Specify LCD output port.");

module_param(viafb_dvi_port, charp, S_IRUSR);
MODULE_PARM_DESC(viafb_dvi_port, "Specify DVI output port.");

MODULE_DESCRIPTION("VIA UniChrome (Pro) and Chrome9 display driver");
MODULE_LICENSE("GPL");
#endif