Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2169359rwo; Thu, 3 Aug 2023 05:54:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlE3uahJW4MH+rtTS6IKBoHQecwDgPrJzCqwN6nItYV2yClZPh5SUOlRkgRHs+kWSa+AuVA6 X-Received: by 2002:a05:6a00:1a56:b0:687:4a3d:8fad with SMTP id h22-20020a056a001a5600b006874a3d8fadmr9566343pfv.16.1691067243123; Thu, 03 Aug 2023 05:54:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691067243; cv=none; d=google.com; s=arc-20160816; b=zvSQMdFq3LXALqlv1ALjnuH3CYI4LtFE/1MpPI4UmuXG3uHVpr/ujM0wyljUaBMgwk 8BHEYmINLoM9ohUMcHhf5zFLalPZz/RRv2k2SMnKLxhR9iYgd0L9nsXH/EPeKPIh9t39 VBYomoRPFXGt4pSpBHNkbjfu35KTkp+gwvKp3bYaub7lbRlyH0ah+kIaJPbs3rbKCL2y znTibDeRG3Rly/KcPt76431jToRuUpZfdleG8joBTm+KInBPH7/THeOb3xusrq7qiKSN rfd8LuZZESZQShNSYAHD/1sArE88bYmelcT3QpyfjirR8Q8HmtxPI0J9Sbib6Y300RPV AgdQ== 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=H0hyPgFsN3rrtEP0ALoiF8TOZT704TBpnLiHmk0qdCs=; fh=JGIPdwR/ghosjNwmGX0PEjhcJN3y9idmuh+UBOLugoc=; b=dUF1C7QUjALQuz1eQpoGTkDYRU9txEnZkKH6OBQ3kCqH0kmzWPZO8BLra/DpAAUVhh 9599wGa6QSsLv0BkkF657B0259B/bJbhlYRAT8Z4/Zv0/je/ptD8mCu8fyd4yWAqdCFC UotyiDirbHiM4CZpQZ5/UKDGupkb8l3EGr3uzjNe88PPVAAJ1wVLJRR4RzprCN0UADKK 8REglez66/Gz+hWY1G1smFWUBv7MQE6HrxrfLLQUOpUf1scS7DXwWL5BrpDQmlvOrwId KQdj7hAsco1FTRfv02qN/qrT61cx9WO0t1ttXZ5G4FuvF4MI80EcavaSfVPq6fPndHBo JHFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MrD63mbz; 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 d6-20020aa78e46000000b0067a5e893334si12628912pfr.55.2023.08.03.05.53.51; Thu, 03 Aug 2023 05:54:03 -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=MrD63mbz; 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 S235520AbjHCK6y (ORCPT + 99 others); Thu, 3 Aug 2023 06:58:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235466AbjHCK6p (ORCPT ); Thu, 3 Aug 2023 06:58:45 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26E013A95; Thu, 3 Aug 2023 03:58:31 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 373AkTSm024073; Thu, 3 Aug 2023 10:58:26 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=H0hyPgFsN3rrtEP0ALoiF8TOZT704TBpnLiHmk0qdCs=; b=MrD63mbz6mONvfzzMtmbQaFEuficTykNHqNMniHMf7IRc9M+1A9e//s6hdriGRPud6b5 sJhqwb6plAEEe0nJsPQnPUZ9L4F7ea+8crZFvVYjdErkE8nXG3YTFsYiN1Yrw4jUZ4ru InMNcu0L9mgbK6wEVrbtQw7ifofSOlrBlnDF9hgl0do+vtKhm+GcLmpwaY6g1D5//wZB pGFI6OJMsdPEXOYytheOkqkiu0erOsMURcw3gLuACWdg5azh3WPf3VA1HeuxBQt41iYM XUyl2z1bN1HIQOwIpbLP0gf+eA5ufoH5nMqiuqYobqpIM7lHqCTvN6FCS8219aZ81ULf OQ== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s87jhge13-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Aug 2023 10:58:25 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 373AwOsQ017827 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 3 Aug 2023 10:58:24 GMT Received: from hu-imrashai-hyd.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Thu, 3 Aug 2023 03:58:19 -0700 From: Imran Shaik To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: Taniya Das , Imran Shaik , Dmitry Baryshkov , Melody Olvera , , , , , Jagadeesh Kona , "Ajit Pandey" , Satya Priya Kakitapalli Subject: [PATCH V5 2/8] clk: qcom: gcc-qdu1000: Fix gcc_pcie_0_pipe_clk_src clock handling Date: Thu, 3 Aug 2023 16:27:35 +0530 Message-ID: <20230803105741.2292309-3-quic_imrashai@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230803105741.2292309-1-quic_imrashai@quicinc.com> References: <20230803105741.2292309-1-quic_imrashai@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 nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 3t9bPkklLMwrv0NOFzBXDZDdZyzV5SuP X-Proofpoint-ORIG-GUID: 3t9bPkklLMwrv0NOFzBXDZDdZyzV5SuP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-03_09,2023-08-03_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308030098 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Fix the gcc pcie pipe clock handling as per the clk_regmap_phy_mux_ops implementation to let the clock framework automatically park the clock at XO when the clock is switched off and restore the parent when the clock is switched on. Fixes: 1c9efb0bc040 ("clk: qcom: Add QDU1000 and QRU1000 GCC support") Co-developed-by: Taniya Das Signed-off-by: Taniya Das Signed-off-by: Imran Shaik Reviewed-by: Konrad Dybcio --- Changes since v4: - None Changes since v3: - None Changes since v2: - Updated the commit text Changes since v1: - Newly added drivers/clk/qcom/gcc-qdu1000.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/clk/qcom/gcc-qdu1000.c b/drivers/clk/qcom/gcc-qdu1000.c index 328b306297ef..9fa0616952d9 100644 --- a/drivers/clk/qcom/gcc-qdu1000.c +++ b/drivers/clk/qcom/gcc-qdu1000.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -371,16 +371,6 @@ static const struct clk_parent_data gcc_parent_data_6[] = { { .index = DT_TCXO_IDX }, }; -static const struct parent_map gcc_parent_map_7[] = { - { P_PCIE_0_PIPE_CLK, 0 }, - { P_BI_TCXO, 2 }, -}; - -static const struct clk_parent_data gcc_parent_data_7[] = { - { .index = DT_PCIE_0_PIPE_CLK_IDX }, - { .index = DT_TCXO_IDX }, -}; - static const struct parent_map gcc_parent_map_8[] = { { P_BI_TCXO, 0 }, { P_GCC_GPLL0_OUT_MAIN, 1 }, @@ -440,16 +430,15 @@ static struct clk_regmap_mux gcc_pcie_0_phy_aux_clk_src = { }, }; -static struct clk_regmap_mux gcc_pcie_0_pipe_clk_src = { +static struct clk_regmap_phy_mux gcc_pcie_0_pipe_clk_src = { .reg = 0x9d064, - .shift = 0, - .width = 2, - .parent_map = gcc_parent_map_7, .clkr = { .hw.init = &(const struct clk_init_data) { .name = "gcc_pcie_0_pipe_clk_src", - .parent_data = gcc_parent_data_7, - .num_parents = ARRAY_SIZE(gcc_parent_data_7), + .parent_data = &(const struct clk_parent_data){ + .index = DT_PCIE_0_PIPE_CLK_IDX, + }, + .num_parents = 1, .ops = &clk_regmap_phy_mux_ops, }, }, -- 2.25.1