1. J1 (the RTC connector) provides 2 I2C pins and one GPIO
2. J7 (I2S connector on the C2) provides 5 I2S pins. Can they be used as GPIO pins?
What about pins
8, 10, 26, 31, 35, 37 No connection
. Can those pins be accessed somehow?Thanks
8, 10, 26, 31, 35, 37 No connection
. Can those pins be accessed somehow?I am working to utilize the GPIO j7 Pins as well. i know the ODLib says you can use the j7, but i havent been able to access them in a meaningful way yet.2. J7 (I2S connector on the C2) provides 5 I2S pins. Can they be used as GPIO pins?
Code: Select all
sudo apt-get install device-tree-compiler
fdtdump /media/boot/meson64_odroidc2.dtb
to list the device tree nodes. The I2S relevant nodes are:
Code: Select all
I2S {
compatible = "amlogic, aml-i2s-dai";
#sound-dai-cells = <0x00000000>;
resets = <0x0000000d 0x0000000d 0x0000000d 0x0000000d 0x0000000d 0x0000000d 0x00000463 0x5f627566 0x6c6b5f6d 0x6f320061 0x65725f72 0x6576656c 0x6e000000 0x0000000d 0x00000003 0x30006d63 0x0000004c 0x00000052 0x6932735f 0x00000003 0x6769632c 0x00000003>;
reset-names = "top_glue", "aud_buf", "i2s_out", "amclk_measure", "aififo2", "aud_mixer", "mixer_reg", "adc", "top_level", "aoclk", "aud_in";
clocks = <0x0000000d 0x00000003 0x30006d63 0x0000004c>;
clock-names = "mpll0", "mclk";
linux,phandle = <0x00000032>;
phandle = <0x00000032>;
};
i2s_platform {
compatible = "amlogic, aml-i2s";
linux,phandle = <0x00000031>;
phandle = <0x00000031>;
};
status = "disabled"
.
Code: Select all
# fdtput /media/boot/meson64_odroidc2.dtb /I2S status disabled
# fdtget /media/boot/meson64_odroidc2.dtb /I2S status
127
# fdtput /media/boot/meson64_odroidc2.dtb /i2s_platform status disabled
# fdtget /media/boot/meson64_odroidc2.dtb /i2s_platform status
127
dmesg | grep -i i2s
Code: Select all
root@kbd:/sys/class/gpio# echo 128 > /sys/class/gpio/export
-su: echo: write error: Invalid argument
root@kbd:/sys/class/gpio# echo 130 > /sys/class/gpio/export
root@kbd:/sys/class/gpio# echo out > /sys/class/gpio/gpio130/direction
root@kbd:/sys/class/gpio# echo 0 > /sys/class/gpio/gpio130/value
root@kbd:/sys/class/gpio# echo 1 > /sys/class/gpio/gpio130/value
root@kbd:/sys/class/gpio# echo 132 > /sys/class/gpio/export
root@kbd:/sys/class/gpio# echo out > /sys/class/gpio/gpio132/direction
root@kbd:/sys/class/gpio# echo 0 > /sys/class/gpio/gpio132/value
root@kbd:/sys/class/gpio# echo 1 > /sys/class/gpio/gpio132/value
root@kbd:/sys/class/gpio# echo 131 > /sys/class/gpio/export
root@kbd:/sys/class/gpio# echo out > /sys/class/gpio/gpio131/direction
root@kbd:/sys/class/gpio# echo 0 > /sys/class/gpio/gpio131/value
root@kbd:/sys/class/gpio# echo 1 > /sys/class/gpio/gpio131/value
root@kbd:/sys/class/gpio# echo 133 > /sys/class/gpio/export
root@kbd:/sys/class/gpio# echo out > /sys/class/gpio/gpio133/direction
root@kbd:/sys/class/gpio# echo 0 > /sys/class/gpio/gpio133/value
root@kbd:/sys/class/gpio# echo 1 > /sys/class/gpio/gpio133/value
Code: Select all
sudo apt-get install device-tree-compiler
/etc/kernel/postinst.d/i2s-disable
Code: Select all
$ cat /etc/kernel/postinst.d/i2s-disable
#!/bin/bash
#disable i2s for Odroid C2 after each kernel update
#requires device-tree-compiler
# sudo apt-get install device-tree-compiler
echo "Disabling I2S support from the device tree"
/usr/bin/fdtput /media/boot/meson64_odroidc2.dtb /I2S status disabled
/usr/bin/fdtput /media/boot/meson64_odroidc2.dtb /i2s_platform status disabled
Code: Select all
$ sudo chmod a+x /etc/kernel/postinst.d/i2s-disable
Code: Select all
$ sudo apt-get install --reinstall linux-image-3.14.79-110
...
run-parts: executing /etc/kernel/postinst.d/i2s-disable 3.14.79-110 /boot/vmlinuz-3.14.79-110
I tried withodroid wrote:GPIOAO.BIT6 seems to be mapped to SPDIF output.
So you might need to find another item in the DT file.
Code: Select all
fdtput /media/boot/meson64_odroidc2.dtb /SPDIF status disabled
How to disable the UART Function?mad_ady wrote: ↑Thu Apr 20, 2017 5:11 pmThe code above seems to disable i2s (I can't see any i2s output in dmesg after reboot):Code: Select all
# fdtput /media/boot/meson64_odroidc2.dtb /I2S status disabled # fdtget /media/boot/meson64_odroidc2.dtb /I2S status 127 # fdtput /media/boot/meson64_odroidc2.dtb /i2s_platform status disabled # fdtget /media/boot/meson64_odroidc2.dtb /i2s_platform status 127
dmesg | grep -i i2s
Users browsing this forum: No registered users and 1 guest