* [PATCH v1 0/2] Qualcomm sm6115 LPASS clock controller
@ 2024-10-17 0:57 Alexey Klimov
2024-10-17 0:57 ` [PATCH v1 1/2] dt-bindings: clock: Add Qualcomm SM6115 " Alexey Klimov
2024-10-17 0:58 ` [PATCH v1 2/2] clk: qcom: Add SM6115 LPASSCC Alexey Klimov
0 siblings, 2 replies; 5+ messages in thread
From: Alexey Klimov @ 2024-10-17 0:57 UTC (permalink / raw)
To: konradybcio, konrad.dybcio, andersson, mturquette, sboyd, krzk+dt
Cc: robh, conor+dt, srinivas.kandagatla, linux-arm-msm, linux-clk,
devicetree, linux-kernel
This is one of the required dependencies for audio support on sm6115 and
its derivatives SoCs. This was written by Konrad Dybcio, however his linaro
email is already invalid. Konrad suggested sending it as-is and keeping
him in c/c. Some updates may be still required, for instance the
maintainers line in DT bindings file.
This was tested on QRB4210 (Qualcomm RB2 board). The only changes from my
side were fixing compilation errors and small changes in commit messages.
Konrad Dybcio (2):
dt-bindings: clock: Add Qualcomm SM6115 LPASS clock controller
clk: qcom: Add SM6115 LPASSCC
.../bindings/clock/qcom,sm6115-lpasscc.yaml | 53 ++++++++++++
drivers/clk/qcom/Kconfig | 9 ++
drivers/clk/qcom/Makefile | 1 +
drivers/clk/qcom/lpasscc-sm6115.c | 85 +++++++++++++++++++
.../dt-bindings/clock/qcom,sm6115-lpasscc.h | 15 ++++
5 files changed, 163 insertions(+)
create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm6115-lpasscc.yaml
create mode 100644 drivers/clk/qcom/lpasscc-sm6115.c
create mode 100644 include/dt-bindings/clock/qcom,sm6115-lpasscc.h
--
2.45.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v1 1/2] dt-bindings: clock: Add Qualcomm SM6115 LPASS clock controller
2024-10-17 0:57 [PATCH v1 0/2] Qualcomm sm6115 LPASS clock controller Alexey Klimov
@ 2024-10-17 0:57 ` Alexey Klimov
2024-10-17 8:39 ` Krzysztof Kozlowski
2024-10-17 0:58 ` [PATCH v1 2/2] clk: qcom: Add SM6115 LPASSCC Alexey Klimov
1 sibling, 1 reply; 5+ messages in thread
From: Alexey Klimov @ 2024-10-17 0:57 UTC (permalink / raw)
To: konradybcio, konrad.dybcio, andersson, mturquette, sboyd, krzk+dt
Cc: robh, conor+dt, srinivas.kandagatla, linux-arm-msm, linux-clk,
devicetree, linux-kernel
From: Konrad Dybcio <konrad.dybcio@linaro.org>
SM6115 (and its derivatives or similar SoCs) has an LPASS clock
controller block which provides audio-related resets.
Add bindings for it.
Cc: Konrad Dybcio <konradybcio@kernel.org>
Cc: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
[alexey.klimov] slightly changed the commit message
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
.../bindings/clock/qcom,sm6115-lpasscc.yaml | 53 +++++++++++++++++++
.../dt-bindings/clock/qcom,sm6115-lpasscc.h | 15 ++++++
2 files changed, 68 insertions(+)
create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm6115-lpasscc.yaml
create mode 100644 include/dt-bindings/clock/qcom,sm6115-lpasscc.h
diff --git a/Documentation/devicetree/bindings/clock/qcom,sm6115-lpasscc.yaml b/Documentation/devicetree/bindings/clock/qcom,sm6115-lpasscc.yaml
new file mode 100644
index 000000000000..58ee84aed073
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/qcom,sm6115-lpasscc.yaml
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,sm6115-lpasscc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm LPASS Core & Audio Clock Controller on SM6115
+
+maintainers:
+ - Konrad Dybcio <konrad.dybcio@linaro.org>
+ - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+
+description: |
+ Qualcomm LPASS core and audio clock controllers provide audio-related resets
+ on SM6115 and its derivatives.
+
+ See also::
+ include/dt-bindings/clock/qcom,sm6115-lpasscc.h
+
+properties:
+ compatible:
+ enum:
+ - qcom,sm6115-lpassaudiocc
+ - qcom,sm6115-lpasscc
+
+ reg:
+ maxItems: 1
+
+ '#reset-cells':
+ const: 1
+
+required:
+ - compatible
+ - reg
+ - '#reset-cells'
+
+additionalProperties: false
+
+examples:
+ - |
+ lpass_audiocc: clock-controller@a6a9000 {
+ compatible = "qcom,sm6115-lpassaudiocc";
+ reg = <0x0a6a9000 0x1000>;
+ #reset-cells = <1>;
+ };
+
+ - |
+ lpasscc: clock-controller@a7ec000 {
+ compatible = "qcom,sm6115-lpasscc";
+ reg = <0x0a7ec000 0x1000>;
+ #reset-cells = <1>;
+ };
+...
diff --git a/include/dt-bindings/clock/qcom,sm6115-lpasscc.h b/include/dt-bindings/clock/qcom,sm6115-lpasscc.h
new file mode 100644
index 000000000000..799274517c9a
--- /dev/null
+++ b/include/dt-bindings/clock/qcom,sm6115-lpasscc.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2023, Linaro Ltd.
+ */
+
+#ifndef _DT_BINDINGS_CLK_QCOM_LPASSCC_SM6115_H
+#define _DT_BINDINGS_CLK_QCOM_LPASSCC_SM6115_H
+
+/* LPASS CC */
+#define LPASS_SWR_TX_CONFIG_CGCR 0
+
+/* LPASS_AUDIO CC */
+#define LPASS_AUDIO_SWR_RX_CGCR 0
+
+#endif
--
2.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v1 2/2] clk: qcom: Add SM6115 LPASSCC
2024-10-17 0:57 [PATCH v1 0/2] Qualcomm sm6115 LPASS clock controller Alexey Klimov
2024-10-17 0:57 ` [PATCH v1 1/2] dt-bindings: clock: Add Qualcomm SM6115 " Alexey Klimov
@ 2024-10-17 0:58 ` Alexey Klimov
1 sibling, 0 replies; 5+ messages in thread
From: Alexey Klimov @ 2024-10-17 0:58 UTC (permalink / raw)
To: konradybcio, konrad.dybcio, andersson, mturquette, sboyd, krzk+dt
Cc: robh, conor+dt, srinivas.kandagatla, linux-arm-msm, linux-clk,
devicetree, linux-kernel
From: Konrad Dybcio <konrad.dybcio@linaro.org>
SM6115 (and its derivatives or similar SoCs) has an LPASS clock
controller block which provides audio-related resets.
Add the required code to support them.
Cc: Konrad Dybcio <konradybcio@kernel.org>
Cc: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
[alexey.klimov] fixed compilation errors after rebase,
slightly changed the commit message
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
drivers/clk/qcom/Kconfig | 9 ++++
drivers/clk/qcom/Makefile | 1 +
drivers/clk/qcom/lpasscc-sm6115.c | 85 +++++++++++++++++++++++++++++++
3 files changed, 95 insertions(+)
create mode 100644 drivers/clk/qcom/lpasscc-sm6115.c
diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
index 30eb8236c9d8..b6b68fc5c3f7 100644
--- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig
@@ -1173,6 +1173,15 @@ config SM_GPUCC_8650
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 2b378667a63f..16e65148066e 100644
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
@@ -147,6 +147,7 @@ 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_GPUCC_8650) += gpucc-sm8650.o
+obj-$(CONFIG_SM_LPASSCC_6115) += lpasscc-sm6115.o
obj-$(CONFIG_SM_TCSRCC_8550) += tcsrcc-sm8550.o
obj-$(CONFIG_SM_TCSRCC_8650) += tcsrcc-sm8650.o
obj-$(CONFIG_SM_VIDEOCC_7150) += videocc-sm7150.o
diff --git a/drivers/clk/qcom/lpasscc-sm6115.c b/drivers/clk/qcom/lpasscc-sm6115.c
new file mode 100644
index 000000000000..8ffdab71b948
--- /dev/null
+++ b/drivers/clk/qcom/lpasscc-sm6115.c
@@ -0,0 +1,85 @@
+// 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/mod_devicetable.h>
+#include <linux/platform_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);
+
+static int lpasscc_sm6115_probe(struct platform_device *pdev)
+{
+ const struct qcom_cc_desc *desc = of_device_get_match_data(&pdev->dev);
+
+ return qcom_cc_probe_by_index(pdev, 0, desc);
+}
+
+static struct platform_driver lpasscc_sm6115_driver = {
+ .probe = lpasscc_sm6115_probe,
+ .driver = {
+ .name = "lpasscc-sm6115",
+ .of_match_table = lpasscc_sm6115_match_table,
+ },
+};
+
+module_platform_driver(lpasscc_sm6115_driver);
+
+MODULE_DESCRIPTION("QTI LPASSCC SM6115 Driver");
+MODULE_LICENSE("GPL");
--
2.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/2] dt-bindings: clock: Add Qualcomm SM6115 LPASS clock controller
2024-10-17 0:57 ` [PATCH v1 1/2] dt-bindings: clock: Add Qualcomm SM6115 " Alexey Klimov
@ 2024-10-17 8:39 ` Krzysztof Kozlowski
2024-10-17 12:39 ` Alexey Klimov
0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-17 8:39 UTC (permalink / raw)
To: Alexey Klimov
Cc: konradybcio, konrad.dybcio, andersson, mturquette, sboyd, krzk+dt,
robh, conor+dt, srinivas.kandagatla, linux-arm-msm, linux-clk,
devicetree, linux-kernel
On Thu, Oct 17, 2024 at 01:57:59AM +0100, Alexey Klimov wrote:
> From: Konrad Dybcio <konrad.dybcio@linaro.org>
>
> SM6115 (and its derivatives or similar SoCs) has an LPASS clock
> controller block which provides audio-related resets.
>
> Add bindings for it.
That's a v2.
>
> Cc: Konrad Dybcio <konradybcio@kernel.org>
> Cc: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> [alexey.klimov] slightly changed the commit message
> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
My tag?
> ---
> .../bindings/clock/qcom,sm6115-lpasscc.yaml | 53 +++++++++++++++++++
> .../dt-bindings/clock/qcom,sm6115-lpasscc.h | 15 ++++++
> 2 files changed, 68 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm6115-lpasscc.yaml
> create mode 100644 include/dt-bindings/clock/qcom,sm6115-lpasscc.h
> +examples:
> + - |
> + lpass_audiocc: clock-controller@a6a9000 {
> + compatible = "qcom,sm6115-lpassaudiocc";
> + reg = <0x0a6a9000 0x1000>;
> + #reset-cells = <1>;
> + };
> +
> + - |
> + lpasscc: clock-controller@a7ec000 {
> + compatible = "qcom,sm6115-lpasscc";
> + reg = <0x0a7ec000 0x1000>;
> + #reset-cells = <1>;
> + };
Not much improved. Don't send same code from whatever repo you got, but
go via mailing list.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1 1/2] dt-bindings: clock: Add Qualcomm SM6115 LPASS clock controller
2024-10-17 8:39 ` Krzysztof Kozlowski
@ 2024-10-17 12:39 ` Alexey Klimov
0 siblings, 0 replies; 5+ messages in thread
From: Alexey Klimov @ 2024-10-17 12:39 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: konradybcio, konrad.dybcio, andersson, mturquette, sboyd, krzk+dt,
robh, conor+dt, srinivas.kandagatla, linux-arm-msm, linux-clk,
devicetree, linux-kernel
On Thu Oct 17, 2024 at 9:39 AM BST, Krzysztof Kozlowski wrote:
> On Thu, Oct 17, 2024 at 01:57:59AM +0100, Alexey Klimov wrote:
> > From: Konrad Dybcio <konrad.dybcio@linaro.org>
> >
> > SM6115 (and its derivatives or similar SoCs) has an LPASS clock
> > controller block which provides audio-related resets.
> >
> > Add bindings for it.
>
> That's a v2.
>
> >
> > Cc: Konrad Dybcio <konradybcio@kernel.org>
> > Cc: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> > Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> > Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> > [alexey.klimov] slightly changed the commit message
> > Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>
> My tag?
>
> > ---
> > .../bindings/clock/qcom,sm6115-lpasscc.yaml | 53 +++++++++++++++++++
> > .../dt-bindings/clock/qcom,sm6115-lpasscc.h | 15 ++++++
> > 2 files changed, 68 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm6115-lpasscc.yaml
> > create mode 100644 include/dt-bindings/clock/qcom,sm6115-lpasscc.h
> > +examples:
> > + - |
> > + lpass_audiocc: clock-controller@a6a9000 {
> > + compatible = "qcom,sm6115-lpassaudiocc";
> > + reg = <0x0a6a9000 0x1000>;
> > + #reset-cells = <1>;
> > + };
> > +
> > + - |
> > + lpasscc: clock-controller@a7ec000 {
> > + compatible = "qcom,sm6115-lpasscc";
> > + reg = <0x0a7ec000 0x1000>;
> > + #reset-cells = <1>;
> > + };
>
> Not much improved. Don't send same code from whatever repo you got, but
> go via mailing list.
Ok, thanks! I was not aware that there was a previous version on
maillist ~ a year ago. My impression was that this was never sent for
review. I'll update and resend it as v2 if there are no objections so it
will become a proper v2. I am more interested what should be done
regarding older email addresses or maybe .mailmap will handle it correctly.
Best regards,
Alexey
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-10-17 12:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-17 0:57 [PATCH v1 0/2] Qualcomm sm6115 LPASS clock controller Alexey Klimov
2024-10-17 0:57 ` [PATCH v1 1/2] dt-bindings: clock: Add Qualcomm SM6115 " Alexey Klimov
2024-10-17 8:39 ` Krzysztof Kozlowski
2024-10-17 12:39 ` Alexey Klimov
2024-10-17 0:58 ` [PATCH v1 2/2] clk: qcom: Add SM6115 LPASSCC Alexey Klimov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox