viafbdev.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 "ioctl.h"
  23. #include "share.h"
  24. #include "chip.h"
  25. #include "hw.h"
  26. #include "via_i2c.h"
  27. #define VERSION_MAJOR 2
  28. #define VERSION_KERNEL 6 /* For kernel 2.6 */
  29. #define VERSION_OS 0 /* 0: for 32 bits OS, 1: for 64 bits OS */
  30. #define VERSION_MINOR 4
  31. struct viafb_par {
  32. void __iomem *io_virt; /*iospace virtual memory address */
  33. unsigned int fbmem; /*framebuffer physical memory address */
  34. unsigned int memsize; /*size of fbmem */
  35. unsigned int io; /*io space address */
  36. unsigned long mmio_base; /*mmio base address */
  37. unsigned long mmio_len; /*mmio base length */
  38. u32 fbmem_free; /* Free FB memory */
  39. u32 fbmem_used; /* Use FB memory size */
  40. u32 cursor_start; /* Cursor Start Address */
  41. u32 VQ_start; /* Virtual Queue Start Address */
  42. u32 VQ_end; /* Virtual Queue End Address */
  43. u32 iga_path;
  44. struct proc_dir_entry *proc_entry; /*viafb proc entry */
  45. /* I2C stuff */
  46. struct via_i2c_stuff i2c_stuff;
  47. /* All the information will be needed to set engine */
  48. struct tmds_setting_information *tmds_setting_info;
  49. struct crt_setting_information *crt_setting_info;
  50. struct lvds_setting_information *lvds_setting_info;
  51. struct lvds_setting_information *lvds_setting_info2;
  52. struct chip_information *chip_info;
  53. /* some information related to video playing */
  54. int video_on_crt;
  55. int video_on_dvi;
  56. int video_on_lcd;
  57. };
  58. extern unsigned int viafb_second_virtual_yres;
  59. extern unsigned int viafb_second_virtual_xres;
  60. extern unsigned int viafb_second_offset;
  61. extern int viafb_second_size;
  62. extern int viafb_SAMM_ON;
  63. extern int viafb_dual_fb;
  64. extern int viafb_LCD2_ON;
  65. extern int viafb_LCD_ON;
  66. extern int viafb_DVI_ON;
  67. extern int viafb_accel;
  68. extern int viafb_hotplug;
  69. extern int viafb_memsize;
  70. extern int strict_strtoul(const char *cp, unsigned int base,
  71. unsigned long *res);
  72. void viafb_memory_pitch_patch(struct fb_info *info);
  73. void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh,
  74. int mode_index);
  75. int viafb_get_mode_index(int hres, int vres);
  76. u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information
  77. *plvds_setting_info, struct lvds_chip_information
  78. *plvds_chip_info, u8 index);
  79. void viafb_gpio_i2c_write_mask_lvds(struct lvds_setting_information
  80. *plvds_setting_info, struct lvds_chip_information
  81. *plvds_chip_info, struct IODATA io_data);
  82. #endif /* __VIAFBDEV_H__ */