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