Possible to route spdif to GPIOY_3? --> YES

Post Reply
User avatar
joerg
Posts: 1306
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 82 times
Been thanked: 180 times
Contact:

Possible to route spdif to GPIOY_3? --> YES

Post by joerg »

I try to get spdif signal on old C1 board. As I saw in datasheet that the pin7 of 40p header GPIOY_3 can also be connected to SPDIF_OUT, I wonder how to do it.
I have tried to edit the /pinmux/audio_pin1 node of devicetree, but no signal.

Code: Select all

fdtget meson8b_odroidc.dtb /pinmux/audio_pin1 amlogic,pins
GPIOY_3
Is there anybody here who can say how the other values must be adjusted?
Original setting with GPIOAO_6:

Code: Select all

        audio_spdif_pins:audio_pin1{
            amlogic,setmask=<10 0x00010000>;
            amlogic,clrmask=<10 0x00040000
			      1 0x00002000>;
            amlogic,pins ="GPIOAO_6";
        };
        
        ...

    audio_spdif_codec{
        compatible = "amlogic,aml-spdif-codec";
        dev_name = "spdif-dit.0";
        pinctrl-names = "aml_audio_spdif";
        pinctrl-0 = <&audio_spdif_pins>;
        status = "okay";
    };

Code: Select all

Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 3.10.107-24 armv7l)
Last edited by joerg on Sat Jan 30, 2021 3:40 am, edited 1 time in total.

User avatar
joerg
Posts: 1306
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 82 times
Been thanked: 180 times
Contact:

Re: Possible to route spdif to GPIOY_3?

Post by joerg »

And I wonder what driver takes possession over pin 7. I have disabled already onewire driver.
When I set with gpio binary pin7 to out, after 2...3s the pin is reset to in.

User avatar
odroid
Site Admin
Posts: 36930
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1595 times
Been thanked: 1072 times
Contact:

Re: Possible to route spdif to GPIOY_3?

Post by odroid »

We've not tried that.
Could you toggle the pin with a generic GPIO output mode before activating SPDIF route?

User avatar
joerg
Posts: 1306
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 82 times
Been thanked: 180 times
Contact:

Re: Possible to route spdif to GPIOY_3?

Post by joerg »

I have done that already.
gpio mode 7 out && gpio write 7 1
It takes 2 s and the pin is forced to in again.

User avatar
odroid
Site Admin
Posts: 36930
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1595 times
Been thanked: 1072 times
Contact:

Re: Possible to route spdif to GPIOY_3?

Post by odroid »

It is hard to know which (hidden?) driver or services change the pin function or direction in 2~3 seconds. :o

User avatar
joerg
Posts: 1306
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 82 times
Been thanked: 180 times
Contact:

Re: Possible to route spdif to GPIOY_3?

Post by joerg »

Maybe you or someone from your team can try it, if it is he same on your C1.
Just install Ubuntu 20.04 minimal and wiringPi and try to set gpio 7 that should be also the pin 7 on 40p header to out and 1.
But, of course the onewire driver must be disabled.
Something like sudo fdtput -t s /boot/odroidc1.dtb /w1 status disabled
I am on work now and can't remember the exact name of dtb and w1 node, but a fdtdump gives the information.

User avatar
joerg
Posts: 1306
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 82 times
Been thanked: 180 times
Contact:

Re: Possible to route spdif to GPIOY_3?

Post by joerg »

OK, I found why pin 7 was possessed by a driver. I only need to modify the correct dtb /media/boot/meson8b_odroidc.dtb not /boot/meson8b_odroidc.dtb. :o I think I stumbled former about the same, only forgot about... It's the age...
But the spdif signal doesn't come out of pin7. :(

User avatar
joerg
Posts: 1306
Joined: Tue Apr 01, 2014 2:14 am
languages_spoken: german, english, español
ODROIDs: C1, C1+, C2, N1, N2, C4
Location: Germany
Has thanked: 82 times
Been thanked: 180 times
Contact:

Re: Possible to route spdif to GPIOY_3? --> YES

Post by joerg »

But now the audio signal comes out of GPIOY_3 :) .

What I did:
Disable onewire

Code: Select all

sudo fdtput -t s /media/boot/meson8b_odroidc.dtb /w1 status disabled
Change gpio

Code: Select all

sudo fdtput -t s /media/boot/meson8b_odroidc.dtb /pinmux/audio_pin1 amlogic,pins GPIOY_3
Set setmask and clearmask

Code: Select all

#Old value setmask
sudo fdtget /media/boot/meson8b_odroidc.dtb /pinmux/audio_pin1 amlogic,setmask
10 65536
#Set new value setmask
sudo fdtput -t x /media/boot/meson8b_odroidc.dtb /pinmux/audio_pin1 amlogic,setmask 0x1 0x80
#New value setmask
sudo fdtget /media/boot/meson8b_odroidc.dtb /pinmux/audio_pin1 amlogic,setmask
1 128

#Old value clearmask
sudo fdtget /media/boot/meson8b_odroidc.dtb /pinmux/audio_pin1 amlogic,clrmask
10 262144 1 8192
#Set new value clearmask
sudo fdtput -t x /media/boot/meson8b_odroidc.dtb /pinmux/audio_pin1 amlogic,clrmask 0x3 0x40000 
#New value clearmask
sudo fdtget /media/boot/meson8b_odroidc.dtb /pinmux/audio_pin1 amlogic,clrmask
3 262144
From where do come the new values?
Attachments
Bildschirmfoto vom 2021-01-29 19-47-42.png
Bildschirmfoto vom 2021-01-29 19-47-42.png (24.49 KiB) Viewed 234 times
These users thanked the author joerg for the post:
odroid (Mon Feb 01, 2021 10:37 am)

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 2 guests