From patchwork Tue Jan 8 20:16:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 1948061 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id ACAE0DF23A for ; Tue, 8 Jan 2013 20:17:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 93220E64F4 for ; Tue, 8 Jan 2013 12:17:09 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yh0-f54.google.com (mail-yh0-f54.google.com [209.85.213.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 760E2E64DC for ; Tue, 8 Jan 2013 12:16:38 -0800 (PST) Received: by mail-yh0-f54.google.com with SMTP id i57so182982yha.13 for ; Tue, 08 Jan 2013 12:16:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=kR9tH+QJx9n87otRtxl3ylLUS/fROYk0iWrEjtoAKNg=; b=Dw7uTr+rHF1XL9GcwkidPGoLoqhv61UDPLnyykC9rBoV16zpa/I/EkuCuGAYWRTPO2 Lj1GMA4UHLpoKbY4oBxiwz042SVb7elRzDVu2eIPF0aHeY84gF2b5q5V/emMvtpmxXP4 3JuQCvWmtJrzOWFUQnsQEKsBilHrc1wxPtWO4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=kR9tH+QJx9n87otRtxl3ylLUS/fROYk0iWrEjtoAKNg=; b=lJuUpgGFTFBg6zc6hZIYoubsjI4J2Hdm6hKpUVAkiAHrIjVmDfJOj7lbZHTdbN0Qe9 8K6AQdjpJFO5VtICCenLMJ02X3DcAAUBQtCBNrUos3LY4Zf1Gl7PeRxtSeoJRsoa6lpY pumhKlWWQCEPBx/78q/0AmCP/GkCe5zaDGmY/q5/FfN+hVX2EgCmnRIlxdEyBsqEkUvc 5nvPKuA+SrNNnbMAj1hEnon/ZJ49JS2SXgykLvbTxYQg6I0kScjzHPwOz46YBNOZ+7fz Q67x49Ls4S4QfQaL1smw58cFLWtdU3Chfo1TIacXm80t5+hxO90t2oZw/W588K6oGHex byxw== X-Received: by 10.236.189.71 with SMTP id b47mr6122786yhn.48.1357676197956; Tue, 08 Jan 2013 12:16:37 -0800 (PST) Received: from seanpaul-glaptop.localdomain (cpe-173-095-180-236.nc.res.rr.com. [173.95.180.236]) by mx.google.com with ESMTPS id y9sm64378543anh.20.2013.01.08.12.16.36 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 12:16:37 -0800 (PST) From: Sean Paul To: devicetree-discuss@lists.ozlabs.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/exynos: Get HDMI version from device tree Date: Tue, 8 Jan 2013 15:16:21 -0500 Message-Id: <1357676181-16728-1-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <50EC5EDE.3030208@firmworks.com> References: <50EC5EDE.3030208@firmworks.com> X-Gm-Message-State: ALoCoQkUTC+QKKWZA5Zf6i6Eao1Z60lXIey8SN76sHV7zvxz0SmPg2x/45J2FTbm1C8yJ1noiL4g Cc: wmb@firmworks.com, olofj@chromium.org, swarren@wwwdotorg.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Add a property to the hdmi node so we can specify the HDMI version in the device tree instead of just defaulting to v1.4 with the existence of the dt node. Signed-off-by: Sean Paul --- .../devicetree/bindings/drm/exynos/hdmi.txt | 2 + drivers/gpu/drm/exynos/exynos_hdmi.c | 22 ++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmi.txt b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt index 589edee..228ede6 100644 --- a/Documentation/devicetree/bindings/drm/exynos/hdmi.txt +++ b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt @@ -11,6 +11,7 @@ Required properties: c) pin function mode. d) optional flags and pull up/down. e) drive strength. +- hdmi-version: (major << 8) | minor Example: @@ -19,4 +20,5 @@ Example: reg = <0x14530000 0x100000>; interrupts = <0 95 0>; hpd-gpio = <&gpx3 7 0xf 1 3>; + hdmi-version = <0x104>; /* version 1.4 */ }; diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 2c46b6c..71736f9 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -74,8 +74,8 @@ enum HDMI_PACKET_TYPE { }; enum hdmi_type { - HDMI_TYPE13, - HDMI_TYPE14, + HDMI_TYPE13 = (1 << 8) | 3, + HDMI_TYPE14 = (1 << 8) | 4, }; struct hdmi_resources { @@ -2444,7 +2444,6 @@ static struct platform_device_id hdmi_driver_types[] = { static struct of_device_id hdmi_match_types[] = { { .compatible = "samsung,exynos5-hdmi", - .data = (void *)HDMI_TYPE14, }, { /* end node */ } @@ -2459,6 +2458,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev) struct s5p_hdmi_platform_data *pdata; struct resource *res; int ret; + u32 ver; DRM_DEBUG_KMS("[%d]\n", __LINE__); @@ -2498,16 +2498,16 @@ static int __devinit hdmi_probe(struct platform_device *pdev) platform_set_drvdata(pdev, drm_hdmi_ctx); - if (dev->of_node) { - const struct of_device_id *match; - match = of_match_node(of_match_ptr(hdmi_match_types), - pdev->dev.of_node); - if (match == NULL) - return -ENODEV; - hdata->type = (enum hdmi_type)match->data; - } else { + if (!dev->of_node) { hdata->type = (enum hdmi_type)platform_get_device_id (pdev)->driver_data; + } else { + ret = of_property_read_u32(dev->of_node, "hdmi-version", &ver); + if (ret) { + DRM_ERROR("Could not resolve HDMI version support\n"); + return ret; + } + hdata->type = (enum hdmi_type)ver; } hdata->hpd_gpio = pdata->hpd_gpio;