From patchwork Fri Oct 25 04:53:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 3094171 Return-Path: X-Original-To: patchwork-spi-devel-general@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 513419F372 for ; Fri, 25 Oct 2013 04:53:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51BB220490 for ; Fri, 25 Oct 2013 04:53:41 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E0BB203EC for ; Fri, 25 Oct 2013 04:53:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VZZP0-0004P8-Tw; Fri, 25 Oct 2013 04:53:38 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1VZZP0-0004P3-1e for spi-devel-general@lists.sourceforge.net; Fri, 25 Oct 2013 04:53:38 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; envelope-from=kuninori.morimoto.gx@gmail.com; helo=mail-pa0-f41.google.com; Received: from mail-pa0-f41.google.com ([209.85.220.41]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1VZZOy-00041u-PI for spi-devel-general@lists.sourceforge.net; Fri, 25 Oct 2013 04:53:38 +0000 Received: by mail-pa0-f41.google.com with SMTP id bj1so4471548pad.0 for ; Thu, 24 Oct 2013 21:53:30 -0700 (PDT) X-Received: by 10.66.66.42 with SMTP id c10mr8177588pat.98.1382676810854; Thu, 24 Oct 2013 21:53:30 -0700 (PDT) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id iu7sm6414554pbc.45.2013.10.24.21.53.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 24 Oct 2013 21:53:29 -0700 (PDT) Date: Thu, 24 Oct 2013 21:53:29 -0700 (PDT) Message-ID: <87hac69cje.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH] spi/hspi: add device tree support To: Mark Brown , Mark Brown , Grant Likely MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") X-Spam-Score: -1.5 (-) X-Headers-End: 1VZZOy-00041u-PI Cc: spi-devel-general@lists.sourceforge.net, Simon , Kuninori Morimoto X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Support for loading the Renesas HSPI driver via devicetree. Signed-off-by: Kuninori Morimoto --- Documentation/devicetree/bindings/spi/sh-hspi.txt | 7 +++++++ drivers/spi/spi-sh-hspi.c | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/sh-hspi.txt diff --git a/Documentation/devicetree/bindings/spi/sh-hspi.txt b/Documentation/devicetree/bindings/spi/sh-hspi.txt new file mode 100644 index 0000000..30b57b1 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/sh-hspi.txt @@ -0,0 +1,7 @@ +Renesas HSPI. + +Required properties: +- compatible : "renesas,hspi" +- reg : Offset and length of the register set for the device +- interrupts : interrupt line used by HSPI + diff --git a/drivers/spi/spi-sh-hspi.c b/drivers/spi/spi-sh-hspi.c index e488a90..47acb20 100644 --- a/drivers/spi/spi-sh-hspi.c +++ b/drivers/spi/spi-sh-hspi.c @@ -303,6 +303,7 @@ static int hspi_probe(struct platform_device *pdev) master->setup = hspi_setup; master->cleanup = hspi_cleanup; master->mode_bits = SPI_CPOL | SPI_CPHA; + master->dev.of_node = pdev->dev.of_node; master->auto_runtime_pm = true; master->transfer_one_message = hspi_transfer_one_message; ret = spi_register_master(master); @@ -333,12 +334,19 @@ static int hspi_remove(struct platform_device *pdev) return 0; } +static struct of_device_id hspi_of_match[] = { + { .compatible = "renesas,hspi", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, hspi_of_match); + static struct platform_driver hspi_driver = { .probe = hspi_probe, .remove = hspi_remove, .driver = { .name = "sh-hspi", .owner = THIS_MODULE, + .of_match_table = hspi_of_match, }, }; module_platform_driver(hspi_driver);