From: Ricardo Cañuelo Date: Wed, 17 Jun 2020 09:46:33 +0000 (+0200) Subject: drm/bridge: tfp410: Fix setup and hold time calculation X-Git-Tag: v5.15~303^2~28^2~2560 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9fe86204b06655204534ac5e0562d6a3e503b16;p=platform%2Fkernel%2Flinux-starfive.git drm/bridge: tfp410: Fix setup and hold time calculation This fixes a bug in the calculation of the setup and hold times based on the deskew configuration. Signed-off-by: Ricardo Cañuelo Reviewed-by: Laurent Pinchart Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200617094633.19663-5-ricardo.canuelo@collabora.com --- diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index dfde811..21d99b4 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -278,8 +278,8 @@ static int tfp410_parse_timings(struct tfp410 *dvi, bool i2c) if (deskew > 7) return -EINVAL; - timings->setup_time_ps = min(0, 1200 - 350 * ((s32)deskew - 4)); - timings->hold_time_ps = min(0, 1300 + 350 * ((s32)deskew - 4)); + timings->setup_time_ps = 1200 - 350 * ((s32)deskew - 4); + timings->hold_time_ps = max(0, 1300 + 350 * ((s32)deskew - 4)); return 0; }