staging: tidspbridge: replace mbox callback with notifier_call

Lately, mailbox callbacks have been replaced by notifier block
call chains, this needs to be changed in the users of mailbox,
otherwise compilation will break due to missing parameters.

For this new change to work, io_mbox_msg needs to be compatible
with the notifier_call definition.

Reported-by: Hari Kanigeri <h-kanigeri2@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by Omar Ramirez Luna and committed by Greg Kroah-Hartman 85d139c9 d1ce3184

+18 -21
+4 -4
drivers/staging/tidspbridge/core/io_sm.c
··· 949 949 * Calls the Bridge's CHNL_ISR to determine if this interrupt is ours, then 950 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 954 struct io_mgr *pio_mgr; 955 955 struct dev_object *dev_obj; ··· 959 959 dev_get_io_mgr(dev_obj, &pio_mgr); 960 960 961 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 965 if (pio_mgr->intr_val & MBX_PM_CLASS) 966 966 io_dispatch_pm(pio_mgr); 967 967 ··· 973 973 spin_unlock_irqrestore(&pio_mgr->dpc_lock, flags); 974 974 tasklet_schedule(&pio_mgr->dpc_tasklet); 975 975 } 976 - return; 976 + return NOTIFY_OK; 977 977 } 978 978 979 979 /*
+6 -4
drivers/staging/tidspbridge/core/tiomap3430.c
··· 223 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 230 static inline void flush_all(struct bridge_dev_context *dev_context) 227 231 { 228 232 if (dev_context->dw_brd_state == BRD_DSP_HIBERNATION || ··· 557 553 * Enable Mailbox events and also drain any pending 558 554 * stale messages. 559 555 */ 560 - dev_context->mbox = omap_mbox_get("dsp"); 556 + dev_context->mbox = omap_mbox_get("dsp", &dsp_mbox_notifier); 561 557 if (IS_ERR(dev_context->mbox)) { 562 558 dev_context->mbox = NULL; 563 559 pr_err("%s: Failed to get dsp mailbox handle\n", ··· 567 563 568 564 } 569 565 if (!status) { 570 - dev_context->mbox->rxq->callback = (int (*)(void *))io_mbox_msg; 571 - 572 566 /*PM_IVA2GRPSEL_PER = 0xC0;*/ 573 567 temp = readl(resources->dw_per_pm_base + 0xA8); 574 568 temp = (temp & 0xFFFFFF30) | 0xC0; ··· 687 685 /* Disable the mailbox interrupts */ 688 686 if (dev_context->mbox) { 689 687 omap_mbox_disable_irq(dev_context->mbox, IRQ_RX); 690 - omap_mbox_put(dev_context->mbox); 688 + omap_mbox_put(dev_context->mbox, &dsp_mbox_notifier); 691 689 dev_context->mbox = NULL; 692 690 } 693 691 /* Reset IVA2 clocks*/
+8 -13
drivers/staging/tidspbridge/include/dspbridge/io_sm.h
··· 72 72 /* 73 73 * ======== io_mbox_msg ======== 74 74 * Purpose: 75 - * Main interrupt handler for the shared memory Bridge channel manager. 76 - * Calls the Bridge's chnlsm_isr to determine if this interrupt is ours, 77 - * then schedules a DPC to dispatch I/O. 75 + * Main message handler for the shared memory Bridge channel manager. 76 + * Determine if this message is ours, then schedules a DPC to 77 + * dispatch I/O. 78 78 * Parameters: 79 - * ref_data: Pointer to the channel manager object for this board. 80 - * Set in an initial call to ISR_Install(). 79 + * self: Pointer to its own notifier_block struct. 80 + * len: Length of message. 81 + * msg: Message code received. 81 82 * Returns: 82 - * TRUE if interrupt handled; FALSE 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: 83 + * NOTIFY_OK if handled; NOTIFY_BAD otherwise. 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 88 * ======== io_request_chnl ========