[PATCH v3 2/6] dt-bindings: clock: qcom: gcc-ipq5424: add spi4 clocks

Manikanta Mylavarapu posted 6 patches 1 year, 1 month ago
[PATCH v3 2/6] dt-bindings: clock: qcom: gcc-ipq5424: add spi4 clocks
Posted by Manikanta Mylavarapu 1 year, 1 month ago
SPI protocol runs on serial engine 4. Hence we need to
rename the spi0 clocks to spi4 clocks.

However, renaming spi0 to spi4 will result in the following
compilation error's.
drivers/clk/qcom/gcc-ipq5424.c:2865:3: error: ‘GCC_QUPV3_SPI0_CLK’
undeclared here
drivers/clk/qcom/gcc-ipq5424.c:2866:3: error: ‘GCC_QUPV3_SPI0_CLK_SRC’
undeclared here

To add spi4 clocks without compilation error's, do not
rename the spi0 clocks. Instead, duplicate the spi0 clock
macros and rename them to spi4.

After switching to spi4 clocks in the gcc-ipq5424 driver,
remove the spi0 clock macros.

Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
---
 include/dt-bindings/clock/qcom,ipq5424-gcc.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/dt-bindings/clock/qcom,ipq5424-gcc.h b/include/dt-bindings/clock/qcom,ipq5424-gcc.h
index 755ce7a71c7c..5dad45a8f614 100644
--- a/include/dt-bindings/clock/qcom,ipq5424-gcc.h
+++ b/include/dt-bindings/clock/qcom,ipq5424-gcc.h
@@ -123,6 +123,7 @@
 #define GCC_QUPV3_I2C0_CLK			113
 #define GCC_QUPV3_I2C1_CLK			114
 #define GCC_QUPV3_SPI0_CLK			115
+#define GCC_QUPV3_SPI4_CLK			GCC_QUPV3_SPI0_CLK
 #define GCC_QUPV3_SPI1_CLK			116
 #define GCC_QUPV3_UART0_CLK			117
 #define GCC_QUPV3_UART1_CLK			118
@@ -132,6 +133,7 @@
 #define GCC_QUPV3_I2C0_DIV_CLK_SRC              122
 #define GCC_QUPV3_I2C1_DIV_CLK_SRC              123
 #define GCC_QUPV3_SPI0_CLK_SRC			124
+#define GCC_QUPV3_SPI4_CLK_SRC			GCC_QUPV3_SPI0_CLK_SRC
 #define GCC_QUPV3_SPI1_CLK_SRC			125
 #define GCC_QUPV3_UART0_CLK_SRC			126
 #define GCC_QUPV3_UART1_CLK_SRC			127
-- 
2.34.1

Re: [PATCH v3 2/6] dt-bindings: clock: qcom: gcc-ipq5424: add spi4 clocks
Posted by Krzysztof Kozlowski 1 year, 1 month ago
On Fri, Dec 27, 2024 at 12:54:42PM +0530, Manikanta Mylavarapu wrote:
> SPI protocol runs on serial engine 4. Hence we need to
> rename the spi0 clocks to spi4 clocks.


No, you do not need. Why spi0 is incorrect?

> 
> However, renaming spi0 to spi4 will result in the following
> compilation error's.
> drivers/clk/qcom/gcc-ipq5424.c:2865:3: error: ‘GCC_QUPV3_SPI0_CLK’
> undeclared here
> drivers/clk/qcom/gcc-ipq5424.c:2866:3: error: ‘GCC_QUPV3_SPI0_CLK_SRC’
> undeclared here

Then do not rename... Sorry, but that part makes no sense. You must keep
ABI, so that's why you add new clocks.


> 
> To add spi4 clocks without compilation error's, do not
> rename the spi0 clocks. Instead, duplicate the spi0 clock
> macros and rename them to spi4.
> 
> After switching to spi4 clocks in the gcc-ipq5424 driver,
> remove the spi0 clock macros.

No. ABI.


Best regards,
Krzysztof