davinci-mcasp: extension to use AHCLKX pin as external clock source
The AHCLKX pin seems not to be supported as external source. The first patch is a general fix to allow external clock. The second allows you to select the AHCLKX pin as clock source.
Patch built against v3.19-rc7
Quoted 6 lines · Urs Fässler
The AHCLKX pin seems not to be supported as external source. The first patch is a general fix to allow external clock. The second allows you to select the AHCLKX pin as clock source.
Patch built against v3.19-rc7
I don't think this series is correct. You can just issue:snd_soc_dai_set_sysclk(cpu_dai, 0, sysclk, SND_SOC_CLOCK_IN);
from the machine driver to select AHCLKX as input.
Signature · 5 lines
Péter _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 5 lines · Peter Ujfalusi
Quoted 4 lines · Urs Fässler
The AHCLKX pin seems not to be supported as external source. The first patch is a general fix to allow external clock. The second allows you to select the AHCLKX pin as clock source.
Quoted 8 lines
Quoted 2 lines
Patch built against v3.19-rc7
I don't think this series is correct. You can just issue:
snd_soc_dai_set_sysclk(cpu_dai, 0, sysclk, SND_SOC_CLOCK_IN);from the machine driver to select AHCLKX as input.
I checked everything and the source of the problem is, that on our hardware the bit clock of the codec is connected to AHCLKX. According to the datasheet, AHCLKX is for the master clock only. On the other hand, it is possible to route a bitclock from AHCLKX to the subsystem (what I did with my patches).
Now my question is, if it is even worth trying to bring such an option for the driver (use AHCLKX as bit clock in) upstream?
Thanks
Urs
Quoted 9 lines · Urs Fässler
Quoted 8 lines · Peter Ujfalusi
Quoted 6 lines · Urs Fässler
The AHCLKX pin seems not to be supported as external source. The first patch is a general fix to allow external clock. The second allows you to select the AHCLKX pin as clock source.
Patch built against v3.19-rc7
Quoted 7 lines
Quoted 5 lines
I don't think this series is correct. You can just issue:
snd_soc_dai_set_sysclk(cpu_dai, 0, sysclk, SND_SOC_CLOCK_IN);from the machine driver to select AHCLKX as input.
I checked everything and the source of the problem is, that on our hardware the bit clock of the codec is connected to AHCLKX.
Why would any HW designer do this???
Just to clarify this: the bitclock from codec is only connected to AHCLKX pin, or is it also connected to the ACLKX pin?
The use of AHCLKX/R pin is _optional_ in McASP and it serves the purpose of providing a way to have synchronized master clock for the codec and McASP. ACLKX, AFSX and data pins are mandatory to be connected.
Quoted 1 line
According to the datasheet, AHCLKX is for the master clock only.
Yes, it is for the master clock to be used by both codec and McASP to avoid clock drifting.
Quoted 2 lines
On the other hand, it is possible to route a bitclock from AHCLKX to the subsystem (what I did with my patches).
Yes, it is possible, when McASP is master it can use the signal on AHCLKX pin to generate the BCLK/FS.
Quoted 2 lines
Now my question is, if it is even worth trying to bring such an option for the driver (use AHCLKX as bit clock in) upstream?
I don't want HW designers to get ideas from code - but if they did what I think they did with your HW they certainly not going to bother checking TRM or code...
But I think you can still get the setup working, if it is really like this:
McASP
AHCLKX <-- bitclock <-- codec
ACLKX (not connected while it should have been)
FSX <-- framsync <-- codec
In this case you want to configure the codec to be CBM_CFM and McASP as CBS_CFM (we don't have this supported in the driver, but not a big deal to add).
And you call:snd_soc_dai_set_sysclk(cpu_dai, 0, sysclk, SND_SOC_CLOCK_IN); snd_soc_dai_set_clkdiv(cpu_dai, 1, 1);
You will have the codec providing the FS and driving the bitclock (connected to wrong McASP pin). McASP will drive the bitclock using the AHCLKX as source using divide by 1. McASP will not try to drive FS.
Signature · 5 lines
Péter _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 13 lines · Peter Ujfalusi
Quoted 12 lines · Urs Fässler
Quoted 11 lines · Peter Ujfalusi
Quoted 6 lines · Urs Fässler
The AHCLKX pin seems not to be supported as external source. The first patch is a general fix to allow external clock. The second allows you to select the AHCLKX pin as clock source.
Patch built against v3.19-rc7
I don't think this series is correct. You can just issue:
snd_soc_dai_set_sysclk(cpu_dai, 0, sysclk, SND_SOC_CLOCK_IN);
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
from the machine driver to select AHCLKX as input.
I checked everything and the source of the problem is, that on our hardware the bit clock of the codec is connected to AHCLKX.
Why would any HW designer do this???
It was not intended that way.
Quoted 34 lines
Just to clarify this: the bitclock from codec is only connected to AHCLKX pin, or is it also connected to the ACLKX pin?
The use of AHCLKX/R pin is _optional_ in McASP and it serves the purpose of providing a way to have synchronized master clock for the codec and McASP. ACLKX, AFSX and data pins are mandatory to be connected.Quoted 1 line
According to the datasheet, AHCLKX is for the master clock only.
Yes, it is for the master clock to be used by both codec and McASP to avoid clock drifting.
Quoted 2 lines
On the other hand, it is possible to route a bitclock from AHCLKX to the subsystem (what I did with my patches).
Yes, it is possible, when McASP is master it can use the signal on AHCLKX pin to generate the BCLK/FS.
Quoted 2 lines
Now my question is, if it is even worth trying to bring such an option for the driver (use AHCLKX as bit clock in) upstream?
I don't want HW designers to get ideas from code - but if they did what I think they did with your HW they certainly not going to bother checking TRM or code...
But I think you can still get the setup working, if it is really like this:
McASP
AHCLKX <-- bitclock <-- codec
ACLKX (not connected while it should have been)
FSX <-- framsync <-- codecIn this case you want to configure the codec to be
CBM_CFMand McASP asCBS_CFM(we don't have this supported in the driver, but not a big deal to add).
Quoted 7 lines
And you call:
snd_soc_dai_set_sysclk(cpu_dai, 0, sysclk, SND_SOC_CLOCK_IN);snd_soc_dai_set_clkdiv(cpu_dai, 1, 1);You will have the codec providing the FS and driving the bitclock (connected to wrong McASP pin). McASP will drive the bitclock using the AHCLKX as source using divide by 1. McASP will not try to drive FS.
Thanks, that looks better than my patches. We will fix the hardware and use your solution for the already produced boards.
Urs