devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Andy Gross <agross@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Marijn Suijten <marijn.suijten@somainline.org>,
	linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] clk: qcom: Add SM6115 LPASSCC
Date: Sat, 26 Aug 2023 11:22:17 +0200	[thread overview]
Message-ID: <a9d52cd9-845e-ff88-3c26-858cb6604e43@linaro.org> (raw)
In-Reply-To: <20230825-topic-6115_lpasscc-v1-3-d4857be298e3@linaro.org>

On 25/08/2023 20:13, Konrad Dybcio wrote:
> SM6115 (and its derivatives or similar SoCs) have a LPASS clock
> controller block which provides audio-related resets.
> 
> Add the required code to support them.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  drivers/clk/qcom/Kconfig          |  9 +++++
>  drivers/clk/qcom/Makefile         |  1 +
>  drivers/clk/qcom/lpasscc-sm6115.c | 84 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 94 insertions(+)
> 
> diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
> index bd9bfb11b328..df9cf112e4b6 100644
> --- a/drivers/clk/qcom/Kconfig
> +++ b/drivers/clk/qcom/Kconfig
> @@ -1001,6 +1001,15 @@ config SM_GPUCC_8550
>  	  Say Y if you want to support graphics controller devices and
>  	  functionality such as 3D graphics.
>  
> +config SM_LPASSCC_6115
> +	tristate "SM6115 Low Power Audio Subsystem (LPASS) Clock Controller"
> +	depends on ARM64 || COMPILE_TEST
> +	select SM_GCC_6115
> +	help
> +	  Support for the LPASS clock controller on SM6115 devices.
> +	  Say Y if you want to toggle LPASS-adjacent resets within
> +	  this clock controller to reset the LPASS subsystem.
> +
>  config SM_TCSRCC_8550
>  	tristate "SM8550 TCSR Clock Controller"
>  	depends on ARM64 || COMPILE_TEST
> diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile
> index 4790c8cca426..61e3c72fe954 100644
> --- a/drivers/clk/qcom/Makefile
> +++ b/drivers/clk/qcom/Makefile
> @@ -128,6 +128,7 @@ obj-$(CONFIG_SM_GPUCC_8250) += gpucc-sm8250.o
>  obj-$(CONFIG_SM_GPUCC_8350) += gpucc-sm8350.o
>  obj-$(CONFIG_SM_GPUCC_8450) += gpucc-sm8450.o
>  obj-$(CONFIG_SM_GPUCC_8550) += gpucc-sm8550.o
> +obj-$(CONFIG_SM_LPASSCC_6115) += lpasscc-sm6115.o
>  obj-$(CONFIG_SM_TCSRCC_8550) += tcsrcc-sm8550.o
>  obj-$(CONFIG_SM_VIDEOCC_8150) += videocc-sm8150.o
>  obj-$(CONFIG_SM_VIDEOCC_8250) += videocc-sm8250.o
> diff --git a/drivers/clk/qcom/lpasscc-sm6115.c b/drivers/clk/qcom/lpasscc-sm6115.c
> new file mode 100644
> index 000000000000..6aa19e16c53b
> --- /dev/null
> +++ b/drivers/clk/qcom/lpasscc-sm6115.c
> @@ -0,0 +1,84 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (c) 2022, 2023 Linaro Limited
> + */
> +
> +#include <linux/clk-provider.h>
> +#include <linux/err.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/of_device.h>
> +#include <linux/regmap.h>
> +
> +#include <dt-bindings/clock/qcom,sm6115-lpasscc.h>
> +
> +#include "common.h"
> +#include "reset.h"
> +
> +static const struct qcom_reset_map lpass_audiocc_sm6115_resets[] = {
> +	[LPASS_AUDIO_SWR_RX_CGCR] =  { .reg = 0x98, .bit = 1, .udelay = 500 },
> +};
> +
> +static struct regmap_config lpass_audiocc_sm6115_regmap_config = {
> +	.reg_bits = 32,
> +	.reg_stride = 4,
> +	.val_bits = 32,
> +	.name = "lpass-audio-csr",
> +	.max_register = 0x1000,
> +};
> +
> +static const struct qcom_cc_desc lpass_audiocc_sm6115_reset_desc = {
> +	.config = &lpass_audiocc_sm6115_regmap_config,
> +	.resets = lpass_audiocc_sm6115_resets,
> +	.num_resets = ARRAY_SIZE(lpass_audiocc_sm6115_resets),
> +};
> +
> +static const struct qcom_reset_map lpasscc_sm6115_resets[] = {
> +	[LPASS_SWR_TX_CONFIG_CGCR] = { .reg = 0x100, .bit = 1, .udelay = 500 },
> +};
> +
> +static struct regmap_config lpasscc_sm6115_regmap_config = {
> +	.reg_bits = 32,
> +	.reg_stride = 4,
> +	.val_bits = 32,
> +	.name = "lpass-tcsr",
> +	.max_register = 0x1000,
> +};
> +
> +static const struct qcom_cc_desc lpasscc_sm6115_reset_desc = {
> +	.config = &lpasscc_sm6115_regmap_config,
> +	.resets = lpasscc_sm6115_resets,
> +	.num_resets = ARRAY_SIZE(lpasscc_sm6115_resets),
> +};
> +
> +static const struct of_device_id lpasscc_sm6115_match_table[] = {
> +	{
> +		.compatible = "qcom,sm6115-lpassaudiocc",
> +		.data = &lpass_audiocc_sm6115_reset_desc,
> +	}, {
> +		.compatible = "qcom,sm6115-lpasscc",
> +		.data = &lpasscc_sm6115_reset_desc,
> +	},
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, lpasscc_sm6115_match_table);

Everything here is almost the same as sc8280xp one, so this should be
added to sc8280xp. You cut some boilerplate and additional driver.

Best regards,
Krzysztof


  reply	other threads:[~2023-08-26  9:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25 18:13 [PATCH 0/3] SM6115 LPASSCC Konrad Dybcio
2023-08-25 18:13 ` [PATCH 1/3] dt-bindings: clock: Add Qualcomm SM6115 LPASS clock controller Konrad Dybcio
2023-08-26  9:28   ` Krzysztof Kozlowski
2023-08-26  9:39     ` Konrad Dybcio
2023-08-26  9:46       ` Krzysztof Kozlowski
2023-08-25 18:13 ` [PATCH 2/3] clk: qcom: reset: Increase max reset delay Konrad Dybcio
2023-08-25 18:13 ` [PATCH 3/3] clk: qcom: Add SM6115 LPASSCC Konrad Dybcio
2023-08-26  9:22   ` Krzysztof Kozlowski [this message]
2023-08-26 14:09     ` Dmitry Baryshkov
2023-08-26 14:29       ` Krzysztof Kozlowski
2023-08-28 11:45         ` Konrad Dybcio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a9d52cd9-845e-ff88-3c26-858cb6604e43@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).