Commit 70eb98a1 authored by Hiroshi DOYU's avatar Hiroshi DOYU Committed by Juha Yrjola

ARM: OMAP: DSPGW: mailbox build fix

Signed-off-by: default avatarHiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: default avatarJuha Yrjola <juha.yrjola@solidboot.com>
parent 58bbb19f
...@@ -212,7 +212,7 @@ static void nokia770_audio_pwr_down(void) ...@@ -212,7 +212,7 @@ static void nokia770_audio_pwr_down(void)
schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */ schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */
} }
static void static int
nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage) nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage)
{ {
down(&audio_pwr_sem); down(&audio_pwr_sem);
...@@ -221,9 +221,10 @@ nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage) ...@@ -221,9 +221,10 @@ nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage)
/* force audio_pwr_state = 0, even if it was 1. */ /* force audio_pwr_state = 0, even if it was 1. */
audio_pwr_state = 0; audio_pwr_state = 0;
up(&audio_pwr_sem); up(&audio_pwr_sem);
return 0;
} }
static void static int
nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage) nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage)
{ {
down(&audio_pwr_sem); down(&audio_pwr_sem);
...@@ -240,6 +241,7 @@ nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage) ...@@ -240,6 +241,7 @@ nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage)
break; break;
} }
up(&audio_pwr_sem); up(&audio_pwr_sem);
return 0;
} }
static struct dsp_kfunc_device nokia770_audio_device = { static struct dsp_kfunc_device nokia770_audio_device = {
...@@ -263,7 +265,7 @@ static __init int omap_dsp_init(void) ...@@ -263,7 +265,7 @@ static __init int omap_dsp_init(void)
if (ret) { if (ret) {
printk(KERN_ERR printk(KERN_ERR
"KFUNC device registration faild: %s\n", "KFUNC device registration faild: %s\n",
dsp_audio_device.name); nokia770_audio_device.name);
goto out; goto out;
} }
return 0; return 0;
......
...@@ -9,8 +9,10 @@ ...@@ -9,8 +9,10 @@
* for more details. * for more details.
*/ */
#include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/resource.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <asm/arch/mailbox.h> #include <asm/arch/mailbox.h>
#include <asm/arch/irqs.h> #include <asm/arch/irqs.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -28,9 +30,9 @@ ...@@ -28,9 +30,9 @@
unsigned long mbox_base; unsigned long mbox_base;
struct omap_mbox1_fifo { struct omap_mbox1_fifo {
void *cmd; unsigned long cmd;
void *data; unsigned long data;
void *flag; unsigned long flag;
}; };
struct omap_mbox1_priv { struct omap_mbox1_priv {
...@@ -51,7 +53,8 @@ static inline void mbox_write_reg(unsigned int val, unsigned int reg) ...@@ -51,7 +53,8 @@ static inline void mbox_write_reg(unsigned int val, unsigned int reg)
/* msg */ /* msg */
static inline mbox_msg_t omap1_mbox_fifo_read(struct omap_mbox *mbox) static inline mbox_msg_t omap1_mbox_fifo_read(struct omap_mbox *mbox)
{ {
struct omap_mbox1_fifo *fifo = &((struct omap_mbox1_priv *)mbox->priv)->rx_fifo; struct omap_mbox1_fifo *fifo =
&((struct omap_mbox1_priv *)mbox->priv)->rx_fifo;
mbox_msg_t msg; mbox_msg_t msg;
msg = mbox_read_reg(fifo->data); msg = mbox_read_reg(fifo->data);
...@@ -60,9 +63,11 @@ static inline mbox_msg_t omap1_mbox_fifo_read(struct omap_mbox *mbox) ...@@ -60,9 +63,11 @@ static inline mbox_msg_t omap1_mbox_fifo_read(struct omap_mbox *mbox)
return msg; return msg;
} }
static inline void omap1_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg) static inline void
omap1_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg)
{ {
struct omap_mbox1_fifo *fifo = &((struct omap_mbox1_priv *)mbox->priv)->rx_fifo; struct omap_mbox1_fifo *fifo =
&((struct omap_mbox1_priv *)mbox->priv)->rx_fifo;
mbox_write_reg(msg & 0xffff, fifo->data); mbox_write_reg(msg & 0xffff, fifo->data);
mbox_write_reg(msg >> 16, fifo->cmd); mbox_write_reg(msg >> 16, fifo->cmd);
...@@ -75,23 +80,29 @@ static inline int omap1_mbox_fifo_empty(struct omap_mbox *mbox) ...@@ -75,23 +80,29 @@ static inline int omap1_mbox_fifo_empty(struct omap_mbox *mbox)
static inline int omap1_mbox_fifo_full(struct omap_mbox *mbox) static inline int omap1_mbox_fifo_full(struct omap_mbox *mbox)
{ {
struct omap_mbox1_fifo *fifo =
&((struct omap_mbox1_priv *)mbox->priv)->rx_fifo;
return (mbox_read_reg(fifo->flag)); return (mbox_read_reg(fifo->flag));
} }
/* irq */ /* irq */
static inline void omap1_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq) static inline void
omap1_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq)
{ {
if (irq == IRQ_RX) if (irq == IRQ_RX)
enable_irq(mbox->irq); enable_irq(mbox->irq);
} }
static inline void omap1_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq) static inline void
omap1_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq)
{ {
if (irq == IRQ_RX) if (irq == IRQ_RX)
disble_irq(mbox->irq); disable_irq(mbox->irq);
} }
static inline int omap1_mbox_is_irq(struct omap_mbox *mbox, omap_mbox_type_t irq) static inline int
omap1_mbox_is_irq(struct omap_mbox *mbox, omap_mbox_type_t irq)
{ {
if (irq == IRQ_TX) if (irq == IRQ_TX)
return 0; return 0;
...@@ -111,22 +122,22 @@ struct omap_mbox_ops omap1_mbox_ops = { ...@@ -111,22 +122,22 @@ struct omap_mbox_ops omap1_mbox_ops = {
/* FIXME: the following struct should be created automatically by the user id */ /* FIXME: the following struct should be created automatically by the user id */
/* DSP */ /* DSP */
static struct omap_mbox2_priv omap1_mbox_dsp_priv = { static struct omap_mbox1_priv omap1_mbox_dsp_priv = {
.tx_fifo = { .tx_fifo = {
.cmd = (void *)MAILBOX_ARM2DSP1b, .cmd = MAILBOX_ARM2DSP1b,
.data = (void *)MAILBOX_ARM2DSP1, .data = MAILBOX_ARM2DSP1,
.flag = (void *)MAILBOX_ARM2DSP1_Flag, .flag = MAILBOX_ARM2DSP1_Flag,
}, },
.rx_fifo = { .rx_fifo = {
.cmd = (void *)MAILBOX_DSP2ARM1b, .cmd = MAILBOX_DSP2ARM1b,
.data = (void *)MAILBOX_DSP2ARM1, .data = MAILBOX_DSP2ARM1,
.flag = (void *)MAILBOX_DSP2ARM1_Flag, .flag = MAILBOX_DSP2ARM1_Flag,
}, },
}; };
struct omap_mbox mbox_dsp_info = { struct omap_mbox mbox_dsp_info = {
.name = "DSP", .name = "DSP",
.ops = &omap1_mbox_ops, .ops = &omap1_mbox_ops,
.priv = &omap1_mbox_dsp_priv, .priv = &omap1_mbox_dsp_priv,
}; };
...@@ -170,7 +181,7 @@ static int omap1_mbox_remove(struct platform_device *pdev) ...@@ -170,7 +181,7 @@ static int omap1_mbox_remove(struct platform_device *pdev)
} }
static struct platform_driver omap1_mbox_driver = { static struct platform_driver omap1_mbox_driver = {
.probe = omap1_mbox_probe, .probe = omap1_mbox_probe,
.remove = omap1_mbox_remove, .remove = omap1_mbox_remove,
.driver = { .driver = {
.name = "mailbox", .name = "mailbox",
......
...@@ -190,5 +190,8 @@ ...@@ -190,5 +190,8 @@
#define WSPR_DISABLE_0 (0x0000aaaa) #define WSPR_DISABLE_0 (0x0000aaaa)
#define WSPR_DISABLE_1 (0x00005555) #define WSPR_DISABLE_1 (0x00005555)
/* Mailbox */
#define OMAP16XX_MAILBOX_BASE (0xfffcf000)
#endif /* __ASM_ARCH_OMAP16XX_H */ #endif /* __ASM_ARCH_OMAP16XX_H */
...@@ -28,5 +28,8 @@ ...@@ -28,5 +28,8 @@
#define OMAP24XX_DSP_IPI_BASE (OMAP24XX_DSP_BASE + 0x1000000) #define OMAP24XX_DSP_IPI_BASE (OMAP24XX_DSP_BASE + 0x1000000)
#define OMAP24XX_DSP_MMU_BASE (OMAP24XX_DSP_BASE + 0x2000000) #define OMAP24XX_DSP_MMU_BASE (OMAP24XX_DSP_BASE + 0x2000000)
/* Mailbox */
#define OMAP24XX_MAILBOX_BASE (L4_24XX_BASE + 0x94000)
#endif /* __ASM_ARCH_OMAP24XX_H */ #endif /* __ASM_ARCH_OMAP24XX_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment