All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: linux-kernel@vger.kernel.org, Jassi Brar <jassisinghbrar@gmail.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	Alexey Klimov <alexey.klimov@arm.com>,
	Jassi Brar <jaswinder.singh@linaro.org>
Subject: [PATCH 6/6] mailbox: arm_mhu: add name support to record mbox-name
Date: Tue,  2 May 2017 14:55:53 +0100	[thread overview]
Message-ID: <1493733353-25812-7-git-send-email-sudeep.holla@arm.com> (raw)
In-Reply-To: <1493733353-25812-1-git-send-email-sudeep.holla@arm.com>

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>
---
 drivers/mailbox/arm_mhu.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/mailbox/arm_mhu.c b/drivers/mailbox/arm_mhu.c
index 0f5ab2204649..9aa623a3aa9a 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 - physical: %d sub: %d\n",
-		pchan, subchan);
+	dev_dbg(mbox->dev, "mbox: %s, created channel - physical: %d sub: %d\n",
+		mhu->name, pchan, subchan);
 
 	return chan;
 }
@@ -361,6 +362,7 @@ static int mhu_probe(struct amba_device *adev, const struct amba_id *id)
 	struct mhu_mbox_pdata *pdata;
 	const struct of_device_id *match;
 	struct device *dev = &adev->dev;
+	struct device_node *np = dev->of_node;
 	int mhu_reg[MHU_NUM_PCHANS] = {
 		MHU_LP_OFFSET, MHU_HP_OFFSET, MHU_SEC_OFFSET,
 	};
@@ -390,6 +392,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;
@@ -441,7 +447,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;
 }
 
-- 
2.7.4

  parent reply	other threads:[~2017-05-02 13:56 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-02 13:55 [PATCH 0/6] mailbox: arm_mhu: add support for subchannels Sudeep Holla
2017-05-02 13:55 ` [PATCH 1/6] mailbox: arm_mhu: reorder header inclusion and drop unneeded ones Sudeep Holla
2017-05-02 13:55 ` [PATCH 2/6] Documentation: devicetree: add bindings to support ARM MHU subchannels Sudeep Holla
2017-05-08 16:10   ` Rob Herring
2017-05-08 16:10     ` Rob Herring
2017-05-08 16:46     ` Jassi Brar
2017-05-08 16:46       ` Jassi Brar
2017-05-08 17:07       ` Sudeep Holla
2017-05-08 17:07         ` Sudeep Holla
2017-05-08 17:52         ` Bjorn Andersson
2017-05-09  9:36           ` Sudeep Holla
2017-05-09  9:36             ` Sudeep Holla
2017-05-09  2:50         ` Jassi Brar
2017-05-09  2:50           ` Jassi Brar
2017-05-09  9:58           ` Sudeep Holla
2017-05-09  9:58             ` Sudeep Holla
2017-05-09 10:31             ` Jassi Brar
2017-05-09 10:31               ` Jassi Brar
2017-05-09 10:53               ` Sudeep Holla
2017-05-09 10:53                 ` Sudeep Holla
2017-05-09 11:55                 ` Jassi Brar
2017-05-09 12:41                   ` Sudeep Holla
2017-05-09 12:41                     ` Sudeep Holla
2017-05-09 13:29                     ` Jassi Brar
2017-05-09 13:29                       ` Jassi Brar
2017-05-09 14:20                       ` Sudeep Holla
2017-05-08 16:53     ` Sudeep Holla
2017-05-08 16:53       ` Sudeep Holla
2017-05-02 13:55 ` [PATCH 3/6] mailbox: arm_mhu: migrate to threaded irq handler Sudeep Holla
2017-05-02 13:55 ` [PATCH 4/6] mailbox: arm_mhu: re-factor data structure to add subchannel support Sudeep Holla
2017-05-02 13:55 ` [PATCH 5/6] mailbox: arm_mhu: add full support for sub-channels Sudeep Holla
2017-05-02 13:55 ` Sudeep Holla [this message]
2017-05-03  3:17 ` [PATCH 0/6] mailbox: arm_mhu: add support for subchannels Jassi Brar
2017-05-03  9:21   ` Sudeep Holla
2017-05-05 11:12     ` Jassi Brar
2017-05-05 11:23       ` Sudeep Holla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1493733353-25812-7-git-send-email-sudeep.holla@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=alexey.klimov@arm.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.