/** * X-Gene SlimPRO mailbox channel information * * @dev: Device to which it is attached * @chan: Pointer to mailbox communication channel * @reg: Base address to access channel registers * @irq: Interrupt number of the channel * @rx_msg: Received message storage
*/ struct slimpro_mbox_chan { struct device *dev; struct mbox_chan *chan; void __iomem *reg; int irq;
u32 rx_msg[3];
};
/** * X-Gene SlimPRO Mailbox controller data * * X-Gene SlimPRO Mailbox controller has 8 communication channels. * Each channel has a separate IRQ number assigned to it. * * @mb_ctrl: Representation of the communication channel controller * @mc: Array of SlimPRO mailbox channels of the controller * @chans: Array of mailbox communication channels *
*/ struct slimpro_mbox { struct mbox_controller mb_ctrl; struct slimpro_mbox_chan mc[MBOX_CNT]; struct mbox_chan chans[MBOX_CNT];
};
staticint slimpro_mbox_probe(struct platform_device *pdev)
{ struct slimpro_mbox *ctx; void __iomem *mb_base; int rc; int i;
ctx = devm_kzalloc(&pdev->dev, sizeof(struct slimpro_mbox), GFP_KERNEL); if (!ctx) return -ENOMEM;
platform_set_drvdata(pdev, ctx);
mb_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mb_base)) return PTR_ERR(mb_base);
/* Setup mailbox links */ for (i = 0; i < MBOX_CNT; i++) {
ctx->mc[i].irq = platform_get_irq(pdev, i); if (ctx->mc[i].irq < 0) { if (i == 0) {
dev_err(&pdev->dev, "no available IRQ\n"); return -EINVAL;
}
dev_info(&pdev->dev, "no IRQ for channel %d\n", i); break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.