acornfb.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:1k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. #include <linux/config.h>
  2. #define acornfb_valid_pixrate(rate) (rate >= 39325 && rate <= 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.   
  9. vidc->control |= VIDC20_CTRL_PIX_CK;
  10. /* Calculate bandwidth */
  11. bandwidth = var->pixclock * 8 / var->bits_per_pixel;
  12. /* Encode bandwidth as VIDC20 setting */
  13. if (bandwidth > 16667*2)
  14. vidc->control |= VIDC20_CTRL_FIFO_16;
  15. else if (bandwidth > 13333*2)
  16. vidc->control |= VIDC20_CTRL_FIFO_20;
  17. else if (bandwidth > 11111*2)
  18. vidc->control |= VIDC20_CTRL_FIFO_24;
  19. else
  20. vidc->control |= VIDC20_CTRL_FIFO_28;
  21. vidc->pll_ctl  = 0x2020;
  22. }
  23. #ifdef CONFIG_CHRONTEL_7003
  24. #define acornfb_default_control() VIDC20_CTRL_PIX_HCLK
  25. #else
  26. #define acornfb_default_control() VIDC20_CTRL_PIX_VCLK
  27. #endif
  28. #define acornfb_default_econtrol() VIDC20_ECTL_DAC | VIDC20_ECTL_REG(3) | VIDC20_ECTL_ECK