rivafb.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. int wc_cookie;
  56. struct riva_i2c_chan chan[3];
  57. };
  58. void riva_common_setup(struct riva_par *);
  59. unsigned long riva_get_memlen(struct riva_par *);
  60. unsigned long riva_get_maxdclk(struct riva_par *);
  61. void riva_delete_i2c_busses(struct riva_par *par);
  62. void riva_create_i2c_busses(struct riva_par *par);
  63. int riva_probe_i2c_connector(struct riva_par *par, int conn, u8 **out_edid);
  64. #endif /* __RIVAFB_H */