From patchwork Fri Sep 3 11:20:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 506525 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp906720jai; Fri, 3 Sep 2021 04:22:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpjhc0wEUtJp275A8jlHMq/7U29XSVQaYMUJI30YS8FftnqywW0gdwHHxKftc6Erdc3g2i X-Received: by 2002:a92:b711:: with SMTP id k17mr2198419ili.247.1630668122883; Fri, 03 Sep 2021 04:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630668122; cv=none; d=google.com; s=arc-20160816; b=QuPoovq1QoO5W6PvIj99UTOAmrKI7oLWSqM/GHJP6aMFZkieiAF3K/6jXAN2lmyW3X /1Fz3ma1kSs2mo34LFzuUIbYbsvRguf4dg0q2twtR3hnNcdJ3ukGY10eBN2iwsAxHcRk hqK2OYY0/wI0k+pZzDo6Xd9qbziLSSI5bfWhgpN8I0W9/wPuuSDJlx52VCni2N3HKzwO PdVG5jMbIkePdzEJtNfA6HlsdcZUeTV9fBxDM5wL6mP17MMirh6o5oExuZNGxZRk0Tm+ dCmJknrdhXaw0Na3V3RzZ8ccKwrVH86l1eHHLF/RiZkDmYXAG+jMitrYnHJssRIluecf +5Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ghQXYCQfqyt/dVUAb3gIF4EwlLmOXpP1q20//Znkk/E=; b=LfKsvm7kQigEJDdeFDS0O2+wrckrVXcGuyhkutL8mEHDpDofDyOV7OgZIBOpASQrXn LTEa5/Bi50iCPPNCfhK5W0cf71GYfFL2SK68RlGj05zdcLUUz/Sh5nhvqEx3CKu+Da2j OKh1aDGZvzjXLiQmCOdarJirVqsWuZKOarJTtwkk7/NpjrvSe9F4Qev0QR5HAhFjkyuO wW4CnX2qAmsqg5uFpf3QG+PhU0YD/SRs9QK12KtgchM5xKHOcOqUhpd8HWZjj9v7WHx7 iIaFZC1zLEtuFT5YqNMc25qQiSY+lee7WwpMuM/rBEqw+i1V02YzP33JF7rdVxb7WULw rMcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y6VDHEC5; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si175389ile.176.2021.09.03.04.22.02; Fri, 03 Sep 2021 04:22:02 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y6VDHEC5; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349261AbhICLXB (ORCPT + 6 others); Fri, 3 Sep 2021 07:23:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348457AbhICLXB (ORCPT ); Fri, 3 Sep 2021 07:23:01 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5246CC061575 for ; Fri, 3 Sep 2021 04:22:01 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id q11so7720735wrr.9 for ; Fri, 03 Sep 2021 04:22:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ghQXYCQfqyt/dVUAb3gIF4EwlLmOXpP1q20//Znkk/E=; b=Y6VDHEC5aJDCAvhUrXmYxyPomX39u4MFhKkQfNSmQvJ5SXDvkBun/VdmiL7//6geD1 wsXTJ0eoMLJGouEjlZ8oXkTVdSoHkIbvCxEs2BXHU4a7GMzvQvvBvCv7UjK/Ew45jvfk +j7lcXXkvo4TnElq0qErURTnXy/0/W0HjDLYkXOPR4CgyhkVMs9g5/uFL2uoJiAO0R0Y zG5lLN33jAND0GvzBycOcCEt/tI2qD2jtKjRcms+9Vmon6BW/OS7qX7az5zxnIjXTwb2 b+rH/r6NCgCuoTl3+hGM344eOy6oPOvJj/OrNiH30AN27nlu+rMfEA8DfETIFDmZ9c7j mZFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ghQXYCQfqyt/dVUAb3gIF4EwlLmOXpP1q20//Znkk/E=; b=M+zWojgah0e+U/apQAxSKjTZii403ZjDXTu76Q9dxwpZ28OgZjs+Y3Iue98RcMprhS CdQNL1lKsnzthScIi90Cifcw6PcTpAP87KcQXEOEg3KQxoKdxptRlHfVg7YAeJYwcUF/ ahjoWqpdGIBtvcAQzYYq0n/wEPaz6taCIrPLPgP2kgRY+2jO1IGvRqt67zi8K+31NGbh 1+XTzEYI1JYAhOXpCfHYgCnyYY4E07hCD6Ty7Dckp5ErzxBVAqmtxfs+RjaHFvVUiCNM tTPiqAfqbuuziTzjJQs+Fb0IGJsvOmXengfCcMz9zuSFmi235r97t25PCyNYP6jkYCBr hNpg== X-Gm-Message-State: AOAM531p/D65DKhvVf34HqaWtjebJtttwua0pS8HHRsnwTgQ33DfrFpd PdsAaVs4iHXoSxQ7Wh7eewRoHQ== X-Received: by 2002:adf:80e5:: with SMTP id 92mr3506967wrl.300.1630668119909; Fri, 03 Sep 2021 04:21:59 -0700 (PDT) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id f20sm3881877wmb.32.2021.09.03.04.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 04:21:59 -0700 (PDT) From: Srinivas Kandagatla To: bjorn.andersson@linaro.org, broonie@kernel.org, robh@kernel.org Cc: plai@codeaurora.org, tiwai@suse.de, devicetree@vger.kernel.org, perex@perex.cz, alsa-devel@alsa-project.org, lgirdwood@gmail.com, bgoswami@codeaurora.org, Srinivas Kandagatla Subject: [PATCH v5 21/21] ASoC: qdsp6: audioreach: add support for q6prm-clocks Date: Fri, 3 Sep 2021 12:20:32 +0100 Message-Id: <20210903112032.25834-22-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210903112032.25834-1-srinivas.kandagatla@linaro.org> References: <20210903112032.25834-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add q6prm clocks using existing qdsp6-audio-clock driver Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/Kconfig | 4 ++ sound/soc/qcom/qdsp6/Makefile | 1 + sound/soc/qcom/qdsp6/q6prm-clocks.c | 85 +++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 sound/soc/qcom/qdsp6/q6prm-clocks.c -- 2.21.0 diff --git a/sound/soc/qcom/Kconfig b/sound/soc/qcom/Kconfig index f4ccfe48f8f7..25beb0d40eb5 100644 --- a/sound/soc/qcom/Kconfig +++ b/sound/soc/qcom/Kconfig @@ -96,7 +96,11 @@ config SND_SOC_QDSP6_APM select SND_SOC_QDSP6_APM_LPASS_DAI tristate +config SND_SOC_QDSP6_PRM_LPASS_CLOCKS + tristate + config SND_SOC_QDSP6_PRM + select SND_SOC_QDSP6_PRM_LPASS_CLOCKS tristate config SND_SOC_QDSP6 diff --git a/sound/soc/qcom/qdsp6/Makefile b/sound/soc/qcom/qdsp6/Makefile index c932f8e24b32..3963bf234664 100644 --- a/sound/soc/qcom/qdsp6/Makefile +++ b/sound/soc/qcom/qdsp6/Makefile @@ -16,3 +16,4 @@ obj-$(CONFIG_SND_SOC_QDSP6_APM) += snd-q6apm.o obj-$(CONFIG_SND_SOC_QDSP6_APM_DAI) += q6apm-dai.o obj-$(CONFIG_SND_SOC_QDSP6_APM_LPASS_DAI) += q6apm-lpass-dais.o obj-$(CONFIG_SND_SOC_QDSP6_PRM) += q6prm.o +obj-$(CONFIG_SND_SOC_QDSP6_PRM_LPASS_CLOCKS) += q6prm-clocks.o diff --git a/sound/soc/qcom/qdsp6/q6prm-clocks.c b/sound/soc/qcom/qdsp6/q6prm-clocks.c new file mode 100644 index 000000000000..a1d9522b2bd2 --- /dev/null +++ b/sound/soc/qcom/qdsp6/q6prm-clocks.c @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2021, Linaro Limited + +#include +#include +#include +#include +#include +#include +#include +#include "q6dsp-lpass-clocks.h" +#include "q6prm.h" + +#define Q6PRM_CLK(id) { \ + .clk_id = id, \ + .q6dsp_clk_id = Q6PRM_##id, \ + .name = #id, \ + .rate = 19200000, \ + } + +static const struct q6dsp_clk_init q6prm_clks[] = { + Q6PRM_CLK(LPASS_CLK_ID_PRI_MI2S_IBIT), + Q6PRM_CLK(LPASS_CLK_ID_PRI_MI2S_EBIT), + Q6PRM_CLK(LPASS_CLK_ID_SEC_MI2S_IBIT), + Q6PRM_CLK(LPASS_CLK_ID_SEC_MI2S_EBIT), + Q6PRM_CLK(LPASS_CLK_ID_TER_MI2S_IBIT), + Q6PRM_CLK(LPAS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CORE_ID_LPASS, + "LPASS_HW_MACRO"), + Q6DSP_VOTE_CLK(LPASS_HW_DCODEC_VOTE, Q6PRM_HW_CORE_ID_DCODEC, + "LPASS_HW_DCODEC"), +}; + +static const struct q6dsp_clk_desc q6dsp_clk_q6prm = { + .clks = q6prm_clks, + .num_clks = ARRAY_SIZE(q6prm_clks), + .lpass_set_clk = q6prm_set_lpass_clock, + .lpass_vote_clk = q6prm_vote_lpass_core_hw, + .lpass_unvote_clk = q6prm_unvote_lpass_core_hw, +}; + +#ifdef CONFIG_OF +static const struct of_device_id q6prm_clock_device_id[] = { + { .compatible = "qcom,q6prm-lpass-clocks", .data = &q6dsp_clk_q6prm }, + {}, +}; +MODULE_DEVICE_TABLE(of, q6prm_clock_device_id); +#endif + +static struct platform_driver q6prm_clock_platform_driver = { + .driver = { + .name = "q6prm-lpass-clock", + .of_match_table = of_match_ptr(q6prm_clock_device_id), + }, + .probe = q6dsp_clock_dev_probe, +}; +module_platform_driver(q6prm_clock_platform_driver); + +MODULE_DESCRIPTION("Q6 Proxy Resource Manager LPASS clock driver"); +MODULE_LICENSE("GPL v2");