From patchwork Thu Jun 13 15:13:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 166677 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp884221ilk; Thu, 13 Jun 2019 08:13:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxf1PtBrdvGAUWSKaWMUIT9fdja9ioB/q+NgFIGGwJ63cYOCM/W++BsUKFbF/zgDzQOXfcU X-Received: by 2002:a62:ee17:: with SMTP id e23mr96049541pfi.130.1560438816804; Thu, 13 Jun 2019 08:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560438816; cv=none; d=google.com; s=arc-20160816; b=qg8vX5DRCrW7FE2CjDtXfqGtMkGhzpHUP2KBVvpO3wP+vMneVv900gYlLM2iEDU/4m LSVMKD52hvHU+KQ7/TyqD38jwZizMQTV9CiwphOgWB39c5qENd7kS74npdtm7Up66y7I 2UsTUoKAaiqrxou/zy3q2GQQNCSQRAFYNsyL60RecMin94MwZTFWa3k3npSYtzc9upcs y9HssWelN7EwhBDkm62j0FyczD05jsjpU0rZwDamElN4y0u0utgNKWr8X/m3dPzpIQoZ b8FTvlBn6AcQPdwz1mPSBpyU3DAiqsbhhhrfIuIKxmndk7A0RzwgkhAh6ZnLiTC90paZ zOMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dRI8LDhDHsCIBwRwhlloOvstxSjM1RSSiRjkI92mIwE=; b=Znq3Xub0M6Hf08kUQIR4HbY3Cjp7XwkaqOUS4pqfmPoH8OilSbGzwSAaC4MKXhG/cO FKXE9lqAEb3BQgfLkktgxCT+/NooALRIerfEVsSPu8mkv5y0CMGgIXHYh6GzOeyqypyu AiIRKXGoXWmPNvkt3PcEflXJMh1fCj6rwCKrDwjvhEDmKjnJ4+HWBityUqJqpTwbjKkr 7lY36z2HtR/T2qen7YwrOYNIz+Dgeh4ebizhPMTzlp1lIR5AgL8pobufT3llUCZozXJm GMg1Mz45AQS2KuU5JeirrOe7msUzwv3sVwsGyihjov6/YcWNVc6sBGaYHwiduLC1akPy ycIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lw9r6PmY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si3414634plv.130.2019.06.13.08.13.35; Thu, 13 Jun 2019 08:13:36 -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=pass header.i=@linaro.org header.s=google header.b=lw9r6PmY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388385AbfFMPNf (ORCPT + 25 others); Thu, 13 Jun 2019 11:13:35 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:45931 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388326AbfFMPNc (ORCPT ); Thu, 13 Jun 2019 11:13:32 -0400 Received: by mail-lj1-f196.google.com with SMTP id m23so18873691lje.12 for ; Thu, 13 Jun 2019 08:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dRI8LDhDHsCIBwRwhlloOvstxSjM1RSSiRjkI92mIwE=; b=lw9r6PmYqD6Hr6/QsZ4lrEvBdxFID2BWPlv5zGEqC2q4tn0gcugk6NoiBpWGanvPSk JkLHblUCjamoh6ksDlc984j2B6BDqfQ62H0JM9arLAsy9IIViFWbT/xECmmmy2alFall x+ShbQD3H7qXdZkMtsqyj2MY+2b9hf7Ad3Ep9jW870noVKVx3yHf50fh/SvWbhCQn7Iq +x1+BlINFAKM2Vvpyb/Mvt9QHbMxUkcF/ttPxEZvAdyITyuqa2D+zIfBI3HyOwUhdAjg hKSmxJfgGojr5ptDsyaVWbNBDI4ULaWEj9XEGiItVLe6CGL9YXfbjNAfw2CzCB94Oiuf o0PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dRI8LDhDHsCIBwRwhlloOvstxSjM1RSSiRjkI92mIwE=; b=XypI9tHALf3MkdYkaKwoyK9upo0NAoz0/OOPu0nF7Ndpu2qRTR7D6xIKCPSc+JiLo7 L2afVcyW13GgGTAEUvC/YXbdgkV5FtaUSXU5WVUx/iaDMSBkwHEDSe8rBHRBLLgPLled y6KVw4vYyddMI6uoPZ4EUMPhJMUXPXESgf1qalmAl/TrJysW7mBb6iWht7Kqp5XkaIht /g7zFG59fythPonHIQ32vSMeRndAhJWktvgyIHpU4tPpMscazCTQjW90ftTnu8tJvFNc Oisp5Mw4k9VvJx8sWfOK4FWzFuP9AUrGrnvLyk1O/u/Vc9XmTgjATxy2j9ujlDxJXn0v 4r5A== X-Gm-Message-State: APjAAAXNaHt93JphDzbqEr7LxgWCvI3B+l5m+hlQI1AcNQ39ju8W8c8o nZ6PH/xD8yS1ZeOOhYDv/XTd4A== X-Received: by 2002:a2e:91c5:: with SMTP id u5mr8390657ljg.65.1560438810181; Thu, 13 Jun 2019 08:13:30 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id k4sm42923ljj.41.2019.06.13.08.13.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Jun 2019 08:13:29 -0700 (PDT) From: Georgi Djakov To: robh+dt@kernel.org, bjorn.andersson@linaro.org, agross@kernel.org, georgi.djakov@linaro.org Cc: vkoul@kernel.org, evgreen@chromium.org, daidavid1@codeaurora.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v4 2/5] soc: qcom: smd-rpm: Create RPM interconnect proxy child device Date: Thu, 13 Jun 2019 18:13:20 +0300 Message-Id: <20190613151323.10850-3-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190613151323.10850-1-georgi.djakov@linaro.org> References: <20190613151323.10850-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Register a platform device to handle the communication of bus bandwidth requests with the remote processor. The interconnect proxy device is part of this remote processor (RPM) hardware. Let's create a icc-smd-rpm proxy child device to represent the bus throughput functionality that is provided by the RPM. Signed-off-by: Georgi Djakov --- v4: - Return error if platform_device_register_data() fails - Remove platform_set_drvdata() on the child device. v3: - New patch. drivers/soc/qcom/smd-rpm.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/smd-rpm.c b/drivers/soc/qcom/smd-rpm.c index fa9dd12b5e39..34cdd638a6c1 100644 --- a/drivers/soc/qcom/smd-rpm.c +++ b/drivers/soc/qcom/smd-rpm.c @@ -19,12 +19,14 @@ /** * struct qcom_smd_rpm - state of the rpm device driver * @rpm_channel: reference to the smd channel + * @icc: interconnect proxy device * @ack: completion for acks * @lock: mutual exclusion around the send/complete pair * @ack_status: result of the rpm request */ struct qcom_smd_rpm { struct rpmsg_endpoint *rpm_channel; + struct platform_device *icc; struct device *dev; struct completion ack; @@ -193,6 +195,7 @@ static int qcom_smd_rpm_callback(struct rpmsg_device *rpdev, static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev) { struct qcom_smd_rpm *rpm; + int ret; rpm = devm_kzalloc(&rpdev->dev, sizeof(*rpm), GFP_KERNEL); if (!rpm) @@ -205,11 +208,23 @@ static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev) rpm->rpm_channel = rpdev->ept; dev_set_drvdata(&rpdev->dev, rpm); - return of_platform_populate(rpdev->dev.of_node, NULL, NULL, &rpdev->dev); + rpm->icc = platform_device_register_data(&rpdev->dev, "icc_smd_rpm", -1, + NULL, 0); + if (IS_ERR(rpm->icc)) + return PTR_ERR(rpm->icc); + + ret = of_platform_populate(rpdev->dev.of_node, NULL, NULL, &rpdev->dev); + if (ret) + platform_device_unregister(rpm->icc); + + return ret; } static void qcom_smd_rpm_remove(struct rpmsg_device *rpdev) { + struct qcom_smd_rpm *rpm = dev_get_drvdata(&rpdev->dev); + + platform_device_unregister(rpm->icc); of_platform_depopulate(&rpdev->dev); }