]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/arm/mach-msm/smd.c
arm: msm: smd: use either package v3 or v4 not both
[net-next-2.6.git] / arch / arm / mach-msm / smd.c
index 086fd77dc8912b432970dce2aa59d7b8bc3d050f..130b7a72bea1585af3c320690fa74d2c01b46105 100644 (file)
@@ -69,24 +69,32 @@ static void smd_diag(void);
 
 static unsigned last_heap_free = 0xffffffff;
 
-#define MSM_A2M_INT(n) (MSM_CSR_BASE + 0x400 + (n) * 4)
+static inline void msm_a2m_int(uint32_t irq)
+{
+#if defined(CONFIG_ARCH_MSM7X30)
+       writel(1 << irq, MSM_GCC_BASE + 0x8);
+#else
+       writel(1, MSM_CSR_BASE + 0x400 + (irq * 4));
+#endif
+}
+
 
 static inline void notify_other_smsm(void)
 {
-       writel(1, MSM_A2M_INT(5));
+       msm_a2m_int(5);
 #ifdef CONFIG_QDSP6
-       writel(1, MSM_A2M_INT(8));
+       msm_a2m_int(8);
 #endif
 }
 
 static inline void notify_modem_smd(void)
 {
-       writel(1, MSM_A2M_INT(0));
+       msm_a2m_int(0);
 }
 
 static inline void notify_dsp_smd(void)
 {
-       writel(1, MSM_A2M_INT(8));
+       msm_a2m_int(8);
 }
 
 static void smd_diag(void)
@@ -115,8 +123,6 @@ static void handle_modem_crash(void)
                ;
 }
 
-extern int (*msm_check_for_modem_crash)(void);
-
 uint32_t raw_smsm_get_state(enum smsm_state_item item)
 {
        return readl(smd_info.state + item * 4);
@@ -599,48 +605,6 @@ static int smd_packet_read(smd_channel_t *ch, void *data, int len)
        return r;
 }
 
-static int smd_alloc_v2(struct smd_channel *ch)
-{
-       struct smd_shared_v2 *shared2;
-       void *buffer;
-       unsigned buffer_sz;
-
-       shared2 = smem_alloc(SMEM_SMD_BASE_ID + ch->n, sizeof(*shared2));
-       buffer = smem_item(SMEM_SMD_FIFO_BASE_ID + ch->n, &buffer_sz);
-
-       if (!buffer)
-               return -1;
-
-       /* buffer must be a power-of-two size */
-       if (buffer_sz & (buffer_sz - 1))
-               return -1;
-
-       buffer_sz /= 2;
-       ch->send = &shared2->ch0;
-       ch->recv = &shared2->ch1;
-       ch->send_data = buffer;
-       ch->recv_data = buffer + buffer_sz;
-       ch->fifo_size = buffer_sz;
-       return 0;
-}
-
-static int smd_alloc_v1(struct smd_channel *ch)
-{
-       struct smd_shared_v1 *shared1;
-       shared1 = smem_alloc(ID_SMD_CHANNELS + ch->n, sizeof(*shared1));
-       if (!shared1) {
-               pr_err("smd_alloc_channel() cid %d does not exist\n", ch->n);
-               return -1;
-       }
-       ch->send = &shared1->ch0;
-       ch->recv = &shared1->ch1;
-       ch->send_data = shared1->data0;
-       ch->recv_data = shared1->data1;
-       ch->fifo_size = SMD_BUF_SIZE;
-       return 0;
-}
-
-
 static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type)
 {
        struct smd_channel *ch;
@@ -652,7 +616,7 @@ static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type)
        }
        ch->n = cid;
 
-       if (smd_alloc_v2(ch) && smd_alloc_v1(ch)) {
+       if (_smd_alloc_channel(ch)) {
                kfree(ch);
                return -1;
        }
@@ -896,9 +860,9 @@ static irqreturn_t smsm_irq_handler(int irq, void *data)
 
        if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
                pr_info("<SM %08x %08x>\n", apps, modm);
-       if (modm & SMSM_RESET) {
+       if (modm & SMSM_RESET)
                handle_modem_crash();
-       }
+
        do_smd_probe();
 
        spin_unlock_irqrestore(&smem_lock, flags);
@@ -1048,8 +1012,6 @@ int smd_core_init(void)
        return 0;
 }
 
-extern void msm_init_last_radio_log(struct module *);
-
 static int __init msm_smd_probe(struct platform_device *pdev)
 {
        pr_info("smd_init()\n");