Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1649420

[PATCH v2 6/6] mailbox: arm_mhu: add support to read and record mbox-name

From Sudeep Holla <sudeep.holla@arm.com>
Newsgroups linux.kernel
Subject [PATCH v2 6/6] mailbox: arm_mhu: add support to read and record mbox-name
Date 2017-05-24 12:20 +0200
Message-ID <tKByy-11f-25@gated-at.bofh.it> (permalink)
References <tKByy-11f-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 79d2392d7f3b..08ed22e9e347 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;
 }
@@ -366,6 +367,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,
 	};
@@ -395,6 +397,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;
@@ -446,7 +452,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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/6] mailbox: arm_mhu: add support for doorbell mode Sudeep Holla <sudeep.holla@arm.com> - 2017-05-24 12:20 +0200
  [PATCH v2 3/6] mailbox: arm_mhu: migrate to threaded irq handler Sudeep Holla <sudeep.holla@arm.com> - 2017-05-24 12:20 +0200
  [PATCH v2 4/6] mailbox: arm_mhu: re-factor data structure to add doorbell support Sudeep Holla <sudeep.holla@arm.com> - 2017-05-24 12:20 +0200
  [PATCH v2 6/6] mailbox: arm_mhu: add support to read and record mbox-name Sudeep Holla <sudeep.holla@arm.com> - 2017-05-24 12:20 +0200
  [PATCH v2 2/6] Documentation: devicetree: add bindings to support ARM MHU doorbells Sudeep Holla <sudeep.holla@arm.com> - 2017-05-24 12:20 +0200
  [PATCH v2 1/6] mailbox: arm_mhu: reorder header inclusion and drop unneeded ones Sudeep Holla <sudeep.holla@arm.com> - 2017-05-24 12:20 +0200
  [PATCH v2 5/6] mailbox: arm_mhu: add full support for the doorbells Sudeep Holla <sudeep.holla@arm.com> - 2017-05-24 12:20 +0200
  Re: [PATCH v2 0/6] mailbox: arm_mhu: add support for doorbell mode Jassi Brar <jassisinghbrar@gmail.com> - 2017-05-24 13:00 +0200

csiph-web