From patchwork Fri Jul 27 12:17:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar Neelakantam X-Patchwork-Id: 10547037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EA8513BB for ; Fri, 27 Jul 2018 12:19:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DC5D2B852 for ; Fri, 27 Jul 2018 12:19:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31CCF2B859; Fri, 27 Jul 2018 12:19:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2450D2B852 for ; Fri, 27 Jul 2018 12:19:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730771AbeG0Nk1 (ORCPT ); Fri, 27 Jul 2018 09:40:27 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46476 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730488AbeG0Nk1 (ORCPT ); Fri, 27 Jul 2018 09:40:27 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 190AA605BD; Fri, 27 Jul 2018 12:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693926; bh=t7Cg7qiQtfy13b26flhqB4okLEiKCjABBkNCklA0/aQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DgKn48psG5Kxmja89ReyxDoOocDE8iqTZjTY/38R8Ye8hNcCo760yOdBSVgDjyfeN 4aVMquU4J9ik77HH/k8fOqPf4pyJYTaHiaiKDeFqiRmWBbuILNuflHo5uXFu2qaJVu AIGa0hdWLs22FnAJhcmfclzZJafRLCGHEU8k3D4s= Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6611060BB2; Fri, 27 Jul 2018 12:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693925; bh=t7Cg7qiQtfy13b26flhqB4okLEiKCjABBkNCklA0/aQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O2TPcbudKi3+L/DPBj3AiI4yBDsE6unGSheP7OS7GcdNjRNq+S91HKnRG0BZaxlUU c2zHTEjFDaw2OhpkbbpJsUoTxXd6o4HaVATnLYBet2y851GoSQhDT1Hck7K6AMi9xu TEjwCnkWI481Yp+BZTFCVaeOV4hUcB0/qpQ15pjE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6611060BB2 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, robh+dt@kernel.org, arnaud.pouliquen@st.com, andy.gross@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH V4 6/9] rpmsg: glink: Expose rpmsg name attr for glink Date: Fri, 27 Jul 2018 17:47:26 +0530 Message-Id: <1532693849-7037-7-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> References: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Chris Lew Expose the name field as an attr so clients listening to uevents for rpmsg can identify the edge the events correspond to. Signed-off-by: Chris Lew Signed-off-by: Arun Kumar Neelakantam --- drivers/rpmsg/qcom_glink_native.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 9f3d026..7b4ffa0 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -1544,6 +1544,26 @@ static void qcom_glink_work(struct work_struct *work) } } +static ssize_t rpmsg_name_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + int ret = 0; + const char *name; + + ret = of_property_read_string(dev->of_node, "label", &name); + if (ret < 0) + name = dev->of_node->name; + + return snprintf(buf, RPMSG_NAME_SIZE, "%s\n", name); +} +static DEVICE_ATTR_RO(rpmsg_name); + +static struct attribute *qcom_glink_attrs[] = { + &dev_attr_rpmsg_name.attr, + NULL +}; +ATTRIBUTE_GROUPS(qcom_glink); + static void qcom_glink_device_release(struct device *dev) { struct rpmsg_device *rpdev = to_rpmsg_device(dev); @@ -1593,6 +1613,12 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev, return ERR_PTR(-ENOMEM); glink->dev = dev; + glink->dev->groups = qcom_glink_groups; + + ret = device_add_groups(dev, qcom_glink_groups); + if (ret) + dev_err(dev, "failed to add groups\n"); + glink->tx_pipe = tx; glink->rx_pipe = rx;