From patchwork Wed Nov 20 17:38:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 3214041 Return-Path: X-Original-To: patchwork-linux-sh@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 8A4FE9F3A0 for ; Wed, 20 Nov 2013 17:39:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E23820760 for ; Wed, 20 Nov 2013 17:39:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D45420767 for ; Wed, 20 Nov 2013 17:39:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754297Ab3KTRjX (ORCPT ); Wed, 20 Nov 2013 12:39:23 -0500 Received: from mail-bk0-f42.google.com ([209.85.214.42]:40249 "EHLO mail-bk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753952Ab3KTRjV (ORCPT ); Wed, 20 Nov 2013 12:39:21 -0500 Received: by mail-bk0-f42.google.com with SMTP id w11so1335082bkz.1 for ; Wed, 20 Nov 2013 09:39:19 -0800 (PST) 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=4QvR/t7UQ3YKMZnxXDjsF+oAeHfCZ6E0vM3t7d0sK04=; b=sbu1aSZc+fCzm6N3MmNR++ugzG8b4SgJYN1SyGKuHv1bGPjL34Bt60RQFBBNyMFL9Q GL6v+d12xh6dlRkbCpC3THn8C+h8Kq5dAldiELFjl+doG9qS9MAT+ub+/fBvLrJ06dNd EX7KdQgDB7FsglPe2leyCyO6latSs8gLUERAQrAqG3vGmDqGntleuG9qxkYI/g7LQv2l KuqEO0UymzPMp6upNDCc/96amTI+sh6NnqKcFgkHbTATmcRFnzgtJWUaHZUZYSiPrD/P 8n5QTj3LE2u/rbuPnmC+7d39X566MVRJt+Fwa2cs+R5XLVlJVelZ+Hm/Ua3C5VXIvYuV +wgg== X-Received: by 10.204.171.142 with SMTP id h14mr772007bkz.30.1384969159824; Wed, 20 Nov 2013 09:39:19 -0800 (PST) Received: from groucho.site ([109.201.152.7]) by mx.google.com with ESMTPSA id no2sm24117885bkb.15.2013.11.20.09.39.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2013 09:39:19 -0800 (PST) From: Ulrich Hecht To: Simon Horman Cc: linux-sh@vger.kernel.org, Magnus Damm , Kuninori Morimoto , Laurent Pinchart , Valentine Barshak , linux-usb@vger.kernel.org, Felipe Balbi , Alan Stern , Ulrich Hecht Subject: [PATCH 6/9] pci: rcar-gen2: enable clock Date: Wed, 20 Nov 2013 18:38:03 +0100 Message-Id: <1384969086-8920-7-git-send-email-ulrich.hecht@gmail.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1384969086-8920-1-git-send-email-ulrich.hecht@gmail.com> References: <1384969086-8920-1-git-send-email-ulrich.hecht@gmail.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Makes the PCI host controllers come alive. Signed-off-by: Ulrich Hecht --- drivers/pci/host/pci-rcar-gen2.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c index cbaa5c4..568ff8e 100644 --- a/drivers/pci/host/pci-rcar-gen2.c +++ b/drivers/pci/host/pci-rcar-gen2.c @@ -9,6 +9,7 @@ * published by the Free Software Foundation. */ +#include #include #include #include @@ -77,6 +78,7 @@ #define RCAR_PCI_NR_CONTROLLERS 3 struct rcar_pci_priv { + struct clk *clk; void __iomem *reg; struct resource io_res; struct resource mem_res; @@ -169,6 +171,9 @@ static int __init rcar_pci_setup(int nr, struct pci_sys_data *sys) void __iomem *reg = priv->reg; u32 val; + clk_prepare_enable(priv->clk); + udelay(4); + val = ioread32(reg + RCAR_PCI_UNIT_REV_REG); pr_info("PCI: bus%u revision %x\n", sys->busnr, val); @@ -273,6 +278,7 @@ static int __init rcar_pci_probe(struct platform_device *pdev) struct resource *cfg_res, *mem_res; struct rcar_pci_priv *priv; void __iomem *reg; + struct clk *clk; cfg_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); reg = devm_ioremap_resource(&pdev->dev, cfg_res); @@ -288,6 +294,12 @@ static int __init rcar_pci_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; + clk = devm_clk_get(&pdev->dev, "usbpci"); + if (IS_ERR(clk)) { + dev_err(&pdev->dev, "Can't get clock\n"); + return PTR_ERR(clk); + } + priv->mem_res = *mem_res; /* * The controller does not support/use port I/O, @@ -302,6 +314,8 @@ static int __init rcar_pci_probe(struct platform_device *pdev) priv->irq = platform_get_irq(pdev, 0); priv->reg = reg; + priv->clk = clk; + return rcar_pci_add_controller(priv); }