Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30288759rwd; Thu, 6 Jul 2023 03:53:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlFeB0iOmn/HvGFBz2gGYlJJkYnMEMjpk/RngbPO2eaHCcykdFTHrlOe9LpAlULr4uStvyM7 X-Received: by 2002:a05:6a20:8418:b0:12f:fef8:ceba with SMTP id c24-20020a056a20841800b0012ffef8cebamr3332603pzd.18.1688640792221; Thu, 06 Jul 2023 03:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688640792; cv=none; d=google.com; s=arc-20160816; b=PtYxZ6lEk9HCg78A0CY6S/xlYlyUIpoVF5FECS6a5Uv6u2gOtXjiq/z4jthswMQ2r6 uPvJT8Yb7RBEbj/XMr7a9lGGJ/ZPFcQ9W9GAQNCqLK8tE8YqoXomBn1Xx7AoVz3JqbNA Qf6p5rZWBXmYEdjY+puxHI5y3hPJMcD30pT7Zvkq+mGqOpjK62otdZlKG8LIyW3+icHf m7ewQS18tq5YNZcmYcuPfNuZT5sR+GEvhOWVRAR6PD7SqUQynm0BVg2FdPKqs5YMLlmW ZTJ+/N+W+xxEtoP0XXIJeyxix8JEQSEqVEIyAl5dbn+ZDcSP3yvQqNhUxOU0z6EjDrrm +1Ew== 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=QUty73iMwPeiirVUiU5Of/Yw08fTIbdM8s+vybIHfQ4=; fh=NunHP3Flr+cCv8bwW6vlYnwDvVg/939akkf7WUBIuEQ=; b=k7uVrXUtDx3hwB8/o/BNYAc9FWnkH75EBTPOUna1drMx3HUnJO5kpH6WjcO8n3fIX4 0ZbdT9v5oMWKMWDhfy5W1OJ0SmYfcvESGLxui4uaRj/lootCrcZkg6Gzip5c51XG1uST LIRAIxq6UDAQw1xRyIhuwKF7FRv1F9Z2hugV9ezIoQIIyyYMDimvEDDviBrEa9sPofYZ zRgRFkNsLwwbVRNYeJq1LN1tJf8qbXdLHGXEkDzXgI827BwtUCJ8oGCbLqR/H9NWag6X 0Li1kAV3PxJR/pBBXgiAxrk7x+JUZwIP4TidbrVd5kgtPj8iD6gdXMep52X92pSZ2IeV btNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZQYbYMDm; 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 k71-20020a63844a000000b0054fec1e94d7si1173888pgd.705.2023.07.06.03.52.57; Thu, 06 Jul 2023 03:53:12 -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=ZQYbYMDm; 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 S232180AbjGFKwM (ORCPT + 99 others); Thu, 6 Jul 2023 06:52:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232033AbjGFKwE (ORCPT ); Thu, 6 Jul 2023 06:52:04 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF7F31FC3; Thu, 6 Jul 2023 03:51:50 -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 366A7nie024876; Thu, 6 Jul 2023 10:51:47 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=QUty73iMwPeiirVUiU5Of/Yw08fTIbdM8s+vybIHfQ4=; b=ZQYbYMDm6PVUSJZE/hVqQOl+heX1326X5UBUzVLk9jdlWld9DBudg2xXSdFHRQQ/SrbC pyaEpdHgCFFLilOQj/sCq/Gtcfj++12kF7ixlpQrALkK44KwtEiMWTQD+f9+8dyIWQbe jNTFn+Lz5pGn4BkgDA9Ky+cUjemTWJnypMxqCccDnjH/EAyVS29sTi7pV5TqMjvUzHeA TpvuXQ0iiPI7CCosy+c+cdwut7/6uDCeMvA23j4Y+lk2zwITdYkADFHuO2KEKVHVrWKA 79dE3519QxVKIhVQf7g7UT4oQ++ZHX9UaCBE3uWfrKQVqTXz96zEwRc0zLJlWr+BdVOM mg== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rmxpnbkbd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jul 2023 10:51:47 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 366ApkPl015232 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 6 Jul 2023 10:51:46 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, 6 Jul 2023 03:51:41 -0700 From: Imran Shaik To: Andy Gross , Konrad Dybcio , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: Bjorn Andersson , Taniya Das , Imran Shaik , "Melody Olvera" , Dmitry Baryshkov , , , , , Jagadeesh Kona , Satya Priya Kakitapalli , Ajit Pandey Subject: [PATCH V3 2/6] clk: qcom: gcc-qdu1000: Fix gcc_pcie_0_pipe_clk_src clock handling Date: Thu, 6 Jul 2023 16:20:41 +0530 Message-ID: <20230706105045.633076-3-quic_imrashai@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230706105045.633076-1-quic_imrashai@quicinc.com> References: <20230706105045.633076-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: nasanex01b.na.qualcomm.com (10.46.141.250) 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-ORIG-GUID: Zjy_op7OWw0RI9C65748m6glPlTymHsx X-Proofpoint-GUID: Zjy_op7OWw0RI9C65748m6glPlTymHsx 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-07-06_06,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 priorityscore=1501 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307060095 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 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 5051769ad90c..c00d26a3e6df 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 @@ -370,16 +370,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 }, @@ -439,16 +429,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