diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-09-07 14:44:44 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2016-02-23 08:34:30 +0100 |
commit | d9829a328943c06b034f52885ea650e334b062a7 (patch) | |
tree | b151399960e27578c01a5e752db076f9bcfb881b /drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c | |
parent | drm: rcar-du: Add R8A7795 device support (diff) | |
download | linux-d9829a328943c06b034f52885ea650e334b062a7.tar.xz linux-d9829a328943c06b034f52885ea650e334b062a7.zip |
drm: rcar-du: lvds: Avoid duplication of clock clamp code
Replace the duplicate code by a single central function.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c')
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c index 85043c5bad03..937b2da98814 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c @@ -140,6 +140,15 @@ int rcar_du_lvdsenc_enable(struct rcar_du_lvdsenc *lvds, struct drm_crtc *crtc, return -EINVAL; } +void rcar_du_lvdsenc_atomic_check(struct rcar_du_lvdsenc *lvds, + struct drm_display_mode *mode) +{ + /* The internal LVDS encoder has a clock frequency operating range of + * 30MHz to 150MHz. Clamp the clock accordingly. + */ + mode->clock = clamp(mode->clock, 30000, 150000); +} + static int rcar_du_lvdsenc_get_resources(struct rcar_du_lvdsenc *lvds, struct platform_device *pdev) { |