Skip to contentSkip to conversation

Add QCOM video clock controller driver

PATCH In review Amit Nischal 3 participants 9 messages Apr 24, 2018 – May 3, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Add QCOM video clock controller driver

This patch series adds a driver and device tree documentation binding for the video clock controller on some Qualcomm Technologies, Inc, SoCs such as SDM845. This would allow video drivers to probe and control their clocks.

The video clock driver depends upon the RPMh driver[1], command DB driver[2], RPMh clock driver[3], rcg2 shared ops[4] changes which are undergoing review.

[1]: https://lkml.org/lkml/2018/4/19/914
[2]: https://lkml.org/lkml/2018/4/5/451
[3]: https://lkml.org/lkml/2018/4/24/390
[4]: https://lkml.org/lkml/2018/4/18/367

Amit Nischal (2):
dt-bindings: clock: Introduce QCOM Video clock bindings
clk: qcom: Add video clock controller driver for SDM845

 .../devicetree/bindings/clock/qcom,videocc.txt     |  18 ++
 drivers/clk/qcom/Kconfig                           |  11 +
 drivers/clk/qcom/Makefile                          |   1 +
 drivers/clk/qcom/videocc-sdm845.c                  | 359 +++++++++++++++++++++
 include/dt-bindings/clock/qcom,videocc-sdm845.h    |  25 ++
 5 files changed, 414 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,videocc.txt
 create mode 100644 drivers/clk/qcom/videocc-sdm845.c
 create mode 100644 include/dt-bindings/clock/qcom,videocc-sdm845.h

--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

#1 lore raw

PATCH 1/2 dt-bindings: clock: Introduce QCOM Video clock bindings

Add device tree bindings for video clock controller for Qualcomm Technology Inc's SoCs.

---
 .../devicetree/bindings/clock/qcom,videocc.txt     | 18 ++++++++++++++++
 include/dt-bindings/clock/qcom,videocc-sdm845.h    | 25 ++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,videocc.txt
 create mode 100644 include/dt-bindings/clock/qcom,videocc-sdm845.h
Documentation/devicetree/bindings/clock/qcom,videocc.txt new file +18 -0
new file mode 100644
index 0000000..1c23b41
@@ -0,0 +1,18 @@
+Qualcomm Video Clock & Reset Controller Binding
+-----------------------------------------------
+
+Required properties :
+- compatible : shall contain "qcom,videocc-sdm845"
+- reg : shall contain base register location and length
+- #clock-cells : shall contain 1
+- #reset-cells : shall contain 1
+- #power-domain-cells : shall contain 1
+
+Example:
+	videocc: qcom,videocc@ab00000 {
+		compatible = "qcom,videocc-sdm845";
+		reg = <0xab00000 0x10000>;
+		#clock-cells = <1>;
+		#reset-cells = <1>;
+		#power-domain-cells = <1>;
+	};
include/dt-bindings/clock/qcom,videocc-sdm845.h new file +25 -0
new file mode 100644
index 0000000..f5f7599
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. */
+
+#ifndef _DT_BINDINGS_CLK_MSM_VIDEO_CC_SDM845_H
+#define _DT_BINDINGS_CLK_MSM_VIDEO_CC_SDM845_H
+
+#define VIDEO_CC_APB_CLK			0
+#define VIDEO_CC_AT_CLK				1
+#define VIDEO_CC_QDSS_TRIG_CLK			2
+#define VIDEO_CC_QDSS_TSCTR_DIV8_CLK		3
+#define VIDEO_CC_VCODEC0_AXI_CLK		4
+#define VIDEO_CC_VCODEC0_CORE_CLK		5
+#define VIDEO_CC_VCODEC1_AXI_CLK		6
+#define VIDEO_CC_VCODEC1_CORE_CLK		7
+#define VIDEO_CC_VENUS_AHB_CLK			8
+#define VIDEO_CC_VENUS_CLK_SRC			9
+#define VIDEO_CC_VENUS_CTL_AXI_CLK		10
+#define VIDEO_CC_VENUS_CTL_CORE_CLK		11
+#define VIDEO_PLL0				12
+
+#define VENUS_GDSC				0
+#define VCODEC0_GDSC				1
+#define VCODEC1_GDSC				2
+
+#endif

--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

#4 lore raw

PATCH 2/2 clk: qcom: Add video clock controller driver for SDM845

In reply to Amit Nischal

Add support for the video clock controller found on SDM845 based devices. This would allow video drivers to probe and control their clocks.

---
 drivers/clk/qcom/Kconfig          |  11 ++
 drivers/clk/qcom/Makefile         |   1 +
 drivers/clk/qcom/videocc-sdm845.c | 359 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 371 insertions(+)
 create mode 100644 drivers/clk/qcom/videocc-sdm845.c
drivers/clk/qcom/Kconfig +11 -0
index fb03d99..0464477 100644
@@ -236,6 +236,17 @@ config SDM_GCC_845
 	  Say Y if you want to use peripheral devices such as UART, SPI,
 	  I2C, USB, UFS, SDDC, PCIe, etc.
 
+config SDM_VIDEOCC_845
+	tristate "SDM845 Video Clock Controller"
+	depends on COMMON_CLK_QCOM
+	select SDM_GCC_845
+	select QCOM_GDSC
+	help
+	  Support for the video clock controller on Qualcomm Technologies, Inc
+	  SDM845 devices.
+	  Say Y if you want to support video devices and functionality such as
+	  video encode and decode.
+
 config SPMI_PMIC_CLKDIV
 	tristate "SPMI PMIC clkdiv Support"
 	depends on (COMMON_CLK_QCOM && SPMI) || COMPILE_TEST
drivers/clk/qcom/Makefile +1 -0
index 23bf50c..7738f50 100644
@@ -39,4 +39,5 @@ obj-$(CONFIG_QCOM_CLK_RPM) += clk-rpm.o
 obj-$(CONFIG_QCOM_CLK_RPMH) += clk-rpmh.o
 obj-$(CONFIG_QCOM_CLK_SMD_RPM) += clk-smd-rpm.o
 obj-$(CONFIG_SDM_GCC_845) += gcc-sdm845.o
+obj-$(CONFIG_SDM_VIDEOCC_845) += videocc-sdm845.o
 obj-$(CONFIG_SPMI_PMIC_CLKDIV) += clk-spmi-pmic-div.o
drivers/clk/qcom/videocc-sdm845.c new file +359 -0

359 lines not on this page · raw message

--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

maintainer
#2 lore raw

Re: [PATCH 1/2] dt-bindings: clock: Introduce QCOM Video clock bindings

In reply to Amit Nischal
Quoted 17 lines · Amit Nischal

Add device tree bindings for video clock controller for Qualcomm Technology Inc's SoCs.

---
 .../devicetree/bindings/clock/qcom,videocc.txt     | 18 ++++++++++++++++
 include/dt-bindings/clock/qcom,videocc-sdm845.h    | 25 ++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,videocc.txt
 create mode 100644 include/dt-bindings/clock/qcom,videocc-sdm845.h
Documentation/devicetree/bindings/clock/qcom,videocc.txt new file +0 -0
new file mode 100644
index 0000000..1c23b41

Documentation/devicetree/bindings/clock/qcom,videocc.txt line 5

Quoted 5 lines
Documentation/devicetree/bindings/clock/qcom,videocc.txt new file +5 -0
@@ -0,0 +1,18 @@
+Qualcomm Video Clock & Reset Controller Binding
+-----------------------------------------------
+
+Required properties :
+- compatible : shall contain "qcom,videocc-sdm845"

'<vendor>,<soc>-<block>' is the preferred order.

Every single QCom binding... Can someone spread the word in QCom.

Documentation/devicetree/bindings/clock/qcom,videocc.txt line 9

Quoted 4 lines
Documentation/devicetree/bindings/clock/qcom,videocc.txt new file +4 -0
+- reg : shall contain base register location and length
+- #clock-cells : shall contain 1
+- #reset-cells : shall contain 1
+- #power-domain-cells : shall contain 1

No header definitions for resets and power-domain? There's no requirement to have headers, but the binding should be complete even if you don't have a driver yet.

Documentation/devicetree/bindings/clock/qcom,videocc.txt line 12

Quoted 3 lines
Documentation/devicetree/bindings/clock/qcom,videocc.txt new file +3 -0
+
+Example:
+	videocc: qcom,videocc@ab00000 {

clock-controller@...

Quoted 45 lines
Documentation/devicetree/bindings/clock/qcom,videocc.txt new file +6 -0
+		compatible = "qcom,videocc-sdm845";
+		reg = <0xab00000 0x10000>;
+		#clock-cells = <1>;
+		#reset-cells = <1>;
+		#power-domain-cells = <1>;
+	};
include/dt-bindings/clock/qcom,videocc-sdm845.h new file +25 -1
new file mode 100644
index 0000000..f5f7599
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. */
+
+#ifndef _DT_BINDINGS_CLK_MSM_VIDEO_CC_SDM845_H
+#define _DT_BINDINGS_CLK_MSM_VIDEO_CC_SDM845_H
+
+#define VIDEO_CC_APB_CLK			0
+#define VIDEO_CC_AT_CLK				1
+#define VIDEO_CC_QDSS_TRIG_CLK			2
+#define VIDEO_CC_QDSS_TSCTR_DIV8_CLK		3
+#define VIDEO_CC_VCODEC0_AXI_CLK		4
+#define VIDEO_CC_VCODEC0_CORE_CLK		5
+#define VIDEO_CC_VCODEC1_AXI_CLK		6
+#define VIDEO_CC_VCODEC1_CORE_CLK		7
+#define VIDEO_CC_VENUS_AHB_CLK			8
+#define VIDEO_CC_VENUS_CLK_SRC			9
+#define VIDEO_CC_VENUS_CTL_AXI_CLK		10
+#define VIDEO_CC_VENUS_CTL_CORE_CLK		11
+#define VIDEO_PLL0				12
+
+#define VENUS_GDSC				0
+#define VCODEC0_GDSC				1
+#define VCODEC1_GDSC				2
+
+#endif
--

QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#5 lore raw

Re: [PATCH 2/2] clk: qcom: Add video clock controller driver for SDM845

In reply to Amit Nischal

Quoting Amit Nischal (2018-04-24 06:32:51)

Quoted 5 lines

Add support for the video clock controller found on SDM845 based devices. This would allow video drivers to probe and control their clocks.

Driver looks small and good. Only concern is that there aren't resets defined, but the binding says there are resets. Will you add them?

I'm going to wait for the respin on the dts binding anyway.

#3 lore raw

Re: [PATCH 1/2] dt-bindings: clock: Introduce QCOM Video clock bindings

In reply to Rob Herring
Quoted 29 lines · Rob Herring
Quoted 20 lines · Amit Nischal

Add device tree bindings for video clock controller for Qualcomm Technology Inc's SoCs.

---
 .../devicetree/bindings/clock/qcom,videocc.txt     | 18 
++++++++++++++++
 include/dt-bindings/clock/qcom,videocc-sdm845.h    | 25 
++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/clock/qcom,videocc.txt
 create mode 100644 include/dt-bindings/clock/qcom,videocc-sdm845.h
Documentation/devicetree/bindings/clock/qcom,videocc.txt new file +0 -0
new file mode 100644
index 0000000..1c23b41

Documentation/devicetree/bindings/clock/qcom,videocc.txt line 5

Quoted 5 lines
Documentation/devicetree/bindings/clock/qcom,videocc.txt new file +5 -0
@@ -0,0 +1,18 @@
+Qualcomm Video Clock & Reset Controller Binding
+-----------------------------------------------
+
+Required properties :
+- compatible : shall contain "qcom,videocc-sdm845"

'<vendor>,<soc>-<block>' is the preferred order.

Quoted 1 line

Every single QCom binding... Can someone spread the word in QCom.

Thanks for the review. I will make the suggested change in the next series.

Quoted 9 lines

Documentation/devicetree/bindings/clock/qcom,videocc.txt line 9

Quoted 5 lines
Documentation/devicetree/bindings/clock/qcom,videocc.txt new file +4 -0
+- reg : shall contain base register location and length
+- #clock-cells : shall contain 1
+- #reset-cells : shall contain 1
+- #power-domain-cells : shall contain 1

No header definitions for resets and power-domain? There's no requirement to have headers, but the binding should be complete even if you don't have a driver yet.

Will do the required changes in the next patch series.

Quoted 6 lines

Documentation/devicetree/bindings/clock/qcom,videocc.txt line 12

Quoted 4 lines
Documentation/devicetree/bindings/clock/qcom,videocc.txt new file +3 -0
+
+Example:
+	videocc: qcom,videocc@ab00000 {

clock-controller@...

Will be fixed in the next patch series.

Quoted 47 lines
Quoted 47 lines
Documentation/devicetree/bindings/clock/qcom,videocc.txt new file +6 -0
+		compatible = "qcom,videocc-sdm845";
+		reg = <0xab00000 0x10000>;
+		#clock-cells = <1>;
+		#reset-cells = <1>;
+		#power-domain-cells = <1>;
+	};
include/dt-bindings/clock/qcom,videocc-sdm845.h new file +2 -0
new file mode 100644
index 0000000..f5f7599
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (c) 2016-2018, The Linux Foundation. All rights 

reserved. */

include/dt-bindings/clock/qcom,videocc-sdm845.h new file +23 -1
+
+#ifndef _DT_BINDINGS_CLK_MSM_VIDEO_CC_SDM845_H
+#define _DT_BINDINGS_CLK_MSM_VIDEO_CC_SDM845_H
+
+#define VIDEO_CC_APB_CLK			0
+#define VIDEO_CC_AT_CLK				1
+#define VIDEO_CC_QDSS_TRIG_CLK			2
+#define VIDEO_CC_QDSS_TSCTR_DIV8_CLK		3
+#define VIDEO_CC_VCODEC0_AXI_CLK		4
+#define VIDEO_CC_VCODEC0_CORE_CLK		5
+#define VIDEO_CC_VCODEC1_AXI_CLK		6
+#define VIDEO_CC_VCODEC1_CORE_CLK		7
+#define VIDEO_CC_VENUS_AHB_CLK			8
+#define VIDEO_CC_VENUS_CLK_SRC			9
+#define VIDEO_CC_VENUS_CTL_AXI_CLK		10
+#define VIDEO_CC_VENUS_CTL_CORE_CLK		11
+#define VIDEO_PLL0				12
+
+#define VENUS_GDSC				0
+#define VCODEC0_GDSC				1
+#define VCODEC1_GDSC				2
+
+#endif
--

QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw

Re: [PATCH 2/2] clk: qcom: Add video clock controller driver for SDM845

In reply to Stephen Boyd
Quoted 8 lines · Stephen Boyd

Quoting Amit Nischal (2018-04-24 06:32:51)

Quoted 5 lines

Add support for the video clock controller found on SDM845 based devices. This would allow video drivers to probe and control their clocks.

Driver looks small and good. Only concern is that there aren't resets defined, but the binding says there are resets. Will you add them?

Thanks for the review.
As of now, there are no resets defined for VIDEOCC. So I will move the #reset-cells tooptional property in the dt-binding. Same will be updated in the next patch series.

Quoted 2 lines

I'm going to wait for the respin on the dts binding anyway.

Yes, I will send the next patch series soon.

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#7 lore raw

Re: [PATCH 2/2] clk: qcom: Add video clock controller driver for SDM845

Quoting Nischal, Amit (2018-05-02 00:56:35)

Quoted 6 lines

Thanks for the review.
As of now, there are no resets defined for VIDEOCC. So I will move the #reset-cells tooptional property in the dt-binding. Same will be updated in the next patch series.

Please don't make it optional. It should be required in the binding, because there are resets in the hardware. If you don't want to add them into the driver, that's ok, but it isn't really that hard to add them so why not add them?

#8 lore raw

Re: [PATCH 2/2] clk: qcom: Add video clock controller driver for SDM845

Quoted 8 lines · Stephen Boyd

Quoting Nischal, Amit (2018-05-02 00:56:35)

Quoted 6 lines

Thanks for the review.
As of now, there are no resets defined for VIDEOCC. So I will move the #reset-cells tooptional property in the dt-binding. Same will be updated in the next patch series.

Quoted 4 lines

Please don't make it optional. It should be required in the binding, because there are resets in the hardware. If you don't want to add them into the driver, that's ok, but it isn't really that hard to add them so why not add them?

There is no reset client for VideoCC so that's why we have not added them in the driver file. However, I will make "#reset-cells" as required property in the dt-binding.

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html