diff options
author | Egbert Eich <eich@freedesktop.org> | 2007-10-16 08:41:23 +0200 |
---|---|---|
committer | Egbert Eich <eich@freedesktop.org> | 2007-10-17 08:34:47 +0200 |
commit | 5398012568af4f5c4cc8002230e79d4585e63401 (patch) | |
tree | 8e376e031865a22dd164df3d5c848091201f969a /src/rhd_i2c.c | |
parent | 0827c9d5b901a24cac134f27bfbe7dfbaef39309 (diff) |
Fix build for the case that AtomBIOS or AtomBIOS parser are not present.
Diffstat (limited to 'src/rhd_i2c.c')
-rw-r--r-- | src/rhd_i2c.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rhd_i2c.c b/src/rhd_i2c.c index 85903ed..a56e8d7 100644 --- a/src/rhd_i2c.c +++ b/src/rhd_i2c.c @@ -36,7 +36,9 @@ #include "rhd_i2c.h" #include "rhd_regs.h" +#ifdef ATOM_BIOS #include "rhd_atombios.h" +#endif typedef struct _rhdI2CRec { @@ -500,9 +502,11 @@ rhdTearDownI2C(I2CBusPtr *I2C) } #define TARGET_HW_I2C_CLOCK 25 /* kHz */ +#define DEFAULT_ENGINE_CLOCK 50 static CARD32 rhdGetI2CPrescale(RHDPtr rhdPtr) { +#ifdef ATOM_BIOS AtomBIOSArg atomBiosArg; RHDFUNC(rhdPtr); @@ -516,6 +520,16 @@ rhdGetI2CPrescale(RHDPtr rhdPtr) GET_REF_CLOCK, &atomBiosArg); return (atomBiosArg.val * 10) / TARGET_HW_I2C_CLOCK; } +#else + RHDFUNC(rhdPtr); + + if (rhdPtr->ChipSet < RHD_R600) { + return (0x7f << 8) + + (DEFAULT_ENGINE_CLOCK) / (4 * 0x7f * TARGET_HW_I2C_CLOCK); + } else { + return (DEFAULT_ENGINE_CLOCK / TARGET_HW_I2C_CLOCK); + } +#endif } static I2CBusPtr * |