Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #ifndef __VIAFBDEV_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #define __VIAFBDEV_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/proc_fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/fb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/spinlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include "via_aux.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include "ioctl.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include "share.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include "chip.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include "hw.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define VERSION_MAJOR       2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define VERSION_KERNEL      6	/* For kernel 2.6 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define VERSION_OS          0	/* 0: for 32 bits OS, 1: for 64 bits OS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define VERSION_MINOR       4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define VIAFB_NUM_I2C		5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct viafb_shared {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	u32 iga1_devices;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 	u32 iga2_devices;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	struct proc_dir_entry *proc_entry;	/*viafb proc entry */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 	struct proc_dir_entry *iga1_proc_entry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 	struct proc_dir_entry *iga2_proc_entry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	struct viafb_dev *vdev;			/* Global dev info */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 	/* I2C busses that may have auxiliary devices */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	struct via_aux_bus *i2c_26;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 	struct via_aux_bus *i2c_31;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 	struct via_aux_bus *i2c_2C;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 	/* All the information will be needed to set engine */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 	struct tmds_setting_information tmds_setting_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 	struct lvds_setting_information lvds_setting_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 	struct lvds_setting_information lvds_setting_info2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 	struct chip_information chip_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 	/* hardware acceleration stuff */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 	u32 cursor_vram_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 	u32 vq_vram_addr;	/* virtual queue address in video ram */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 	int (*hw_bitblt)(void __iomem *engine, u8 op, u32 width, u32 height,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 		u8 dst_bpp, u32 dst_addr, u32 dst_pitch, u32 dst_x, u32 dst_y,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 		u32 *src_mem, u32 src_addr, u32 src_pitch, u32 src_x, u32 src_y,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 		u32 fg_color, u32 bg_color, u8 fill_rop);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) struct viafb_par {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 	u8 depth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 	u32 vram_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 	unsigned int fbmem;	/*framebuffer physical memory address */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 	unsigned int memsize;	/*size of fbmem */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 	u32 fbmem_free;		/* Free FB memory */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 	u32 fbmem_used;		/* Use FB memory size */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) 	u32 iga_path;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 	struct viafb_shared *shared;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) 	/* All the information will be needed to set engine */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) 	/* depreciated, use the ones in shared directly */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) 	struct tmds_setting_information *tmds_setting_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) 	struct lvds_setting_information *lvds_setting_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) 	struct lvds_setting_information *lvds_setting_info2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) 	struct chip_information *chip_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) extern int viafb_SAMM_ON;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) extern int viafb_dual_fb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) extern int viafb_LCD2_ON;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) extern int viafb_LCD_ON;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) extern int viafb_DVI_ON;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) extern int viafb_hotplug;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) 	*plvds_setting_info, struct lvds_chip_information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) 	*plvds_chip_info, u8 index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) void viafb_gpio_i2c_write_mask_lvds(struct lvds_setting_information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) 			      *plvds_setting_info, struct lvds_chip_information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) 			      *plvds_chip_info, struct IODATA io_data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) int via_fb_pci_probe(struct viafb_dev *vdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) void via_fb_pci_remove(struct pci_dev *pdev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) /* Temporary */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) int viafb_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) void viafb_exit(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) #endif /* __VIAFBDEV_H__ */