From patchwork Thu Mar 30 08:40:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varadarajan Narayanan X-Patchwork-Id: 76962 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp972105vqo; Thu, 30 Mar 2023 01:44:13 -0700 (PDT) X-Google-Smtp-Source: AKy350bvpLHMmmkfyK8FQsctX6Fr4lRFMntd2lm0xyiGZUiRv4cfH5COys4X167US+2tvDeot8v/ X-Received: by 2002:aa7:da57:0:b0:4fb:80cf:89e6 with SMTP id w23-20020aa7da57000000b004fb80cf89e6mr22741618eds.8.1680165852835; Thu, 30 Mar 2023 01:44:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680165852; cv=none; d=google.com; s=arc-20160816; b=D/EAlS/Kkp5KPmvZgoLsCpYX4TIuO8Sk7CF7PYQ1C0/tkMCs5RPaQCTfv71GlRTmN0 5pF1eGNXav/r+6OHr01ADSl/pvsi/5aRdC9bzkEPNdZ987YeBWQ8ONabSVOcED6DcHAh eOfKUCrvEOj6163Zulp8FBcKPcOd3qsBFfvz+d+0qbJ133ENgVwD5u7L5JLnMFyBjm8j APg2Jui/C6CY8cm5YEQ13An/H2rfJCseccpiKquLydfitekoNyOpv2ePeuSpRjBJJpR9 EvwnBecncaHOjUCdPg78QQSF1uGtu97bWfLkyg4blhWo+TTUV773u2Wt9htjW4x0IHR5 pp4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=NamAeNPplxwq6w9Jmy4Y5hQCgNKEtDIZ5CuLKlhkppg=; b=1CgS1DC2gmxJ/vc1k92tXzNJrMVQD1idZ9Hl4AHvjnxUpq3nRxFPj6XERZeSLUiPK+ nPph89KlY42Upt8clEaqdqOKSqIxPdad6dAnc8NiqeRpwWLX5Cef0UoUdbWX7j4SzrCH tRKupbw859+d7+QmVpd6eazFZnht08NlY+Ffi5eorsQE4vDUNPgrR1syRnbm73Q24ibH wqFAftKv3gFlpYzcEkFvZsXGI5dnnvUK6L8Lr8OyvPLuRRGHphDzwPtay0E5d0ysYP0p 8wqZFnLl/aalpHnXdSgNhhLsNE4WYWsAZ6kAM7EREHmCQ39rRkXV+deU25IxYWakBxR4 0OkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gWXLTbfY; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d16-20020a056402517000b004fd2b0b6f16si28620173ede.355.2023.03.30.01.43.47; Thu, 30 Mar 2023 01:44: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=gWXLTbfY; 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 S230050AbjC3Im3 (ORCPT + 99 others); Thu, 30 Mar 2023 04:42:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbjC3ImH (ORCPT ); Thu, 30 Mar 2023 04:42:07 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 805E57ABD; Thu, 30 Mar 2023 01:41:41 -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 32U6J0Kf015054; Thu, 30 Mar 2023 08:41:27 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-type; s=qcppdkim1; bh=NamAeNPplxwq6w9Jmy4Y5hQCgNKEtDIZ5CuLKlhkppg=; b=gWXLTbfY4UaD9c4fajexqT3o1lnlACnApR4YKDmNpAWL3By9YAe6/AhGYRR/ypqNBU8u 952UcgB/7s0ZErJlW3jS9fbEWMVBIuB753x3ySjGdiKcwpFnGhNub49eJNFz3s/tzJas erOLcL2fPCBqG6Fld4G3ppI9vhVqgC3OG0AnMs2IErOP0pKkJsQ3QJfcK7S0CIwUEZ9u WeN7eDfG5C7Icr1eOMGj5BD6BjikzgGFR6jenw9I8bfkc9bSoba3v6opILageGqbiE4h VYp/vr+E/lryQtE/SK4M/sTauxQroBwdJc1AL9YwmqIrR/PHoHW5dEsHtbJGkrGHoedk wg== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pn51ygcrd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Mar 2023 08:41:27 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32U8fQqd019947 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Mar 2023 08:41:26 GMT Received: from varda-linux.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.986.42; Thu, 30 Mar 2023 01:41:20 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , CC: Varadarajan Narayanan Subject: [PATCH v5 4/8] clk: qcom: gcc-ipq9574: Add USB related clocks Date: Thu, 30 Mar 2023 14:10:46 +0530 Message-ID: <2cbfb513f6cf3f17124b02ff10c625508c6038a0.1680162377.git.quic_varada@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 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-ORIG-GUID: EuTGxf3GbWr629N8CQBNC98F3FnYoDxq X-Proofpoint-GUID: EuTGxf3GbWr629N8CQBNC98F3FnYoDxq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-30_04,2023-03-30_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 impostorscore=0 malwarescore=0 adultscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303300069 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761781589156373223?= X-GMAIL-MSGID: =?utf-8?q?1761781589156373223?= Add the clocks needed for enabling USB in IPQ9574 Reviewed-by: Dmitry Baryshkov Acked-by: Stephen Boyd Signed-off-by: Varadarajan Narayanan --- Changes in v2: - Fixed coding style issues --- drivers/clk/qcom/gcc-ipq9574.c | 37 ++++++++++++++++++++++++++++ include/dt-bindings/clock/qcom,ipq9574-gcc.h | 2 ++ 2 files changed, 39 insertions(+) diff --git a/drivers/clk/qcom/gcc-ipq9574.c b/drivers/clk/qcom/gcc-ipq9574.c index 1bf33d5..06b724a 100644 --- a/drivers/clk/qcom/gcc-ipq9574.c +++ b/drivers/clk/qcom/gcc-ipq9574.c @@ -2041,6 +2041,41 @@ static struct clk_regmap_mux usb0_pipe_clk_src = { }, }; +static struct clk_branch gcc_usb0_pipe_clk = { + .halt_reg = 0x2c054, + .halt_check = BRANCH_HALT_DELAY, + .clkr = { + .enable_reg = 0x2c054, + .enable_mask = BIT(0), + .hw.init = &(struct clk_init_data){ + .name = "gcc_usb0_pipe_clk", + .parent_hws = (const struct clk_hw *[]) { + &usb0_pipe_clk_src.clkr.hw + }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_usb0_sleep_clk = { + .halt_reg = 0x2c058, + .clkr = { + .enable_reg = 0x2c058, + .enable_mask = BIT(0), + .hw.init = &(struct clk_init_data){ + .name = "gcc_usb0_sleep_clk", + .parent_hws = (const struct clk_hw *[]) { + &gcc_sleep_clk_src.clkr.hw + }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + .ops = &clk_branch2_ops, + }, + }, +}; + static const struct freq_tbl ftbl_sdcc_apps_clk_src[] = { F(144000, P_XO, 16, 12, 125), F(400000, P_XO, 12, 1, 5), @@ -4008,6 +4043,8 @@ static struct clk_regmap *gcc_ipq9574_clks[] = { [GCC_USB0_MOCK_UTMI_CLK] = &gcc_usb0_mock_utmi_clk.clkr, [USB0_PIPE_CLK_SRC] = &usb0_pipe_clk_src.clkr, [GCC_USB0_PHY_CFG_AHB_CLK] = &gcc_usb0_phy_cfg_ahb_clk.clkr, + [GCC_USB0_PIPE_CLK] = &gcc_usb0_pipe_clk.clkr, + [GCC_USB0_SLEEP_CLK] = &gcc_usb0_sleep_clk.clkr, [SDCC1_APPS_CLK_SRC] = &sdcc1_apps_clk_src.clkr, [GCC_SDCC1_APPS_CLK] = &gcc_sdcc1_apps_clk.clkr, [SDCC1_ICE_CORE_CLK_SRC] = &sdcc1_ice_core_clk_src.clkr, diff --git a/include/dt-bindings/clock/qcom,ipq9574-gcc.h b/include/dt-bindings/clock/qcom,ipq9574-gcc.h index 14543a4..97a7b19 100644 --- a/include/dt-bindings/clock/qcom,ipq9574-gcc.h +++ b/include/dt-bindings/clock/qcom,ipq9574-gcc.h @@ -214,4 +214,6 @@ #define GCC_SNOC_PCIE1_1LANE_S_CLK 205 #define GCC_SNOC_PCIE2_2LANE_S_CLK 206 #define GCC_SNOC_PCIE3_2LANE_S_CLK 207 +#define GCC_USB0_PIPE_CLK 208 +#define GCC_USB0_SLEEP_CLK 209 #endif