viafbdev.h 2.8 KB

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