Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1253049ybb; Fri, 20 Mar 2020 16:37:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuMLGcFAJM8kwzAO0ErA78gk7HU43m8ewQ4PsUSwndTwszJz5oHvNMVRodW2WLEwXkdkbN3 X-Received: by 2002:a9d:4ee:: with SMTP id 101mr8812660otm.301.1584747440220; Fri, 20 Mar 2020 16:37:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584747440; cv=none; d=google.com; s=arc-20160816; b=q58mDhH6V+sfcYIv6BlK6v0AOD7x4iCra+nu033Sz7Cu5FIg6yGt2JB6z2I8l2akbu exzjV8/B/tlheyocr3/SaL05QLu4MAXVYQGqgkXTLYn+wgPM0zk8QcX9RDMC08aIl6+p aDQzF+Ks/oB7hoh7maGwZgjsS2+HF2NQu7vK/t8RyI3BTaXWWbU0LWe7t0WSzFD9RKkB 1oOOrcOyTcR7mcUamZhYi8eQpxm35hUKXMAetjncKpYcJIhF9cjdOy8e+cdkg4Ml61Y4 Helb8znX4VjFmi5VhXDdw6aeE5KXFR2xYFwDwkCPbzrMSCf47rO+y3vdoVH7l2X/cu+k xlAw== 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:dmarc-filter:dkim-signature; bh=kWl2oYWfBPVLMLG1p4eJPUX2txbmOHZxIQKSjE0B98E=; b=b1Hgoa8F3w/HAPXVtFfULM58ck6Q82WFC4O8U+8IMXdRz+oQ8LVAEDoG1nnVvJZOPr d3iZINrh+s8IKxa3yKRjSUih0JrhPkE68breYGvFLP9xMSdViuiOIeW5wPYMnLtfcAHI SB/GoKoEjAFqBuJ/tgeJbYuPCGiWDxaO+hEhqCZoVYafj7eJilXT+qH32WB7S+ex9zEa tz209mnLmTqyl7T86b33iX3c4E95im5m4mkqm5ScA4h7DIbAYIo/WHsbuqLS20AUOrh0 Wzr1NGbsWp+8C1qKQVoLH4apKbbxeI3A7+qLpOEPv4lw0MemHZ76cOeMhx9m03P1xhFs hNUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=J6gb8ana; 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 v22si3677029oia.165.2020.03.20.16.37.08; Fri, 20 Mar 2020 16:37:20 -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; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=J6gb8ana; 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 S1727733AbgCTXgh (ORCPT + 99 others); Fri, 20 Mar 2020 19:36:37 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:26250 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726851AbgCTXgf (ORCPT ); Fri, 20 Mar 2020 19:36:35 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1584747395; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=kWl2oYWfBPVLMLG1p4eJPUX2txbmOHZxIQKSjE0B98E=; b=J6gb8ana4ZhKc8b/D+sV8tv6RBsrgRopPxINkaMBsfHO4uZCWjBqniUK0a+zpglTGzOeO8c/ UFmla/66bWmpN+618hRgcnwsxplCETysn6wFyugw7YHZD76ALEVW7vp6DS1JqmpjvRDX2srv xU6W/ZR3jXueSiEOOuvhD7BT7j0= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e75537d.7f6bc1a32b58-smtp-out-n02; Fri, 20 Mar 2020 23:36:29 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id E6158C4478F; Fri, 20 Mar 2020 23:36:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from rishabhb-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rishabhb) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1F2FDC43637; Fri, 20 Mar 2020 23:36:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1F2FDC43637 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=rishabhb@codeaurora.org From: Rishabh Bhatnagar To: linux-remoteproc-owner@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org Cc: psodagud@codeaurora.org, tsoni@codeaurora.org, sidgup@codeaurora.org, Rishabh Bhatnagar Subject: [PATCH 2/2] remoteproc: core: Register the character device interface Date: Fri, 20 Mar 2020 16:36:17 -0700 Message-Id: <1584747377-14824-3-git-send-email-rishabhb@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1584747377-14824-1-git-send-email-rishabhb@codeaurora.org> References: <1584747377-14824-1-git-send-email-rishabhb@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the character device during rproc_add. This would create a character device node at /dev/subsys_. Userspace applications can interact with the remote processor using this interface rather than using sysfs node. To distinguish between different remote processor nodes the device name has been changed to include the rproc name appended to "subsys_" string. Signed-off-by: Rishabh Bhatnagar --- drivers/remoteproc/remoteproc_core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 097f33e..48a3932 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1907,6 +1907,12 @@ int rproc_add(struct rproc *rproc) struct device *dev = &rproc->dev; int ret; + ret = rproc_char_device_add(rproc); + if (ret) { + pr_err("error while adding character device\n"); + return ret; + } + ret = device_add(dev); if (ret < 0) return ret; @@ -2044,7 +2050,7 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, return NULL; } - dev_set_name(&rproc->dev, "remoteproc%d", rproc->index); + dev_set_name(&rproc->dev, "subsys_%s", rproc->name); atomic_set(&rproc->power, 0); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project