[Gta04-owner] fm-tuner - was Re: hw routing audio patch removed in 3.7?
Dr. H. Nikolaus Schaller
hns at goldelico.com
Mon Jun 24 11:38:24 CEST 2013
fm-radio appears to work. At least on one board (the one where I did solder some wires to measure the clocks and PCM signals).
The code has to be changed at 3 positions:
1. U-Boot: we must correctly set the pinmux:
Please make sure that you load the right U-Boot (it took me two days to find out
that I did still use the U-Boot from NAND...).
2. kernel / sound
We must configure the McBSP in 5-wire mode which is very tricky.
The reason is that we use CLKR as the interrupt input but FSR as the
normal framing input.
(A McBSP config issue will manifest itself as a arecord timeout.)
And the configuration method has been changed by the OMAP
developers several times from 2.6.32 to 3.7. The reasons are that they
want to avoid cross-module #includes and prepare everything for
the device tree. But it makes it very difficult to find out how it *should*
be done and I was not able to find an example.
Then, I had to update the Si47xx driver so that it is probed like the GTM601
driver. I.e. we currently have disabled the I2C code in the driver (because I
still don't know how to configure the I2C address for an alsa-soc driver in
the board file).
But it appears that these changes work:
3. user space tool
the data sheet says that the PCM clock must be applied before the
Si47xx is programmed for the sample rate and must be removed after
setting it to 0 kHz. This was impossible to control with the current tool.
Therefore I have reworked it so that it has separate command line options
to set/reset individual parts in the Si47xx chip making it easier to call from a script.
The new Si47xx tool is here:
And my demo script:
Now comes the bad news: it works only on one GTA04 board and I don't
know why it fails on the others I have tested. Since they have no wires I
can't check if the clocks are available and the Si47xx is sending PCM
to the CPU or not. Or if there is something unreliable in the McBSP config.
It could also be some hardware issue. If you look into the schematics, there
are series resistors for the McBSP1 interface. Their values are choosen
based on the recommendations of a reference design we had found.
But 2k2 appears a little high value, taking into account that we have a 2.5 MHz
clock. I.e. the signals may be damped and too slow so that e.g. the clocks
are not recognized correctly.
What could be next steps?
1. make the SI47xx driver use I2C
and add ALSA mixer controls for e.g. setting frequency,
scanning and asking for signal strength etc.
You may ask why we need this if we can control I2C directly from
user space. The reason why I think we need it is that suspend/resume
must do the correct clock switching sequence and this needs interaction
between the McBSP and the Si47xx drivers.
2. find out why it works on one board only
e.g. by replacing the series resistors by 50 Ohm. Or doing scope
If we need to change the resistor values, this may become an
improvement applied to the GTA04A5 production.
3. learn something about power useage and suspend
More information about the Gta04-owner