From patchwork Wed Apr 5 11:41:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Varadarajan Narayanan X-Patchwork-Id: 79575 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp234842vqo; Wed, 5 Apr 2023 04:44:25 -0700 (PDT) X-Google-Smtp-Source: AKy350ZzfYqnW3e6iZgQ4a8Y6tmd2TWH9fnUmAmYxY+bkuH9GH7WtR+EvCi4543AFSkYsWY6gchI X-Received: by 2002:a17:907:bb8c:b0:946:e908:3af0 with SMTP id xo12-20020a170907bb8c00b00946e9083af0mr2154724ejc.26.1680695064787; Wed, 05 Apr 2023 04:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680695064; cv=none; d=google.com; s=arc-20160816; b=bZrcM1GebckvYKs+VOPKsJqyt+O030L+X5QEIzq9muzmG6kpWKelHsbD0u0mm48Bjg /NqSRuRRqJH13/5ISs3RB7m9RVPNKCoYUi+rpkgfE9vJm93qKV5k+WNPaO8/vrchAO4l gTcrVJevOj6Z1bkxVc7Q+MBfSCwcO8FytK/n5NRbMt6vtH9/8DrljHlLSdxAvHX3331E DcEpw8913OQ94cwY6IUouAhJLUkP7aSgHlmhg8n29tFZnQ26nHYA4HzY0bD0DOK4aFP+ utGTkKeTbYr09isiXSNuNWuhRpcng3zHtoP7MhwAfb0hdo563oElKq51kBr1xbHjxrLG Mrhw== 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=XZx9UJLoz0MpotphWSon+tYSj8fjQWPtH8A99zmkScY=; b=Gl4JlC9t5p7gDQbsP9JwRk0nj7YLjjHIEI1V2eYrT9LWFE2ynx6mk20ArhhJmnI1GK PWD96N2YJ8QmPRSJmE2CgDLl8sj/nZrg9ftJ+mRbuJDQ7hwvxAOAyzXtrPDssTuK7Wo2 AG/IRHbPlYY2YZRDhwtl09MVDRhdEpUv0qhq2kOSq28jH1D+kO0p6b8KKe/XapTol0R/ ogwx5R+VSXkdPBUpChjazOFAsyG3scmRawgDKqSR8U3d/oM2wp3cyRXEy8aMxjymvUWc 1G6QQ/qkra0sR4T6cGLjZjubcxcGfgxalsEAlwjZIydo4S2RjcNC17u47Manr2luMLQ8 fh9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=V3xjmd6o; 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 zh18-20020a170906881200b008b17dae0e0dsi8250005ejb.846.2023.04.05.04.44.01; Wed, 05 Apr 2023 04:44:24 -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=V3xjmd6o; 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 S237236AbjDELmY (ORCPT + 99 others); Wed, 5 Apr 2023 07:42:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237938AbjDELmN (ORCPT ); Wed, 5 Apr 2023 07:42:13 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E0FF55AE; Wed, 5 Apr 2023 04:42:11 -0700 (PDT) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3359c1Fu017131; Wed, 5 Apr 2023 11:42:05 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=XZx9UJLoz0MpotphWSon+tYSj8fjQWPtH8A99zmkScY=; b=V3xjmd6oo5bcw0O6W9ngjUmTRZJ3y48hBwIVUnVMb8i/IqrnmdxGv3Y7k0LIs5nXMEUp JuifHmxx/Ngyg5XldxBLWhMrO6N9w1SzcYp2R1Apzr43FyUalYIRgatVDTh79QcVRG2a KHiDV9fW5b8kAIrpSPxUo2kqLLtE3gd14/eI5hqy0W/R380oVJXG75xg74auhrz4dByx RTBcOBQzfHdezqtxbLel05koy4BBhY6gAzLOVgJKRN2MTujtAnIPTNHngzUB+skIYQO3 dfJouI2drw4JiAtnlHGQzkv6wfKPMnvBPnbbgFfSHSvgNfMIkY/08u5i7dSAQL8NTw4r Wg== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3prn8b2t96-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Apr 2023 11:42:05 +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 335Bg482027522 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 5 Apr 2023 11:42:04 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; Wed, 5 Apr 2023 04:41:58 -0700 From: Varadarajan Narayanan To: , , , , , , , , , , , , , , , , CC: Varadarajan Narayanan Subject: [PATCH v8 4/8] clk: qcom: gcc-ipq9574: Add USB related clocks Date: Wed, 5 Apr 2023 17:11:23 +0530 Message-ID: <2ff453eb9b51184b2a85bf64fc9bc8d737ee8a0d.1680693149.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-GUID: tm5RgD8OK7SF__pHceV_5k9DtN4Vodbs X-Proofpoint-ORIG-GUID: tm5RgD8OK7SF__pHceV_5k9DtN4Vodbs 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-04-05_07,2023-04-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 impostorscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304050106 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?1762336508329487760?= X-GMAIL-MSGID: =?utf-8?q?1762336508329487760?= 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 c855954..f19e9cb 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 2d7b460..2cb02f7 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_PCIE1_PIPE_CLK 205 #define GCC_PCIE2_PIPE_CLK 206 #define GCC_PCIE3_PIPE_CLK 207 +#define GCC_USB0_PIPE_CLK 208 +#define GCC_USB0_SLEEP_CLK 209 #endif