[xf86-video-cirrus] Tab to spaces conversion for lg_i2c.c

Submitted by Kevin Brace on May 3, 2019, 1:10 a.m.

Details

Message ID 20190503011013.6213-1-kevinbrace@gmx.com
State New
Headers show
Series "Tab to spaces conversion for lg_i2c.c" ( rev: 1 ) in X.org

Not browsing as part of any series.

Commit Message

Kevin Brace May 3, 2019, 1:10 a.m.
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
---
 src/lg_i2c.c | 108 ++++++++++++++++++++++++++-------------------------
 1 file changed, 56 insertions(+), 52 deletions(-)

--
2.17.1

Patch hide | download patch | download mbox

diff --git a/src/lg_i2c.c b/src/lg_i2c.c
index 3e8c962..b6fcc28 100644
--- a/src/lg_i2c.c
+++ b/src/lg_i2c.c
@@ -17,80 +17,84 @@ 
 #include "lg.h"

 static void
-LgI2CPutBits(I2CBusPtr b, int clock,  int data)
+LgI2CPutBits(I2CBusPtr b, int clock, int data)
 {
-	unsigned int regval, regno;
-	CirPtr pCir = ((CirPtr)b->DriverPrivate.ptr);
-	if (b == pCir->I2CPtr1)
-		regno = 0x280;
-	else if (b == pCir->I2CPtr2)
-		regno = 0x282;
-	else
-		return;
-
-	regval = 0xff7e;
-	if (clock) regval |= 0x0080;
-	if (data)  regval |= 0x0001;
-	memww(regno, regval);
-	/* ErrorF("LgI2CPutBits: %d %d\n", clock, data); */
+    unsigned int regval, regno;
+    CirPtr pCir = ((CirPtr) b->DriverPrivate.ptr);
+    if (b == pCir->I2CPtr1)
+        regno = 0x280;
+    else if (b == pCir->I2CPtr2)
+        regno = 0x282;
+    else
+        return;
+
+    regval = 0xff7e;
+    if (clock)
+        regval |= 0x0080;
+    if (data)
+        regval |= 0x0001;
+    memww(regno, regval);
+    /* ErrorF("LgI2CPutBits: %d %d\n", clock, data); */
 }

 static void
 LgI2CGetBits(I2CBusPtr b, int *clock, int *data)
 {
-	unsigned int regval, regno;
-	CirPtr pCir = ((CirPtr)b->DriverPrivate.ptr);
-	if (b == pCir->I2CPtr1)
-		regno = 0x280;
-	else if (b == pCir->I2CPtr2)
-		regno = 0x282;
-	else
-		return;
-
-	regval = memrw(regno);
-	*clock = (regval & 0x8000) != 0;
-	*data  = (regval & 0x0100) != 0;
-	/* ErrorF("LgI2CGetBits: %d %d\n", *clock, *data); */
+    unsigned int regval, regno;
+    CirPtr pCir = ((CirPtr) b->DriverPrivate.ptr);
+    if (b == pCir->I2CPtr1)
+        regno = 0x280;
+    else if (b == pCir->I2CPtr2)
+        regno = 0x282;
+    else
+        return;
+
+    regval = memrw(regno);
+    *clock = (regval & 0x8000) != 0;
+    *data = (regval & 0x0100) != 0;
+    /* ErrorF("LgI2CGetBits: %d %d\n", *clock, *data); */
 }

 Bool
 LgI2CInit(ScrnInfoPtr pScrn)
 {
-	CirPtr pCir = CIRPTR(pScrn);
-	I2CBusPtr I2CPtr;
+    CirPtr pCir = CIRPTR(pScrn);
+    I2CBusPtr I2CPtr;

 #ifdef LG_DEBUG
-	ErrorF("LgI2CInit\n");
+    ErrorF("LgI2CInit\n");
 #endif

-	I2CPtr = xf86CreateI2CBusRec();
-	if (!I2CPtr) return FALSE;
+    I2CPtr = xf86CreateI2CBusRec();
+    if (!I2CPtr)
+        return FALSE;

-	pCir->I2CPtr1 = I2CPtr;
+    pCir->I2CPtr1 = I2CPtr;

-	I2CPtr->BusName				= "I2C bus 1";
-	I2CPtr->scrnIndex			= pScrn->scrnIndex;
-	I2CPtr->I2CPutBits			= LgI2CPutBits;
-	I2CPtr->I2CGetBits			= LgI2CGetBits;
-	I2CPtr->DriverPrivate.ptr	= pCir;
+    I2CPtr->BusName             = "I2C bus 1";
+    I2CPtr->scrnIndex           = pScrn->scrnIndex;
+    I2CPtr->I2CPutBits          = LgI2CPutBits;
+    I2CPtr->I2CGetBits          = LgI2CGetBits;
+    I2CPtr->DriverPrivate.ptr   = pCir;

-	if (!xf86I2CBusInit(I2CPtr))
-		return FALSE;
+    if (!xf86I2CBusInit(I2CPtr))
+        return FALSE;

-	I2CPtr = xf86CreateI2CBusRec();
-	if (!I2CPtr) return FALSE;
+    I2CPtr = xf86CreateI2CBusRec();
+    if (!I2CPtr)
+        return FALSE;

-	pCir->I2CPtr2 = I2CPtr;
+    pCir->I2CPtr2 = I2CPtr;

-	I2CPtr->BusName				= "I2C bus 2";
-	I2CPtr->scrnIndex			= pScrn->scrnIndex;
-	I2CPtr->I2CPutBits			= LgI2CPutBits;
-	I2CPtr->I2CGetBits			= LgI2CGetBits;
-	I2CPtr->DriverPrivate.ptr	= pCir;
+    I2CPtr->BusName             = "I2C bus 2";
+    I2CPtr->scrnIndex           = pScrn->scrnIndex;
+    I2CPtr->I2CPutBits          = LgI2CPutBits;
+    I2CPtr->I2CGetBits          = LgI2CGetBits;
+    I2CPtr->DriverPrivate.ptr   = pCir;

-	if (!xf86I2CBusInit(I2CPtr))
-		return FALSE;
+    if (!xf86I2CBusInit(I2CPtr))
+        return FALSE;

-	return TRUE;
+    return TRUE;
 }