Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2637438pxm; Mon, 28 Feb 2022 03:14:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyapK8UQm4qs+1sRWiQ7oaa6B8NvR7cbi9Uqb4OifLcjPfF7DwJnAg8RWTbfpQEkiRSi2dS X-Received: by 2002:a17:906:ad8d:b0:6ae:9bd6:1e9a with SMTP id la13-20020a170906ad8d00b006ae9bd61e9amr15190615ejb.337.1646046893819; Mon, 28 Feb 2022 03:14:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646046893; cv=none; d=google.com; s=arc-20160816; b=mM07iWi7PFdEO1kYyT9JB9pdsWSUQfImUNi4qma2Qg69m2Nb7QoQ/2gNlGOyj7vW69 LjwzVH5eR7GBD6vyShLMf8tigH71ck/mFjXjzISgRiINKbKQPAyPItoP1TSV7Pj1nqed NeY6e6ADdbNvdlM3tA7BV+uSn2/kWOwiBDQz3tkobsqLbREH8Hhl8ZVFsRfE1r5aSjCO M0SwmBFaOEeGvY2A3Fql13nFtq28yXyEN/EYbbw0kPzjYVEdOL/Tw06Rb/MXte4envSj b940YurUpwoPbxMAQpgNWkmt77neqsVdg0s87I9eXUR+CQ60LgSOPNcVARsdBdOZkgAi PbhQ== 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=p9K9p80/Kt5ZYVZQzZ80bVW17pYGTl7pqRSVohlsFhU=; b=yGd3lcl+8aQkkxatMA0/0BUOIJamYqURaQYaiybaJ3Q7M0yNTIDQnUAcEe9TfkHdnp 7SfTYejFWfxN+mgsTdQBTGE8VMgUSRDq883ArjxybFra0bfvzRGnoKTGbRCUOCAGrEjf ridg3qMOQ4dpJ3VUluGbBPgdVz1cPRWN3MQrks76f0Qra8Dg8eAw8ful/BHYDjREqQoZ tQ+tEh3OTxe4oY2rlku1tcX0qjjDSI7SIp18vlQJBYyZmPzv0PoF/wbD06qdNYiJI9TS BC4aI/B9V4f+6q3v7l17tIkJSysT55Cb0v63v4UWLfCRVJBL3m4n0Wgkdxxr3+u99TGJ wC5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=PbVEwk8j; 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 p16-20020a17090664d000b006ae2b8daec5si7006580ejn.894.2022.02.28.03.14.31; Mon, 28 Feb 2022 03:14:53 -0800 (PST) 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=qcdkim header.b=PbVEwk8j; 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 S233461AbiB1IKP (ORCPT + 99 others); Mon, 28 Feb 2022 03:10:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231949AbiB1IKM (ORCPT ); Mon, 28 Feb 2022 03:10:12 -0500 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DAA569480; Mon, 28 Feb 2022 00:09:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646035774; x=1677571774; h=from:to:cc:subject:date:message-id:mime-version; bh=p9K9p80/Kt5ZYVZQzZ80bVW17pYGTl7pqRSVohlsFhU=; b=PbVEwk8jZqlvFXcIDK4WxWUpVx5JLcvjPc3D8oMp2d286HzKksCvpbVK N2gaDJCe9SBFNPBXYWMneMXaajaiankVBefIJIALWnI7AWgNypfozqqwn iAnm2djIioGJ1KD2mF9QrK/gHf9PO29uIwxO2aEnJ6i1Tkaq+XkwV5HNL A=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 28 Feb 2022 00:09:34 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2022 00:09:33 -0800 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.15; Mon, 28 Feb 2022 00:09:32 -0800 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.15; Mon, 28 Feb 2022 00:09:26 -0800 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu , "Venkata Prasad Potturu" Subject: [PATCH] ASoC: qcom: soundwire: Add support for controlling audio CGCR from HLOS Date: Mon, 28 Feb 2022 13:39:10 +0530 Message-ID: <1646035750-25635-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=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 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 Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu --- This patch set depends on: -- Clock driver patches with reset control support, yet to be posted. drivers/soundwire/qcom.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index fb183bd..440aad8 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -129,6 +130,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 @@ -618,6 +620,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 */ @@ -1269,6 +1273,9 @@ static int qcom_swrm_probe(struct platform_device *pdev) ctrl->bus.ops = &qcom_swrm_ops; ctrl->bus.port_ops = &qcom_swrm_port_ops; ctrl->bus.compute_params = &qcom_swrm_compute_params; + 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) -- 2.7.4