rivafb.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef __RIVAFB_H
  2. #define __RIVAFB_H
  3. #include <linux/fb.h>
  4. #include <video/vga.h>
  5. #include <linux/i2c.h>
  6. #include <linux/i2c-algo-bit.h>
  7. #include "riva_hw.h"
  8. /* GGI compatibility macros */
  9. #define NUM_SEQ_REGS 0x05
  10. #define NUM_CRT_REGS 0x41
  11. #define NUM_GRC_REGS 0x09
  12. #define NUM_ATC_REGS 0x15
  13. /* I2C */
  14. #define DDC_SCL_READ_MASK (1 << 2)
  15. #define DDC_SCL_WRITE_MASK (1 << 5)
  16. #define DDC_SDA_READ_MASK (1 << 3)
  17. #define DDC_SDA_WRITE_MASK (1 << 4)
  18. /* holds the state of the VGA core and extended Riva hw state from riva_hw.c.
  19. * From KGI originally. */
  20. struct riva_regs {
  21. u8 attr[NUM_ATC_REGS];
  22. u8 crtc[NUM_CRT_REGS];
  23. u8 gra[NUM_GRC_REGS];
  24. u8 seq[NUM_SEQ_REGS];
  25. u8 misc_output;
  26. RIVA_HW_STATE ext;
  27. };
  28. struct riva_par;
  29. struct riva_i2c_chan {
  30. struct riva_par *par;
  31. unsigned long ddc_base;
  32. struct i2c_adapter adapter;
  33. struct i2c_algo_bit_data algo;
  34. };
  35. struct riva_par {
  36. RIVA_HW_INST riva; /* interface to riva_hw.c */
  37. u32 pseudo_palette[16]; /* default palette */
  38. u32 palette[16]; /* for Riva128 */
  39. u8 __iomem *ctrl_base; /* virtual control register base addr */
  40. unsigned dclk_max; /* max DCLK */
  41. struct riva_regs initial_state; /* initial startup video mode */
  42. struct riva_regs current_state;
  43. #ifdef CONFIG_X86
  44. struct vgastate state;
  45. #endif
  46. struct mutex open_lock;
  47. unsigned int ref_count;
  48. unsigned char *EDID;
  49. unsigned int Chipset;
  50. int forceCRTC;
  51. Bool SecondCRTC;
  52. int FlatPanel;
  53. struct pci_dev *pdev;
  54. int cursor_reset;
  55. #ifdef CONFIG_MTRR
  56. struct { int vram; int vram_valid; } mtrr;
  57. #endif
  58. struct riva_i2c_chan chan[3];
  59. };
  60. void riva_common_setup(struct riva_par *);
  61. unsigned long riva_get_memlen(struct riva_par *);
  62. unsigned long riva_get_maxdclk(struct riva_par *);
  63. void riva_delete_i2c_busses(struct riva_par *par);
  64. void riva_create_i2c_busses(struct riva_par *par);
  65. int riva_probe_i2c_connector(struct riva_par *par, int conn, u8 **out_edid);
  66. #endif /* __RIVAFB_H */