From patchwork Tue Sep 21 13:37:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 514419 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp3092090jao; Tue, 21 Sep 2021 06:39:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0Mjr8VPYgvQQpWbl62rMvmzM1eiVxeAApeQAMSjEb0b30IpqUB/rCc7OWQq2OefoN2is4 X-Received: by 2002:a05:6402:16d2:: with SMTP id r18mr23576235edx.363.1632231594734; Tue, 21 Sep 2021 06:39:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632231594; cv=none; d=google.com; s=arc-20160816; b=TwZ2BQbhgDevvQp12gWReQ/EbR72OCR9g30i6n4Lv31ghX7YGSs5Ucam0j/ugon9hR bAzwqhed+SJQT2dTl3l1/smtWuyL3iy46Ipi6F/1YJiz6czfJAZQ6k39unc48BPvCH6g f7PGc3HVzlmwKNYkgpEsa35GtGMTRzqO7lVM51e69LcOPHa+qs0pHArypxJrHi2njrzD UV/vpoHcATVJCZn/YOXI7c8Kcbo0wFoyIEIwS9ihUzBTvLlumxX7z7xsPa+QUxb45R8C Q5RrFm2T2Qk6o+tFFvY1XRIv32Eo9KC3Y0DscBFxZlsSuf9/rhXlMFhs8KaJKjlYuZUh DAYQ== 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=oA13aWw/vBigvq7sNCk3NCQoESUEmWiPzPnMa1c1hkI=; b=ZwsEWmZYzgQwG8082aXPPFqpDSubWOQ4QW3iEC6m7FPJgUCwPX6JatKyweNjybQaM0 97nkSpM3eLZr2z2Lmui1pENhoZjx4pIXU9Cjl9KqUJnAqSyhJDEneLkgJfcYNnz6lyXs DXQzVYTE6HtQ0hThYQ/Hd5dtxxDjWApM/eIfNTeavWYCqRd2eAnmRjMIEFDFbMN5BKqM PTL3jM+jfGn0qSI9aOPMb4VJjilLwdosAB7wx964yQe0OdGB6rlJ4zd3eE4bC7ilkOkE rZttoeQXMeSEnKNKnft2YD33Xi2dgS1KMubqrCRgKiuvKy1qufEle44dknMNwNz29hPa 3GBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qIx63ch3; 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 gv40si20271551ejc.399.2021.09.21.06.39.54; Tue, 21 Sep 2021 06:39:54 -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=qIx63ch3; 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 S233172AbhIUNlV (ORCPT + 7 others); Tue, 21 Sep 2021 09:41:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232953AbhIUNlU (ORCPT ); Tue, 21 Sep 2021 09:41:20 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44E75C061574 for ; Tue, 21 Sep 2021 06:39:52 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id v5so72821068edc.2 for ; Tue, 21 Sep 2021 06:39:52 -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=oA13aWw/vBigvq7sNCk3NCQoESUEmWiPzPnMa1c1hkI=; b=qIx63ch3Glgs0g6AxWOIjp9zAskJ8PnPAZemHNeQSm6jpzR4E2iVFKlj4if187mrLL oapX10kgvPMe+Tkk+UmnkM84JDrjLYnz1/zpimZVnPHajSz5wsv2HD6MCU3H+Ya3pbeU rxgM0KT3E6xfwsT2Z7xbmvOQus7wJgF7nbUWVYx6R4lNtuiKfdTuT4ZY+59ofY/jdZzb W8jP6RRGDmPmJ2MJYrmTzfRHQgwfH6pdOqaKlXa7BfaCeENABy9fRRvnVFIMI0ORAlv9 eVhCk6SUjnf6ZwwjvPa03ak+WJP8GCyZmcXacIsjUOD/WZyQ1nwmIOxnP8W9S1zaM8Fv ga4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oA13aWw/vBigvq7sNCk3NCQoESUEmWiPzPnMa1c1hkI=; b=uL4G6cxbclIXN/CWSXUdAfIQmnwvrE16WWcXdPjzIbqtQLkV+vYKcVzKzHGwkYdgES Vc7E4VaUisJ18Z5tH8PQIEQyDkEIGXpYgs0HCGMRAVrH6rMXVBmRDqT5GlxcKbZwN4nI 7c1p/Myl/Dpu2kXJckAwOvzeHeZSqlfXZ3KpLYNqRL5nkluNbeZsFCmxDfdREMSGzGbj Ai+MZgRibhZggL1QWP3oBdIF8yjuWzhB3xfGUWl5Tz0dwD5irl4ZXjvKqIOne/qBhFpX G7gPsqhGPcUKDaztP+Ra4o7gRHeKbgjABXju4oP7LUj6B2YJbR5XK1YD3zL1t2WXUcIW Cy6w== X-Gm-Message-State: AOAM5337ey0AXPL0JeTXlsAHcKgjK9yX/BwYcmn8tZnMeKFI5nlqLxPL 4NOwdgjWG796LMbryfZSkluY4w== X-Received: by 2002:a05:6402:203:: with SMTP id t3mr36298416edv.69.1632231477716; Tue, 21 Sep 2021 06:37:57 -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 b3sm7915799edx.55.2021.09.21.06.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 06:37:57 -0700 (PDT) From: Srinivas Kandagatla To: bjorn.andersson@linaro.org, broonie@kernel.org, robh@kernel.org Cc: plai@codeaurora.org, pierre-louis.bossart@linux.intel.com, 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 v7 22/22] ASoC: qdsp6: audioreach: add support for q6prm-clocks Date: Tue, 21 Sep 2021 14:37:09 +0100 Message-Id: <20210921133709.4973-23-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210921133709.4973-1-srinivas.kandagatla@linaro.org> References: <20210921133709.4973-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 465a2a603401..5b74c5bcc47f 100644 --- a/sound/soc/qcom/Kconfig +++ b/sound/soc/qcom/Kconfig @@ -96,8 +96,12 @@ config SND_SOC_QDSP6_APM select SND_SOC_QDSP6_APM_DAI select SND_SOC_QDSP6_APM_LPASS_DAI +config SND_SOC_QDSP6_PRM_LPASS_CLOCKS + tristate + config SND_SOC_QDSP6_PRM tristate + select SND_SOC_QDSP6_PRM_LPASS_CLOCKS config SND_SOC_QDSP6 tristate "SoC ALSA audio driver for 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..a26cda5140c1 --- /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(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M_CLK(LPASS_CLK_ID_VA_CORE_2X_MCLK), + Q6DSP_VOTE_CLK(LPASS_HW_MACRO_VOTE, Q6PRM_HW_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 __maybe_unused = { + .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");