From patchwork Tue Dec 5 15:46:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 10093283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F01260329 for ; Tue, 5 Dec 2017 15:48:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 597BF28863 for ; Tue, 5 Dec 2017 15:48:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DD5A288D8; Tue, 5 Dec 2017 15:48:21 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 CB6BC28863 for ; Tue, 5 Dec 2017 15:48:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753191AbdLEPru (ORCPT ); Tue, 5 Dec 2017 10:47:50 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:35454 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752748AbdLEPrI (ORCPT ); Tue, 5 Dec 2017 10:47:08 -0500 Received: by mail-wr0-f196.google.com with SMTP id g53so796896wra.2 for ; Tue, 05 Dec 2017 07:47:07 -0800 (PST) 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; bh=J54cUz8cByVAIC1R7usxpO0FFrUQJouk4nlZHfLBoEQ=; b=RK/9XmgW1YBL2G4ez09+JjMJcsSYCYwn2JOtvTp8vGciEIaI4/KD4KzUE97zEQEzVM 9JtVaHzJqyHr9oEhvW5nTlepB1La3VGP2T1H2/mK3RCJSjD3CbSw8ZT6NF27XYsoMv0y 8c/Mx/1D4Q9EkgM9uiUD9aycBSfsh7WmLtOXs= 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; bh=J54cUz8cByVAIC1R7usxpO0FFrUQJouk4nlZHfLBoEQ=; b=SX9UGeDDFZdZdJzMuGgQc9JXl/rfbxWoY7TosJRhN2HP5EQqJiqhm0RVROqTUYWoJf 1gvukhEWU4F3NM4VpT/8ftVIkn0O4bJ1zMv7hi2KmY3jNmbKlIzsJn3PZU/Swb3yVKRD XNubCVLY3Un36iAjCOW0MA5wTBMBCJxc1153ShM+ScF0NqYOmDNh4vaxCOeT/AFtHczu SUHUzgNe8hEpbmW91+UUDv1uMNL5GGZ2xrfFZEk3qQZaZq99v6/qgfHS6Ddngwyu1Jmv i7SMQeUQQPiVjqDBcOc4YWNndUxOp1wLKPQbnu+4Fq4jO2n/O/9Bob/6pMJoyqOkeM0C 1dFg== X-Gm-Message-State: AJaThX7eclpi3qPp68rtv6LRF2d6T/OZ80nVPEFVXM4lFUgGyI1wq8Wz y/zkEuS2ZCkqitEaZ0SbgX6OdA== X-Google-Smtp-Source: AGs4zMbfkuJWe3opjfB5TCt3D2tv3r5SsHmkQtovdO18EzKZHP8/umstTcNIUYpQgc/JASh1fVAtMw== X-Received: by 10.223.150.68 with SMTP id c4mr16359458wra.255.1512488826943; Tue, 05 Dec 2017 07:47:06 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id v47sm500946wrc.13.2017.12.05.07.47.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Dec 2017 07:47:05 -0800 (PST) From: Georgi Djakov To: sboyd@codeaurora.org, jassisinghbrar@gmail.com, bjorn.andersson@linaro.org Cc: mturquette@baylibre.com, robh@kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH v11 2/6] mailbox: qcom: Create APCS child device for clock controller Date: Tue, 5 Dec 2017 17:46:57 +0200 Message-Id: <20171205154701.27730-3-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171205154701.27730-1-georgi.djakov@linaro.org> References: <20171205154701.27730-1-georgi.djakov@linaro.org> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is a clock controller functionality provided by the APCS hardware block of msm8916 devices. The device-tree would represent an APCS node with both mailbox and clock provider properties. Create a platform child device for the clock controller functionality so the driver can probe and use APCS as parent. Signed-off-by: Georgi Djakov Acked-by: Bjorn Andersson --- drivers/mailbox/qcom-apcs-ipc-mailbox.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-clk" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c index ab344bc6fa63..57bde0dfd12f 100644 --- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c +++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c @@ -29,6 +29,7 @@ struct qcom_apcs_ipc { struct regmap *regmap; unsigned long offset; + struct platform_device *clk; }; static const struct regmap_config apcs_regmap_config = { @@ -96,6 +97,14 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev) return ret; } + if (of_device_is_compatible(np, "qcom,msm8916-apcs-kpss-global")) { + apcs->clk = platform_device_register_data(&pdev->dev, + "qcom-apcs-msm8916-clk", + -1, NULL, 0); + if (IS_ERR(apcs->clk)) + dev_err(&pdev->dev, "failed to register APCS clk\n"); + } + platform_set_drvdata(pdev, apcs); return 0; @@ -104,8 +113,10 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev) static int qcom_apcs_ipc_remove(struct platform_device *pdev) { struct qcom_apcs_ipc *apcs = platform_get_drvdata(pdev); + struct platform_device *clk = apcs->clk; mbox_controller_unregister(&apcs->mbox); + platform_device_unregister(clk); return 0; }