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