rivafb.h 1.9 KB

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