summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2006-07-10 18:21:04 -0700
committerEric Anholt <anholt@FreeBSD.org>2006-07-10 18:21:04 -0700
commitd75490701cdbf2ab6eab82eaa078790a5fe0aea0 (patch)
treed09195156058080b1e4fa185b9037f5e0581cfd3
parent426d26ea446d646fa8f561ea0e03c8e4a2c0c315 (diff)
Hook up SiI164 mode setting (just a matter of turning the chip on).
Also adds register dumping in case this turns out to not be enough, and fixes a couple of prototypes.
-rw-r--r--src/i830_display.c11
-rw-r--r--src/sil164/sil164.c32
2 files changed, 39 insertions, 4 deletions
diff --git a/src/i830_display.c b/src/i830_display.c
index 7b96b3a7..e8c8509b 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 4 -*- */
/*
* Copyright © 2006 Intel Corporation
*
@@ -843,8 +844,14 @@ i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
}
for (i = 0; i < pI830->num_outputs; i++) {
- if (pI830->output[i].sdvo_drv)
- I830SDVOPreSetMode(pI830->output[i].sdvo_drv, pMode);
+ struct _I830OutputRec *output = &pI830->output[i];
+
+ if (output->sdvo_drv)
+ I830SDVOPreSetMode(output->sdvo_drv, pMode);
+
+ if (output->i2c_drv != NULL)
+ output->i2c_drv->vid_rec->Mode(output->i2c_drv->dev_priv,
+ pMode);
}
if (pI830->planeEnabled[0]) {
diff --git a/src/sil164/sil164.c b/src/sil164/sil164.c
index 77a7a00e..93640ae8 100644
--- a/src/sil164/sil164.c
+++ b/src/sil164/sil164.c
@@ -37,8 +37,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "sil164.h"
#include "sil164_reg.h"
+static void
+sil164PrintRegs(I2CDevPtr d);
+static void
+sil164Power(I2CDevPtr d, Bool On);
+
static Bool
-sil164ReadByte(SIL164Ptr sil, int addr, unsigned char *ch)
+sil164ReadByte(SIL164Ptr sil, int addr, CARD8 *ch)
{
if (!xf86I2CReadByte(&(sil->d), addr, ch)) {
xf86DrvMsg(sil->d.pI2CBus->scrnIndex, X_ERROR,
@@ -50,7 +55,7 @@ sil164ReadByte(SIL164Ptr sil, int addr, unsigned char *ch)
}
static Bool
-sil164WriteByte(SIL164Ptr sil, int addr, unsigned char ch)
+sil164WriteByte(SIL164Ptr sil, int addr, CARD8 ch)
{
if (!xf86I2CWriteByte(&(sil->d), addr, ch)) {
xf86DrvMsg(sil->d.pI2CBus->scrnIndex, X_ERROR,
@@ -138,6 +143,15 @@ sil164Mode(I2CDevPtr d, DisplayModePtr mode)
{
SIL164Ptr sil = SILPTR(d);
+ sil164Power(d, TRUE);
+ sil164PrintRegs(d);
+
+ /* recommended programming sequence from doc */
+ /*sil164WriteByte(sil, 0x08, 0x30);
+ sil164WriteByte(sil, 0x09, 0x00);
+ sil164WriteByte(sil, 0x0a, 0x90);
+ sil164WriteByte(sil, 0x0c, 0x89);
+ sil164WriteByte(sil, 0x08, 0x31);*/
/* don't do much */
return;
}
@@ -168,6 +182,20 @@ static void
sil164PrintRegs(I2CDevPtr d)
{
SIL164Ptr sil = SILPTR(d);
+ CARD8 val;
+
+ sil164ReadByte(sil, SIL164_FREQ_LO, &val);
+ xf86DrvMsg(sil->d.pI2CBus->scrnIndex, X_INFO, "SIL164_FREQ_LO: 0x%02x\n",
+ val);
+ sil164ReadByte(sil, SIL164_FREQ_HI, &val);
+ xf86DrvMsg(sil->d.pI2CBus->scrnIndex, X_INFO, "SIL164_FREQ_HI: 0x%02x\n",
+ val);
+ sil164ReadByte(sil, SIL164_REG8, &val);
+ xf86DrvMsg(sil->d.pI2CBus->scrnIndex, X_INFO, "SIL164_REG8: 0x%02x\n", val);
+ sil164ReadByte(sil, SIL164_REG9, &val);
+ xf86DrvMsg(sil->d.pI2CBus->scrnIndex, X_INFO, "SIL164_REG9: 0x%02x\n", val);
+ sil164ReadByte(sil, SIL164_REGC, &val);
+ xf86DrvMsg(sil->d.pI2CBus->scrnIndex, X_INFO, "SIL164_REGC: 0x%02x\n", val);
}
static void