Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1931798rdb; Tue, 5 Sep 2023 09:08:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEf1wM7JSZhi93U4G4lP2fmxXpsmHTH+VvZfHpYKpYNBN2f0BUyd4CWy1hbwIIcBcd+pUQz X-Received: by 2002:a17:906:32c7:b0:9a5:9038:b1e7 with SMTP id k7-20020a17090632c700b009a59038b1e7mr236146ejk.36.1693930082201; Tue, 05 Sep 2023 09:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693930082; cv=none; d=google.com; s=arc-20160816; b=KynuhcsBGrYIwnGkEli3j4A2er+6fEDT3hE1qDDF2G0nFnZKnH9r8JKJPoOGyWSPo9 075fEWjZpAl+fxcWzGamvfQer9Zh3eqW0F+jnrKi0K9vZ0NDJPhlYpADHUofvK8tVPC5 nCrjQs0HZBz/diK+wXA8yD++0msARgusBgEfn3iYq54m3cWeW0ZXxBMCfBRIbbp6jcx8 /mPCQZVp8oeU88DHhGPg0yl+32EM4JMvOAFYdhaVxxYNaciR7FaKeCK3jB5uzd9/rrDG m/oIFhkrDMfTQrDwc8PLh8ncWl9fy8Nt9OElWSDt2Fowe8YM4KGCBz6/VELhweBvmEcL 0f5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3ZqP/qb7E3Qq8blh3GamvPqSBl8OJiIyeIumGZy7XVY=; fh=1N2DBqAE4qlJ/MdmzyBAVyqZb6NxbBXSfjSgYrLDqv0=; b=agoSSyHBb7Yl7mf49hszOPT9D2AaprbZ3venYSAcUPBqqfqegFPWXFiyOgoNyZbg4O XURV15v86UVkAYQFAXlQaDztbBvT/pZ9B5WiQGx4NfvdFAwvVsmx5BfZKKlFOazBbxim wrbig1IgR/WOagyw6uls3UP8sFpaN8xHX9U+AWSMIZQ6lrtXwu7ii8KElQ8FRddTxALa A1reN9OApXI2p9rpu3Rr0zmu4vtXdZERVytHWfLauYNM4cdO4m8LiSN1JbI6vefArZRo fSvVg15REszXenxRbORuKAieHvs2gRSUPw4MsnhLafXMin5SDob6nzW5DYZdyoKu+J/F 9OXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="dAD1mu/D"; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ks8-20020a170906f84800b0099df2ddfc3csi7964250ejb.890.2023.09.05.09.07.59; Tue, 05 Sep 2023 09:08:02 -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=@quicinc.com header.s=qcppdkim1 header.b="dAD1mu/D"; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348761AbjIAJUK (ORCPT + 10 others); Fri, 1 Sep 2023 05:20:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348768AbjIAJUI (ORCPT ); Fri, 1 Sep 2023 05:20:08 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0359510E7; Fri, 1 Sep 2023 02:20:01 -0700 (PDT) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3816Pim2008981; Fri, 1 Sep 2023 09:18:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=3ZqP/qb7E3Qq8blh3GamvPqSBl8OJiIyeIumGZy7XVY=; b=dAD1mu/DQK8K4mdkmEZGas4qIkN+1HL7YxucXl2hqyWsFLACtNZbpczXDtyALPiqe1le Kuq2xbxZuQgass0JVNaWwFq2L1rupGwAaVWjLeaiidivfynJSR54MCXC82hFMEOA6Vvg BdNF2XAcxdxZoOT31OaYcwDkES11N3XO3a1uXzF4hLCevatQuTTHKS4w1ebQ8VTCOSHy CCKm+Kg8V3/vs373mJsBaQJCpgvIHfCVVy/6a1nwprTnIeCAhiCn3oZFrPbhQl83iNLF RYd6TMdzOfYpqziGFsV8prl1tUVR7iJHUb/TZQAR39ognT+K3Qi75nyqWYy1g2JP/Y2m Zg== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3str1nk1hv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 01 Sep 2023 09:18:50 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3819InSN001282 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 1 Sep 2023 09:18:49 GMT Received: from akronite-sh-dev02.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 1 Sep 2023 02:18:44 -0700 From: Luo Jie To: , , , , , , , , , , CC: , , , , Subject: [PATCH v6 1/4] clk: qcom: branch: Add clk_branch2_prepare_ops Date: Fri, 1 Sep 2023 17:18:20 +0800 Message-ID: <20230901091823.30242-2-quic_luoj@quicinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230901091823.30242-1-quic_luoj@quicinc.com> References: <20230901091823.30242-1-quic_luoj@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: DL5x_uup_JN8blSDHHyAeubcMKchxfSI X-Proofpoint-ORIG-GUID: DL5x_uup_JN8blSDHHyAeubcMKchxfSI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-01_07,2023-08-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 mlxlogscore=845 spamscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 adultscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309010086 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_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 Add the clk_branch2_prepare_ops for supporting clock controller where the hardware register is accessed by MDIO bus, and the spin lock can't be used because of sleep during the MDIO operation. The clock is enabled by the .prepare instead of .enable when the clk_branch2_prepare_ops is used. Signed-off-by: Luo Jie --- drivers/clk/qcom/clk-branch.c | 7 +++++++ drivers/clk/qcom/clk-branch.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/clk/qcom/clk-branch.c b/drivers/clk/qcom/clk-branch.c index fc4735f74f0f..e22cdcf694f6 100644 --- a/drivers/clk/qcom/clk-branch.c +++ b/drivers/clk/qcom/clk-branch.c @@ -153,3 +153,10 @@ const struct clk_ops clk_branch_simple_ops = { .is_enabled = clk_is_enabled_regmap, }; EXPORT_SYMBOL_GPL(clk_branch_simple_ops); + +const struct clk_ops clk_branch2_prepare_ops = { + .prepare = clk_branch2_enable, + .unprepare = clk_branch2_disable, + .is_prepared = clk_is_enabled_regmap, +}; +EXPORT_SYMBOL_GPL(clk_branch2_prepare_ops); diff --git a/drivers/clk/qcom/clk-branch.h b/drivers/clk/qcom/clk-branch.h index 0cf800b9d08d..f6f355f28b71 100644 --- a/drivers/clk/qcom/clk-branch.h +++ b/drivers/clk/qcom/clk-branch.h @@ -85,6 +85,7 @@ extern const struct clk_ops clk_branch_ops; extern const struct clk_ops clk_branch2_ops; extern const struct clk_ops clk_branch_simple_ops; extern const struct clk_ops clk_branch2_aon_ops; +extern const struct clk_ops clk_branch2_prepare_ops; #define to_clk_branch(_hw) \ container_of(to_clk_regmap(_hw), struct clk_branch, clkr) -- 2.42.0