aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2010-08-04 09:10:38 -0400
committerTony Lindgren <tony@atomide.com>2010-08-04 09:10:38 -0400
commitd21872b3683ff37f73c68993749a6e6aeeaed265 (patch)
tree0a84ae436325d6e646fe987516fb6bfccfff8a1c /arch/arm/mach-omap1
parent80690ccc41f01df6edfb6684006824d8edff189e (diff)
parentb3e69146f43fa351aa3cdffe2e76ec42174da612 (diff)
Merge branch 'v2.6.35-omap-mailbox-for-next' of git://gitorious.org/~doyu/lk/mainline into omap-for-linus
Conflicts: arch/arm/mach-omap1/devices.c
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/mailbox.c55
1 files changed, 21 insertions, 34 deletions
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 4f5b3da3d559..1a85a421007f 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Mailbox reservation modules for DSP 2 * Mailbox reservation modules for OMAP1
3 * 3 *
4 * Copyright (C) 2006-2009 Nokia Corporation 4 * Copyright (C) 2006-2009 Nokia Corporation
5 * Written by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com> 5 * Written by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
@@ -9,13 +9,10 @@
9 * for more details. 9 * for more details.
10 */ 10 */
11 11
12#include <linux/kernel.h>
13#include <linux/resource.h>
14#include <linux/interrupt.h> 12#include <linux/interrupt.h>
15#include <linux/platform_device.h> 13#include <linux/platform_device.h>
16#include <linux/io.h> 14#include <linux/io.h>
17#include <plat/mailbox.h> 15#include <plat/mailbox.h>
18#include <mach/irqs.h>
19 16
20#define MAILBOX_ARM2DSP1 0x00 17#define MAILBOX_ARM2DSP1 0x00
21#define MAILBOX_ARM2DSP1b 0x04 18#define MAILBOX_ARM2DSP1b 0x04
@@ -83,7 +80,7 @@ static int omap1_mbox_fifo_full(struct omap_mbox *mbox)
83 struct omap_mbox1_fifo *fifo = 80 struct omap_mbox1_fifo *fifo =
84 &((struct omap_mbox1_priv *)mbox->priv)->rx_fifo; 81 &((struct omap_mbox1_priv *)mbox->priv)->rx_fifo;
85 82
86 return (mbox_read_reg(fifo->flag)); 83 return mbox_read_reg(fifo->flag);
87} 84}
88 85
89/* irq */ 86/* irq */
@@ -141,47 +138,37 @@ struct omap_mbox mbox_dsp_info = {
141 .ops = &omap1_mbox_ops, 138 .ops = &omap1_mbox_ops,
142 .priv = &omap1_mbox_dsp_priv, 139 .priv = &omap1_mbox_dsp_priv,
143}; 140};
144EXPORT_SYMBOL(mbox_dsp_info); 141
142struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL };
145 143
146static int __devinit omap1_mbox_probe(struct platform_device *pdev) 144static int __devinit omap1_mbox_probe(struct platform_device *pdev)
147{ 145{
148 struct resource *res; 146 struct resource *mem;
147 int ret;
148 int i;
149 struct omap_mbox **list;
149 150
150 if (pdev->num_resources != 2) { 151 list = omap1_mboxes;
151 dev_err(&pdev->dev, "invalid number of resources: %d\n", 152 list[0]->irq = platform_get_irq_byname(pdev, "dsp");
152 pdev->num_resources);
153 return -ENODEV;
154 }
155 153
156 /* MBOX base */ 154 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
157 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 155 mbox_base = ioremap(mem->start, resource_size(mem));
158 if (unlikely(!res)) { 156 if (!mbox_base)
159 dev_err(&pdev->dev, "invalid mem resource\n"); 157 return -ENOMEM;
160 return -ENODEV;
161 }
162 158
163 mbox_base = ioremap(res->start, resource_size(res)); 159 ret = omap_mbox_register(&pdev->dev, list);
164 if (!mbox_base) { 160 if (ret) {
165 dev_err(&pdev->dev, "ioremap failed\n");
166 return -ENODEV;
167 }
168
169 /* DSP IRQ */
170 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
171 if (unlikely(!res)) {
172 dev_err(&pdev->dev, "invalid irq resource\n");
173 iounmap(mbox_base); 161 iounmap(mbox_base);
174 return -ENODEV; 162 return ret;
175 } 163 }
176 mbox_dsp_info.irq = res->start;
177 164
178 return omap_mbox_register(&pdev->dev, &mbox_dsp_info); 165 return 0;
179} 166}
180 167
181static int __devexit omap1_mbox_remove(struct platform_device *pdev) 168static int __devexit omap1_mbox_remove(struct platform_device *pdev)
182{ 169{
183 omap_mbox_unregister(&mbox_dsp_info); 170 omap_mbox_unregister();
184 171 iounmap(mbox_base);
185 return 0; 172 return 0;
186} 173}
187 174
@@ -189,7 +176,7 @@ static struct platform_driver omap1_mbox_driver = {
189 .probe = omap1_mbox_probe, 176 .probe = omap1_mbox_probe,
190 .remove = __devexit_p(omap1_mbox_remove), 177 .remove = __devexit_p(omap1_mbox_remove),
191 .driver = { 178 .driver = {
192 .name = "omap1-mailbox", 179 .name = "omap-mailbox",
193 }, 180 },
194}; 181};
195 182