From patchwork Mon Apr 14 15:00:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 3982441 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CAC15BFF02 for ; Mon, 14 Apr 2014 15:01:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13CA62015D for ; Mon, 14 Apr 2014 15:01:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2774B201E4 for ; Mon, 14 Apr 2014 15:01:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753259AbaDNPBL (ORCPT ); Mon, 14 Apr 2014 11:01:11 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:19790 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751938AbaDNPBH (ORCPT ); Mon, 14 Apr 2014 11:01:07 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4100KAM0DSPR10@mailout2.samsung.com>; Tue, 15 Apr 2014 00:01:04 +0900 (KST) X-AuditID: cbfee61a-b7fb26d00000724f-95-534bf83091b8 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id F5.ED.29263.038FB435; Tue, 15 Apr 2014 00:01:04 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N4100LEU0COAT20@mmp2.samsung.com>; Tue, 15 Apr 2014 00:01:04 +0900 (KST) From: Tomasz Stanislawski To: linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org Cc: m.chehab@samsung.com, robh+dt@kernel.org, inki.dae@samsung.com, kyungmin.park@samsung.com, sw0312.kim@samsung.com, t.figa@samsung.com, b.zolnierkie@samsung.com, jy0922.shim@samsung.com, rahul.sharma@samsung.com, pawel.moll@arm.com, Tomasz Stanislawski Subject: [PATCH 4/4] drm: exynos: hdmi: add support for pixel clock limitation Date: Mon, 14 Apr 2014 17:00:22 +0200 Message-id: <1397487622-3577-5-git-send-email-t.stanislaws@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1397487622-3577-1-git-send-email-t.stanislaws@samsung.com> References: <1397487622-3577-1-git-send-email-t.stanislaws@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGLMWRmVeSWpSXmKPExsVy+t9jQV2DH97BBktfKlpsnLGe1eLK1/ds FpPuT2CxeHHvIovF2aY37BY9G7ayWsw4v4/J4uI6eYsJ09eyWExZdJjVonXvEXaLGZNfslms n/GaxWJe+0tWBz6PNfPWMHpsWtXJ5nG/+ziTR9+WVYwenzfJBbBGcdmkpOZklqUW6dslcGV8 m3+FueC6WMWnzmmMDYw7hboYOTkkBEwkVu2ZzgZhi0lcuLceyObiEBKYzihxYk0rK4TTxSSx c8MzdpAqNqCOY0s+M4LYIgKpEvNXdzCDFDELLGCSmLq1B6xIWMBP4uLOq0DdHBwsAqoSGxeW gIR5BdwlWr71M0JsU5TofjYBbDOngIdE39qZTCC2EFDN0d9bmScw8i5gZFjFKJpakFxQnJSe a6hXnJhbXJqXrpecn7uJERyaz6R2MK5ssDjEKMDBqMTDO+Gdd7AQa2JZcWXuIUYJDmYlEV7X rUAh3pTEyqrUovz4otKc1OJDjNIcLErivAdarQOFBNITS1KzU1MLUotgskwcnFINjB7n+gtP lGhc3xJa87zqU+D2cDfJbXK9W1oXLg71a86Y+t12mnpa4k47ozibdSt/GdxzMjBbunhaJduB 8zYcd1RMmG2in3Dl7BC68PHqjXsMEwT3Pv/CIT/fdNu3mtfVhUmd33mrYrtCV8v4zGt8KfWy 4jzr5cXaB9wPBjwJtAuvnZD3Za2ogxJLcUaioRZzUXEiABXHzWNJAgAA Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- .../devicetree/bindings/video/exynos_hdmi.txt | 4 ++++ drivers/gpu/drm/exynos/exynos_hdmi.c | 12 ++++++++++++ include/media/s5p_hdmi.h | 1 + 3 files changed, 17 insertions(+) diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt index f9187a2..8718f8d 100644 --- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt +++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt @@ -28,6 +28,10 @@ Required properties: - ddc: phandle to the hdmi ddc node - phy: phandle to the hdmi phy node +Optional properties: +- max-pixel-clock: used to limit the maximal pixel clock if a board has lines, + connectors or bridges not capable of carring higher frequencies + Example: hdmi { diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 6fa63ea..ca313b3 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -195,6 +195,7 @@ struct hdmi_context { struct hdmi_resources res; int hpd_gpio; + u32 max_pixel_clock; enum hdmi_type type; }; @@ -883,6 +884,9 @@ static int hdmi_mode_valid(struct drm_connector *connector, if (ret) return MODE_BAD; + if (mode->clock * 1000 > hdata->max_pixel_clock) + return MODE_BAD; + ret = hdmi_find_phy_conf(hdata, mode->clock * 1000); if (ret < 0) return MODE_BAD; @@ -2027,6 +2031,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; } @@ -2063,6 +2069,11 @@ static int hdmi_probe(struct platform_device *pdev) if (!pdata) return -EINVAL; + if (!pdata->max_pixel_clock) { + DRM_INFO("max-pixel-clock is zero, using INF\n"); + pdata->max_pixel_clock = ULONG_MAX; + } + hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL); if (!hdata) return -ENOMEM; @@ -2079,6 +2090,7 @@ static int hdmi_probe(struct platform_device *pdev) hdata->type = drv_data->type; 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 181642b..7272d65 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 */