From patchwork Tue May 2 13:55:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 98445 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1885280qgf; Tue, 2 May 2017 06:56:30 -0700 (PDT) X-Received: by 10.98.211.27 with SMTP id q27mr32752726pfg.126.1493733390639; Tue, 02 May 2017 06:56:30 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si6180111plv.44.2017.05.02.06.56.29; Tue, 02 May 2017 06:56:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751637AbdEBN4P (ORCPT + 25 others); Tue, 2 May 2017 09:56:15 -0400 Received: from foss.arm.com ([217.140.101.70]:44808 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751526AbdEBN4H (ORCPT ); Tue, 2 May 2017 09:56:07 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4100415A2; Tue, 2 May 2017 06:56:07 -0700 (PDT) Received: from e107155-lin.cambridge.arm.com (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5D18C3F23B; Tue, 2 May 2017 06:56:06 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org, Jassi Brar Cc: Sudeep Holla , Alexey Klimov , Jassi Brar Subject: [PATCH 6/6] mailbox: arm_mhu: add name support to record mbox-name Date: Tue, 2 May 2017 14:55:53 +0100 Message-Id: <1493733353-25812-7-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1493733353-25812-1-git-send-email-sudeep.holla@arm.com> References: <1493733353-25812-1-git-send-email-sudeep.holla@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Jassi Brar Signed-off-by: Sudeep Holla --- drivers/mailbox/arm_mhu.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) -- 2.7.4 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; }