4 #ifdef CONFIG_FB_RADEON_DEBUG
8 #include <linux/module.h>
9 #include <linux/kernel.h>
10 #include <linux/sched.h>
12 #include <linux/pci.h>
16 #ifdef CONFIG_FB_RADEON_I2C
17 #include <linux/i2c.h>
23 #if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
61 #define IS_RV100_VARIANT(rinfo) (((rinfo)->family == CHIP_FAMILY_RV100) || \
62 ((rinfo)->family == CHIP_FAMILY_RV200) || \
63 ((rinfo)->family == CHIP_FAMILY_RS100) || \
64 ((rinfo)->family == CHIP_FAMILY_RS200) || \
65 ((rinfo)->family == CHIP_FAMILY_RV250) || \
66 ((rinfo)->family == CHIP_FAMILY_RV280) || \
67 ((rinfo)->family == CHIP_FAMILY_RS300))
70 #define IS_R300_VARIANT(rinfo) (((rinfo)->family == CHIP_FAMILY_R300) || \
71 ((rinfo)->family == CHIP_FAMILY_RV350) || \
72 ((rinfo)->family == CHIP_FAMILY_R350) || \
73 ((rinfo)->family == CHIP_FAMILY_RV380) || \
74 ((rinfo)->family == CHIP_FAMILY_R420) || \
75 ((rinfo)->family == CHIP_FAMILY_RC410) || \
76 ((rinfo)->family == CHIP_FAMILY_RS480))
270 #ifdef CONFIG_FB_RADEON_I2C
304 #if defined(CONFIG_PPC_OF) || defined(CONFIG_SPARC)
361 #ifdef CONFIG_FB_RADEON_I2C
367 #define PRIMARY_MONITOR(rinfo) (rinfo->mon1_type)
380 static inline void _radeon_msleep(
struct radeonfb_info *rinfo,
unsigned long ms)
389 #define INREG8(addr) readb((rinfo->mmio_base)+addr)
390 #define OUTREG8(addr,val) writeb(val, (rinfo->mmio_base)+addr)
391 #define INREG16(addr) readw((rinfo->mmio_base)+addr)
392 #define OUTREG16(addr,val) writew(val, (rinfo->mmio_base)+addr)
393 #define INREG(addr) readl((rinfo->mmio_base)+addr)
394 #define OUTREG(addr,val) writel(val, (rinfo->mmio_base)+addr)
407 spin_unlock_irqrestore(&rinfo->
reg_lock, flags);
410 #define OUTREGP(addr,val,mask) _OUTREGP(rinfo, addr, val,mask)
429 static inline void radeon_pll_errata_after_index(
struct radeonfb_info *rinfo)
438 static inline void radeon_pll_errata_after_data(
struct radeonfb_info *rinfo)
442 _radeon_msleep(rinfo, 5);
459 radeon_pll_errata_after_index(rinfo);
461 radeon_pll_errata_after_data(rinfo);
470 radeon_pll_errata_after_index(rinfo);
472 radeon_pll_errata_after_data(rinfo);
476 static inline void __OUTPLLP(
struct radeonfb_info *rinfo,
unsigned int index,
481 tmp = __INPLL(rinfo, index);
484 __OUTPLL(rinfo, index, tmp);
488 #define INPLL(addr) __INPLL(rinfo, addr)
489 #define OUTPLL(index, val) __OUTPLL(rinfo, index, val)
490 #define OUTPLLP(index, val, mask) __OUTPLLP(rinfo, index, val, mask)
493 #define BIOS_IN8(v) (readb(rinfo->bios_seg + (v)))
494 #define BIOS_IN16(v) (readb(rinfo->bios_seg + (v)) | \
495 (readb(rinfo->bios_seg + (v) + 1) << 8))
496 #define BIOS_IN32(v) (readb(rinfo->bios_seg + (v)) | \
497 (readb(rinfo->bios_seg + (v) + 1) << 8) | \
498 (readb(rinfo->bios_seg + (v) + 2) << 16) | \
499 (readb(rinfo->bios_seg + (v) + 3) << 24))
506 return (num + (den / 2)) /
den;
513 return (var->
green.length == 5) ? 15 : 16;
540 for (i=0; i<2000000; i++) {
548 static inline void radeon_engine_flush (
struct radeonfb_info *rinfo)
559 _radeon_fifo_wait (rinfo, 64);
562 for (i=0; i < 2000000; i++) {
571 static inline void _radeon_engine_idle(
struct radeonfb_info *rinfo)
576 _radeon_fifo_wait (rinfo, 64);
578 for (i=0; i<2000000; i++) {
580 radeon_engine_flush (rinfo);
589 #define radeon_engine_idle() _radeon_engine_idle(rinfo)
590 #define radeon_fifo_wait(entries) _radeon_fifo_wait(rinfo,entries)
591 #define radeon_msleep(ms) _radeon_msleep(rinfo,ms)
607 const char *monitor_layout,
int ignore_edid);
627 #ifdef CONFIG_FB_RADEON_BACKLIGHT