summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/savage_i2c.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/savage_i2c.c b/src/savage_i2c.c
index b5739a2..a37fc7f 100644
--- a/src/savage_i2c.c
+++ b/src/savage_i2c.c
@@ -37,7 +37,11 @@ in this Software without prior written authorization from the XFree86 Project.
static void
SavageI2CPutBits(I2CBusPtr b, int clock, int data)
{
+#ifdef XF86_SCRN_INTERFACE
+ ScrnInfoPtr pScrn = b->pScrn;
+#else
ScrnInfoPtr pScrn = (ScrnInfoPtr)(xf86Screens[b->scrnIndex]);
+#endif
SavagePtr psav = SAVPTR(pScrn);
unsigned char reg = 0x10;
@@ -51,7 +55,11 @@ SavageI2CPutBits(I2CBusPtr b, int clock, int data)
static void
SavageI2CGetBits(I2CBusPtr b, int *clock, int *data)
{
+#ifdef XF86_SCRN_INTERFACE
+ ScrnInfoPtr pScrn = b->pScrn;
+#else
ScrnInfoPtr pScrn = (ScrnInfoPtr)(xf86Screens[b->scrnIndex]);
+#endif
SavagePtr psav = SAVPTR(pScrn);
unsigned char reg = 0x10;
@@ -76,6 +84,9 @@ SavageI2CInit(ScrnInfoPtr pScrn)
I2CPtr->BusName = "I2C bus";
I2CPtr->scrnIndex = pScrn->scrnIndex;
+#ifdef XF86_SCRN_INTERFACE
+ I2CPtr->pScrn = pScrn;
+#endif
I2CPtr->I2CPutBits = SavageI2CPutBits;
I2CPtr->I2CGetBits = SavageI2CGetBits;