[Letux-kernel] Letux/Alpha 400: small progress with sound

H. Nikolaus Schaller hns at goldelico.com
Fri Apr 30 12:32:58 CEST 2021


Hi Maarten,

> Am 29.04.2021 um 14:15 schrieb Maarten ter Huurne <maarten at treewalker.org>:
> 
> On Thursday, 29 April 2021 13:48:13 CEST H. Nikolaus Schaller wrote:
>>> Am 29.04.2021 um 13:31 schrieb Maarten ter Huurne
>>> <maarten at treewalker.org>:> 
>>> There is a Linux driver for the JZ4770 internal codec, Paul Cercueil
>>> is maintaining it. A quick look at both programming manuals
>>> suggests it won't work as-is, but the 4780 codec is an evolution of
>>> the 4770 one, so a lot of code could be re-used. Register numbers
>>> are different, but most of the names and bit fields within the
>>> registers are the same.
>> Good to know! So at least this is a good starting point for
>> debugging...
>> 
>> I'll give it a try what happens if we use the ingenic,jz4770-codec on
>> the CI20.
> 
> You would have to at least update the register number enum at the top, 
> since almost all of the registers got renumbered.

I have copied the jz4770 driver, added Kconfig&Makefile, renamed everything
to jz4780 and added some DTS nodes for jz4780.dtsi and ci20.dts.

As expected I get:

[    6.233327] jz4780-codec 100200a4.audio-codec: Unable to sync register 0x1. -145
[    6.236454] asoc-simple-card sound: ASoC: no sink widget found for MIC
[    6.236475] asoc-simple-card sound: ASoC: Failed to add route Mic -> direct -> MIC
[    6.236489] asoc-simple-card sound: ASoC: no source widget found for OUTL
[    6.236498] asoc-simple-card sound: ASoC: Failed to add route OUTL -> direct -> Speaker
[    6.236509] asoc-simple-card sound: ASoC: no source widget found for OUTR
[    6.236518] asoc-simple-card sound: ASoC: Failed to add route OUTR -> direct -> Speaker
[    6.236530] asoc-simple-card sound: ASoC: no sink widget found for INL
[    6.236539] asoc-simple-card sound: ASoC: Failed to add route LOUT -> direct -> INL
[    6.236551] asoc-simple-card sound: ASoC: no sink widget found for INR
[    6.236559] asoc-simple-card sound: ASoC: Failed to add route ROUT -> direct -> INR

So general setup works and I'll dig into the register numbers to see if I can
get the codec starting...

>> Alternatively we could check if one of the other codecs (4725, 4740,
>> 4760) is more similar to find the best starting point.
> 
> I would expect 4770 to be the most similar, since it's the closest on 
> the timeline and it's a full-featured SoC like the 4780 is. But it 
> wouldn't hurt to check.
> 
>> BTW: there seems to be a typo in the DTS node name/address of
>> jz4770.dtsi
>> 
>> 	codec: audio-codec at 100200a0 {
>> 		reg = <0x100200a4 0x8>;
> 
> I'm not sure whether that's a typo or just the address being rounded 
> down. I'll ask Paul.

I am not sure but AFAIR, latest dtbscheck requires and checks the @ value
with the reg entry. At least for I2C client addresses.

BR and thanks,
Nikolaus



More information about the Letux-kernel mailing list