diff options
author | Shu Zhong <shuz@nvidia.com> | 2018-01-06 01:39:41 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-01-10 14:16:22 -0500 |
commit | 4af207f104143e937a6c41c58426e0803c1b24aa (patch) | |
tree | 8e3fa3f663ca4e9ad69ace368bb5cd97eb3123bc /drivers/video/tegra/dc/dp.c | |
parent | 4c3c1dfd389469bab9b0770e6913d342d5f7dfa9 (diff) |
dp: fix command type for I2C-over-AUX writes
Currently, tegra_dc_dpaux_i2c_write() always sets the MOT
bit for each I2C-over-AUX write that it issues, which
doesn't make a lot of sense. The MOT bit only needs to
be set under these two main conditions:
- The original I2C transaction that the source sends is
broken up into multiple I2C-over-AUX transactions, and
the current I2C-over-AUX transaction is not the last
one that signals an I2C STOP.
- The original I2C transaction sent by the source is a
RepeatedStart transaction.
Reading the EDID from the sink falls under the second condition
above since the segment pointer that we write to address 0x30 for
reading the extension blocks is volatile. However, the I2C writes
that we send via our exported sysfs nodes are assumed to be individual
writes, and don't need the MOT bit set.
To fix this issue, this patch adds a command parameter to
tegra_dc_dpaux_i2c_write(), which allows callers of the API
to decide whether to set the MOT bit.
Bug 2039653
Change-Id: Ibffdc024b7df8701eb399bef70cddabd1b266b00
Signed-off-by: Shu Zhong <shuz@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1633061
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ujwal Patel <ujwalp@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/dp.c')
-rw-r--r-- | drivers/video/tegra/dc/dp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/video/tegra/dc/dp.c b/drivers/video/tegra/dc/dp.c index 309b738c5..4adfc1c4e 100644 --- a/drivers/video/tegra/dc/dp.c +++ b/drivers/video/tegra/dc/dp.c | |||
@@ -164,8 +164,9 @@ static int tegra_dc_dp_i2c_xfer(struct tegra_dc *dc, struct i2c_msg *msgs, | |||
164 | if (!pmsg->flags) { | 164 | if (!pmsg->flags) { |
165 | len = pmsg->len; | 165 | len = pmsg->len; |
166 | 166 | ||
167 | status = tegra_dc_dpaux_i2c_write(dp->dpaux, pmsg->addr, | 167 | status = tegra_dc_dpaux_i2c_write(dp->dpaux, |
168 | pmsg->buf, &len, &aux_stat); | 168 | DPAUX_DP_AUXCTL_CMD_MOTWR, |
169 | pmsg->addr, pmsg->buf, &len, &aux_stat); | ||
169 | if (status) { | 170 | if (status) { |
170 | dev_err(&dp->dc->ndev->dev, | 171 | dev_err(&dp->dc->ndev->dev, |
171 | "dp: Failed for I2C write" | 172 | "dp: Failed for I2C write" |
@@ -745,7 +746,8 @@ static ssize_t dpaux_i2c_data_set(struct file *file, | |||
745 | goto free_mem; | 746 | goto free_mem; |
746 | } | 747 | } |
747 | 748 | ||
748 | ret = tegra_dc_dpaux_i2c_write(dp->dpaux, addr, data, &size, &aux_stat); | 749 | ret = tegra_dc_dpaux_i2c_write(dp->dpaux, DPAUX_DP_AUXCTL_CMD_I2CWR, |
750 | addr, data, &size, &aux_stat); | ||
749 | if (!ret) | 751 | if (!ret) |
750 | ret = count; | 752 | ret = count; |
751 | else | 753 | else |