Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp752809rdb; Tue, 19 Sep 2023 09:07:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE3H7Cs/x7jtWHAFAzCbevYNo3oOL/iFBWechp7160GUHw4Ms/j2Y3xIJ30Hx/WYtL+ipfW X-Received: by 2002:a17:90b:4c05:b0:263:1f1c:ef4d with SMTP id na5-20020a17090b4c0500b002631f1cef4dmr166194pjb.10.1695139669463; Tue, 19 Sep 2023 09:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695139669; cv=none; d=google.com; s=arc-20160816; b=hx1cXWDC0rFmx3FBtL1LMw9atldZvOqBUpkg+0dtt4D4lQKLUNzZtJI0AN7Edtz+mt YDHOa6Ah/Qkg32JE6xnFQ9DzCIxvhMFi0CzOPq/Ta8B/dJp583sgdxjq5tPnIRmOBzfD qrI0/PjQf+mKE1D3zmLkeH/TN2iHHqeIiJN+65utUcOhfyqwvn1sBCIfJ7aqEAR3b2x8 s3OC9dkb9j3Q4QGVByJb3zPL+0fL371eJYaJWGUNJDQkcbiBTb+FiWTAo2HVp6a4E6yW ubmeJUc0L0nxYvZAjCGSbQzcLk9m942nZxHm4bB0Wv+dpO5cSmIlYtDTqhUrnlEewvtG SAng== 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=ZuD+kzTK3GMqMh4cRFD6FbY1OqwfVp6oqKPDZbwG/ng=; fh=1N2DBqAE4qlJ/MdmzyBAVyqZb6NxbBXSfjSgYrLDqv0=; b=HcdAZLWJWdZooN9sPQ4yNDnwLJ/M3xZOBogIwHEKchsvSFDNbiDUqAkwhMOFTgCozL hob/YuOEOKMFMrcfhTmkWj4qLBRKJKDfDa3AnZ6/4sLny4H0gvO8V9Q6mrfo7qcxFZSc 7HHjvy/NHshGw2VF7CuEJU7AytbIgmeO3RI3A0pm7akbJbop38Yi+lv4dfA1eF/gBw3k 6hbrt8wqyBFJB19Y7Ls9ZdsAHFJYircy9bB/PQqpZFL+OiTXR1DlkBZwApLbIk6CHIkE Mm82/KQwjNukJUOwmZCNgOfLnP9YBlB2rc+CToK4m/c+VFZOXWokL0d1hIxM1cgYhuDg TSrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=o0hR73Ce; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id g14-20020a17090a67ce00b00267f3363479si9890420pjm.57.2023.09.19.09.07.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 09:07:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=o0hR73Ce; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 474148037976; Tue, 19 Sep 2023 01:11:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230371AbjISILV (ORCPT + 99 others); Tue, 19 Sep 2023 04:11:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230316AbjISILR (ORCPT ); Tue, 19 Sep 2023 04:11:17 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26890114; Tue, 19 Sep 2023 01:11:11 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38J7RMD3012566; Tue, 19 Sep 2023 08:10:59 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=ZuD+kzTK3GMqMh4cRFD6FbY1OqwfVp6oqKPDZbwG/ng=; b=o0hR73CeMSERtwXvo+u8YqIJLL3tRdHXCzb6j8b//HZqiqrzafJeaC+XkG/G3tX2r7Ge Biz51Xcqslg3DTaKvYR44DbtxsMqMpuVl42qxUOGRIsCLbrlK/lujajJGokylrDyPE28 lZmPenuytEsyjDuVEc33T7nYY8oQVmqahxgdkr/z/tzCabZLuTieDkZq9wJKVJ0Ny/Ns 6kN5NH8VHLtZLD2fVc0sxvvf6+UWfpSn4QNBBeVnqH5u70TaSMrUG3qyrtMMm5iFb9wh x+FIiOk5ugdupirxOtFQ95MDzDqX4iwEj40cM8dXvkFuNVRCLzENbKar7I/MKvwvdDcQ fQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t72ngrgxg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 08:10:59 +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 38J8AwPv013890 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 08:10:58 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; Tue, 19 Sep 2023 01:10:54 -0700 From: Luo Jie To: , , , , , , , , , , CC: , , , , Subject: [PATCH v8 1/4] clk: qcom: branch: Add clk_branch2_prepare_ops Date: Tue, 19 Sep 2023 16:10:26 +0800 Message-ID: <20230919081029.30324-2-quic_luoj@quicinc.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230919081029.30324-1-quic_luoj@quicinc.com> References: <20230919081029.30324-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: nasanex01a.na.qualcomm.com (10.52.223.231) 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: pvZy0lJyZD8_F67K_qgfyO8D4yqLtBg8 X-Proofpoint-ORIG-GUID: pvZy0lJyZD8_F67K_qgfyO8D4yqLtBg8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-19_02,2023-09-18_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 mlxscore=0 bulkscore=0 impostorscore=0 adultscore=0 mlxlogscore=799 phishscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309190067 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 19 Sep 2023 01:11:24 -0700 (PDT) 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 Acked-by: Stephen Boyd --- 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