> Date: Fri, 29 Mar 2013 13:24:58 +1100
> From: Jonathan Gray <j...@jsg.id.au>
> 
> On Fri, Mar 29, 2013 at 12:33:32PM +1100, Jonathan Gray wrote:
> > On Thu, Mar 28, 2013 at 09:38:20AM +0100, Ralf Horstmann wrote:
> > > Hi,
> > > 
> > > with current snapshot (i386) the DVI output of the docking station of
> > > my Fujitsu Lifebook T4215 is not detected anymore. Under Linux (Debian
> > > kernel 3.2) it's detected as DVI1. With older OpenBSD versions it was
> > > detected as TMDS-1.
> > > 
> > > VGA on the docking station works fine as well as directly attached to the
> > > laptop. In contrast to VGA, there is no DVI output at the laptop, only at 
> > > the
> > > docking station.
> > > 
> > > Cheers,
> > > Ralf
> > 
> > It sounds like your docking station has a SDVO output, which
> > apparently requires bitbanging for gmbus which we don't
> > yet do.
> 
> Looking over the sdvo code it seems part of the i2c code
> is wrong, try this:

That diff isn't quite right either.  The following should be
equivalent to what Linux is doing.  Can't test this myself
unfortunately.


Index: intel_sdvo.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/drm/i915/intel_sdvo.c,v
retrieving revision 1.2
diff -u -p -r1.2 intel_sdvo.c
--- intel_sdvo.c        19 Mar 2013 03:58:10 -0000      1.2
+++ intel_sdvo.c        29 Mar 2013 15:52:38 -0000
@@ -392,10 +392,11 @@ intel_sdvo_write_sdvox(struct intel_sdvo
 bool
 intel_sdvo_read_byte(struct intel_sdvo *intel_sdvo, u8 addr, u8 *ch)
 {
-       uint8_t cmd = 0;
+       uint8_t cmd = addr;
 
        iic_acquire_bus(intel_sdvo->i2c, 0);
-       iic_exec(intel_sdvo->i2c, I2C_OP_READ_WITH_STOP, addr, &cmd, 1, ch, 1, 
0);
+       iic_exec(intel_sdvo->i2c, I2C_OP_READ_WITH_STOP,
+                intel_sdvo->slave_addr, &cmd, 1, ch, 1, 0);
        iic_release_bus(intel_sdvo->i2c, 0);
 
        return true;
@@ -571,7 +572,6 @@ intel_sdvo_write_cmd(struct intel_sdvo *
        u8 *buf, status;
        struct i2c_msg *msgs;
        int i, ret = true, x;
-       uint8_t c = 0;
 
         /* Would be simpler to allocate both in one go ? */        
        buf = (u8 *)malloc(args_len * 2 + 2, M_DRM,
@@ -589,14 +589,14 @@ intel_sdvo_write_cmd(struct intel_sdvo *
        intel_sdvo_debug_write(intel_sdvo, cmd, args, args_len);
 
        for (i = 0; i < args_len; i++) {
-               msgs[i].op = I2C_OP_WRITE_WITH_STOP;
+               msgs[i].op = I2C_OP_WRITE;
                msgs[i].addr = intel_sdvo->slave_addr;
                msgs[i].len = 2;
                msgs[i].buf = buf + 2 *i;
                buf[2*i + 0] = SDVO_I2C_ARG_0 - i;
                buf[2*i + 1] = ((u8*)args)[i];
        }
-       msgs[i].op = I2C_OP_WRITE_WITH_STOP;
+       msgs[i].op = I2C_OP_WRITE;
        msgs[i].addr = intel_sdvo->slave_addr;
        msgs[i].len = 2;
        msgs[i].buf = buf + 2*i;
@@ -605,7 +605,7 @@ intel_sdvo_write_cmd(struct intel_sdvo *
 
        /* the following two are to read the response */
        status = SDVO_I2C_CMD_STATUS;
-       msgs[i+1].op = I2C_OP_WRITE_WITH_STOP;
+       msgs[i+1].op = I2C_OP_WRITE;
        msgs[i+1].addr = intel_sdvo->slave_addr;
        msgs[i+1].len = 1;
        msgs[i+1].buf = &status;
@@ -618,7 +618,7 @@ intel_sdvo_write_cmd(struct intel_sdvo *
        iic_acquire_bus(intel_sdvo->i2c, 0);
        for (x = 0; x < i+3; x++) {
                ret = iic_exec(intel_sdvo->i2c, msgs[x].op, msgs[x].addr,
-                   &c, 1, msgs[x].buf, msgs[x].len, 0);
+                   NULL, 0, msgs[x].buf, msgs[x].len, 0);
                if (ret) {
                        DRM_DEBUG_KMS("sdvo i2c transfer failed\n");
                        ret = false;

Reply via email to