acornfb.h 932 B

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