From patchwork Fri Jun 2 03:21:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 770056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wf92Z4B5sz9s4q for ; Fri, 2 Jun 2017 13:40:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mF1DA1mc"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="d/cV+4k/"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="KtJeNvjZ"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=tObE61QAkRjfXvmoBG/Sp2wbdmgCeooVZpR9tYYxQk8=; b=mF1DA1mcdW7FEOLKeZghvGWX9H BjC879nXdM8lcGGEQaqMOF6Om2PtBjnj58OB+lwcNLHkOe6htMN5et/tq0fqyTidS2svYsK3l8UK0 BFpwmEi85rZxjnBHUPpW5v3cXUcNPLUDA6oyv7Kw3zH9UMmmo9mc8Es5vlyndHjMl1OItvPXBIAt8 KYLcEY/MuYWovSWiM+R4gKB/g2zY4IYtXkhB2vMgQz8esHNWMmkOXb9h78rjiI1beNvv4qi2hMUOu EbGBrOP3zuBQnOQZ35/Ad3CICtczxu2ubV6xIgcG5LA+um+SJDbUSkPEWBkSJdu0Q7pq/1j5qXHC6 3qyeOymQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dGdRP-0003rW-GR; Fri, 02 Jun 2017 03:39:59 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dGdRN-0003ko-UG for linux-mtd@bombadil.infradead.org; Fri, 02 Jun 2017 03:39:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CpnskMu3yt/1aVGG8keSKl90W89bvAdGZSupX8PlhFk=; b=d/cV+4k/V7oaE8YB8hvYebqTX wJdfUJ7nztur1ildk8OM0h/6zyDCdh1js+dxInSLFxFTdsgLbVLI7V9DFO62rmfRAjlyh0AuOkDB6 nbHzQAuid6vPJ/T5JVSXK9OBGMAj6CFLuzkR8IU+bH30jluDdf7DCbl5R1xLc64mTVQ+o+eTTl1w7 gdOZzkOLqRIPtbfk+ClWtwUSJf7qoEbR0I/MDcKOG6BJsGqdsmrTwn7xS2IqmMX6ZELpNfqNSFg5/ eKw2m0TbODBIRU624E2ts147sUIbL+C07RBCuqdpy/ozayOZm+acc9yYO7uurt6gCBJNY8HTE4XNK Z4JWQTUYQ==; Received: from gate2.alliedtelesis.co.nz ([2001:df5:b000:5::4]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dGd9y-0006ZI-A7 for linux-mtd@lists.infradead.org; Fri, 02 Jun 2017 03:22:01 +0000 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 07B1F8365D; Fri, 2 Jun 2017 15:21:26 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail; t=1496373686; bh=CpnskMu3yt/1aVGG8keSKl90W89bvAdGZSupX8PlhFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KtJeNvjZilEB33AZShfyPSWsGbcj2JPLY/YKHSUDqKRfYvtkKXiwAo0sTCiNgQirQ DmoOMzb3pUXzmJSJPj8a6oaJ7MO/54I6d1f0JSywnJbXYO0vMYvWXaYSUnrp2ASaWU RPJ8Wk0MC+tEHleJ1I5oTlJrEXd1QGE5uwGsMtIo= Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7, 5, 7, 9061) id ; Fri, 02 Jun 2017 15:21:25 +1200 Received: from chrisp-dl.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by smtp (Postfix) with ESMTP id 1F91113EFE4; Fri, 2 Jun 2017 15:21:28 +1200 (NZST) Received: by chrisp-dl.atlnz.lc (Postfix, from userid 1030) id 4FFD41E1D78; Fri, 2 Jun 2017 15:21:25 +1200 (NZST) From: Chris Packham To: linux-mtd@lists.infradead.org, andrew@lunn.ch, dwmw2@infradead.org, boris.brezillon@free-electrons.com Subject: [PATCH v5 1/5] mtd: mchp23k256: Add OF device ID table Date: Fri, 2 Jun 2017 15:21:15 +1200 Message-Id: <20170602032119.22282-2-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170602032119.22282-1-chris.packham@alliedtelesis.co.nz> References: <20170602032119.22282-1-chris.packham@alliedtelesis.co.nz> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170602_042158_992065_F8EDA02B X-CRM114-Status: GOOD ( 17.57 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-2.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 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] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Richard Weinberger , linux-kernel@vger.kernel.org, Rob Herring , Marek Vasut , Chris Packham , Cyrille Pitchen , Brian Norris MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This allows registering of this device via a Device Tree. Signed-off-by: Chris Packham Reviewed-by: Andrew Lunn Tested-by: Andrew Lunn --- Changes in v2: - collect review/test from Andrew Changes in v3: - None Changes in v4: - None Changes in v5: - None (note this has already been applied to l2-mtd.git) .../devicetree/bindings/mtd/microchip,mchp23k256.txt | 18 ++++++++++++++++++ drivers/mtd/devices/mchp23k256.c | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/microchip,mchp23k256.txt diff --git a/Documentation/devicetree/bindings/mtd/microchip,mchp23k256.txt b/Documentation/devicetree/bindings/mtd/microchip,mchp23k256.txt new file mode 100644 index 000000000000..25e5ad38b0f0 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/microchip,mchp23k256.txt @@ -0,0 +1,18 @@ +* MTD SPI driver for Microchip 23K256 (and similar) serial SRAM + +Required properties: +- #address-cells, #size-cells : Must be present if the device has sub-nodes + representing partitions. +- compatible : Must be "microchip,mchp23k256" +- reg : Chip-Select number +- spi-max-frequency : Maximum frequency of the SPI bus the chip can operate at + +Example: + + spi-sram@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "microchip,mchp23k256"; + reg = <0>; + spi-max-frequency = <20000000>; + }; diff --git a/drivers/mtd/devices/mchp23k256.c b/drivers/mtd/devices/mchp23k256.c index e237db9f1bdb..9d8306a15833 100644 --- a/drivers/mtd/devices/mchp23k256.c +++ b/drivers/mtd/devices/mchp23k256.c @@ -19,6 +19,7 @@ #include #include #include +#include struct mchp23k256_flash { struct spi_device *spi; @@ -166,9 +167,16 @@ static int mchp23k256_remove(struct spi_device *spi) return mtd_device_unregister(&flash->mtd); } +static const struct of_device_id mchp23k256_of_table[] = { + { .compatible = "microchip,mchp23k256" }, + {} +}; +MODULE_DEVICE_TABLE(of, mchp23k256_of_table); + static struct spi_driver mchp23k256_driver = { .driver = { .name = "mchp23k256", + .of_match_table = of_match_ptr(mchp23k256_of_table), }, .probe = mchp23k256_probe, .remove = mchp23k256_remove,