From patchwork Fri Jun 9 20:19:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 105797 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1166090vqr; Fri, 9 Jun 2023 13:29:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6znAv8Oig2IhazRe5H5BA650xQUbdkZVgVZJBIzuxuo1/uvZDR7ocodJ3BVrdqobxaqP9r X-Received: by 2002:a05:6a20:12d1:b0:119:94f4:c614 with SMTP id v17-20020a056a2012d100b0011994f4c614mr2036243pzg.55.1686342549350; Fri, 09 Jun 2023 13:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686342549; cv=none; d=google.com; s=arc-20160816; b=YmOmHdY4QuAcMJ4j/YTvSCj3sVK/ofP3VTG4oMCsxr+W9642qL3dhcepsO+R/ROQ0S WNmzW8m9BfCnZq0fdqp6jmWsVoyHnqo1wEaH0U4vHc7xGl6JEyL/n0YhmHLF9fnR4yKn PykAYxXWIwV055cP6AhJqaNzenXEidlfz8D1AllDmG77Ovoj+8QEZyTJA4AqltQE8Ngi xHR+QxXoeLGKpr+MtZgwoUE9O/jMvnUVCFBb3p2Z5zVVFICaQhyKUdzkS4rHuqKcbBJ1 PtghQVXn69c060/HbvqN3UDaZfvQPoF3FmFf/TD6cQcgQzrMMrBhJ7sRCXI9UsnVtxGU wwqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=o4TG88G8lz+fAZ9zU8d6rxSrHlYur3wUM1VMDavTyKo=; b=jpITN83eu2LmJ9d20p3nytuDH5OPhItA22LYHGR3Kgsj5wc4F0K+kUoyJdG9FWElSd oCilc5/O+i/K6lTN0Pdi7Oobi0nY9eqoNJDbPmd7xm6JIdpXm+taos7zY3gk6Hfre0uR 5sX4H0qrOklsKFIki4P+MS413tFQK6EZsIsQzcLzxWS2+s2e3SqotIeuRlxGdhb6mbvw wf0mtywXIKuTsDzSV4buXSTRQyoMhcxOAnBAnDhEQpCr3Z/S9ZLouhazCcuJVHTQZYk2 RNTULnH0kXSIYpULv6sUkUmtWOlqo44+blQkbn89Ss8nI54kF6vvlY1YcmCB5B6rqn08 FDtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qJwESa6T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w20-20020a637b14000000b00540e8c5b786si189760pgc.819.2023.06.09.13.28.54; Fri, 09 Jun 2023 13:29:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qJwESa6T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231899AbjFIUTd (ORCPT + 99 others); Fri, 9 Jun 2023 16:19:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbjFIUTW (ORCPT ); Fri, 9 Jun 2023 16:19:22 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7EB9E47 for ; Fri, 9 Jun 2023 13:19:20 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2b1adf27823so24900151fa.2 for ; Fri, 09 Jun 2023 13:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686341959; x=1688933959; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=o4TG88G8lz+fAZ9zU8d6rxSrHlYur3wUM1VMDavTyKo=; b=qJwESa6TrqhD+rWOkoWhimvnDd5gJYhIyhdgbpLYlClG/vHRHCuf5+NIYgrDdv/+IU dPFvncbN3f62l7+bSJGFAy6mgh1S+JzjcnNS3Rsa4cFhq/HTdVusJCCI4nnfhvjU+btG xOh7T2pZwh28sLjFeLzk4SMBzgGa2kVlyxP64dCbI1mqI+mHy+ff1a6y28Ktr2q9SBQe 0YqXt1hTFQi++QlnuNb2HFqoMx500gSLIk9Zeks7JCZWQvBvJLPcA9o+2gk4BcyNfWKo nAxf0zHYjEaSzaCd6i6QHLJ68lRELOa2Ir1fnPYAwokV6Qd0d2+j/EVaJKyolfGiTKTx WEGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686341959; x=1688933959; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o4TG88G8lz+fAZ9zU8d6rxSrHlYur3wUM1VMDavTyKo=; b=XAyN+U3MikZLuC7AXl5+iIZVXHrvBvYMe9i0xeDbcZtg94fLBSIjML7mMIQMl2d9qm l5Pdr1jd+kzjI0I5B8giWFnjw9/A3xEuhf1Sl5LfkEZkwwECCjcDHGzqdUzVVaIYWk47 0nQ3VPzolLgW99SdWT7CX+Tt68PtFQG58vCQkMvicD9QKHkq6SRvVKg/qgUmzxfrTrXx uizfIlGZc5PAVWZifwrzock6YM2AGRDHjHrYsGjb8AcysqTDVRJULuhUF3D2m4MNEaG8 ggJJdfOAaZPCnwXk1gx5eH4BvYXJqCCw4sCBeJERJEsLWtCfG8rHauLEGYDHAwAWTaMp GB4A== X-Gm-Message-State: AC+VfDzFH+9A4joD+WAp4oLwAHq7vAeW934d3vYellN1qokyU1dBbbl/ lMDHu+VhNLzlmxFmRbC1LYbV7w== X-Received: by 2002:a05:6512:32b7:b0:4f1:430d:ca5c with SMTP id q23-20020a05651232b700b004f1430dca5cmr1487387lfe.56.1686341959062; Fri, 09 Jun 2023 13:19:19 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id b18-20020ac25632000000b004f628eb7884sm641349lff.232.2023.06.09.13.19.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 13:19:18 -0700 (PDT) From: Konrad Dybcio Date: Fri, 09 Jun 2023 22:19:08 +0200 Subject: [PATCH v2 03/22] clk: qcom: smd-rpm: Move some RPM resources to the common header MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v2-3-e5934b07d813@linaro.org> References: <20230526-topic-smd_icc-v2-0-e5934b07d813@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v2-0-e5934b07d813@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686341953; l=2437; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=UU7GtjAFC9F3/14Sgtv72aSDwAe2u4JL+0KQToDCmwI=; b=DwmrC5bgCMsGkboo7dYMtoVQPexE6x7n5ZSH9/AjiZbntp4SZLkKIG9KH6RkKo14G2ByfEFLW 0ffy9SvAQ6dA7aIAD6TVs94ybJzOrnUGeoj0WZ06c55qBoErRW8IEV4 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768258324879054295?= X-GMAIL-MSGID: =?utf-8?q?1768258324879054295?= In preparation for handling the bus clocks in the icc driver, carve out some defines and a struct definition to the common rpm header. Reviewed-by: Dmitry Baryshkov Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/clk-smd-rpm.c | 13 ------------- include/linux/soc/qcom/smd-rpm.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index e4de74b68797..937cb1515968 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -18,13 +18,6 @@ #include -#define QCOM_RPM_KEY_SOFTWARE_ENABLE 0x6e657773 -#define QCOM_RPM_KEY_PIN_CTRL_CLK_BUFFER_ENABLE_KEY 0x62636370 -#define QCOM_RPM_SMD_KEY_RATE 0x007a484b -#define QCOM_RPM_SMD_KEY_ENABLE 0x62616e45 -#define QCOM_RPM_SMD_KEY_STATE 0x54415453 -#define QCOM_RPM_SCALING_ENABLE_ID 0x2 - #define __DEFINE_CLK_SMD_RPM_PREFIX(_prefix, _name, _active, \ type, r_id, key) \ static struct clk_smd_rpm clk_smd_rpm_##_prefix##_active; \ @@ -171,12 +164,6 @@ struct clk_smd_rpm { unsigned long rate; }; -struct clk_smd_rpm_req { - __le32 key; - __le32 nbytes; - __le32 value; -}; - struct rpm_smd_clk_desc { struct clk_smd_rpm **clks; size_t num_clks; diff --git a/include/linux/soc/qcom/smd-rpm.h b/include/linux/soc/qcom/smd-rpm.h index 99499e4b080e..8190878645f9 100644 --- a/include/linux/soc/qcom/smd-rpm.h +++ b/include/linux/soc/qcom/smd-rpm.h @@ -2,6 +2,8 @@ #ifndef __QCOM_SMD_RPM_H__ #define __QCOM_SMD_RPM_H__ +#include + struct qcom_smd_rpm; #define QCOM_SMD_RPM_ACTIVE_STATE 0 @@ -45,6 +47,19 @@ struct qcom_smd_rpm; #define QCOM_SMD_RPM_PKA_CLK 0x616b70 #define QCOM_SMD_RPM_MCFG_CLK 0x6766636d +#define QCOM_RPM_KEY_SOFTWARE_ENABLE 0x6e657773 +#define QCOM_RPM_KEY_PIN_CTRL_CLK_BUFFER_ENABLE_KEY 0x62636370 +#define QCOM_RPM_SMD_KEY_RATE 0x007a484b +#define QCOM_RPM_SMD_KEY_ENABLE 0x62616e45 +#define QCOM_RPM_SMD_KEY_STATE 0x54415453 +#define QCOM_RPM_SCALING_ENABLE_ID 0x2 + +struct clk_smd_rpm_req { + __le32 key; + __le32 nbytes; + __le32 value; +}; + int qcom_rpm_smd_write(struct qcom_smd_rpm *rpm, int state, u32 resource_type, u32 resource_id,