Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp449455iob; Wed, 18 May 2022 05:53:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5kcfpWh5UbNosCfRcx+/VKsQkcnLIXj0i07a0unlxIB1QXjtJpn+3XlBlRcDksJNXT5LV X-Received: by 2002:a17:902:f68a:b0:15e:b12d:f4a1 with SMTP id l10-20020a170902f68a00b0015eb12df4a1mr26537133plg.166.1652878387964; Wed, 18 May 2022 05:53:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652878387; cv=none; d=google.com; s=arc-20160816; b=bbt90eN4bBcBz0+3Pt94duOx2mXbYvAvaG9CEz7zGh3DfLDn9jKa5ydIfNefCX7yns ggMBGVC/1zBUNfrridAH1QZCGmVK6tglN3vQs5yxG02GZo4bJGlel6xxfUHZfoAdmX0I DP32OvHxkO2RLwuNSmfp5rnnel2ZDG5dWBDcy8VjRk9KX7L0YbrYJzQ+Pm+LtpPXrXLP tXc/PrVAR/trar4F3WF/54pmtGs9K2tJtQlrxcAEoCTUuswtTeTgQQFWnHRKw3lS9T2Y WtmTlGVrYEy9JUAbncdYrShUleDbf4FW4QjsDDvZJpCWnPIkMXC4yVoaoa3YL9sEQj4U TAQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=s1haGoMzWn+D78/Wjs5Eo95uLM9lSkcETlTB2+3u46w=; b=HktTQNWq38yW/CECgfCGh2bFXKLnd1nQlKCJATPtftSqyPPOswTFJ9iy44aer3iIqL S42/zIFv25H1IsoI7P1giaQkX0gQAzWWU0lxyAMCMvVuy5+NR9snAUXwKuR3LsAsZuFL ANlUuxH16mcPHTd0MFtgWPwPt78a5+1Z0GNhQ4wKHTbn2xts0+9DUtdu3S8jaCRvCaTK UOOwTudpWWROkooUAAs0o+M2YkREdlxaXAUlfjsju7HM5oEJgHtpAnCMVjkJJTLQM1wg A+KPCGYFktEqWH61h+8GJo2Thgz8L3saNZSNN43gYiOdghqD6i4c6zCnkGIrtF0KfNMA y2nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=hnpwlAkk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id be2-20020a170902aa0200b00153b2d165e8si2554893plb.496.2022.05.18.05.53.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 05:53:07 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=hnpwlAkk; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 07AE81737F6; Wed, 18 May 2022 05:48:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236509AbiERMsK (ORCPT + 99 others); Wed, 18 May 2022 08:48:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237572AbiERMqF (ORCPT ); Wed, 18 May 2022 08:46:05 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D87511632AC; Wed, 18 May 2022 05:43:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652877785; x=1684413785; h=from:to:cc:subject:date:message-id:mime-version; bh=s1haGoMzWn+D78/Wjs5Eo95uLM9lSkcETlTB2+3u46w=; b=hnpwlAkkzVzs23vGtWnOfs/wUZonfu7p2syRxT77kFgjRaBgptaGyWRy YYYiBm8r2Oajs5yr+k9fV8Xhg4g7sBXtbvnNC+CC+2Vf3zZNLQg0WYlG3 dxcU+71xKU3D09DqeYMl7Ix3sgK4GFLhl4PTJQ1/2cnTmDp/Nq87w0ki4 4=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 18 May 2022 05:43:03 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2022 05:43:03 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 18 May 2022 05:43:02 -0700 Received: from hu-srivasam-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 18 May 2022 05:42:56 -0700 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu Subject: [PATCH v2] ASoC: qcom: soundwire: Add support for controlling audio CGCR from HLOS Date: Wed, 18 May 2022 18:12:35 +0530 Message-ID: <1652877755-25120-1-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Add support for controlling soundwire audio CGCR interface using clock framework to make hclk ungating with software. As per new hardware changes, software has to always ungate hclk if soundwire is operational and keep it running. This requirement is for latest LPASS chipsets for RX, TX and WSA path to work. Signed-off-by: Srinivasa Rao Mandadapu --- This patch set depends on: -- Clock driver patches for CGCR reset control support. --- https://patchwork.kernel.org/project/linux-arm-msm/list/?series=638002 --- https://patchwork.kernel.org/project/linux-arm-msm/list/?series=637998 Changes since v1: -- Add audio cgcr reset control in runtime PM resume handler. -- Update dependency list. drivers/soundwire/qcom.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index da1ad7e..445e481 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -142,6 +143,7 @@ struct qcom_swrm_ctrl { struct device *dev; struct regmap *regmap; void __iomem *mmio; + struct reset_control *audio_cgcr; #ifdef CONFIG_DEBUG_FS struct dentry *debugfs; #endif @@ -656,6 +658,8 @@ static int qcom_swrm_init(struct qcom_swrm_ctrl *ctrl) val = FIELD_PREP(SWRM_MCP_FRAME_CTRL_BANK_ROW_CTRL_BMSK, ctrl->rows_index); val |= FIELD_PREP(SWRM_MCP_FRAME_CTRL_BANK_COL_CTRL_BMSK, ctrl->cols_index); + reset_control_reset(ctrl->audio_cgcr); + ctrl->reg_write(ctrl, SWRM_MCP_FRAME_CTRL_BANK_ADDR(0), val); /* Enable Auto enumeration */ @@ -1333,6 +1337,10 @@ static int qcom_swrm_probe(struct platform_device *pdev) ctrl->bus.compute_params = &qcom_swrm_compute_params; ctrl->bus.clk_stop_timeout = 300; + ctrl->audio_cgcr = devm_reset_control_get_exclusive(dev, "swr_audio_cgcr"); + if (IS_ERR(ctrl->audio_cgcr)) + dev_err(dev, "Failed to get audio_cgcr reset required for soundwire-v1.6.0\n"); + ret = qcom_swrm_get_port_config(ctrl); if (ret) goto err_clk; @@ -1486,6 +1494,8 @@ static int __maybe_unused swrm_runtime_resume(struct device *dev) qcom_swrm_get_device_status(ctrl); sdw_handle_slave_status(&ctrl->bus, ctrl->status); } else { + reset_control_reset(ctrl->audio_cgcr); + ctrl->reg_write(ctrl, SWRM_MCP_BUS_CTRL, SWRM_MCP_BUS_CLK_START); ctrl->reg_write(ctrl, SWRM_INTERRUPT_CLEAR, SWRM_INTERRUPT_STATUS_MASTER_CLASH_DET); -- 2.7.4