diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2020-01-21 12:46:55 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2020-02-11 10:17:51 +0300 |
commit | 9109594def49525079811a6d97a64a0c4ba2bbf7 (patch) | |
tree | 51d03f897090c1eb49bbf36765db96c1d8f68c7c /drivers/gpu/drm/bridge/ti-tfp410.c | |
parent | 2f2aa13724d56829d910b2fa8e80c502d388f106 (diff) | |
download | linux-9109594def49525079811a6d97a64a0c4ba2bbf7.tar.xz |
drm/bridge: tfp410: add pclk limits
Add pixel clock limits to the driver as per TFP410 datasheet: min 25MHz,
max 165MHz.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200121094655.9092-1-tomi.valkeinen@ti.com
Diffstat (limited to 'drivers/gpu/drm/bridge/ti-tfp410.c')
-rw-r--r-- | drivers/gpu/drm/bridge/ti-tfp410.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index 6f6d6d1e60ae..108e8cd7ab68 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -167,10 +167,23 @@ static void tfp410_disable(struct drm_bridge *bridge) gpiod_set_value_cansleep(dvi->powerdown, 1); } +static enum drm_mode_status tfp410_mode_valid(struct drm_bridge *bridge, + const struct drm_display_mode *mode) +{ + if (mode->clock < 25000) + return MODE_CLOCK_LOW; + + if (mode->clock > 165000) + return MODE_CLOCK_HIGH; + + return MODE_OK; +} + static const struct drm_bridge_funcs tfp410_bridge_funcs = { .attach = tfp410_attach, .enable = tfp410_enable, .disable = tfp410_disable, + .mode_valid = tfp410_mode_valid, }; static void tfp410_hpd_work_func(struct work_struct *work) |