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: 3982401 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8A1E69F2BA for ; Mon, 14 Apr 2014 15:01:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB462201E4 for ; Mon, 14 Apr 2014 15:01:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 11205201BF for ; Mon, 14 Apr 2014 15:01:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 500226E7B2; Mon, 14 Apr 2014 08:01:07 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 9EF816E7B2 for ; Mon, 14 Apr 2014 08:01:05 -0700 (PDT) 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> for dri-devel@lists.freedesktop.org; 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 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 Cc: Tomasz Stanislawski , pawel.moll@arm.com, b.zolnierkie@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, robh+dt@kernel.org, rahul.sharma@samsung.com, m.chehab@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 */