From patchwork Tue Aug 9 14:05:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamlakant Patel X-Patchwork-Id: 9271339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AAAE860839 for ; Tue, 9 Aug 2016 14:17:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C53A28391 for ; Tue, 9 Aug 2016 14:17:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90FB6283E5; Tue, 9 Aug 2016 14:17:57 +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=-6.9 required=2.0 tests=BAYES_00,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 1428028391 for ; Tue, 9 Aug 2016 14:17:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752747AbcHIORw (ORCPT ); Tue, 9 Aug 2016 10:17:52 -0400 Received: from mail-gw2-out.broadcom.com ([216.31.210.63]:41504 "EHLO mail-gw2-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752737AbcHIORv (ORCPT ); Tue, 9 Aug 2016 10:17:51 -0400 X-IronPort-AV: E=Sophos;i="5.28,494,1464678000"; d="scan'208";a="102014608" Received: from mail-irv-18.broadcom.com ([10.15.198.37]) by mail-gw2-out.broadcom.com with ESMTP; 09 Aug 2016 07:46:26 -0700 Received: from mail-irva-12.broadcom.com (mail-irva-12.broadcom.com [10.11.16.101]) by mail-irv-18.broadcom.com (Postfix) with ESMTP id BEDE28202D; Tue, 9 Aug 2016 07:17:50 -0700 (PDT) Received: from linaro.ban.broadcom.com (unknown [10.131.60.135]) by mail-irva-12.broadcom.com (Postfix) with ESMTP id A407BA6280; Tue, 9 Aug 2016 07:17:49 -0700 (PDT) From: kamlakant.patel@broadcom.com To: Mark Brown Cc: Kamlakant Patel , linux-spi@vger.kernel.org, Jayachandran C Subject: [PATCH 2/2 v2] spi: xlp: Add ACPI support for Vulcan SPI controller Date: Tue, 9 Aug 2016 19:35:22 +0530 Message-Id: <1470751522-11060-2-git-send-email-kamlakant.patel@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470751522-11060-1-git-send-email-kamlakant.patel@broadcom.com> References: <1470751522-11060-1-git-send-email-kamlakant.patel@broadcom.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kamlakant Patel Add ACPI support for SPI controller on Broadcom Vulcan ARM64. Signed-off-by: Kamlakant Patel --- v1 -> v2: Fix error return code. drivers/spi/spi-xlp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-xlp.c b/drivers/spi/spi-xlp.c index 8f04fec..4071a72 100644 --- a/drivers/spi/spi-xlp.c +++ b/drivers/spi/spi-xlp.c @@ -11,6 +11,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ +#include #include #include #include @@ -405,8 +406,9 @@ static int xlp_spi_probe(struct platform_device *pdev) clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(clk)) { dev_err(&pdev->dev, "could not get spi clock\n"); - return -ENODEV; + return PTR_ERR(clk); } + xspi->spi_clk = clk_get_rate(clk); master = spi_alloc_master(&pdev->dev, 0); @@ -437,6 +439,14 @@ static int xlp_spi_probe(struct platform_device *pdev) return 0; } +#ifdef CONFIG_ACPI +static const struct acpi_device_id xlp_spi_acpi_match[] = { + { "BRCM900D", 0 }, + { }, +}; +MODULE_DEVICE_TABLE(acpi, xlp_spi_acpi_match); +#endif + static const struct of_device_id xlp_spi_dt_id[] = { { .compatible = "netlogic,xlp832-spi" }, { }, @@ -447,6 +457,7 @@ static struct platform_driver xlp_spi_driver = { .driver = { .name = "xlp-spi", .of_match_table = xlp_spi_dt_id, + .acpi_match_table = ACPI_PTR(xlp_spi_acpi_match), }, }; module_platform_driver(xlp_spi_driver);