From patchwork Fri Oct 31 22:54:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 5207421 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6876AC11AC for ; Fri, 31 Oct 2014 23:57:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A624B201B9 for ; Fri, 31 Oct 2014 23:56:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C949520172 for ; Fri, 31 Oct 2014 23:56:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CE966E8A1; Fri, 31 Oct 2014 16:56:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by gabe.freedesktop.org (Postfix) with ESMTP id B9AF06E856 for ; Fri, 31 Oct 2014 15:57:38 -0700 (PDT) Received: by mail-pd0-f175.google.com with SMTP id y13so8127093pdi.34 for ; Fri, 31 Oct 2014 15:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nu4mNqlv2E/uVS53Lj3Thhw0xZr5i+gA+1pcvSeqcAk=; b=fJLrrxpCKaYQVSeW4PKrtXaT7rtixVKgkVm/DzSKPkM6JmIKKlPvLhUK9qAiTGEHcS z5ILOuWK29qbjfxtxvaF37MdMWf/H+XowHsOdNnQPnaRRTGXoBiYQYu7WHhfQazExPOx e63ykn9kY4bDXut/CVpoxO4pVkoyS/JHoa5QeUnNRACk+hshWfT2H46vb4CaTYKgs87L FzFm7alW7p1Ai2B+poSrpJ3phxPPEkMcvXFWOgU7lnX0s0FxS2z5HAYZUkv3Odog8tKw k605wAwDOEaiWoy7UUovu31EvPQcF1OxnTpO2qFv9/aOTcsMW3OU84SWoZEasMPhR6X0 KjEA== X-Received: by 10.66.118.136 with SMTP id km8mr28277664pab.100.1414796258650; Fri, 31 Oct 2014 15:57:38 -0700 (PDT) Received: from mothership.mgc.mentorg.com (c-50-152-159-227.hsd1.ca.comcast.net. [50.152.159.227]) by mx.google.com with ESMTPSA id ev8sm10870656pdb.28.2014.10.31.15.57.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 15:57:38 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: dri-devel@lists.freedesktop.org Subject: [PATCH 61/72] imx-drm: hdmi: Save ipu/di mux for later iomux setup Date: Fri, 31 Oct 2014 15:54:44 -0700 Message-Id: <1414796095-10107-62-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> References: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> X-Mailman-Approved-At: Fri, 31 Oct 2014 16:56:32 -0700 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Store the ipu/di mux in struct imx_hdmi during imx_hdmi_encoder_prepare(). imx_hdmi_encoder_commit() can then use the mux when setting the iomux instead of looking it up again via imx_drm_encoder_get_mux_id(). Signed-off-by: Steve Longerbeam --- drivers/staging/imx-drm/imx-hdmi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c index d97fa18..2503237 100644 --- a/drivers/staging/imx-drm/imx-hdmi.c +++ b/drivers/staging/imx-drm/imx-hdmi.c @@ -124,6 +124,7 @@ struct imx_hdmi { struct hdmi_data_info hdmi_data; int vic; int irq; + int mux; u8 edid[HDMI_EDID_LEN]; bool cable_plugin; @@ -1454,12 +1455,13 @@ static void imx_hdmi_encoder_dpms(struct drm_encoder *encoder, int mode) static void imx_hdmi_encoder_prepare(struct drm_encoder *encoder) { struct imx_hdmi *hdmi = container_of(encoder, struct imx_hdmi, encoder); - int mux = imx_drm_encoder_get_mux_id(hdmi->dev->of_node, encoder); + + hdmi->mux = imx_drm_encoder_get_mux_id(hdmi->dev->of_node, encoder); imx_hdmi_poweroff(hdmi); /* set DI clock mux to DI pre clock mux */ - clk_set_parent(hdmi->di_sel[mux], hdmi->di_pre_sel[mux]); + clk_set_parent(hdmi->di_sel[hdmi->mux], hdmi->di_pre_sel[hdmi->mux]); imx_drm_panel_format(encoder, V4L2_PIX_FMT_RGB24, NULL); } @@ -1467,9 +1469,8 @@ static void imx_hdmi_encoder_prepare(struct drm_encoder *encoder) static void imx_hdmi_encoder_commit(struct drm_encoder *encoder) { struct imx_hdmi *hdmi = container_of(encoder, struct imx_hdmi, encoder); - int mux = imx_drm_encoder_get_mux_id(hdmi->dev->of_node, encoder); - imx_hdmi_set_ipu_di_mux(hdmi, mux); + imx_hdmi_set_ipu_di_mux(hdmi, hdmi->mux); imx_hdmi_poweron(hdmi); }