From patchwork Fri Nov 23 10:15:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10695533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7458E1750 for ; Fri, 23 Nov 2018 10:16:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61E9F2C4DB for ; Fri, 23 Nov 2018 10:16:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50D802C4F9; Fri, 23 Nov 2018 10:16:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F26482C4DB for ; Fri, 23 Nov 2018 10:16:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503195AbeKWU7y (ORCPT ); Fri, 23 Nov 2018 15:59:54 -0500 Received: from mail.bootlin.com ([62.4.15.54]:54787 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503198AbeKWU7w (ORCPT ); Fri, 23 Nov 2018 15:59:52 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 326B620D92; Fri, 23 Nov 2018 11:16:11 +0100 (CET) Received: from localhost.localdomain (aaubervilliers-681-1-94-205.w90-88.abo.wanadoo.fr [90.88.35.205]) by mail.bootlin.com (Postfix) with ESMTPSA id C19A820DB0; Fri, 23 Nov 2018 11:16:00 +0100 (CET) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Rob Herring , Mark Rutland , Jens Axboe , Hans de Goede Cc: , , linux-ide@vger.kernel.org, linux-pm@vger.kernel.org, Thomas Petazzoni , Antoine Tenart , Maxime Chevallier , Nadav Haklai , Miquel Raynal Subject: [PATCH 5/7] ata: ahci: mvebu: add clock support Date: Fri, 23 Nov 2018 11:15:54 +0100 Message-Id: <20181123101556.29888-6-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181123101556.29888-1-miquel.raynal@bootlin.com> References: <20181123101556.29888-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add clock support to the ahci_mvebu.c driver. This is needed in order to get suspend to RAM working. Signed-off-by: Miquel Raynal --- drivers/ata/ahci_mvebu.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c index 902971bfe301..cad35806c3c2 100644 --- a/drivers/ata/ahci_mvebu.c +++ b/drivers/ata/ahci_mvebu.c @@ -195,6 +195,16 @@ static int ahci_mvebu_probe(struct platform_device *pdev) if (!hpriv->plat_data) return -EINVAL; + /* The clock property is absent in old bindings */ + hpriv->clks[0] = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(hpriv->clks[0])) { + if (PTR_ERR(hpriv->clks[0]) == -EPROBE_DEFER) + return PTR_ERR(hpriv->clks[0]); + + dev_warn(&pdev->dev, "no clock available\n"); + hpriv->clks[0] = NULL; + } + rc = ahci_platform_enable_resources(hpriv); if (rc) return rc;