From patchwork Thu Sep 13 00:08:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Ramirez Luna X-Patchwork-Id: 1449441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (unknown [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 7FF0EDF238 for ; Thu, 13 Sep 2012 00:29:07 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TBwz9-0007Ey-4a; Thu, 13 Sep 2012 00:08:47 +0000 Received: from mail-ob0-f177.google.com ([209.85.214.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TBwz3-0007Dv-E4 for linux-arm-kernel@lists.infradead.org; Thu, 13 Sep 2012 00:08:42 +0000 Received: by mail-ob0-f177.google.com with SMTP id ta17so3745218obb.36 for ; Wed, 12 Sep 2012 17:08:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=nPwjbv5f6Hrvjl/OC9gIaNz7GbHWC6uzMIWhjNqPLe4=; b=b2yKU7i/QKu3axt+VjN13oP3sQxenz9sHJ6++LZ6BhwS1jGqSX82dqULjqk32ocxe2 nAlkw5ImOUekOOGTEIdnCbhTIk8tIOm/L5baod5JCOS0Snydfzs1i3mMlYC3cGBuzZ4D TjR60+X9aWXKUgqe6MDTrytqe7UyLNJwFH2KvAwkyRcyPzDgD+8SKmoCHfT+Vr5XAOiV kG7h2ZcyxNo5HVdW7j9GwjDS0P20G+GRvNrUSxG70fas1fkkS212D92sshoBga9EjDY/ ey59/qCQCwSxbWr2/iS7/y4o9gb/eeFpaygYEX3u6jGMNd03RpjKv44pWHQgwG99Qb7i W42Q== Received: by 10.182.174.100 with SMTP id br4mr141570obc.62.1347494921068; Wed, 12 Sep 2012 17:08:41 -0700 (PDT) Received: from uda0273944.am.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id hz6sm21868178obb.1.2012.09.12.17.08.40 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Sep 2012 17:08:40 -0700 (PDT) From: Omar Ramirez Luna To: Tony Lindgren , Benoit Cousson Subject: [PATCH v2 1/2] OMAP: mailbox: add device tree support Date: Wed, 12 Sep 2012 19:08:14 -0500 Message-Id: <1347494898-16671-2-git-send-email-omar.luna@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1347494898-16671-1-git-send-email-omar.luna@linaro.org> References: <1347494898-16671-1-git-send-email-omar.luna@linaro.org> X-Gm-Message-State: ALoCoQnl5XPajku3pRAgOsNDxooWr6eyF8jYiwjvjoUHhlHmSEZT/I+Z/E8ZmOaMuKv6q7OrV9Ib X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.177 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Russell King , linux-doc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org, Omar Ramirez Luna , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Adapt driver to use DT if provided. Signed-off-by: Omar Ramirez Luna --- .../devicetree/bindings/arm/omap/mailbox.txt | 9 +++++++++ arch/arm/mach-omap2/devices.c | 3 +++ arch/arm/mach-omap2/mailbox.c | 12 ++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/omap/mailbox.txt diff --git a/Documentation/devicetree/bindings/arm/omap/mailbox.txt b/Documentation/devicetree/bindings/arm/omap/mailbox.txt new file mode 100644 index 0000000..c57c0d5 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/omap/mailbox.txt @@ -0,0 +1,9 @@ +OMAP Mailbox module + +Required properties: + compatible : should be "ti,omap2-mailbox" for OMAP2 mailbox + compatible : should be "ti,omap3-mailbox" for OMAP3 mailbox + compatible : should be "ti,omap4-mailbox" for OMAP4 mailbox + +Optional properties: + None diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index c00c689..19093fb 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -279,6 +279,9 @@ static inline void __init omap_init_mbox(void) struct omap_hwmod *oh; struct platform_device *pdev; + if (of_have_populated_dt()) + return; + oh = omap_hwmod_lookup("mailbox"); if (!oh) { pr_err("%s: unable to find hwmod\n", __func__); diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 6875be8..80beadf 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -400,11 +401,22 @@ static int __devexit omap2_mbox_remove(struct platform_device *pdev) return 0; } +#if defined(CONFIG_OF) +static const struct of_device_id omap_mailbox_of_match[] = { + { .compatible = "ti,omap2-mailbox" }, + { .compatible = "ti,omap3-mailbox" }, + { .compatible = "ti,omap4-mailbox" }, + {}, +}; +MODULE_DEVICE_TABLE(of, omap_mailbox_of_match); +#endif + static struct platform_driver omap2_mbox_driver = { .probe = omap2_mbox_probe, .remove = __devexit_p(omap2_mbox_remove), .driver = { .name = "omap-mailbox", + .of_match_table = of_match_ptr(omap_mailbox_of_match), }, };