From patchwork Sat Jun 25 01:17:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: omar ramirez X-Patchwork-Id: 917962 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 p5P1J919004894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 25 Jun 2011 01:19:30 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QaHWS-00024U-KS; Sat, 25 Jun 2011 01:18:57 +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 1QaHWR-0004Eg-AO; Sat, 25 Jun 2011 01:18:55 +0000 Received: from na3sys009aog102.obsmtp.com ([74.125.149.69]) by canuck.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1QaHVo-00046h-IX for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2011 01:18:17 +0000 Received: from mail-yx0-f171.google.com ([209.85.213.171]) (using TLSv1) by na3sys009aob102.postini.com ([74.125.148.12]) with SMTP ID DSNKTgU3VSNEhwjtBhI5atIrqbp2JZXGL4CG@postini.com; Fri, 24 Jun 2011 18:18:16 PDT Received: by yxh35 with SMTP id 35so1482625yxh.30 for ; Fri, 24 Jun 2011 18:18:13 -0700 (PDT) Received: by 10.100.252.3 with SMTP id z3mr661619anh.69.1308964691696; Fri, 24 Jun 2011 18:18:11 -0700 (PDT) Received: from localhost.localdomain (dragon.ti.com [192.94.94.33]) by mx.google.com with ESMTPS id r10sm3051365anh.28.2011.06.24.18.18.10 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Jun 2011 18:18:10 -0700 (PDT) From: Omar Ramirez Luna To: Hiroshi Doyu Subject: [RFC PATCH 2/7] OMAP2+: devices: get the number of supported mailboxes Date: Fri, 24 Jun 2011 20:17:38 -0500 Message-Id: <1308964663-5669-3-git-send-email-omar.ramirez@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1308964663-5669-1-git-send-email-omar.ramirez@ti.com> References: <1308964663-5669-1-git-send-email-omar.ramirez@ti.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110624_211816_865117_14681178 X-CRM114-Status: GOOD ( 11.65 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.69 listed in list.dnswl.org] Cc: Omar Ramirez Luna , Russell King , Benoit Cousson , Fernando Guzman Lugo , Tony Lindgren , Felipe Contreras , lo , lak 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: , 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 25 Jun 2011 01:19:30 +0000 (UTC) Use hwmod data attributes to get the defined number of mailboxes on our current chip, and pass it through platform data. Signed-off-by: Omar Ramirez Luna --- arch/arm/mach-omap2/devices.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 5b8ca68..e1110f2 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -274,6 +275,8 @@ static inline void omap_init_mbox(void) { struct omap_hwmod *oh; struct omap_device *od; + struct omap_mailbox_dev_attr *mb_attr; + struct omap_mailbox_platform_data pdata; oh = omap_hwmod_lookup("mailbox"); if (!oh) { @@ -281,7 +284,10 @@ static inline void omap_init_mbox(void) return; } - od = omap_device_build("omap-mailbox", -1, oh, NULL, 0, + mb_attr = oh->dev_attr; + pdata.nr_mbox = mb_attr->nr_mbox; + + od = omap_device_build("omap-mailbox", -1, oh, &pdata, sizeof(pdata), mbox_latencies, ARRAY_SIZE(mbox_latencies), 0); WARN(IS_ERR(od), "%s: could not build device, err %ld\n", __func__, PTR_ERR(od));