From patchwork Mon Jun 19 13:04:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 110012 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2999054vqr; Mon, 19 Jun 2023 06:12:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4lUzOMCrIQH3kg9xrsB4SvcIHLVeebSF/DG6gj0aJCwueCtbV/EGn5Jv5edVNb7M0HTUAL X-Received: by 2002:a17:902:b7ca:b0:1b3:d7d3:db27 with SMTP id v10-20020a170902b7ca00b001b3d7d3db27mr5366636plz.14.1687180368136; Mon, 19 Jun 2023 06:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687180368; cv=none; d=google.com; s=arc-20160816; b=gi4+ZYil4nTMNemTOC/NvuT3SHcE+Jrj4AKqIskNtoI79KWTeGwpusS5nLD8T7yt5j VFRMduXc0e+XfAhzqCdafosFJiA0n8/7xpRqHtVt/lRC66ZMLyHLcg14eS1IBAgY8S02 NF5wyshekY+bHeIwyDd3PswzKThTSkrMho/xWKVwQ72GhKTBeg0W4m47guWCzrCERtNu 8UQXSjh5FWtpSkhU0tT5+gzDy8GVgbTy4FsMb3jj5qLE0hHPwWj1mNnuH0/zTr/LPmE0 C43K3YLyrHQLY13HRXssCs4ndEk+pD5/IbXYIo9jOAGRKJtlninlxQClSq7mphtKqCXr uVTA== 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=43WXKM//3PGv9o6RwF8pM2BvmgRQSkW/hfnQEDsAZP4=; b=Z9aIZpvZO+Ml4qwpBA25qBOwnT0Sl8ypD1/xuqXukm6J9H1az5wsNJ1WIMMRFJsWX6 jD93Zn5Lo1Me0zT0BV/0hmTVQua6CMqK8T4ZzF2RHwbo9YWpTFNn2zg3OfxReobB642G u8tBfC7CAkioVjlKGcgDRxSWrYsiNPMSQwbS54sHevSHnxV4H7RUuQ5P+R7cRRNsV/3V UhkIq3xbR4OxuwADT0JvH67oNAb1TreRxRI7h/WqoeJpzr/vF5DRox7VOA3YBqvr/1B9 6w8EoFVcTazpwf6mneXRg2ENx8pJMzH8UwWR5ZSyzXn1svCGAk24FEeWo0rMYGVEbrtd 6j0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NXtMpvRS; 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 lc6-20020a170902fa8600b001b5621062c4si2334456plb.151.2023.06.19.06.12.31; Mon, 19 Jun 2023 06:12:48 -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=NXtMpvRS; 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 S231611AbjFSNFG (ORCPT + 99 others); Mon, 19 Jun 2023 09:05:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231565AbjFSNEl (ORCPT ); Mon, 19 Jun 2023 09:04:41 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4718E77 for ; Mon, 19 Jun 2023 06:04:39 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f866a3d8e4so2395493e87.0 for ; Mon, 19 Jun 2023 06:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687179878; x=1689771878; 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=43WXKM//3PGv9o6RwF8pM2BvmgRQSkW/hfnQEDsAZP4=; b=NXtMpvRSsGHv86vgY25l6GYGLPeICzKpayXTSR1WPsf/W1I6CzmqFWwy7P6HStfZzr a/7STd26HCWCfr0+UPqWABk9hpbZCv1xbXxuKqcFWmWzBqqoIdmNjtgaEiWjHpbuxM83 OE2E8KVckJJfEPMoWxD/hYIQ7u4cz8xSrfKU/9dZPlPPMNExTYLfymN9tbOmHO2xehq4 /pFs24hKyQQFzNkl/vIpaRS7mbyfRQYqNEJnKIFaIdCo9HKc0mgL+xHxxI4PhpT7LKB3 1qWhmVdNRgH6z/bxkZWfi9RfBmJSIv7XolYKAZUELbJctWzisU5Z+me5rRrNp99xWxOi PbCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687179878; x=1689771878; 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=43WXKM//3PGv9o6RwF8pM2BvmgRQSkW/hfnQEDsAZP4=; b=NTnpAJUzOwXp9u4T/2PLr1yDteZj2zqChXuTluOZ5+Ozw30KQ+FKfip+OdTjTb0Xli HbqgHxyswmcPTx9k+J4Xa0yW+IcFksDjFexFDFlMUM04Y7rn3MrMXIkoP6yRUX3EBA3w 89gGPgCeUOgbWOlVmfWsgVQ+DQr5TMYTODNHr0hkPLjuHXeb4PDUddK9EUiTFNjCISCF jebessvoDNiwZzlnncPCFdZfM0MY0qDQD5+RDowjEm2CkdT5mWwCkpbJuiWVMZYBBkf8 70H8+DXDUNya0jvMXYags63UyvZCZGFgRVN7UB8Xe3dA6zBcNTSM3kMfN+8a+IfRi7/C CZyw== X-Gm-Message-State: AC+VfDw4R9MfPRF2l9qpPDYpNNg6RqhWfonK5pCEDy1VWwKQcdGi+j4Q mlVkW5CRLn9771VjU1Vf8Mapgg== X-Received: by 2002:a05:6512:118d:b0:4f8:5e11:2cbc with SMTP id g13-20020a056512118d00b004f85e112cbcmr4538705lfr.36.1687179877718; Mon, 19 Jun 2023 06:04:37 -0700 (PDT) Received: from [192.168.1.101] (abyl242.neoplus.adsl.tpnet.pl. [83.9.31.242]) by smtp.gmail.com with ESMTPSA id q28-20020ac25a1c000000b004f643664882sm4256489lfn.147.2023.06.19.06.04.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 06:04:37 -0700 (PDT) From: Konrad Dybcio Date: Mon, 19 Jun 2023 15:04:29 +0200 Subject: [PATCH v7 04/22] clk: qcom: smd-rpm: Move some RPM resources to the common header MIME-Version: 1.0 Message-Id: <20230526-topic-smd_icc-v7-4-09c78c175546@linaro.org> References: <20230526-topic-smd_icc-v7-0-09c78c175546@linaro.org> In-Reply-To: <20230526-topic-smd_icc-v7-0-09c78c175546@linaro.org> To: Andy Gross , Bjorn Andersson , Michael Turquette , Stephen Boyd , Georgi Djakov , Leo Yan , Evan Green , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1687179869; l=2480; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=htdvXfCYU07v6+YNPv56ef+1cDlrbXu+3LbOKbiWsm8=; b=3b13EbEW2YMGSGEQ0jokedrvStoqW1dUmKiTpvXR0jCHaOVvviKfDGqGmKj01bSrwwkrNpsOM s71yNWYKf9pC6Py1qYqkce4Oj13iQ+6j3JENspZzHzM1LWspn2L+gZs 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 autolearn=unavailable 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?1769136841902370052?= X-GMAIL-MSGID: =?utf-8?q?1769136841902370052?= 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 Acked-by: Stephen Boyd 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,