From patchwork Mon Jul 25 13:37:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 1004352 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6PDW7ha003980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 25 Jul 2011 13:32:28 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QlLGG-0004dO-23; Mon, 25 Jul 2011 13:31:56 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QlLGF-0006bM-NA; Mon, 25 Jul 2011 13:31:55 +0000 Received: from va3ehsobe005.messaging.microsoft.com ([216.32.180.31] helo=VA3EHSOBE005.bigfish.com) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QlLG3-0006Zg-Sj; Mon, 25 Jul 2011 13:31:44 +0000 Received: from mail129-va3-R.bigfish.com (10.7.14.246) by VA3EHSOBE005.bigfish.com (10.7.40.25) with Microsoft SMTP Server id 14.1.225.22; Mon, 25 Jul 2011 13:31:41 +0000 Received: from mail129-va3 (localhost.localdomain [127.0.0.1]) by mail129-va3-R.bigfish.com (Postfix) with ESMTP id B44727302BC; Mon, 25 Jul 2011 13:31:41 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bh8275dhz2dh87h2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail129-va3 (localhost.localdomain [127.0.0.1]) by mail129-va3 (MessageSwitch) id 131160065893755_15930; Mon, 25 Jul 2011 13:30:58 +0000 (UTC) Received: from VA3EHSMHS017.bigfish.com (unknown [10.7.14.252]) by mail129-va3.bigfish.com (Postfix) with ESMTP id 8F479670051; Mon, 25 Jul 2011 13:30:57 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS017.bigfish.com (10.7.99.27) with Microsoft SMTP Server (TLS) id 14.1.225.22; Mon, 25 Jul 2011 13:30:46 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.289.8; Mon, 25 Jul 2011 08:30:30 -0500 Received: from S2100-06.ap.freescale.net (S2100-06.ap.freescale.net [10.192.242.125]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p6PDUQfO017888; Mon, 25 Jul 2011 08:30:27 -0500 (CDT) From: Shawn Guo To: Subject: [PATCH] mtd/m25p80: add device tree probe support Date: Mon, 25 Jul 2011 21:37:43 +0800 Message-ID: <1311601063-16581-1-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110725_093144_053196_AA2BA772 X-CRM114-Status: GOOD ( 13.77 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [216.32.180.31 listed in list.dnswl.org] Cc: Artem Bityutskiy , patches@linaro.org, devicetree-discuss@lists.ozlabs.org, Grant Likely , Shawn Guo , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 25 Jul 2011 13:32:28 +0000 (UTC) It adds device tree probe support for m25p80 driver. Signed-off-by: Shawn Guo Cc: Grant Likely Cc: Artem Bityutskiy Acked-by: Grant Likely --- Documentation/devicetree/bindings/mtd/st-m25p.txt | 14 ++++++++++++++ drivers/mtd/devices/m25p80.c | 12 ++++++++++++ 2 files changed, 26 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/mtd/st-m25p.txt diff --git a/Documentation/devicetree/bindings/mtd/st-m25p.txt b/Documentation/devicetree/bindings/mtd/st-m25p.txt new file mode 100644 index 0000000..a8c0485 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/st-m25p.txt @@ -0,0 +1,14 @@ +* STMicroelectronics SPI Flash + +Required properties: +- compatible : "st,", "st,m25p". + +Examples: + +flash: m25p32@1 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "st,m25p32", "st,m25p"; + spi-max-frequency = <20000000>; + reg = <1>; +}; diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index e6ba034..d9d4101 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -767,6 +768,16 @@ static const struct spi_device_id m25p_ids[] = { }; MODULE_DEVICE_TABLE(spi, m25p_ids); +#ifdef CONFIG_OF +static const struct of_device_id m25p_dt_ids[] = { + { .compatible = "st,m25p", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, m25p_dt_ids); +#else +#define m25p_dt_ids NULL +#endif + static const struct spi_device_id *__devinit jedec_probe(struct spi_device *spi) { int tmp; @@ -986,6 +997,7 @@ static struct spi_driver m25p80_driver = { .name = "m25p80", .bus = &spi_bus_type, .owner = THIS_MODULE, + .of_match_table = m25p_dt_ids, }, .id_table = m25p_ids, .probe = m25p_probe,