Use I2S pins for GPIO

Hello,

I am building the image for VIM4 using fenix and I am trying to free up the GPIOs used for I2S as I do not need any sound devices. I have tried to disable everything related to the sound-device in fenix/build/linux/arch/arm64/boot/dts/amlogic/vim4.dts, however, when using sudo gpioinfo they are still locked to the kernel and marked as used and I cannot write anything to these pins. I am specifically trying to free up GPIOT_1 (gpiochip0 92) which according to the schematic should be I2S_SCLK1 and GPIOT_4 (gpiochip0 95) which according to the schematic should be I2S_SDI1. Does anybody have any suggestions on how to proceed?

Thanks.

Hello @pnorgren

Please post your modifications here. And after modifications you need to execute make kernel-deb to regenerate the kernel debian package.

Thanks, building and install the new kernel-debs did the trick. I assumed that everything was rebuild when running make and I just flashed the generated image. Here is my git-diff for disabling the I2S:

diff --git a/arch/arm64/boot/dts/amlogic/kvim4.dts b/arch/arm64/boot/dts/amlogic/kvim4.dts
index 607ebca661f3..a65bccf830dd 100644
--- a/arch/arm64/boot/dts/amlogic/kvim4.dts
+++ b/arch/arm64/boot/dts/amlogic/kvim4.dts
@@ -567,7 +567,7 @@
                interrupts = <GIC_SPI 51 IRQ_TYPE_EDGE_RISING>;
                interrupt-names = "audio_exception64";
 
-               status = "okay";
+               status = "disabled";
 
                aml-audio-card,dai-link@0 {
                        mclk-fs = <128>;
@@ -942,7 +942,7 @@
                /*enable default mclk(12.288M), before extern codec start*/
                //start_clk_enable = <1>;
 
-               status = "okay";
+               status = "disable";
        };
 
        tdmb:tdm@1 {
@@ -982,7 +982,7 @@
                ctrl_gain = <1>;
                /*tdm clk tuning enable*/
                clk_tuning_enable = <1>;
-               status = "okay";
+               status = "disable";
 
                /* !!!For --TV platform-- ONLY */
                Channel_Mask {
@@ -1005,7 +1005,7 @@
                tdmin-src-name = "hdmirx";
                i2s2hdmi = <1>;
 
-               status = "okay";
+               status = "disable";
        };
 
        pdm:pdm {
@@ -1031,7 +1031,7 @@
 
                train_sample_count = <0xb>;
 
-               status = "okay";
+               status = "disable";
        };
 
        spdifa:spdif@0 {
@@ -1058,7 +1058,7 @@
 
                /*spdif clk tuning enable*/
                clk_tuning_enable = <1>;
-               status = "okay";
+               status = "disable";
        };
        spdifb:spdif@1 {
                compatible = "amlogic, tm2-revb-snd-spdif-b";
@@ -1069,7 +1069,7 @@
                clock-names = "sysclk",
                                "gate_spdifout", "clk_spdifout";
 
-               status = "okay";
+               status = "disable";
        };