dptx: Only increment segment pointer if required.

It seems that monitors capable of MST, upon switching to SST mode in the monitor
options menu, respond with NACK when the segment pointer is written.
These same monitors ACK segment pointer writes when running in MST mode.
Tested monitors that are SST only monitors also ACK segment pointer writes.

The issue here is that MST monitors running in SST mode will error out when the
I2C read function is called because the segment pointer is always being written
to 0 (segment pointer is reset), and thus receives a NACK.
This patch prevents this from happening.

From now on, if the user changes the segment pointer, it is up to them to reset
it to 0.
The I2C read will only increment the segment pointer when required to do a read
outside of the base EDID block.

Signed-off-by: Andrei-Liviu Simion <andrei.simion@xilinx.com>
This commit is contained in:
Andrei-Liviu Simion 2015-01-28 19:15:28 -08:00 committed by Suneel Garapati
parent be5ee89f69
commit c5d8647eff

View file

@ -831,9 +831,8 @@ u32 XDptx_IicRead(XDptx *InstancePtr, u8 IicAddress, u16 Offset,
NumBytesLeftInSeg = 256 - Offset;
/* Set the segment pointer to 0. */
Status = XDptx_IicWrite(InstancePtr, XDPTX_SEGPTR_ADDR, 1, &SegPtr);
if (Status != XST_SUCCESS) {
return Status;
if (SegPtr != 0) {
XDptx_IicWrite(InstancePtr, XDPTX_SEGPTR_ADDR, 1, &SegPtr);
}
/* Send I2C read message. Multiple transactions are required if the
@ -875,11 +874,8 @@ u32 XDptx_IicRead(XDptx *InstancePtr, u8 IicAddress, u16 Offset,
Offset %= 256;
SegPtr++;
Status = XDptx_IicWrite(InstancePtr,
XDPTX_SEGPTR_ADDR, 1, &SegPtr);
if (Status != XST_SUCCESS) {
return Status;
}
XDptx_IicWrite(InstancePtr, XDPTX_SEGPTR_ADDR,
1, &SegPtr);
}
}
/* Last I2C read. */
@ -889,8 +885,10 @@ u32 XDptx_IicRead(XDptx *InstancePtr, u8 IicAddress, u16 Offset,
}
/* Reset the segment pointer to 0. */
SegPtr = 0;
Status = XDptx_IicWrite(InstancePtr, XDPTX_SEGPTR_ADDR, 1, &SegPtr);
if (SegPtr != 0) {
SegPtr = 0;
XDptx_IicWrite(InstancePtr, XDPTX_SEGPTR_ADDR, 1, &SegPtr);
}
return Status;
}