]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.111/drm-dp-mst-configure-no_stop_bit-correctly-for-remot.patch
Linux 4.14.111
[thirdparty/kernel/stable-queue.git] / releases / 4.14.111 / drm-dp-mst-configure-no_stop_bit-correctly-for-remot.patch
CommitLineData
04fd09d4
SL
1From ccce3187be850a2d563aadade41ac1c5d9b6f578 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
3Date: Fri, 28 Sep 2018 21:03:59 +0300
4Subject: drm/dp/mst: Configure no_stop_bit correctly for remote i2c xfers
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9[ Upstream commit c978ae9bde582e82a04c63a4071701691dd8b35c ]
10
11We aren't supposed to force a stop+start between every i2c msg
12when performing multi message transfers. This should eg. cause
13the DDC segment address to be reset back to 0 between writing
14the segment address and reading the actual EDID extension block.
15
16To quote the E-DDC spec:
17"... this standard requires that the segment pointer be
18 reset to 00h when a NO ACK or a STOP condition is received."
19
20Since we're going to touch this might as well consult the
21I2C_M_STOP flag to determine whether we want to force the stop
22or not.
23
24Cc: Brian Vincent <brainn@gmail.com>
25References: https://bugs.freedesktop.org/show_bug.cgi?id=108081
26Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
27Link: https://patchwork.freedesktop.org/patch/msgid/20180928180403.22499-1-ville.syrjala@linux.intel.com
28Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
29Signed-off-by: Sasha Levin <sashal@kernel.org>
30---
31 drivers/gpu/drm/drm_dp_mst_topology.c | 1 +
32 1 file changed, 1 insertion(+)
33
34diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
35index 2a4cf6837324..bb9a9852ec22 100644
36--- a/drivers/gpu/drm/drm_dp_mst_topology.c
37+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
38@@ -3199,6 +3199,7 @@ static int drm_dp_mst_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs
39 msg.u.i2c_read.transactions[i].i2c_dev_id = msgs[i].addr;
40 msg.u.i2c_read.transactions[i].num_bytes = msgs[i].len;
41 msg.u.i2c_read.transactions[i].bytes = msgs[i].buf;
42+ msg.u.i2c_read.transactions[i].no_stop_bit = !(msgs[i].flags & I2C_M_STOP);
43 }
44 msg.u.i2c_read.read_i2c_device_id = msgs[num - 1].addr;
45 msg.u.i2c_read.num_bytes_read = msgs[num - 1].len;
46--
472.19.1
48