viafbdev.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
  3. * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public
  6. * License as published by the Free Software Foundation;
  7. * either version 2, or (at your option) any later version.
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
  10. * the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. * A PARTICULAR PURPOSE.See the GNU General Public License
  12. * for more details.
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program; if not, write to the Free Software
  15. * Foundation, Inc.,
  16. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #ifndef __VIAFBDEV_H__
  19. #define __VIAFBDEV_H__
  20. #include <linux/proc_fs.h>
  21. #include <linux/fb.h>
  22. #include <linux/spinlock.h>
  23. #include "via_aux.h"
  24. #include "ioctl.h"
  25. #include "share.h"
  26. #include "chip.h"
  27. #include "hw.h"
  28. #define VERSION_MAJOR 2
  29. #define VERSION_KERNEL 6 /* For kernel 2.6 */
  30. #define VERSION_OS 0 /* 0: for 32 bits OS, 1: for 64 bits OS */
  31. #define VERSION_MINOR 4
  32. #define VIAFB_NUM_I2C 5
  33. struct viafb_shared {
  34. u32 iga1_devices;
  35. u32 iga2_devices;
  36. struct proc_dir_entry *proc_entry; /*viafb proc entry */
  37. struct proc_dir_entry *iga1_proc_entry;
  38. struct proc_dir_entry *iga2_proc_entry;
  39. struct viafb_dev *vdev; /* Global dev info */
  40. /* I2C busses that may have auxiliary devices */
  41. struct via_aux_bus *i2c_26;
  42. struct via_aux_bus *i2c_31;
  43. struct via_aux_bus *i2c_2C;
  44. /* All the information will be needed to set engine */
  45. struct tmds_setting_information tmds_setting_info;
  46. struct lvds_setting_information lvds_setting_info;
  47. struct lvds_setting_information lvds_setting_info2;
  48. struct chip_information chip_info;
  49. /* hardware acceleration stuff */
  50. u32 cursor_vram_addr;
  51. u32 vq_vram_addr; /* virtual queue address in video ram */
  52. int (*hw_bitblt)(void __iomem *engine, u8 op, u32 width, u32 height,
  53. u8 dst_bpp, u32 dst_addr, u32 dst_pitch, u32 dst_x, u32 dst_y,
  54. u32 *src_mem, u32 src_addr, u32 src_pitch, u32 src_x, u32 src_y,
  55. u32 fg_color, u32 bg_color, u8 fill_rop);
  56. };
  57. struct viafb_par {
  58. u8 depth;
  59. u32 vram_addr;
  60. unsigned int fbmem; /*framebuffer physical memory address */
  61. unsigned int memsize; /*size of fbmem */
  62. u32 fbmem_free; /* Free FB memory */
  63. u32 fbmem_used; /* Use FB memory size */
  64. u32 iga_path;
  65. struct viafb_shared *shared;
  66. /* All the information will be needed to set engine */
  67. /* depreciated, use the ones in shared directly */
  68. struct tmds_setting_information *tmds_setting_info;
  69. struct lvds_setting_information *lvds_setting_info;
  70. struct lvds_setting_information *lvds_setting_info2;
  71. struct chip_information *chip_info;
  72. };
  73. extern int viafb_SAMM_ON;
  74. extern int viafb_dual_fb;
  75. extern int viafb_LCD2_ON;
  76. extern int viafb_LCD_ON;
  77. extern int viafb_DVI_ON;
  78. extern int viafb_hotplug;
  79. u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information
  80. *plvds_setting_info, struct lvds_chip_information
  81. *plvds_chip_info, u8 index);
  82. void viafb_gpio_i2c_write_mask_lvds(struct lvds_setting_information
  83. *plvds_setting_info, struct lvds_chip_information
  84. *plvds_chip_info, struct IODATA io_data);
  85. int via_fb_pci_probe(struct viafb_dev *vdev);
  86. void via_fb_pci_remove(struct pci_dev *pdev);
  87. /* Temporary */
  88. int viafb_init(void);
  89. void viafb_exit(void);
  90. #endif /* __VIAFBDEV_H__ */