xf86-video-intel: Branch 'modesetting' - 3 commits - src/ch7xxx/ch7xxx.c src/ch7xxx/ch7xxx_module.c src/ch7xxx/ch7xxx_reg.h src/i830_debug.c src/i830_randr.c src/i830_sdvo.c
Eric Anholt
anholt at kemper.freedesktop.org
Mon Nov 27 21:25:26 EET 2006
src/ch7xxx/ch7xxx.c | 351 ++++++++++++++++++++++-----------------------
src/ch7xxx/ch7xxx_module.c | 13 -
src/ch7xxx/ch7xxx_reg.h | 11 -
src/i830_debug.c | 16 +-
src/i830_randr.c | 2
src/i830_sdvo.c | 43 +++--
6 files changed, 226 insertions(+), 210 deletions(-)
New commits:
diff-tree 72692ba2e0254460c4f5a8cd476f5748383390ae (from 5f38bc3e2a685da5c03efa8103a353f79c842aa7)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Nov 27 11:23:55 2006 -0800
Postpone SDVO DDC bus creation until we've detected the SDVO device.
This reduces log noise for those of us with no SDVO devices.
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 71bccc7..ebf5868 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -1026,6 +1026,22 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int ou
return;
}
+ output->pI2CBus = i2cbus;
+ output->dev_priv = dev_priv;
+
+ /* Read the regs to test if we can talk to the device */
+ for (i = 0; i < 0x40; i++) {
+ if (!i830_sdvo_read_byte_quiet(output, i, &ch[i])) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "No SDVO device found on SDVO%c\n",
+ output_device == SDVOB ? 'B' : 'C');
+ xf86DestroyI2CDevRec(&dev_priv->d, FALSE);
+ xf86DestroyI2CBusRec(i2cbus, TRUE, TRUE);
+ xfree(dev_priv);
+ return;
+ }
+ }
+
/* Set up our wrapper I2C bus for DDC. It acts just like the regular I2C
* bus, except that it does the control bus switch to DDC mode before every
* Start. While we only need to do it at Start after every Stop after a
@@ -1055,24 +1071,7 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int ou
xfree(dev_priv);
return;
}
-
- output->pI2CBus = i2cbus;
output->pDDCBus = ddcbus;
- output->dev_priv = dev_priv;
-
- /* Read the regs to test if we can talk to the device */
- for (i = 0; i < 0x40; i++) {
- if (!i830_sdvo_read_byte_quiet(output, i, &ch[i])) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "No SDVO device found on SDVO%c\n",
- output_device == SDVOB ? 'B' : 'C');
- xf86DestroyI2CBusRec(output->pDDCBus, FALSE, FALSE);
- xf86DestroyI2CDevRec(&dev_priv->d, FALSE);
- xf86DestroyI2CBusRec(i2cbus, TRUE, TRUE);
- xfree(dev_priv);
- return;
- }
- }
i830_sdvo_get_capabilities(output, &dev_priv->caps);
diff-tree 5f38bc3e2a685da5c03efa8103a353f79c842aa7 (from 85f404bc67d5ab54175c19e75aad406abfcf2133)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Nov 27 11:06:50 2006 -0800
Reduce the severity of many informational log messages.
diff --git a/src/i830_debug.c b/src/i830_debug.c
index 185988e..d74d092 100644
--- a/src/i830_debug.c
+++ b/src/i830_debug.c
@@ -200,7 +200,7 @@ static void i830DumpIndexed (ScrnInfoPtr
for (i = min; i <= max; i++) {
OUTREG8 (id, i);
- xf86DrvMsg (pScrn->scrnIndex, X_WARNING, "%18.18s%02x: 0x%02x\n",
+ xf86DrvMsg (pScrn->scrnIndex, X_INFO, "%18.18s%02x: 0x%02x\n",
name, i, INREG8(val));
}
}
@@ -218,14 +218,14 @@ void i830DumpRegs (ScrnInfoPtr pScrn)
int msr;
int crt;
- xf86DrvMsg (pScrn->scrnIndex, X_WARNING, "DumpRegsBegin\n");
+ xf86DrvMsg (pScrn->scrnIndex, X_INFO, "DumpRegsBegin\n");
for (i = 0; i < NUM_I830_SNAPSHOTREGS; i++) {
- xf86DrvMsg (pScrn->scrnIndex, X_WARNING, "%20.20s: 0x%08x\n",
+ xf86DrvMsg (pScrn->scrnIndex, X_INFO, "%20.20s: 0x%08x\n",
i830_snapshot[i].name, (unsigned int) INREG(i830_snapshot[i].reg));
}
i830DumpIndexed (pScrn, "SR", 0x3c4, 0x3c5, 0, 7);
msr = INREG8(0x3cc);
- xf86DrvMsg (pScrn->scrnIndex, X_WARNING, "%20.20s: 0x%02x\n",
+ xf86DrvMsg (pScrn->scrnIndex, X_INFO, "%20.20s: 0x%02x\n",
"MSR", (unsigned int) msr);
if (msr & 1)
@@ -285,7 +285,9 @@ void i830DumpRegs (ScrnInfoPtr pScrn)
case 6:
break;
default:
- xf86DrvMsg (pScrn->scrnIndex, X_ERROR, "phase %d out of range\n", phase);
+ xf86DrvMsg (pScrn->scrnIndex, X_INFO,
+ "SDVO phase shift %d out of range -- probobly not "
+ "an issue.\n", phase);
break;
}
switch ((dpll >> 8) & 1) {
@@ -300,8 +302,8 @@ void i830DumpRegs (ScrnInfoPtr pScrn)
m2 = ((fp >> 0) & 0x3f);
m = 5 * (m1 + 2) + (m2 + 2);
dot = (ref * (5 * (m1 + 2) + (m2 + 2)) / (n + 2)) / (p1 * p2);
- xf86DrvMsg (pScrn->scrnIndex, X_WARNING, "pipe %s dot %d n %d m1 %d m2 %d p1 %d p2 %d\n",
+ xf86DrvMsg (pScrn->scrnIndex, X_INFO, "pipe %s dot %d n %d m1 %d m2 %d p1 %d p2 %d\n",
pipe == 0 ? "A" : "B", dot, n, m1, m2, p1, p2);
}
- xf86DrvMsg (pScrn->scrnIndex, X_WARNING, "DumpRegsEnd\n");
+ xf86DrvMsg (pScrn->scrnIndex, X_INFO, "DumpRegsEnd\n");
}
diff --git a/src/i830_randr.c b/src/i830_randr.c
index a530ffb..389805a 100644
--- a/src/i830_randr.c
+++ b/src/i830_randr.c
@@ -889,7 +889,7 @@ I830RandRCreateScreenResources12 (Screen
mmWidth = mmWidth * width / pScreen->width;
if (height != pScreen->height)
mmHeight = mmHeight * height / pScreen->height;
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Setting screen physical size to %d x %d\n",
mmWidth, mmHeight);
I830RandRScreenSetSize (pScreen,
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index fedb8a6..71bccc7 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -87,13 +87,22 @@ static Bool i830_sdvo_read_byte(I830Outp
if (!xf86I2CReadByte(&dev_priv->d, addr, ch)) {
xf86DrvMsg(output->pI2CBus->scrnIndex, X_ERROR,
- "Unable to read from %s slave %d.\n",
+ "Unable to read from %s slave 0x%02x.\n",
output->pI2CBus->BusName, dev_priv->d.SlaveAddr);
return FALSE;
}
return TRUE;
}
+/** Read a single byte from the given address on the SDVO device. */
+static Bool i830_sdvo_read_byte_quiet(I830OutputPtr output, int addr,
+ unsigned char *ch)
+{
+ struct i830_sdvo_priv *dev_priv = output->dev_priv;
+
+ return xf86I2CReadByte(&dev_priv->d, addr, ch);
+}
+
/** Write a single byte to the given address on the SDVO device. */
static Bool i830_sdvo_write_byte(I830OutputPtr output,
int addr, unsigned char ch)
@@ -102,7 +111,7 @@ static Bool i830_sdvo_write_byte(I830Out
if (!xf86I2CWriteByte(&dev_priv->d, addr, ch)) {
xf86DrvMsg(output->pI2CBus->scrnIndex, X_ERROR,
- "Unable to write to %s Slave %d.\n",
+ "Unable to write to %s Slave %02x.\n",
output->pI2CBus->BusName, dev_priv->d.SlaveAddr);
return FALSE;
}
@@ -1053,7 +1062,10 @@ i830_sdvo_init(ScrnInfoPtr pScrn, int ou
/* Read the regs to test if we can talk to the device */
for (i = 0; i < 0x40; i++) {
- if (!i830_sdvo_read_byte(output, i, &ch[i])) {
+ if (!i830_sdvo_read_byte_quiet(output, i, &ch[i])) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "No SDVO device found on SDVO%c\n",
+ output_device == SDVOB ? 'B' : 'C');
xf86DestroyI2CBusRec(output->pDDCBus, FALSE, FALSE);
xf86DestroyI2CDevRec(&dev_priv->d, FALSE);
xf86DestroyI2CBusRec(i2cbus, TRUE, TRUE);
diff-tree 85f404bc67d5ab54175c19e75aad406abfcf2133 (from 9aca4e207440119f4280b78199a221f85d50c511)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Nov 20 09:32:26 2006 -0800
Re-indent ch7xxx driver.
diff --git a/src/ch7xxx/ch7xxx.c b/src/ch7xxx/ch7xxx.c
index d11c355..df66d03 100644
--- a/src/ch7xxx/ch7xxx.c
+++ b/src/ch7xxx/ch7xxx.c
@@ -33,11 +33,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN
#include "miscstruct.h"
#include "xf86i2c.h"
-
#include "../i2c_vid.h"
#include "ch7xxx.h"
#include "ch7xxx_reg.h"
+/** @file
+ * driver for the Chrontel 7xxx DVI chip over DVO.
+ */
+
static void ch7xxxSaveRegs(I2CDevPtr d);
static CARD8 ch7xxxFreqRegs[][7] =
@@ -48,225 +51,229 @@ static CARD8 ch7xxxFreqRegs[][7] =
static Bool ch7xxxReadByte(CH7xxxPtr ch7xxx, int addr, unsigned char *ch)
{
- if (!xf86I2CReadByte(&(ch7xxx->d), addr, ch)) {
- xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR, "Unable to read from %s Slave %d.\n", ch7xxx->d.pI2CBus->BusName, ch7xxx->d.SlaveAddr);
- return FALSE;
- }
- return TRUE;
+ if (!xf86I2CReadByte(&(ch7xxx->d), addr, ch)) {
+ xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex,
+ X_ERROR, "Unable to read from %s Slave %d.\n",
+ ch7xxx->d.pI2CBus->BusName, ch7xxx->d.SlaveAddr);
+ return FALSE;
+ }
+
+ return TRUE;
}
static Bool ch7xxxWriteByte(CH7xxxPtr ch7xxx, int addr, unsigned char ch)
{
- if (!xf86I2CWriteByte(&(ch7xxx->d), addr, ch)) {
- xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR, "Unable to write to %s Slave %d.\n", ch7xxx->d.pI2CBus->BusName, ch7xxx->d.SlaveAddr);
- return FALSE;
- }
- return TRUE;
+ if (!xf86I2CWriteByte(&(ch7xxx->d), addr, ch)) {
+ xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR,
+ "Unable to write to %s Slave %d.\n",
+ ch7xxx->d.pI2CBus->BusName, ch7xxx->d.SlaveAddr);
+ return FALSE;
+ }
+
+ return TRUE;
}
-/* Ch7xxxicon Image 164 driver for chip on i2c bus */
static void *ch7xxxDetect(I2CBusPtr b, I2CSlaveAddr addr)
{
- /* this will detect the CH7xxx chip on the specified i2c bus */
- CH7xxxPtr ch7xxx;
- unsigned char ch;
-
- xf86DrvMsg(b->scrnIndex, X_ERROR, "detecting ch7xxx\n");
-
- ch7xxx = xcalloc(1, sizeof(CH7xxxRec));
- if (ch7xxx == NULL)
- return NULL;
+ /* this will detect the CH7xxx chip on the specified i2c bus */
+ CH7xxxPtr ch7xxx;
+ unsigned char ch;
+
+ xf86DrvMsg(b->scrnIndex, X_ERROR, "detecting ch7xxx\n");
+
+ ch7xxx = xcalloc(1, sizeof(CH7xxxRec));
+ if (ch7xxx == NULL)
+ return NULL;
+
+ ch7xxx->d.DevName = "CH7xxx TMDS Controller";
+ ch7xxx->d.SlaveAddr = addr;
+ ch7xxx->d.pI2CBus = b;
+ ch7xxx->d.StartTimeout = b->StartTimeout;
+ ch7xxx->d.BitTimeout = b->BitTimeout;
+ ch7xxx->d.AcknTimeout = b->AcknTimeout;
+ ch7xxx->d.ByteTimeout = b->ByteTimeout;
+ ch7xxx->d.DriverPrivate.ptr = ch7xxx;
+
+ if (!ch7xxxReadByte(ch7xxx, CH7xxx_REG_VID, &ch))
+ goto out;
+
+ ErrorF("VID is %02X", ch);
+ if (ch!=(CH7xxx_VID & 0xFF)) {
+ xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR,
+ "ch7xxx not detected got %d: from %s Slave %d.\n",
+ ch, ch7xxx->d.pI2CBus->BusName, ch7xxx->d.SlaveAddr);
+ goto out;
+ }
+
+
+ if (!ch7xxxReadByte(ch7xxx, CH7xxx_REG_DID, &ch))
+ goto out;
+
+ ErrorF("DID is %02X", ch);
+ if (ch!=(CH7xxx_DID & 0xFF)) {
+ xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR,
+ "ch7xxx not detected got %d: from %s Slave %d.\n",
+ ch, ch7xxx->d.pI2CBus->BusName, ch7xxx->d.SlaveAddr);
+ goto out;
+ }
+
+
+ if (!xf86I2CDevInit(&(ch7xxx->d))) {
+ goto out;
+ }
+
+ return ch7xxx;
- ch7xxx->d.DevName = "CH7xxx TMDS Controller";
- ch7xxx->d.SlaveAddr = addr;
- ch7xxx->d.pI2CBus = b;
- ch7xxx->d.StartTimeout = b->StartTimeout;
- ch7xxx->d.BitTimeout = b->BitTimeout;
- ch7xxx->d.AcknTimeout = b->AcknTimeout;
- ch7xxx->d.ByteTimeout = b->ByteTimeout;
- ch7xxx->d.DriverPrivate.ptr = ch7xxx;
-
- if (!ch7xxxReadByte(ch7xxx, CH7xxx_REG_VID, &ch))
- goto out;
-
- ErrorF("VID is %02X", ch);
- if (ch!=(CH7xxx_VID & 0xFF))
- {
- xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR, "ch7xxx not detected got %d: from %s Slave %d.\n", ch, ch7xxx->d.pI2CBus->BusName, ch7xxx->d.SlaveAddr);
- goto out;
- }
-
-
- if (!ch7xxxReadByte(ch7xxx, CH7xxx_REG_DID, &ch))
- goto out;
-
- ErrorF("DID is %02X", ch);
- if (ch!=(CH7xxx_DID & 0xFF))
- {
- xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR, "ch7xxx not detected got %d: from %s Slave %d.\n", ch, ch7xxx->d.pI2CBus->BusName, ch7xxx->d.SlaveAddr);
- goto out;
- }
-
-
- if (!xf86I2CDevInit(&(ch7xxx->d)))
- {
- goto out;
- }
-
- return ch7xxx;
-
- out:
- xfree(ch7xxx);
- return NULL;
+out:
+ xfree(ch7xxx);
+ return NULL;
}
static Bool ch7xxxInit(I2CDevPtr d)
{
- CH7xxxPtr ch7xxx = CH7PTR(d);
+ CH7xxxPtr ch7xxx = CH7PTR(d);
- /* not much to do */
- return TRUE;
+ /* not much to do */
+ return TRUE;
}
static ModeStatus ch7xxxModeValid(I2CDevPtr d, DisplayModePtr mode)
{
- CH7xxxPtr ch7xxx = CH7PTR(d);
-
- return MODE_OK;
+ CH7xxxPtr ch7xxx = CH7PTR(d);
+
+ return MODE_OK;
}
static void ch7xxxMode(I2CDevPtr d, DisplayModePtr mode)
{
- CH7xxxPtr ch7xxx = CH7PTR(d);
- int ret;
- unsigned char pm, idf;
- unsigned char tpcp, tpd, tpf, cm;
- CARD8 *freq_regs;
- int i;
- ErrorF("Clock is %d\n", mode->Clock);
-
- if (mode->Clock < 75000)
- freq_regs = ch7xxxFreqRegs[0];
- else if (mode->Clock < 125000)
- freq_regs = ch7xxxFreqRegs[1];
- else
- freq_regs = ch7xxxFreqRegs[2];
-
- for (i = 0x31; i < 0x37; i++) {
- ch7xxx->ModeReg.regs[i] = freq_regs[i - 0x31];
- ch7xxxWriteByte(ch7xxx, i, ch7xxx->ModeReg.regs[i]);
- }
-
-#if 0
-
- xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR, "ch7xxx idf is 0x%02x, 0x%02x, 0x%02x, 0x%02x\n", idf, tpcp, tpd, tpf);
-
- xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR, "ch7xxx pm is %02X\n", pm);
-
- if (mode->Clock < 65000) {
- tpcp = 0x08;
- tpd = 0x16;
- tpf = 0x60;
- } else {
- tpcp = 0x06;
- tpd = 0x26;
- tpf = 0xa0;
- }
-
- idf &= ~(CH7xxx_IDF_HSP | CH7xxx_IDF_VSP);
- if (mode->Flags & V_PHSYNC)
- idf |= CH7xxx_IDF_HSP;
-
- if (mode->Flags & V_PVSYNC)
- idf |= CH7xxx_IDF_HSP;
-
- /* setup PM Registers */
- pm &= ~CH7xxx_PM_FPD;
- pm |= CH7xxx_PM_DVIL | CH7xxx_PM_DVIP;
-
- // cm |= 1;
-
- ch7xxxWriteByte(ch7xxx, CH7xxx_CM, cm);
- ch7xxxWriteByte(ch7xxx, CH7xxx_TPCP, tpcp);
- ch7xxxWriteByte(ch7xxx, CH7xxx_TPD, tpd);
- ch7xxxWriteByte(ch7xxx, CH7xxx_TPF, tpf);
- ch7xxxWriteByte(ch7xxx, CH7xxx_TPF, idf);
- ch7xxxWriteByte(ch7xxx, CH7xxx_PM, pm);
+ CH7xxxPtr ch7xxx = CH7PTR(d);
+ int ret;
+ unsigned char pm, idf;
+ unsigned char tpcp, tpd, tpf, cm;
+ CARD8 *freq_regs;
+ int i;
+
+ ErrorF("Clock is %d\n", mode->Clock);
+
+ if (mode->Clock < 75000)
+ freq_regs = ch7xxxFreqRegs[0];
+ else if (mode->Clock < 125000)
+ freq_regs = ch7xxxFreqRegs[1];
+ else
+ freq_regs = ch7xxxFreqRegs[2];
+
+ for (i = 0x31; i < 0x37; i++) {
+ ch7xxx->ModeReg.regs[i] = freq_regs[i - 0x31];
+ ch7xxxWriteByte(ch7xxx, i, ch7xxx->ModeReg.regs[i]);
+ }
+#if 0
+ xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR,
+ "ch7xxx idf is 0x%02x, 0x%02x, 0x%02x, 0x%02x\n",
+ idf, tpcp, tpd, tpf);
+
+ xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR,
+ "ch7xxx pm is %02X\n", pm);
+
+ if (mode->Clock < 65000) {
+ tpcp = 0x08;
+ tpd = 0x16;
+ tpf = 0x60;
+ } else {
+ tpcp = 0x06;
+ tpd = 0x26;
+ tpf = 0xa0;
+ }
+
+ idf &= ~(CH7xxx_IDF_HSP | CH7xxx_IDF_VSP);
+ if (mode->Flags & V_PHSYNC)
+ idf |= CH7xxx_IDF_HSP;
+
+ if (mode->Flags & V_PVSYNC)
+ idf |= CH7xxx_IDF_HSP;
+
+ /* setup PM Registers */
+ pm &= ~CH7xxx_PM_FPD;
+ pm |= CH7xxx_PM_DVIL | CH7xxx_PM_DVIP;
+
+ /* cm |= 1; */
+
+ ch7xxxWriteByte(ch7xxx, CH7xxx_CM, cm);
+ ch7xxxWriteByte(ch7xxx, CH7xxx_TPCP, tpcp);
+ ch7xxxWriteByte(ch7xxx, CH7xxx_TPD, tpd);
+ ch7xxxWriteByte(ch7xxx, CH7xxx_TPF, tpf);
+ ch7xxxWriteByte(ch7xxx, CH7xxx_TPF, idf);
+ ch7xxxWriteByte(ch7xxx, CH7xxx_PM, pm);
#endif
- /* don't do much */
- return;
}
/* set the CH7xxx power state */
static void ch7xxxPower(I2CDevPtr d, Bool On)
{
- CH7xxxPtr ch7xxx = CH7PTR(d);
- int ret;
- unsigned char ch;
+ CH7xxxPtr ch7xxx = CH7PTR(d);
+ int ret;
+ unsigned char ch;
+ ret = ch7xxxReadByte(ch7xxx, CH7xxx_PM, &ch);
+ if (ret == FALSE)
+ return;
- ret = ch7xxxReadByte(ch7xxx, CH7xxx_PM, &ch);
- if (ret == FALSE)
- return;
-
- xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR, "ch7xxx pm is %02X\n", ch);
-
-#if 0
- ret = ch7xxxReadByte(ch7xxx, CH7xxx_REG8, &ch);
- if (ret)
- return;
+ xf86DrvMsg(ch7xxx->d.pI2CBus->scrnIndex, X_ERROR,
+ "ch7xxx pm is %02X\n", ch);
- if (On)
- ch |= CH7xxx_8_PD;
- else
- ch &= ~CH7xxx_8_PD;
+#if 0
+ ret = ch7xxxReadByte(ch7xxx, CH7xxx_REG8, &ch);
+ if (ret)
+ return;
+
+ if (On)
+ ch |= CH7xxx_8_PD;
+ else
+ ch &= ~CH7xxx_8_PD;
- ch7xxxWriteByte(ch7xxx, CH7xxx_REG8, ch);
+ ch7xxxWriteByte(ch7xxx, CH7xxx_REG8, ch);
#endif
- return;
}
static void ch7xxxPrintRegs(I2CDevPtr d)
{
- CH7xxxPtr ch7xxx = CH7PTR(d);
- int i;
-
- ch7xxxSaveRegs(d);
+ CH7xxxPtr ch7xxx = CH7PTR(d);
+ int i;
- for (i = 0; i < CH7xxx_NUM_REGS; i++) {
- if (( i % 8 ) == 0 )
- ErrorF("\n %02X: ", i);
- ErrorF("%02X ", ch7xxx->ModeReg.regs[i]);
+ ch7xxxSaveRegs(d);
- }
+ for (i = 0; i < CH7xxx_NUM_REGS; i++) {
+ if (( i % 8 ) == 0 )
+ ErrorF("\n %02X: ", i);
+ ErrorF("%02X ", ch7xxx->ModeReg.regs[i]);
+ }
}
static void ch7xxxSaveRegs(I2CDevPtr d)
{
- CH7xxxPtr ch7xxx = CH7PTR(d);
- int ret;
- int i;
+ CH7xxxPtr ch7xxx = CH7PTR(d);
+ int ret;
+ int i;
+
+ for (i = 0; i < CH7xxx_NUM_REGS; i++) {
+ ret = ch7xxxReadByte(ch7xxx, i, &ch7xxx->SavedReg.regs[i]);
+ if (ret == FALSE)
+ break;
+ }
- for (i = 0; i < CH7xxx_NUM_REGS; i++) {
- ret = ch7xxxReadByte(ch7xxx, i, &ch7xxx->SavedReg.regs[i]);
- if (ret == FALSE)
- break;
- }
+ memcpy(ch7xxx->ModeReg.regs, ch7xxx->SavedReg.regs, CH7xxx_NUM_REGS);
- memcpy(ch7xxx->ModeReg.regs, ch7xxx->SavedReg.regs, CH7xxx_NUM_REGS);
-
- return;
+ return;
}
I830I2CVidOutputRec CH7xxxVidOutput = {
- ch7xxxDetect,
- ch7xxxInit,
- ch7xxxModeValid,
- ch7xxxMode,
- ch7xxxPower,
- ch7xxxPrintRegs,
- ch7xxxSaveRegs,
- NULL,
+ ch7xxxDetect,
+ ch7xxxInit,
+ ch7xxxModeValid,
+ ch7xxxMode,
+ ch7xxxPower,
+ ch7xxxPrintRegs,
+ ch7xxxSaveRegs,
+ NULL,
};
diff --git a/src/ch7xxx/ch7xxx_module.c b/src/ch7xxx/ch7xxx_module.c
index 19dc6cd..2613d9e 100644
--- a/src/ch7xxx/ch7xxx_module.c
+++ b/src/ch7xxx/ch7xxx_module.c
@@ -10,8 +10,7 @@
static MODULESETUPPROTO(ch7xxxSetup);
-static XF86ModuleVersionInfo ch7xxxVersRec =
- {
+static XF86ModuleVersionInfo ch7xxxVersRec = {
"ch7xxx",
MODULEVENDORSTRING,
MODINFOSTRING1,
@@ -22,15 +21,15 @@ static XF86ModuleVersionInfo ch7xxxVersR
ABI_VIDEODRV_VERSION,
MOD_CLASS_NONE,
{ 0,0,0,0 }
- };
+};
_X_EXPORT XF86ModuleData ch7xxxModuleData = {
- &ch7xxxVersRec,
- ch7xxxSetup,
- NULL
+ &ch7xxxVersRec,
+ ch7xxxSetup,
+ NULL
};
static pointer
ch7xxxSetup(pointer module, pointer opts, int *errmaj, int *errmin) {
- return (pointer)1;
+ return (pointer)1;
}
diff --git a/src/ch7xxx/ch7xxx_reg.h b/src/ch7xxx/ch7xxx_reg.h
index 59de13b..e24e9a6 100644
--- a/src/ch7xxx/ch7xxx_reg.h
+++ b/src/ch7xxx/ch7xxx_reg.h
@@ -29,7 +29,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define CH7xxx_REG_VID 0x4a
#define CH7xxx_REG_DID 0x4b
-
#define CH7011_VID 0x83
#define CH7009A_VID 0x84
#define CH7009B_VID 0x85
@@ -41,13 +40,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define CH7xxx_NUM_REGS 0x4c
typedef struct _CH7xxxSaveRec {
- CARD8 regs[CH7xxx_NUM_REGS];
+ CARD8 regs[CH7xxx_NUM_REGS];
} CH7xxxSaveRec;
typedef struct {
- I2CDevRec d;
- CH7xxxSaveRec SavedReg;
- CH7xxxSaveRec ModeReg;
+ I2CDevRec d;
+ CH7xxxSaveRec SavedReg;
+ CH7xxxSaveRec ModeReg;
} CH7xxxRec, *CH7xxxPtr;
#define CH7PTR(d) ((CH7xxxPtr)(d->DriverPrivate.ptr))
@@ -86,6 +85,4 @@ typedef struct {
#define CH7301_SYNC_RGB_YUV (1<<0)
#define CH7301_SYNC_POL_DVI (1<<5)
-
-
#endif
More information about the xorg-commit
mailing list