From patchwork Wed May 24 10:16:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 100437 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp202112qge; Wed, 24 May 2017 03:18:25 -0700 (PDT) X-Received: by 10.84.164.193 with SMTP id l1mr28028631plg.154.1495621105298; Wed, 24 May 2017 03:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495621105; cv=none; d=google.com; s=arc-20160816; b=R+5grONP9x8AdU5llbVQ2ioh2HeBibZ1tkGbKAOdm8mkT3zI7FWfrFYIs6/KQ6Pw4t LW86m4AK8LmwN7oebEvU7TzpT4dzXFpSaGK8BqaNMoB2NdgeH+nvDLQp9/CBt2jADmlw yKvzxOB+vLeiyl5nXe3OSPTKj0SyRUwBPLnnDkPaGZSyqB8uI/dUoXWwSaOo45Ysu3j/ gNWYSK33TppTA4aZrHoRLOtiwQ6e+cfYAJEaGj0Ov6NPIzx6rd+Nl6yuFVQ2l1/Ju6sl lazCWbfVNZNVPhJ83I8KQcSzxu2UgBNnjP3KTs8VedVCXe7Pg2uoV4Dv37S/zfGu/Kc2 9NEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=i564DOyAsxvRvgbWFPWZ/RmXlDwoL7gU6W5JFrvcc40=; b=bYQc9fdEwyCaYW1HM6p/NO55C9gR93hVNsvd9Zz6ihifdBkhQ269a4eoViHTcJgh7R B9EnFQN6O7GhBGUXgcpj0qgSt+TOXR+TYvX/knK/MGf286Kb+FJiLOCB0PQQFk2U/WRh j5zmaVs5CdUOLjyI56hfyObbP4vnGAHn0jiS6EQKsKcU/V1icPSN0kou8ue9QmPdtAm6 PoxZAP56noHJULRujsXBTVsz2oHw/auefbfzyb/I+PuSKXGTvh0SOCpx956TLj7f+LJS ED5YKCYRlIVvzOTkWeP18mP2UNAcLUDdEFP3FRPTzs3VkWm0/D4Bh6aZ/PfHd0hcxlzL HxUQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si24352864pfk.205.2017.05.24.03.18.24; Wed, 24 May 2017 03:18:25 -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 S969354AbdEXKSV (ORCPT + 25 others); Wed, 24 May 2017 06:18:21 -0400 Received: from foss.arm.com ([217.140.101.70]:35540 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968581AbdEXKRH (ORCPT ); Wed, 24 May 2017 06:17: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 4F42315BF; Wed, 24 May 2017 03:17:07 -0700 (PDT) Received: from e107155-lin.cambridge.arm.com (unknown [10.1.211.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 38CEC3F578; Wed, 24 May 2017 03:17:06 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org, Jassi Brar Cc: Sudeep Holla , devicetree@vger.kernel.org, Alexey Klimov , Jassi Brar Subject: [PATCH v2 6/6] mailbox: arm_mhu: add support to read and record mbox-name Date: Wed, 24 May 2017 11:16:43 +0100 Message-Id: <1495621003-4291-7-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495621003-4291-1-git-send-email-sudeep.holla@arm.com> References: <1495621003-4291-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 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; }