Lines Matching refs:mdev
36 #define MBOX_BASE(mdev, inst) ((mdev)->base + ((inst) * 4)) argument
81 struct sti_mbox_device *mdev; member
89 struct sti_mbox_device *mdev = chan_info->mdev; in sti_mbox_channel_is_enabled() local
93 return mdev->enabled[instance] & BIT(channel); in sti_mbox_channel_is_enabled()
122 struct sti_mbox_device *mdev = chan_info->mdev; in sti_mbox_enable_channel() local
126 void __iomem *base = MBOX_BASE(mdev, instance); in sti_mbox_enable_channel()
128 spin_lock_irqsave(&mdev->lock, flags); in sti_mbox_enable_channel()
129 mdev->enabled[instance] |= BIT(channel); in sti_mbox_enable_channel()
131 spin_unlock_irqrestore(&mdev->lock, flags); in sti_mbox_enable_channel()
137 struct sti_mbox_device *mdev = chan_info->mdev; in sti_mbox_disable_channel() local
141 void __iomem *base = MBOX_BASE(mdev, instance); in sti_mbox_disable_channel()
143 spin_lock_irqsave(&mdev->lock, flags); in sti_mbox_disable_channel()
144 mdev->enabled[instance] &= ~BIT(channel); in sti_mbox_disable_channel()
146 spin_unlock_irqrestore(&mdev->lock, flags); in sti_mbox_disable_channel()
152 struct sti_mbox_device *mdev = chan_info->mdev; in sti_mbox_clear_irq() local
155 void __iomem *base = MBOX_BASE(mdev, instance); in sti_mbox_clear_irq()
160 static struct mbox_chan *sti_mbox_irq_to_channel(struct sti_mbox_device *mdev, in sti_mbox_irq_to_channel() argument
163 struct mbox_controller *mbox = mdev->mbox; in sti_mbox_irq_to_channel()
167 void __iomem *base = MBOX_BASE(mdev, instance); in sti_mbox_irq_to_channel()
193 struct sti_mbox_device *mdev = data; in sti_mbox_thread_handler() local
194 struct sti_mbox_pdata *pdata = dev_get_platdata(mdev->dev); in sti_mbox_thread_handler()
200 chan = sti_mbox_irq_to_channel(mdev, instance); in sti_mbox_thread_handler()
215 struct sti_mbox_device *mdev = data; in sti_mbox_irq_handler() local
216 struct sti_mbox_pdata *pdata = dev_get_platdata(mdev->dev); in sti_mbox_irq_handler()
223 chan = sti_mbox_irq_to_channel(mdev, instance); in sti_mbox_irq_handler()
229 dev_warn(mdev->dev, in sti_mbox_irq_handler()
232 mdev->name, chan_info->instance, in sti_mbox_irq_handler()
233 chan_info->channel, mdev->enabled[instance]); in sti_mbox_irq_handler()
246 dev_err(mdev->dev, "Spurious IRQ - was a channel requested?\n"); in sti_mbox_irq_handler()
254 struct sti_mbox_device *mdev = chan_info->mdev; in sti_mbox_tx_is_ready() local
257 void __iomem *base = MBOX_BASE(mdev, instance); in sti_mbox_tx_is_ready()
260 dev_dbg(mdev->dev, "Mbox: %s: inst: %d, chan: %d disabled\n", in sti_mbox_tx_is_ready()
261 mdev->name, instance, channel); in sti_mbox_tx_is_ready()
266 dev_dbg(mdev->dev, "Mbox: %s: inst: %d, chan: %d not ready\n", in sti_mbox_tx_is_ready()
267 mdev->name, instance, channel); in sti_mbox_tx_is_ready()
277 struct sti_mbox_device *mdev = chan_info->mdev; in sti_mbox_send_data() local
280 void __iomem *base = MBOX_BASE(mdev, instance); in sti_mbox_send_data()
285 dev_dbg(mdev->dev, in sti_mbox_send_data()
287 mdev->name, instance, channel); in sti_mbox_send_data()
303 struct mbox_controller *mbox = chan_info->mdev->mbox; in sti_mbox_shutdown_chan()
324 struct sti_mbox_device *mdev = dev_get_drvdata(mbox->dev); in sti_mbox_xlate() local
325 struct sti_mbox_pdata *pdata = dev_get_platdata(mdev->dev); in sti_mbox_xlate()
345 mbox->dev == chan_info->mdev->dev && in sti_mbox_xlate()
370 chan_info->mdev = mdev; in sti_mbox_xlate()
378 mdev->name, instance, channel); in sti_mbox_xlate()
408 struct sti_mbox_device *mdev; in sti_mbox_probe() local
422 mdev = devm_kzalloc(&pdev->dev, sizeof(*mdev), GFP_KERNEL); in sti_mbox_probe()
423 if (!mdev) in sti_mbox_probe()
426 platform_set_drvdata(pdev, mdev); in sti_mbox_probe()
429 mdev->base = devm_ioremap_resource(&pdev->dev, res); in sti_mbox_probe()
430 if (IS_ERR(mdev->base)) in sti_mbox_probe()
431 return PTR_ERR(mdev->base); in sti_mbox_probe()
433 ret = of_property_read_string(np, "mbox-name", &mdev->name); in sti_mbox_probe()
435 mdev->name = np->full_name; in sti_mbox_probe()
446 mdev->dev = &pdev->dev; in sti_mbox_probe()
447 mdev->mbox = mbox; in sti_mbox_probe()
449 spin_lock_init(&mdev->lock); in sti_mbox_probe()
456 mbox->dev = mdev->dev; in sti_mbox_probe()
469 "%s: Registered Tx only Mailbox\n", mdev->name); in sti_mbox_probe()
476 IRQF_ONESHOT, mdev->name, mdev); in sti_mbox_probe()
482 dev_info(&pdev->dev, "%s: Registered Tx/Rx Mailbox\n", mdev->name); in sti_mbox_probe()