diff options
author | Alex Deucher <alex@botch2.com> | 2007-03-04 02:45:55 -0500 |
---|---|---|
committer | Alex Deucher <alex@botch2.com> | 2007-03-13 00:17:29 -0400 |
commit | 3030e5a6afda5d05ddee5b586295a9e608b7a0de (patch) | |
tree | 6bfa950179dd258492b1d64a8a24970af0054d0e /src/smi_i2c.c | |
parent | 606971fc8a323b0b33bb43524941b4bae6a0c334 (diff) |
Whitespace and formatting changes
Diffstat (limited to 'src/smi_i2c.c')
-rw-r--r-- | src/smi_i2c.c | 80 |
1 files changed, 39 insertions, 41 deletions
diff --git a/src/smi_i2c.c b/src/smi_i2c.c index f4aa19d..959b5b6 100644 --- a/src/smi_i2c.c +++ b/src/smi_i2c.c @@ -55,64 +55,62 @@ authorization from the XFree86 Project and Silicon Motion. static void SMI_I2CPutBits(I2CBusPtr b, int clock, int data) { - SMIPtr pSmi = SMIPTR(xf86Screens[b->scrnIndex]); - unsigned int reg = 0x30; + SMIPtr pSmi = SMIPTR(xf86Screens[b->scrnIndex]); + unsigned int reg = 0x30; - ENTER_PROC("SMI_I2CPutBits"); + ENTER_PROC("SMI_I2CPutBits"); - if (clock) reg |= 0x01; - if (data) reg |= 0x02; + if (clock) reg |= 0x01; + if (data) reg |= 0x02; - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72, reg); + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72, reg); - LEAVE_PROC("SMI_I2CPutBits"); + LEAVE_PROC("SMI_I2CPutBits"); } static void SMI_I2CGetBits(I2CBusPtr b, int *clock, int *data) { - SMIPtr pSmi = SMIPTR(xf86Screens[b->scrnIndex]); - unsigned int reg = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72); + SMIPtr pSmi = SMIPTR(xf86Screens[b->scrnIndex]); + unsigned int reg = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x72); - ENTER_PROC("SMI_I2CGetBits"); + ENTER_PROC("SMI_I2CGetBits"); - *clock = reg & 0x04; - *data = reg & 0x08; + *clock = reg & 0x04; + *data = reg & 0x08; - LEAVE_PROC("SMI_I2CGetBits"); + LEAVE_PROC("SMI_I2CGetBits"); } Bool SMI_I2CInit(ScrnInfoPtr pScrn) { - SMIPtr pSmi = SMIPTR(pScrn); - - ENTER_PROC("SMI_I2CInit"); - - if (pSmi->I2C == NULL) - { - I2CBusPtr I2CPtr = xf86CreateI2CBusRec(); - if (I2CPtr == NULL) - { - LEAVE_PROC("SMI_I2CInit"); - return(FALSE); - } - - I2CPtr->BusName = "I2C bus"; - I2CPtr->scrnIndex = pScrn->scrnIndex; - I2CPtr->I2CPutBits = SMI_I2CPutBits; - I2CPtr->I2CGetBits = SMI_I2CGetBits; - - if (!xf86I2CBusInit(I2CPtr)) - { - xf86DestroyI2CBusRec(I2CPtr, TRUE, TRUE); - LEAVE_PROC("SMI_I2CInit"); - return(FALSE); - } - - pSmi->I2C = I2CPtr; + SMIPtr pSmi = SMIPTR(pScrn); + + ENTER_PROC("SMI_I2CInit"); + + if (pSmi->I2C == NULL) { + I2CBusPtr I2CPtr = xf86CreateI2CBusRec(); + if (I2CPtr == NULL) { + LEAVE_PROC("SMI_I2CInit"); + return FALSE; } - LEAVE_PROC("SMI_I2CInit"); - return(TRUE); + I2CPtr->BusName = "I2C bus"; + I2CPtr->scrnIndex = pScrn->scrnIndex; + I2CPtr->I2CPutBits = SMI_I2CPutBits; + I2CPtr->I2CGetBits = SMI_I2CGetBits; + + if (!xf86I2CBusInit(I2CPtr)) { + xf86DestroyI2CBusRec(I2CPtr, TRUE, TRUE); + LEAVE_PROC("SMI_I2CInit"); + return FALSE; + } + + pSmi->I2C = I2CPtr; + } + + LEAVE_PROC("SMI_I2CInit"); + return TRUE; } + |