Linux v2.6.15-rc7
[pohmelfs.git] / include / asm-arm / arch-cl7500 / acornfb.h
blob3867231a44700bd7e7457b6cfc0c01b0f83e1d7c
1 #include <linux/config.h>
2 #define acornfb_valid_pixrate(var) (var->pixclock >= 39325 && var->pixclock <= 40119)
4 static inline void
5 acornfb_vidc20_find_rates(struct vidc_timing *vidc,
6 struct fb_var_screeninfo *var)
8 u_int bandwidth;
10 vidc->control |= VIDC20_CTRL_PIX_CK;
12 /* Calculate bandwidth */
13 bandwidth = var->pixclock * 8 / var->bits_per_pixel;
15 /* Encode bandwidth as VIDC20 setting */
16 if (bandwidth > 16667*2)
17 vidc->control |= VIDC20_CTRL_FIFO_16;
18 else if (bandwidth > 13333*2)
19 vidc->control |= VIDC20_CTRL_FIFO_20;
20 else if (bandwidth > 11111*2)
21 vidc->control |= VIDC20_CTRL_FIFO_24;
22 else
23 vidc->control |= VIDC20_CTRL_FIFO_28;
25 vidc->pll_ctl = 0x2020;
28 #ifdef CONFIG_CHRONTEL_7003
29 #define acornfb_default_control() VIDC20_CTRL_PIX_HCLK
30 #else
31 #define acornfb_default_control() VIDC20_CTRL_PIX_VCLK
32 #endif
34 #define acornfb_default_econtrol() VIDC20_ECTL_DAC | VIDC20_ECTL_REG(3) | VIDC20_ECTL_ECK