diff options
Diffstat (limited to 'arch/arm/mach-omap2/mailbox.c')
-rw-r--r-- | arch/arm/mach-omap2/mailbox.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index b03cd06e055..4799561c5a9 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c | |||
@@ -70,6 +70,9 @@ struct omap_mbox2_priv { | |||
70 | 70 | ||
71 | static struct clk *mbox_ick_handle; | 71 | static struct clk *mbox_ick_handle; |
72 | 72 | ||
73 | static void omap2_mbox_enable_irq(struct omap_mbox *mbox, | ||
74 | omap_mbox_type_t irq); | ||
75 | |||
73 | static inline unsigned int mbox_read_reg(unsigned int reg) | 76 | static inline unsigned int mbox_read_reg(unsigned int reg) |
74 | { | 77 | { |
75 | return __raw_readl(mbox_base + reg); | 78 | return __raw_readl(mbox_base + reg); |
@@ -81,7 +84,7 @@ static inline void mbox_write_reg(unsigned int val, unsigned int reg) | |||
81 | } | 84 | } |
82 | 85 | ||
83 | /* Mailbox H/W preparations */ | 86 | /* Mailbox H/W preparations */ |
84 | static inline int omap2_mbox_startup(struct omap_mbox *mbox) | 87 | static int omap2_mbox_startup(struct omap_mbox *mbox) |
85 | { | 88 | { |
86 | unsigned int l; | 89 | unsigned int l; |
87 | 90 | ||
@@ -97,38 +100,40 @@ static inline int omap2_mbox_startup(struct omap_mbox *mbox) | |||
97 | l |= 0x00000011; | 100 | l |= 0x00000011; |
98 | mbox_write_reg(l, MAILBOX_SYSCONFIG); | 101 | mbox_write_reg(l, MAILBOX_SYSCONFIG); |
99 | 102 | ||
103 | omap2_mbox_enable_irq(mbox, IRQ_RX); | ||
104 | |||
100 | return 0; | 105 | return 0; |
101 | } | 106 | } |
102 | 107 | ||
103 | static inline void omap2_mbox_shutdown(struct omap_mbox *mbox) | 108 | static void omap2_mbox_shutdown(struct omap_mbox *mbox) |
104 | { | 109 | { |
105 | clk_disable(mbox_ick_handle); | 110 | clk_disable(mbox_ick_handle); |
106 | clk_put(mbox_ick_handle); | 111 | clk_put(mbox_ick_handle); |
107 | } | 112 | } |
108 | 113 | ||
109 | /* Mailbox FIFO handle functions */ | 114 | /* Mailbox FIFO handle functions */ |
110 | static inline mbox_msg_t omap2_mbox_fifo_read(struct omap_mbox *mbox) | 115 | static mbox_msg_t omap2_mbox_fifo_read(struct omap_mbox *mbox) |
111 | { | 116 | { |
112 | struct omap_mbox2_fifo *fifo = | 117 | struct omap_mbox2_fifo *fifo = |
113 | &((struct omap_mbox2_priv *)mbox->priv)->rx_fifo; | 118 | &((struct omap_mbox2_priv *)mbox->priv)->rx_fifo; |
114 | return (mbox_msg_t) mbox_read_reg(fifo->msg); | 119 | return (mbox_msg_t) mbox_read_reg(fifo->msg); |
115 | } | 120 | } |
116 | 121 | ||
117 | static inline void omap2_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg) | 122 | static void omap2_mbox_fifo_write(struct omap_mbox *mbox, mbox_msg_t msg) |
118 | { | 123 | { |
119 | struct omap_mbox2_fifo *fifo = | 124 | struct omap_mbox2_fifo *fifo = |
120 | &((struct omap_mbox2_priv *)mbox->priv)->tx_fifo; | 125 | &((struct omap_mbox2_priv *)mbox->priv)->tx_fifo; |
121 | mbox_write_reg(msg, fifo->msg); | 126 | mbox_write_reg(msg, fifo->msg); |
122 | } | 127 | } |
123 | 128 | ||
124 | static inline int omap2_mbox_fifo_empty(struct omap_mbox *mbox) | 129 | static int omap2_mbox_fifo_empty(struct omap_mbox *mbox) |
125 | { | 130 | { |
126 | struct omap_mbox2_fifo *fifo = | 131 | struct omap_mbox2_fifo *fifo = |
127 | &((struct omap_mbox2_priv *)mbox->priv)->rx_fifo; | 132 | &((struct omap_mbox2_priv *)mbox->priv)->rx_fifo; |
128 | return (mbox_read_reg(fifo->msg_stat) == 0); | 133 | return (mbox_read_reg(fifo->msg_stat) == 0); |
129 | } | 134 | } |
130 | 135 | ||
131 | static inline int omap2_mbox_fifo_full(struct omap_mbox *mbox) | 136 | static int omap2_mbox_fifo_full(struct omap_mbox *mbox) |
132 | { | 137 | { |
133 | struct omap_mbox2_fifo *fifo = | 138 | struct omap_mbox2_fifo *fifo = |
134 | &((struct omap_mbox2_priv *)mbox->priv)->tx_fifo; | 139 | &((struct omap_mbox2_priv *)mbox->priv)->tx_fifo; |
@@ -136,7 +141,7 @@ static inline int omap2_mbox_fifo_full(struct omap_mbox *mbox) | |||
136 | } | 141 | } |
137 | 142 | ||
138 | /* Mailbox IRQ handle functions */ | 143 | /* Mailbox IRQ handle functions */ |
139 | static inline void omap2_mbox_enable_irq(struct omap_mbox *mbox, | 144 | static void omap2_mbox_enable_irq(struct omap_mbox *mbox, |
140 | omap_mbox_type_t irq) | 145 | omap_mbox_type_t irq) |
141 | { | 146 | { |
142 | struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; | 147 | struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; |
@@ -147,7 +152,7 @@ static inline void omap2_mbox_enable_irq(struct omap_mbox *mbox, | |||
147 | mbox_write_reg(l, p->irqenable); | 152 | mbox_write_reg(l, p->irqenable); |
148 | } | 153 | } |
149 | 154 | ||
150 | static inline void omap2_mbox_disable_irq(struct omap_mbox *mbox, | 155 | static void omap2_mbox_disable_irq(struct omap_mbox *mbox, |
151 | omap_mbox_type_t irq) | 156 | omap_mbox_type_t irq) |
152 | { | 157 | { |
153 | struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; | 158 | struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; |
@@ -158,7 +163,7 @@ static inline void omap2_mbox_disable_irq(struct omap_mbox *mbox, | |||
158 | mbox_write_reg(l, p->irqenable); | 163 | mbox_write_reg(l, p->irqenable); |
159 | } | 164 | } |
160 | 165 | ||
161 | static inline void omap2_mbox_ack_irq(struct omap_mbox *mbox, | 166 | static void omap2_mbox_ack_irq(struct omap_mbox *mbox, |
162 | omap_mbox_type_t irq) | 167 | omap_mbox_type_t irq) |
163 | { | 168 | { |
164 | struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; | 169 | struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; |
@@ -167,7 +172,7 @@ static inline void omap2_mbox_ack_irq(struct omap_mbox *mbox, | |||
167 | mbox_write_reg(bit, p->irqstatus); | 172 | mbox_write_reg(bit, p->irqstatus); |
168 | } | 173 | } |
169 | 174 | ||
170 | static inline int omap2_mbox_is_irq(struct omap_mbox *mbox, | 175 | static int omap2_mbox_is_irq(struct omap_mbox *mbox, |
171 | omap_mbox_type_t irq) | 176 | omap_mbox_type_t irq) |
172 | { | 177 | { |
173 | struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; | 178 | struct omap_mbox2_priv *p = (struct omap_mbox2_priv *)mbox->priv; |