diff options
author | Sudeep Holla <sudeep.holla@arm.com> | 2017-05-02 12:08:36 +0100 |
---|---|---|
committer | Amit Daniel Kachhap <amit.kachhap@arm.com> | 2018-07-30 12:30:48 +0530 |
commit | 685617317f7a8f6d811f1552cb487ca9841b101a (patch) | |
tree | c1b0a554acfac412f008ad316a530251ec268524 | |
parent | f873b420df2fb97e5989f753bd43c3a0a9b796e3 (diff) |
mailbox: arm_mhu: add support to read and record mbox-name
It's sometimes useful to identify the mailbox controller with the name
as specified in the devicetree via mbox-name property especially in a
system with multiple controllers.
This patch adds support to read and record the mailbox controller name.
Cc: Alexey Klimov <alexey.klimov@arm.com>
Cc: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
-rw-r--r-- | drivers/mailbox/arm_mhu.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mailbox/arm_mhu.c b/drivers/mailbox/arm_mhu.c index 9d38278030b8..4ed389d8f3dd 100644 --- a/drivers/mailbox/arm_mhu.c +++ b/drivers/mailbox/arm_mhu.c @@ -47,6 +47,7 @@ struct arm_mhu { struct mhu_link mlink[MHU_NUM_PCHANS]; struct mbox_controller mbox; struct device *dev; + const char *name; }; /** @@ -257,8 +258,8 @@ static struct mbox_chan *mhu_mbox_xlate(struct mbox_controller *mbox, chan->con_priv = chan_info; - dev_dbg(mbox->dev, "mbox: created channel phys: %d doorbell: %d\n", - pchan, doorbell); + dev_dbg(mbox->dev, "mbox: %s, created channel phys: %d doorbell: %d\n", + mhu->name, pchan, doorbell); return chan; } @@ -388,6 +389,10 @@ static int mhu_probe(struct amba_device *adev, const struct amba_id *id) return PTR_ERR(mhu->base); } + err = of_property_read_string(np, "mbox-name", &mhu->name); + if (err) + mhu->name = np->full_name; + chans = devm_kcalloc(dev, max_chans, sizeof(*chans), GFP_KERNEL); if (!chans) return -ENOMEM; @@ -439,7 +444,7 @@ static int mhu_probe(struct amba_device *adev, const struct amba_id *id) } } - dev_info(dev, "ARM MHU Mailbox registered\n"); + dev_info(dev, "%s mailbox registered\n", mhu->name); return 0; } |