drm/bridge: tc358767: fix tc_aux_get_status error handling

tc_aux_get_status() does not report AUX_TIMEOUT correctly, as it only
checks the AUX_TIMEOUT if aux is still busy. Fix this by always checking
for AUX_TIMEOUT.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190528082747.3631-2-tomi.valkeinen@ti.com
This commit is contained in:
Tomi Valkeinen 2019-05-28 11:27:24 +03:00 committed by Andrzej Hajda
parent c25b84c008
commit bfb6e014c4

View File

@ -286,14 +286,17 @@ static int tc_aux_get_status(struct tc_data *tc, u8 *reply)
ret = regmap_read(tc->regmap, DP0_AUXSTATUS, &value);
if (ret < 0)
return ret;
if (value & AUX_BUSY) {
if (value & AUX_TIMEOUT) {
dev_err(tc->dev, "i2c access timeout!\n");
return -ETIMEDOUT;
}
dev_err(tc->dev, "aux busy!\n");
return -EBUSY;
}
if (value & AUX_TIMEOUT) {
dev_err(tc->dev, "aux access timeout!\n");
return -ETIMEDOUT;
}
*reply = (value & AUX_STATUS_MASK) >> AUX_STATUS_SHIFT;
return 0;
}