From patchwork Tue Apr 15 09:27:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 3990321 Return-Path: X-Original-To: patchwork-linux-media@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 8915F9F336 for ; Tue, 15 Apr 2014 09:28:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6C5120213 for ; Tue, 15 Apr 2014 09:28:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B74CA20211 for ; Tue, 15 Apr 2014 09:28:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752371AbaDOJ2K (ORCPT ); Tue, 15 Apr 2014 05:28:10 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:40085 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751161AbaDOJ2E (ORCPT ); Tue, 15 Apr 2014 05:28:04 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4200D15FMG13E0@mailout3.samsung.com>; Tue, 15 Apr 2014 18:27:52 +0900 (KST) X-AuditID: cbfee61a-b7fb26d00000724f-de-534cfb98e44d Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 18.A7.29263.89BFC435; Tue, 15 Apr 2014 18:27:52 +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 <0N42001CMFLM6080@mmp2.samsung.com>; Tue, 15 Apr 2014 18:27:52 +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: [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation Date: Tue, 15 Apr 2014 11:27:20 +0200 Message-id: <1397554040-4037-5-git-send-email-t.stanislaws@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1397554040-4037-1-git-send-email-t.stanislaws@samsung.com> References: <1397554040-4037-1-git-send-email-t.stanislaws@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKLMWRmVeSWpSXmKPExsVy+t9jQd0Zv32CDR5+F7TYOGM9q8WVr+/Z LCbdn8Bi8eLeRRaLs01v2C16NmxltZhxfh+TxcV18hYTpq9lsZiy6DCrReveI+wWMya/ZLNY P+M1i8W89pesDnwea+atYfTYtKqTzeN+93Emj74tqxg9Pm+SC2CN4rJJSc3JLEst0rdL4Mq4 PP0SY8FVsYqdV46wNTBuF+pi5OSQEDCRmLVlDguELSZx4d56ti5GLg4hgemMEkvvfWaBcLqY JGYeu8gOUsUG1HFsyWdGEFtEIFVi/uoOZpAiZoEFTBJTt/aAFQkLBEj8OHITqIiDg0VAVaL/ nBVImFfAXeLUpK1sENsUJbqfTWADKeEU8JC4fDUYJCwEVPLx5hqmCYy8CxgZVjGKphYkFxQn peca6hUn5haX5qXrJefnbmIEB+YzqR2MKxssDjEKcDAq8fB6TPAJFmJNLCuuzD3EKMHBrCTC ++UlUIg3JbGyKrUoP76oNCe1+BCjNAeLkjjvgVbrQCGB9MSS1OzU1ILUIpgsEwenVAPjZq74 7xPrNweUcVon355cpsZk93pHHutXqfCC/Hc/UxN4wzOPfq9VZyrZsPRdvISqh6RR6M7HM7Ya lV82cuAUy7pdP79QIMbUkV9KI4hR5Qu7AuvjiX3pDBoWjmJzmw/1aD/dEMO2oXXWvpm+YuFC Xxumb3zu6fhfInL/GvXtswV37pTqO6/EUpyRaKjFXFScCAA/+gG2SAIAAA== 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.6 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 2a18f4e..404f1b7 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; }; @@ -887,6 +888,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; @@ -2031,6 +2035,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; } @@ -2067,6 +2073,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 = U32_MAX; + } + hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL); if (!hdata) return -ENOMEM; @@ -2083,6 +2094,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 */