From patchwork Mon Jan 7 20:43:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 1942621 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 25E483FE37 for ; Mon, 7 Jan 2013 20:43:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 276A4E634C for ; Mon, 7 Jan 2013 12:43:57 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ia0-f172.google.com (mail-ia0-f172.google.com [209.85.210.172]) by gabe.freedesktop.org (Postfix) with ESMTP id D9ABCE5D16 for ; Mon, 7 Jan 2013 12:43:43 -0800 (PST) Received: by mail-ia0-f172.google.com with SMTP id r13so383130iar.31 for ; Mon, 07 Jan 2013 12:43:43 -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; bh=04QewQpmI76u5jEuUGA+bhkl9o0GCmGbMksCB2g6W3s=; b=XeunVGQupFPmYIi2YRR8elUIgf8w2yKlNQqFgtGt779MdhXgpwKMgWXTh5Qc3GG3W2 k4CZa1nyIBWfl5XFlvjTutbRiDbQYB/ewDj6rhf0UUnnP+Dr6zy3TKgemfN2c+QJx5C6 s41Y2OkH6IcYwKyBrJAA0i6I9msA8f19EOCIE= 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 :x-gm-message-state; bh=04QewQpmI76u5jEuUGA+bhkl9o0GCmGbMksCB2g6W3s=; b=Lx+GGLOujL7cWt2kXylBSD+uOFzxKWgr6XoWA901rGzwRPTA7Vl5vwx38yT3ERO3sr 4D4xA7HEQZgrF3gx4TFPQ3MEIeMOr0SRd8aa+E2QdfzTEUtR5NSuiSohVHtsbP3VwLQn 3KrQrUN+3cG6daC5uWKxJnnc9vRG9Rur6fPQT2fftD9RUutQHOGuDCXgmFqCnmsE4c0J MDp7SbWVgmnW1Kj6qoZYqR7uQn096MFUHtqCQb8ODa6Vm+lT0riim/tl3NqnodMwphy0 SY3Zp7ew93hHEt+1YV04lwu90VbF/KJZYmJYaiCTcbjc2X7opYAb2UK6Qm2iKzt/aXGY 3Q7Q== X-Received: by 10.50.195.196 with SMTP id ig4mr6855197igc.33.1357591423269; Mon, 07 Jan 2013 12:43:43 -0800 (PST) Received: from seanpaul-glaptop.corp.google.com ([172.26.43.107]) by mx.google.com with ESMTPS id ex10sm8584792igc.15.2013.01.07.12.43.41 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 12:43:42 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org, devicetree-discuss@lists.ozlabs.org Subject: [PATCH] drm/exynos: Get HDMI version from device tree Date: Mon, 7 Jan 2013 15:43:35 -0500 Message-Id: <1357591415-17092-1-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 1.7.7.3 X-Gm-Message-State: ALoCoQk9MDtqZQT5c4rYLzXmm5Akj8dt3CS5v/R5/E/eFT7oHlQcOb9fOKp0QRxz8XF0ruV4fJ8o 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 | 3 +++ drivers/gpu/drm/exynos/exynos_hdmi.c | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/drm/exynos/hdmi.txt b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt index 589edee..d1c7d91 100644 --- a/Documentation/devicetree/bindings/drm/exynos/hdmi.txt +++ b/Documentation/devicetree/bindings/drm/exynos/hdmi.txt @@ -11,6 +11,8 @@ Required properties: c) pin function mode. d) optional flags and pull up/down. e) drive strength. +- samsung,supports-hdmi-1.4: Define if device supports HDMI v1.4 +- samsung,supports-hdmi-1.3: Define if device supports HDMI v1.3 Example: @@ -19,4 +21,5 @@ Example: reg = <0x14530000 0x100000>; interrupts = <0 95 0>; hpd-gpio = <&gpx3 7 0xf 1 3>; + samsung,supports-hdmi-1.4; }; diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 2c46b6c..9834ae5 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -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 */ } @@ -2498,16 +2497,18 @@ 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 if (of_get_property(dev->of_node, "samsung,supports-hdmi-1.4", + NULL)) { + hdata->type = HDMI_TYPE14; + } else if (of_get_property(dev->of_node, "samsung,supports-hdmi-1.3", + NULL)) { + hdata->type = HDMI_TYPE13; + } else { + DRM_ERROR("Could not resolve HDMI version support\n"); + return -ENODEV; } hdata->hpd_gpio = pdata->hpd_gpio;