diff options
author | Tomasz Stanislawski <t.stanislaws@samsung.com> | 2013-12-19 16:24:07 +0100 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2014-05-15 07:27:13 +0200 |
commit | 38e98b02013873753e7e37f92d6dfc0842ead550 (patch) | |
tree | 327916a04f30b2b64a9f6bd64350dcd0e7814042 | |
parent | a82c7da4738adfaa8b237dcd03448abecb0c1d62 (diff) | |
download | linux-3.10-38e98b02013873753e7e37f92d6dfc0842ead550.tar.gz linux-3.10-38e98b02013873753e7e37f92d6dfc0842ead550.tar.bz2 linux-3.10-38e98b02013873753e7e37f92d6dfc0842ead550.zip |
drm: exynos: hdmi: add support for pixel clock limitation
Adds support for limitation of maximal pixel clock of HDMI
signal. This feature is needed on boards that contains
lines or bridges with frequency limitations.
Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Change-Id: I4cc38e995feeaca77b73e9ea0197d67f99d57715
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_hdmi.c | 11 | ||||
-rw-r--r-- | include/media/s5p_hdmi.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 87c3f4271e9..a48cf7551a2 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -201,6 +201,7 @@ struct hdmi_context { struct hdmi_resources res; int hpd_gpio; + u32 max_pixel_clock; enum hdmi_type type; }; @@ -801,6 +802,8 @@ static int hdmi_check_mode(void *ctx, struct drm_display_mode *mode) (mode->flags & DRM_MODE_FLAG_INTERLACE) ? true : false, mode->clock * 1000); + if (mode->clock * 1000 > hdata->max_pixel_clock) + return -E2BIG; ret = hdmi_find_phy_conf(hdata, mode->clock * 1000); if (ret < 0) return ret; @@ -1868,6 +1871,8 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata return NULL; } + of_property_read_u32(np, "max-pixel-clock", &pd->max_pixel_clock); + return pd; } #else @@ -1934,6 +1939,11 @@ static int hdmi_probe(struct platform_device *pdev) return -EINVAL; } + if (!pdata->max_pixel_clock) { + DRM_LOG("max-pixel-clock is zero, using INF\n"); + pdata->max_pixel_clock = ULONG_MAX; + } + drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx), GFP_KERNEL); if (!drm_hdmi_ctx) @@ -1964,6 +1974,7 @@ static int hdmi_probe(struct platform_device *pdev) } hdata->hpd_gpio = pdata->hpd_gpio; + hdata->max_pixel_clock = pdata->max_pixel_clock; hdata->dev = dev; ret = hdmi_resources_init(hdata); diff --git a/include/media/s5p_hdmi.h b/include/media/s5p_hdmi.h index 181642b8d0a..7272d655def 100644 --- a/include/media/s5p_hdmi.h +++ b/include/media/s5p_hdmi.h @@ -31,6 +31,7 @@ struct s5p_hdmi_platform_data { int mhl_bus; struct i2c_board_info *mhl_info; int hpd_gpio; + u32 max_pixel_clock; }; #endif /* S5P_HDMI_H */ |