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: 3990261 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 A607D9F375 for ; Tue, 15 Apr 2014 09:28:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C828A2012E for ; Tue, 15 Apr 2014 09:28:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0327020211 for ; Tue, 15 Apr 2014 09:28:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3C3836E8A9; Tue, 15 Apr 2014 02:28:05 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTP id ED1816E8AA for ; Tue, 15 Apr 2014 02:28:03 -0700 (PDT) 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> for dri-devel@lists.freedesktop.org; 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 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== 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=-4.9 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 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 */