From nobody Tue Apr 28 01:11:34 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CCD9C43334 for ; Fri, 1 Jul 2022 07:17:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235062AbiGAHRu (ORCPT ); Fri, 1 Jul 2022 03:17:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234353AbiGAHRe (ORCPT ); Fri, 1 Jul 2022 03:17:34 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D67866B276; Fri, 1 Jul 2022 00:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1656659853; x=1688195853; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=GBB5iuEgmhph9RjzbVLlUF6rwOvV59YvfcO8hpiv5V4=; b=tXRqQBDj9U4gSGFh6VHPjscEpPZpcFvVSLjRWdY6J2DwkiQ4B86SKeCd VuEERYit+E6a7L4Zp/tirUk4LuxaeVqWPE3krF1yDZ5DX12/r1JATBIYa pLjuQAKTplh+YYpK0P/1GhemYl+zgfbbHuIMwpLNX/K5qBpOP0oCGEhKg c=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-02.qualcomm.com with ESMTP; 01 Jul 2022 00:17:33 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2022 00:17:32 -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; Fri, 1 Jul 2022 00:17:32 -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; Fri, 1 Jul 2022 00:17:26 -0700 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu Subject: [RESEND v5 1/2] soundwire: qcom: Add flag for software clock gating check Date: Fri, 1 Jul 2022 12:47:06 +0530 Message-ID: <1656659827-27450-2-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1656659827-27450-1-git-send-email-quic_srivasam@quicinc.com> References: <1656659827-27450-1-git-send-email-quic_srivasam@quicinc.com> MIME-Version: 1.0 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Validate software clock gating required or not and do software clock gating on hclk if soundwire is operational and keep it running by adding flag in private data structure. This is to avoid conflict between older architectures, where software clock gating is not required and on latest architectures, where software clock gating is mandatory. Signed-off-by: Srinivasa Rao Mandadapu Reviewed-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 22b7063..5baceda 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -179,6 +179,7 @@ struct qcom_swrm_ctrl { struct qcom_swrm_data { u32 default_cols; u32 default_rows; + bool sw_clk_gate_required; }; =20 static const struct qcom_swrm_data swrm_v1_3_data =3D { @@ -1307,6 +1308,15 @@ static int qcom_swrm_probe(struct platform_device *p= dev) return PTR_ERR(ctrl->mmio); } =20 + if (data->sw_clk_gate_required) { + ctrl->audio_cgcr =3D devm_reset_control_get_exclusive(dev, "swr_audio_cg= cr"); + if (IS_ERR_OR_NULL(ctrl->audio_cgcr)) { + dev_err(dev, "Failed to get cgcr reset ctrl required for SW gating\n"); + ret =3D PTR_ERR(ctrl->audio_cgcr); + goto err_init; + } + } + ctrl->irq =3D of_irq_get(dev->of_node, 0); if (ctrl->irq < 0) { ret =3D ctrl->irq; --=20 2.7.4 From nobody Tue Apr 28 01:11:34 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38ACCC43334 for ; Fri, 1 Jul 2022 07:17:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233609AbiGAHRo (ORCPT ); Fri, 1 Jul 2022 03:17:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235062AbiGAHRk (ORCPT ); Fri, 1 Jul 2022 03:17:40 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3904A6B276; Fri, 1 Jul 2022 00:17:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1656659860; x=1688195860; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=d3C89lxkSV25rneKnYRK3zet+skzg3cqSdSRgWF97+s=; b=tas/J0XQ1VsMCTn0BtT5eI6GVS4rw7pVd/hdDFrR00PwQ2t74E3CirPT Sr4mfaxHZzaIhq/SmuEoxd+1jUI+0Qep0YmxXQLrAwn0WLAOY6GnF4ry0 HPTQW1mUBStwi5DyqKvyt/vaELlPrrG1moHPqIsNjnY5teKitd+7a/SNh 8=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 01 Jul 2022 00:17:39 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2022 00:17:38 -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; Fri, 1 Jul 2022 00:17:38 -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; Fri, 1 Jul 2022 00:17:32 -0700 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu Subject: [RESEND v5 2/2] ASoC: qcom: soundwire: Enable software clock gating requirement flag Date: Fri, 1 Jul 2022 12:47:07 +0530 Message-ID: <1656659827-27450-3-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1656659827-27450-1-git-send-email-quic_srivasam@quicinc.com> References: <1656659827-27450-1-git-send-email-quic_srivasam@quicinc.com> MIME-Version: 1.0 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Enable software clock gating flag in private data for SC7280 based platforms, which are soundwire 1.6.0 version based. Signed-off-by: Srinivasa Rao Mandadapu Reviewed-by: Srinivas Kandagatla --- drivers/soundwire/qcom.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index 5baceda..4a77e74 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -192,6 +192,12 @@ static const struct qcom_swrm_data swrm_v1_5_data =3D { .default_cols =3D 16, }; =20 +static const struct qcom_swrm_data swrm_v1_6_data =3D { + .default_rows =3D 50, + .default_cols =3D 16, + .sw_clk_gate_required =3D true, +}; + #define to_qcom_sdw(b) container_of(b, struct qcom_swrm_ctrl, bus) =20 static int qcom_swrm_ahb_reg_read(struct qcom_swrm_ctrl *ctrl, int reg, @@ -1558,7 +1564,7 @@ static const struct dev_pm_ops swrm_dev_pm_ops =3D { static const struct of_device_id qcom_swrm_of_match[] =3D { { .compatible =3D "qcom,soundwire-v1.3.0", .data =3D &swrm_v1_3_data }, { .compatible =3D "qcom,soundwire-v1.5.1", .data =3D &swrm_v1_5_data }, - { .compatible =3D "qcom,soundwire-v1.6.0", .data =3D &swrm_v1_5_data }, + { .compatible =3D "qcom,soundwire-v1.6.0", .data =3D &swrm_v1_6_data }, {/* sentinel */}, }; =20 --=20 2.7.4