From patchwork Fri Apr 12 12:56:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Fuzzey X-Patchwork-Id: 2435571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id CA1ECDF2A1 for ; Fri, 12 Apr 2013 12:57:41 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UQdXB-0006oY-8B; Fri, 12 Apr 2013 12:56:53 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UQdWk-0003Dd-St; Fri, 12 Apr 2013 12:56:26 +0000 Received: from mta1.parkeon.com ([91.121.43.66]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UQdWh-0003D5-FT for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2013 12:56:24 +0000 Received: from ip71.parkeon.com ([213.152.31.71] helo=mta2.parkeon.com) by mta1.parkeon.com with esmtp (Exim 4.76) (envelope-from ) id 1UQdWf-0004Ag-GH; Fri, 12 Apr 2013 14:56:21 +0200 Received: from [10.32.16.23] (helo=mail.besancon.parkeon.com) by mta2.parkeon.com with esmtp (Exim 4.77) (envelope-from ) id 1UQdWZ-0006BL-He; Fri, 12 Apr 2013 14:56:15 +0200 Received: from [10.32.51.221] (port=60324 helo=[127.0.0.1]) by mail.besancon.parkeon.com with esmtp (Exim 4.71) (envelope-from ) id 1UQdWf-0002ZA-AW; Fri, 12 Apr 2013 14:56:21 +0200 Subject: [PATCH] SPI: spidev: Add DT compatible string for spidev driver. To: Grant Likely , spi-devel-general@lists.sourceforge.net From: Martin Fuzzey Date: Fri, 12 Apr 2013 14:56:21 +0200 Message-ID: <20130412125621.9645.78102.stgit@localhost> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Virus-Scanned: by ClamAV at mta2.parkeon.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130412_085623_630573_FB2E5F3C X-CRM114-Status: GOOD ( 12.05 ) X-Spam-Score: -4.3 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -2.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The spidev driver is useful to allow userspace access to SPI devices that have no kernel SPI driver. However DT requires a compatible tree to allow the driver to be probed. To avoid having to modify the driver for every extra device add a generic "linux,spidev" compatible string that may be used in the DT to match such devices. Signed-off-by: Martin Fuzzey --- Documentation/devicetree/bindings/spi/spi-bus.txt | 3 +++ drivers/spi/spidev.c | 1 + 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt index 296015e..3176587 100644 --- a/Documentation/devicetree/bindings/spi/spi-bus.txt +++ b/Documentation/devicetree/bindings/spi/spi-bus.txt @@ -59,6 +59,9 @@ contain the following properties. If a gpio chipselect is used for the SPI slave the gpio number will be passed via the cs_gpio +For slave devices having no kernel driver the compatible string "linux,spidev" +may be used to enable access from userspace via the spidev driver. + SPI example for an MPC5200 SPI bus: spi@f00 { #address-cells = <1>; diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 2e0655d..c2447a8 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -646,6 +646,7 @@ static int spidev_remove(struct spi_device *spi) static const struct of_device_id spidev_dt_ids[] = { { .compatible = "rohm,dh2228fv" }, + { .compatible = "linux,spidev" }, {}, };