]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/drm-dp-mst-configure-no_stop_bit-correctly-for-remot.patch
Linux 4.14.111
[thirdparty/kernel/stable-queue.git] / queue-4.19 / drm-dp-mst-configure-no_stop_bit-correctly-for-remot.patch
1 From 5e0b504e10740e949c3691a3a8e305ee7cfc07f1 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
3 Date: Fri, 28 Sep 2018 21:03:59 +0300
4 Subject: drm/dp/mst: Configure no_stop_bit correctly for remote i2c xfers
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 [ Upstream commit c978ae9bde582e82a04c63a4071701691dd8b35c ]
10
11 We aren't supposed to force a stop+start between every i2c msg
12 when performing multi message transfers. This should eg. cause
13 the DDC segment address to be reset back to 0 between writing
14 the segment address and reading the actual EDID extension block.
15
16 To 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
20 Since we're going to touch this might as well consult the
21 I2C_M_STOP flag to determine whether we want to force the stop
22 or not.
23
24 Cc: Brian Vincent <brainn@gmail.com>
25 References: https://bugs.freedesktop.org/show_bug.cgi?id=108081
26 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
27 Link: https://patchwork.freedesktop.org/patch/msgid/20180928180403.22499-1-ville.syrjala@linux.intel.com
28 Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
29 Signed-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
34 diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
35 index d708472d93c4..65f58e23e03d 100644
36 --- a/drivers/gpu/drm/drm_dp_mst_topology.c
37 +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
38 @@ -3278,6 +3278,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 --
47 2.19.1
48