From patchwork Tue Jul 23 14:23:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 169540 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8949244ilk; Tue, 23 Jul 2019 07:23:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVQnvir4slXt/Gy+kXmH/3DhS3ziqlWZNoEM5N21brQLZM47uYDLb1wUh29UnS93QiwZ3y X-Received: by 2002:a62:6083:: with SMTP id u125mr5939958pfb.208.1563891829718; Tue, 23 Jul 2019 07:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563891829; cv=none; d=google.com; s=arc-20160816; b=myuYWLIHysGKDtxQnI5uFj20mpAIj+LezG9ZmQAz+uAPnA72URBlwv3lVih5gJ3mjH qeO+9SO6wN0vS8EIgPnIw4Z/MckN5L1nc6ldYhSHKvgoCjYVcBafI37QXqzLLcZNXznc YjlEs2/qo6zeWzBuyCrLsFczlC7PGHn4neP5kA5Zw4dYegwc6OGDMNyRQo7DvwhILJP7 EWviMRvMfvOfLeX+67QLn04zJWICTqeO1ZYYKDwZtRDz1DFGP4+HhNRr2ppxRVfCReEH g+cD27mvyL5QeNp/4esZeXMecd3kcZanF/YavAB6EWSvO3NJB6Pce7PdTs0bAPWhXAU0 W6PA== 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=FbVR62JVrWT5p1YV/PXTQMK7g7u1TZfSbRIPAQh2zmI=; b=RS+inP8QkEn9IZ4mi95KGb68H1kNDqxKdpkV3i6t/nmF2qz2nzjMTEkz+gdU9GfHCf FMBWySAk+dls3OtQ1w72anm0RWlxXgDi1vmCH5Yt+z3z4457zwRSV8pnJO+BoX4UdD/L hdwaFfF7yS70AUsd+Zqxm/zcxvttx7hxldPYR4crhcNjZmPyEzkkqnrxZJCu0CaOkI4z xXWxdy10vyXkXB9qHWZN5b+Ijbt/5MIgl7hEUl1l1Pm56xT06xmRe4wJPsZRvoisOppt +CYsBTkYgeZD8OZyCT3aOM2/0RsCNnxiVgkwmxKtxmA8Dwrl4FyAV3nhCfMy0SXShwLZ e4rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pqjy30Na; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 n1si6019711pgf.237.2019.07.23.07.23.49; Tue, 23 Jul 2019 07:23:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=pqjy30Na; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 S2388195AbfGWOXt (ORCPT + 8 others); Tue, 23 Jul 2019 10:23:49 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:46866 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388170AbfGWOXs (ORCPT ); Tue, 23 Jul 2019 10:23:48 -0400 Received: by mail-lf1-f65.google.com with SMTP id z15so25215945lfh.13 for ; Tue, 23 Jul 2019 07:23:47 -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=FbVR62JVrWT5p1YV/PXTQMK7g7u1TZfSbRIPAQh2zmI=; b=pqjy30NaHFnw6pcJ57wAnzko3t4O4huqM2mhHodrJ9jmdvgIfV9Xwgo3+TI4xeE5zz EO5h3MH9wLBV26uraJyi7ZHXlNWSElGcbmJJ2NWpEAL/lUyrxus7e7gGMT74MjAEYGAd RkBfV9FPdETMqbGMNxilpx4IkRHXPqifArGJx3hRJTjrZaX4Ue9Z2n0hhGKl655gLaX3 hIwyFeuakmEQDACmmXaUOqs1Dv2FaeVv+RcOvEzhTpk1wIe+OO5/fSldby78OhcY36A5 4gYgp7pFqPNs7Qy8eRw2O9NN7gGESjem2m11n9aAuq/hpqsOPsDyAX9pgehNlcwBBEqB ScCw== 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=FbVR62JVrWT5p1YV/PXTQMK7g7u1TZfSbRIPAQh2zmI=; b=ltLkAyx9FtZa4ihp7EQVKm0UUIxEztuIU4iuBbZ7hvAtTxUDXxtRYP06ZoJfXtK2cv t8oc/bPyGlkgIINWPa5F+4qpHmL/D2tkwRd0tjOGfTTfju/BB/1aeHyqLVvzzCjqln+V 6cV+mgYbU3xqMYZ0aDPCrZLiPALrC+Co7YGWFl2UgUicUPn3soQtZfdX+6xG1XfxrYyD fA8K7WRkFlC3HPbVmPJ6qegGzxkVykHiHVJGuUsuA9JOct39AA10DKTzU8+O2TFLJB3e vmnJCwX0h+WbzsOrgZ7d1Q/qWHVbxfT2Q3n+Ecypg1yCDbCVw4hpj3NJ3KGFU5oATt0V +tbA== X-Gm-Message-State: APjAAAUxjnE8SuIHP8zOjOxYQNjm7Mmko8k5BGKleq7neW2PveLYNEQ+ 39fabHJL2XfNUIvVz7U0p3GTxQ== X-Received: by 2002:a19:1d1:: with SMTP id 200mr35295422lfb.8.1563891827036; Tue, 23 Jul 2019 07:23:47 -0700 (PDT) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id z17sm8048519ljc.37.2019.07.23.07.23.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Jul 2019 07:23:46 -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-arm-msm@vger.kernel.org Subject: [PATCH v5 2/5] soc: qcom: smd-rpm: Create RPM interconnect proxy child device Date: Tue, 23 Jul 2019 17:23:36 +0300 Message-Id: <20190723142339.27772-3-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190723142339.27772-1-georgi.djakov@linaro.org> References: <20190723142339.27772-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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. Reviewed-by: Bjorn Andersson Signed-off-by: Georgi Djakov --- v5: - Picked Bjorn's r-b. 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); }