Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7722911rwp; Tue, 18 Jul 2023 22:09:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlEu9Wx0WKG9pwjRBr+ZnO5bFYVRS7kABFPQEOxeWPflLfWQQCkjCA3akOYShjj89cXJqacI X-Received: by 2002:a67:fc09:0:b0:440:c0dd:e7f7 with SMTP id o9-20020a67fc09000000b00440c0dde7f7mr1008087vsq.4.1689743345782; Tue, 18 Jul 2023 22:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689743345; cv=none; d=google.com; s=arc-20160816; b=z8Wehl0y97kfBo/HWAYfyvUpqkrziQwfaZHwxKg3m793pVx00ZrvZGsPKG87TlAsL0 hc9GB8VjmBgHcbTjXa6RVwE99EBy7w4FZhMR0sXjdaqOLptOxYegY5ql/IsgxWhpxrtY Nh1KjFOTYd0X1to+sFGttUVpPpgQm0r1XqvteifudU+an+Ar00+20M6QEPYUIG7Aj+5M tu6PxfsT8dxjPW23M60Shmau8dZLLWKrW/f/rqqoeuuEU7jsC/U/y66DbOwILhB56HzN KhMWCIOtxok1Mx95dCjXY9b5tJds4dpAUtIZsn25ce357C+I2HkPyCB7LkStcai1vS0d g27w== 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=2Vm4We1gMwREqRK4DWOA1k7q/h5hM/AvpdkonpB8OtA=; fh=NunHP3Flr+cCv8bwW6vlYnwDvVg/939akkf7WUBIuEQ=; b=d69JKlA+csGZxSJdm9dUvq050YuyU6sBcdEmV8+YEqiBMNngliZgNjsEg4vJTLiVz6 vod8b5FMl9pEyDIRgKqlK1cEC6bmDFaOBvX8X8lR/A/7pmR4vRILSTFBzbymZc7Q/i2F M3EajO8ce4KAavG+dMFIWKcn2vXMJzXggTch8e6nulXK9TOBQRYDizApzq/GFz2Nohvi b7edH4+tKNiVe4UgdPnl1bsSapRGqYCeWMNIc7I1GjNuj0dIw9zVyO3xdrj0bd/L//Yu SMniHnd0ELit6N2HpwfWGA5rCUTG48zjwCiq15k/frZLdCFLciHzCM/BlV14vBhwllFc 52Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=JyNfy++N; 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 q28-20020a638c5c000000b0054fd35b2dbcsi2781022pgn.350.2023.07.18.22.08.53; Tue, 18 Jul 2023 22:09:05 -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=JyNfy++N; 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 S230061AbjGSEPl (ORCPT + 99 others); Wed, 19 Jul 2023 00:15:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbjGSEPg (ORCPT ); Wed, 19 Jul 2023 00:15:36 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C44D18E; Tue, 18 Jul 2023 21:15:35 -0700 (PDT) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36J1uvsG010544; Wed, 19 Jul 2023 04:15:32 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=2Vm4We1gMwREqRK4DWOA1k7q/h5hM/AvpdkonpB8OtA=; b=JyNfy++N2ju0e8zftgZP9EkKd+3VGZRzLh81so3LHatkupgwqE46MxQqW0awQEaQC5ZF u43nbp1MYyqFBtz1aoRa/ehvvJcGKPbd8QOk9A2mI23u6eRpVqxBU/EPu+4Td33eKhPh nmChfU6J6BTVzjgPzu/k0p0yQAqDvbTwc/P9a0z6h+XlQbyV+VyiqDYYucc4LWQMYloK 9WDvy4l6kL58V12bTI2AznMSoEvwamj3EFlLiSiAL6OcnQzolw4AG3/Sg/7vT3eTPlwN XHSL7TI3lGTYWSwTKduwg0FgDcH9XsGlnw+kGKWbLG6DOTdIqYN7ysAyu83WNQEQ7RGY 5w== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rwps5a9vr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jul 2023 04:15:32 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36J4FUra032443 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jul 2023 04:15:30 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; Tue, 18 Jul 2023 21:15:25 -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 V4 2/7] clk: qcom: gcc-qdu1000: Fix gcc_pcie_0_pipe_clk_src clock handling Date: Wed, 19 Jul 2023 09:44:45 +0530 Message-ID: <20230719041450.737929-3-quic_imrashai@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230719041450.737929-1-quic_imrashai@quicinc.com> References: <20230719041450.737929-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-GUID: cToEqiviRSFq9nlgO22oh90V_RexXwdh X-Proofpoint-ORIG-GUID: cToEqiviRSFq9nlgO22oh90V_RexXwdh 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-19_01,2023-07-18_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 adultscore=0 impostorscore=0 phishscore=0 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307190038 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,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 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 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