acornfb.h 906 B

123456789101112131415161718192021222324252627282930313233
  1. #define acornfb_valid_pixrate(var) (var->pixclock >= 39325 && var->pixclock <= 40119)
  2. static inline void
  3. acornfb_vidc20_find_rates(struct vidc_timing *vidc,
  4. struct fb_var_screeninfo *var)
  5. {
  6. u_int bandwidth;
  7. vidc->control |= VIDC20_CTRL_PIX_CK;
  8. /* Calculate bandwidth */
  9. bandwidth = var->pixclock * 8 / var->bits_per_pixel;
  10. /* Encode bandwidth as VIDC20 setting */
  11. if (bandwidth > 16667*2)
  12. vidc->control |= VIDC20_CTRL_FIFO_16;
  13. else if (bandwidth > 13333*2)
  14. vidc->control |= VIDC20_CTRL_FIFO_20;
  15. else if (bandwidth > 11111*2)
  16. vidc->control |= VIDC20_CTRL_FIFO_24;
  17. else
  18. vidc->control |= VIDC20_CTRL_FIFO_28;
  19. vidc->pll_ctl = 0x2020;
  20. }
  21. #ifdef CONFIG_CHRONTEL_7003
  22. #define acornfb_default_control() VIDC20_CTRL_PIX_HCLK
  23. #else
  24. #define acornfb_default_control() VIDC20_CTRL_PIX_VCLK
  25. #endif
  26. #define acornfb_default_econtrol() VIDC20_ECTL_DAC | VIDC20_ECTL_REG(3) | VIDC20_ECTL_ECK