Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp299376lqr; Wed, 5 Jun 2024 06:35:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWwiLyysNFkEReDx0p8dN/KtOzgVcEnW0jOLBhmLUCTwKw4j1dlMu8218qZbL+vvMn8KFVTwEHGBBFGBUh/ImGIfc7VGn3doihfR1rMPQ== X-Google-Smtp-Source: AGHT+IH3iCvQf2Cj4osTQOE1FhcmkoinMuEwagxMf2GLEGtXOclBsmrHDKMGUjyigxfpPedU6r24 X-Received: by 2002:a17:903:3212:b0:1f6:7f8f:65b5 with SMTP id d9443c01a7336-1f6a5a73208mr24586045ad.56.1717594521636; Wed, 05 Jun 2024 06:35:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717594521; cv=pass; d=google.com; s=arc-20160816; b=UXZKjV9wCiDc6RyrPuqycingbis7tY1U13p8EVa5a5iwq3JuRQqIxD1QvP9F5BIbNs gszA0vrIEYHf9v3eX9PsguZsUd1ocq2kecmokaYBpJbJPhI+M+ck7vdrQF1Ra/DP+Cfl nKEtIAcsh4Rq8OKxiZV4XOX2thCrw2/I0O/AtwjZyKXRZfqQH6pqMUEG773hkDnvnPWR vdZrLsLecQGH/ApvkcU+AlMAvOaUaeiIk6r9qc4BjfvnNaUQGdb7Mi2NFtAJMCELBALB JqvIeXeTl9XajQ+bTbkANgsKewMlhM95RPp2ZKD83R2VqkhkT6DrUpiKzNeCjRB1Y+ms s9HQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=TdtnQX3UxdvebW48f7tnydCq4mOF0SfKR6i6gTwXTPw=; fh=pZr6MZM5KYOIXjEdaDZFhqcAknzCCzjS05j4eIEmwvs=; b=vRt0JU34/ZD1QdmZsldaKCxJb7DtSPEjus5VRmWUxwzF1WOddxcARl1JlpVEE/xEVD WbZ4hXNkIlp6EKEySVhWXfkTjo2oY6oKp7IoDP24efMqRGe+hk0hMVPknE/GDr94b8Eb GnW4J+Ia/3GcSMOxBRWzi7F45Vt6CWlZ1CbFOOjjr/Y5oUWD3pRgg7IlAHaLAlugt6+d 5qBmpxYvza2YsITS/R/cX+pgJ91H1UiOrBO4kz5K3zUrr2MeKtkMsFdpQ9+dy5zonIbk GSPFTfNevCbafTGGqHXgFEmx7wqixJjMacPs/7GS0xes9rOv9C3zTBzcmVfaYT4bIW3j 6UqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Q6ShRD4+; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-202630-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202630-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f6323debb3si7416165ad.232.2024.06.05.06.35.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 06:35:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202630-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Q6ShRD4+; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-202630-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202630-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B338228BC82 for ; Wed, 5 Jun 2024 13:19:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26130192B68; Wed, 5 Jun 2024 12:46:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Q6ShRD4+" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7977188CAD; Wed, 5 Jun 2024 12:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717591573; cv=none; b=OVwNc8O1VD0DupLhmk9bBrD4MIghU2adQHLxuRuZFcgrQy70JpWv3oyPmdX/kNxodO02MzG1ZFoShvICXSGadDn7uNRSdBYsnqVhgMc0mC7l4+5Z/BI7V0Vekrft5+RY9gsJJO+wwzLdOIRWY0c6lEES/5q3p1Y8tq0Xfxprg3s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717591573; c=relaxed/simple; bh=Ch3CWjOSmEjNjTZ7SHlJr5S6yjUweCAKcDHefoaSG9M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jAKvKLIn8kHOumNuzMfU3FgtvR6HyAxMosAlGldE4GECHkr+PP0NBLU3jron+rm6rhgbslzdrek1PNyvcd0L5NW+eaqB8L+1E1qyR3n7/hprbUNPaiZvo9cupnHmjZN+lzxSW/V92RdSjOVdLfNQQBzbhdMM/GoBiNUcj/aFKw8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Q6ShRD4+; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 455B1Zbn031042; Wed, 5 Jun 2024 12:46:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= TdtnQX3UxdvebW48f7tnydCq4mOF0SfKR6i6gTwXTPw=; b=Q6ShRD4+Dsucax+4 UBpogMenfCZkF11L0b3sFekhHbvg3b+SRw1LVBsf/7jkpoGAVI7rEqcWLBgqGGpq bFpD18GhEXHFt0k1gMHM+Tt78bS5/+QQtgCz+pX9vvhvW7bDKboVXW46V/pIqaOF 6LmsMcgraTM0rRLwcHeynZNalR70XuQh1Z3yXJPcO+BAP3g4Dpfjac/eEF8eWUoO nZ1vDQmbDdB4f552ZxOiz6UIe1SGPnqRHhVDMUFjdj8UUk2C7axIi9ZiC2jJsRX1 1mL/2+2ATHrsYw9rYtcbwFRjtXIMdEitCmw0/WJpCIfmMsP5J0vTF2BVGbBBwfai ozLXIA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yj87rj0ra-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 12:46:04 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 455Ck2Hh022087 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 5 Jun 2024 12:46:02 GMT Received: from luoj-gv.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.1544.9; Wed, 5 Jun 2024 05:45:58 -0700 From: Luo Jie To: , , , , , , CC: , , , , Subject: [PATCH v15 1/4] clk: qcom: branch: Add clk_branch2_prepare_ops Date: Wed, 5 Jun 2024 20:45:38 +0800 Message-ID: <20240605124541.2711467-2-quic_luoj@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240605124541.2711467-1-quic_luoj@quicinc.com> References: <20240605124541.2711467-1-quic_luoj@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: QmZqDMvj5JrJlXHLZDWronzWIEE0bwTt X-Proofpoint-ORIG-GUID: QmZqDMvj5JrJlXHLZDWronzWIEE0bwTt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-05_02,2024-06-05_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 phishscore=0 impostorscore=0 malwarescore=0 bulkscore=0 clxscore=1015 spamscore=0 mlxlogscore=889 adultscore=0 lowpriorityscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406050097 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. Acked-by: Stephen Boyd 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 c1dba33ac31a..229480c5b075 100644 --- a/drivers/clk/qcom/clk-branch.c +++ b/drivers/clk/qcom/clk-branch.c @@ -191,3 +191,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 f1b3b635ff32..292756435f53 100644 --- a/drivers/clk/qcom/clk-branch.h +++ b/drivers/clk/qcom/clk-branch.h @@ -109,6 +109,7 @@ 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_mem_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.34.1