Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
0004  * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
0005 
0006  */
0007 
0008 #ifndef __VIAFBDEV_H__
0009 #define __VIAFBDEV_H__
0010 
0011 #include <linux/proc_fs.h>
0012 #include <linux/fb.h>
0013 #include <linux/spinlock.h>
0014 
0015 #include "via_aux.h"
0016 #include "ioctl.h"
0017 #include "share.h"
0018 #include "chip.h"
0019 #include "hw.h"
0020 
0021 #define VERSION_MAJOR       2
0022 #define VERSION_KERNEL      6   /* For kernel 2.6 */
0023 
0024 #define VERSION_OS          0   /* 0: for 32 bits OS, 1: for 64 bits OS */
0025 #define VERSION_MINOR       4
0026 
0027 #define VIAFB_NUM_I2C       5
0028 
0029 struct viafb_shared {
0030     u32 iga1_devices;
0031     u32 iga2_devices;
0032 
0033     struct proc_dir_entry *proc_entry;  /*viafb proc entry */
0034     struct proc_dir_entry *iga1_proc_entry;
0035     struct proc_dir_entry *iga2_proc_entry;
0036     struct viafb_dev *vdev;         /* Global dev info */
0037 
0038     /* I2C busses that may have auxiliary devices */
0039     struct via_aux_bus *i2c_26;
0040     struct via_aux_bus *i2c_31;
0041     struct via_aux_bus *i2c_2C;
0042 
0043     /* All the information will be needed to set engine */
0044     struct tmds_setting_information tmds_setting_info;
0045     struct lvds_setting_information lvds_setting_info;
0046     struct lvds_setting_information lvds_setting_info2;
0047     struct chip_information chip_info;
0048 
0049     /* hardware acceleration stuff */
0050     u32 cursor_vram_addr;
0051     u32 vq_vram_addr;   /* virtual queue address in video ram */
0052     int (*hw_bitblt)(void __iomem *engine, u8 op, u32 width, u32 height,
0053         u8 dst_bpp, u32 dst_addr, u32 dst_pitch, u32 dst_x, u32 dst_y,
0054         u32 *src_mem, u32 src_addr, u32 src_pitch, u32 src_x, u32 src_y,
0055         u32 fg_color, u32 bg_color, u8 fill_rop);
0056 };
0057 
0058 struct viafb_par {
0059     u8 depth;
0060     u32 vram_addr;
0061 
0062     unsigned int fbmem; /*framebuffer physical memory address */
0063     unsigned int memsize;   /*size of fbmem */
0064     u32 fbmem_free;     /* Free FB memory */
0065     u32 fbmem_used;     /* Use FB memory size */
0066     u32 iga_path;
0067 
0068     struct viafb_shared *shared;
0069 
0070     /* All the information will be needed to set engine */
0071     /* depreciated, use the ones in shared directly */
0072     struct tmds_setting_information *tmds_setting_info;
0073     struct lvds_setting_information *lvds_setting_info;
0074     struct lvds_setting_information *lvds_setting_info2;
0075     struct chip_information *chip_info;
0076 };
0077 
0078 extern int viafb_SAMM_ON;
0079 extern int viafb_dual_fb;
0080 extern int viafb_LCD2_ON;
0081 extern int viafb_LCD_ON;
0082 extern int viafb_DVI_ON;
0083 extern int viafb_hotplug;
0084 
0085 u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information
0086     *plvds_setting_info, struct lvds_chip_information
0087     *plvds_chip_info, u8 index);
0088 void viafb_gpio_i2c_write_mask_lvds(struct lvds_setting_information
0089                   *plvds_setting_info, struct lvds_chip_information
0090                   *plvds_chip_info, struct IODATA io_data);
0091 int via_fb_pci_probe(struct viafb_dev *vdev);
0092 void via_fb_pci_remove(struct pci_dev *pdev);
0093 /* Temporary */
0094 int viafb_init(void);
0095 void viafb_exit(void);
0096 #endif /* __VIAFBDEV_H__ */