From patchwork Tue Oct 15 16:06:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 3046481 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 1A808BF924 for ; Tue, 15 Oct 2013 16:07:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7ADE203F1 for ; Tue, 15 Oct 2013 16:07:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8CE022041B for ; Tue, 15 Oct 2013 16:07:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932317Ab3JOQHK (ORCPT ); Tue, 15 Oct 2013 12:07:10 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:40353 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759538Ab3JOQHE (ORCPT ); Tue, 15 Oct 2013 12:07:04 -0400 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3czhNP0ZtSz3hhxw; Tue, 15 Oct 2013 18:07:00 +0200 (CEST) X-Auth-Info: yU4nKRj8ZRGUSVxYHOF+r06MQsRfjH4EVoenJWqeAWU= Received: from chi.lan (host-82-135-33-74.customer.m-online.net [82.135.33.74]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3czhNM5djNzbbl1; Tue, 15 Oct 2013 18:06:59 +0200 (CEST) From: Marek Vasut To: linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Marek Vasut , Bjorn Helgaas , Frank Li , Jingoo Han , Mohit KUMAR , Pratyush Anand , Richard Zhu , Sascha Hauer , Sean Cross , Shawn Guo , Siva Reddy Kallam , Srikanth T Shivanand , Tim Harvey , Troy Kisky , Yinghai Lu Subject: [PATCH 2/6] PCI: imx6: Fix the clock for PCIe Date: Tue, 15 Oct 2013 18:06:36 +0200 Message-Id: <1381853200-5534-3-git-send-email-marex@denx.de> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1381853200-5534-1-git-send-email-marex@denx.de> References: <1381853200-5534-1-git-send-email-marex@denx.de> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The PCIe needs lvds_gate for successful operation, so make the PCIe driver enable (set as output) the lvds_gate . Signed-off-by: Marek Vasut Cc: Bjorn Helgaas Cc: Frank Li Cc: Jingoo Han Cc: Mohit KUMAR Cc: Pratyush Anand Cc: Richard Zhu Cc: Sascha Hauer Cc: Sean Cross Cc: Shawn Guo Cc: Siva Reddy Kallam Cc: Srikanth T Shivanand Cc: Tim Harvey Cc: Troy Kisky Cc: Yinghai Lu --- drivers/pci/host/pci-imx6.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index 728989a..94e4d0f 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -35,6 +35,7 @@ struct imx6_pcie { int power_on_gpio; int wake_up_gpio; int disable_gpio; + struct clk *lvds_sel; struct clk *lvds_gate; struct clk *sata_ref_100m; struct clk *pcie_ref_125m; @@ -255,6 +256,12 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp) goto err_pcie_ref; } + ret = clk_prepare_enable(imx6_pcie->lvds_sel); + if (ret) { + dev_err(pp->dev, "unable to enable lvds_sel\n"); + goto err_lvds_sel; + } + ret = clk_prepare_enable(imx6_pcie->lvds_gate); if (ret) { dev_err(pp->dev, "unable to enable lvds_gate\n"); @@ -273,8 +280,10 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp) return 0; err_pcie_axi: - clk_disable_unprepare(imx6_pcie->lvds_gate); + clk_disable_unprepare(imx6_pcie->lvds_sel); err_lvds_gate: + clk_disable_unprepare(imx6_pcie->lvds_gate); +err_lvds_sel: clk_disable_unprepare(imx6_pcie->pcie_ref_125m); err_pcie_ref: clk_disable_unprepare(imx6_pcie->sata_ref_100m); @@ -497,6 +506,14 @@ static int __init imx6_pcie_probe(struct platform_device *pdev) } /* Fetch clocks */ + imx6_pcie->lvds_sel = devm_clk_get(&pdev->dev, "lvds_sel"); + if (IS_ERR(imx6_pcie->lvds_sel)) { + dev_err(&pdev->dev, + "lvds_sel clock select missing or invalid\n"); + ret = PTR_ERR(imx6_pcie->lvds_sel); + goto err; + } + imx6_pcie->lvds_gate = devm_clk_get(&pdev->dev, "lvds_gate"); if (IS_ERR(imx6_pcie->lvds_gate)) { dev_err(&pdev->dev,