diff options
-rw-r--r-- | drivers/staging/tidspbridge/core/io_sm.c | 8 | ||||
-rw-r--r-- | drivers/staging/tidspbridge/core/tiomap3430.c | 10 | ||||
-rw-r--r-- | drivers/staging/tidspbridge/include/dspbridge/io_sm.h | 21 |
3 files changed, 18 insertions, 21 deletions
diff --git a/drivers/staging/tidspbridge/core/io_sm.c b/drivers/staging/tidspbridge/core/io_sm.c index 571864555dd..27e0aa81a58 100644 --- a/drivers/staging/tidspbridge/core/io_sm.c +++ b/drivers/staging/tidspbridge/core/io_sm.c | |||
@@ -949,7 +949,7 @@ func_end: | |||
949 | * Calls the Bridge's CHNL_ISR to determine if this interrupt is ours, then | 949 | * Calls the Bridge's CHNL_ISR to determine if this interrupt is ours, then |
950 | * schedules a DPC to dispatch I/O. | 950 | * schedules a DPC to dispatch I/O. |
951 | */ | 951 | */ |
952 | void io_mbox_msg(u32 msg) | 952 | int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg) |
953 | { | 953 | { |
954 | struct io_mgr *pio_mgr; | 954 | struct io_mgr *pio_mgr; |
955 | struct dev_object *dev_obj; | 955 | struct dev_object *dev_obj; |
@@ -959,9 +959,9 @@ void io_mbox_msg(u32 msg) | |||
959 | dev_get_io_mgr(dev_obj, &pio_mgr); | 959 | dev_get_io_mgr(dev_obj, &pio_mgr); |
960 | 960 | ||
961 | if (!pio_mgr) | 961 | if (!pio_mgr) |
962 | return; | 962 | return NOTIFY_BAD; |
963 | 963 | ||
964 | pio_mgr->intr_val = (u16)msg; | 964 | pio_mgr->intr_val = (u16)((u32)msg); |
965 | if (pio_mgr->intr_val & MBX_PM_CLASS) | 965 | if (pio_mgr->intr_val & MBX_PM_CLASS) |
966 | io_dispatch_pm(pio_mgr); | 966 | io_dispatch_pm(pio_mgr); |
967 | 967 | ||
@@ -973,7 +973,7 @@ void io_mbox_msg(u32 msg) | |||
973 | spin_unlock_irqrestore(&pio_mgr->dpc_lock, flags); | 973 | spin_unlock_irqrestore(&pio_mgr->dpc_lock, flags); |
974 | tasklet_schedule(&pio_mgr->dpc_tasklet); | 974 | tasklet_schedule(&pio_mgr->dpc_tasklet); |
975 | } | 975 | } |
976 | return; | 976 | return NOTIFY_OK; |
977 | } | 977 | } |
978 | 978 | ||
979 | /* | 979 | /* |
diff --git a/drivers/staging/tidspbridge/core/tiomap3430.c b/drivers/staging/tidspbridge/core/tiomap3430.c index c3126e2e23f..a3f69f6f505 100644 --- a/drivers/staging/tidspbridge/core/tiomap3430.c +++ b/drivers/staging/tidspbridge/core/tiomap3430.c | |||
@@ -223,6 +223,10 @@ static struct bridge_drv_interface drv_interface_fxns = { | |||
223 | bridge_msg_set_queue_id, | 223 | bridge_msg_set_queue_id, |
224 | }; | 224 | }; |
225 | 225 | ||
226 | static struct notifier_block dsp_mbox_notifier = { | ||
227 | .notifier_call = io_mbox_msg, | ||
228 | }; | ||
229 | |||
226 | static inline void flush_all(struct bridge_dev_context *dev_context) | 230 | static inline void flush_all(struct bridge_dev_context *dev_context) |
227 | { | 231 | { |
228 | if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION || | 232 | if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION || |
@@ -553,7 +557,7 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, | |||
553 | * Enable Mailbox events and also drain any pending | 557 | * Enable Mailbox events and also drain any pending |
554 | * stale messages. | 558 | * stale messages. |
555 | */ | 559 | */ |
556 | dev_context->mbox = omap_mbox_get("dsp"); | 560 | dev_context->mbox = omap_mbox_get("dsp", &dsp_mbox_notifier); |
557 | if (IS_ERR(dev_context->mbox)) { | 561 | if (IS_ERR(dev_context->mbox)) { |
558 | dev_context->mbox = NULL; | 562 | dev_context->mbox = NULL; |
559 | pr_err("%s: Failed to get dsp mailbox handle\n", | 563 | pr_err("%s: Failed to get dsp mailbox handle\n", |
@@ -563,8 +567,6 @@ static int bridge_brd_start(struct bridge_dev_context *dev_ctxt, | |||
563 | 567 | ||
564 | } | 568 | } |
565 | if (!status) { | 569 | if (!status) { |
566 | dev_context->mbox->rxq->callback = (int (*)(void *))io_mbox_msg; | ||
567 | |||
568 | /*PM_IVA2GRPSEL_PER = 0xC0;*/ | 570 | /*PM_IVA2GRPSEL_PER = 0xC0;*/ |
569 | temp = readl(resources->dw_per_pm_base + 0xA8); | 571 | temp = readl(resources->dw_per_pm_base + 0xA8); |
570 | temp = (temp & 0xFFFFFF30) | 0xC0; | 572 | temp = (temp & 0xFFFFFF30) | 0xC0; |
@@ -685,7 +687,7 @@ static int bridge_brd_stop(struct bridge_dev_context *dev_ctxt) | |||
685 | /* Disable the mailbox interrupts */ | 687 | /* Disable the mailbox interrupts */ |
686 | if (dev_context->mbox) { | 688 | if (dev_context->mbox) { |
687 | omap_mbox_disable_irq(dev_context->mbox, IRQ_RX); | 689 | omap_mbox_disable_irq(dev_context->mbox, IRQ_RX); |
688 | omap_mbox_put(dev_context->mbox); | 690 | omap_mbox_put(dev_context->mbox, &dsp_mbox_notifier); |
689 | dev_context->mbox = NULL; | 691 | dev_context->mbox = NULL; |
690 | } | 692 | } |
691 | /* Reset IVA2 clocks*/ | 693 | /* Reset IVA2 clocks*/ |
diff --git a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h index 18aec55d864..8242c70e09d 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/io_sm.h +++ b/drivers/staging/tidspbridge/include/dspbridge/io_sm.h | |||
@@ -72,22 +72,17 @@ extern void io_dpc(unsigned long ref_data); | |||
72 | /* | 72 | /* |
73 | * ======== io_mbox_msg ======== | 73 | * ======== io_mbox_msg ======== |
74 | * Purpose: | 74 | * Purpose: |
75 | * Main interrupt handler for the shared memory Bridge channel manager. | 75 | * Main message handler for the shared memory Bridge channel manager. |
76 | * Calls the Bridge's chnlsm_isr to determine if this interrupt is ours, | 76 | * Determine if this message is ours, then schedules a DPC to |
77 | * then schedules a DPC to dispatch I/O. | 77 | * dispatch I/O. |
78 | * Parameters: | 78 | * Parameters: |
79 | * ref_data: Pointer to the channel manager object for this board. | 79 | * self: Pointer to its own notifier_block struct. |
80 | * Set in an initial call to ISR_Install(). | 80 | * len: Length of message. |
81 | * msg: Message code received. | ||
81 | * Returns: | 82 | * Returns: |
82 | * TRUE if interrupt handled; FALSE otherwise. | 83 | * NOTIFY_OK if handled; NOTIFY_BAD otherwise. |
83 | * Requires: | ||
84 | * Must be in locked memory if executing in kernel mode. | ||
85 | * Must only call functions which are in locked memory if Kernel mode. | ||
86 | * Must only call asynchronous services. | ||
87 | * Interrupts are disabled and EOI for this interrupt has been sent. | ||
88 | * Ensures: | ||
89 | */ | 84 | */ |
90 | void io_mbox_msg(u32 msg); | 85 | int io_mbox_msg(struct notifier_block *self, unsigned long len, void *msg); |
91 | 86 | ||
92 | /* | 87 | /* |
93 | * ======== io_request_chnl ======== | 88 | * ======== io_request_chnl ======== |