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

Paul Boddie paul at boddie.org.uk
Sat May 1 22:43:35 CEST 2021

On Saturday, 1 May 2021 21:31:29 CEST H. Nikolaus Schaller wrote:
> Ok, that was easier than it initially looked. I had to cross-port some
> minor improvements from the jz4770 driver to the jz4780 and the main task
> was to change the soc_codec etc. to soc_component and track how to get the
> struct pointer dereferencing right again.
> One major observation is that the jz4780 codec driver turns on clocks before
> reading/writing the ragmap backed up registers. This is not part of the
> jz4770 code and may be the reason why my initial attempts with that driver
> failed.

I wouldn't be familiar with the JZ4770, but I imagine that when looking at 
"new" SoCs in this series, it is rather necessary to see what they did with 
the clocks on the product in question because there always seems to be 
something different.

> The more challenging part was to make the ci20-audio (board) driver work
> since it initializes both channels for the headset and HDMI audio of the
> CI20.
> Fortunately, the dw-hdmi-i2s-audio driver is already upstream so I only had
> to configure and compile it.
> I haven't tried if I really get sound (have to find a 2.5mm headset first
> and my HDMI monitor has no speakers), but this is what I can see:
> root at letux:~# aplay -l
> **** List of PLAYBACK Hardware Devices ****
> card 0: ci20 [ci20], device 0: headphones 100200a4.audio-codec-0 [headphones
> 100200a4.audio-codec-0] Subdevices: 1/1
>   Subdevice #0: subdevice #0
> card 0: ci20 [ci20], device 1: hdmi i2s-hifi-1 [hdmi i2s-hifi-1]
>   Subdevices: 1/1
>   Subdevice #0: subdevice #0
> root at letux:~# amixer
> Simple mixer control 'Master',0
>   Capabilities: pvolume cvolume pswitch pswitch-joined
>   Playback channels: Front Left - Front Right
>   Capture channels: Front Left - Front Right
>   Limits: Playback 0 - 31 Capture 0 - 63
>   Front Left: Playback 25 [81%] [on] Capture 51 [81%]
>   Front Right: Playback 25 [81%] [on] Capture 51 [81%]
> Simple mixer control 'Headphone',0
>   Capabilities: pvolume pswitch pswitch-joined
>   Playback channels: Front Left - Front Right
>   Limits: Playback 0 - 31
>   Mono:
>   Front Left: Playback 22 [71%] [on]
>   Front Right: Playback 22 [71%] [on]
> Simple mixer control 'Mic',0
>   Capabilities: cvolume cvolume-joined cswitch cswitch-joined
>   Capture channels: Mono
>   Limits: Capture 0 - 7
>   Mono: Capture 0 [0%] [off]
> Simple mixer control 'ADC',0
>   Capabilities: cenum
>   Items: 'AIP1' 'AIP2'
>   Item0: 'AIP1'
> root at letux:~#
> There is also a headset detect in /dev/input/event*.

That looks like a good result!

> From an architecture point if view a key question will be if we want
> to have the CI20 board file or if we can replace it by the simple-audio-card
> driver like the lb60 did a while ago:
> 	91c7db5e7c652 "ASoC: jz4740: Drop lb60 board code"
> I'll consolidate these changes a little and post them here for all CI20
> users. Maybe someone wants to volunteer to help upstreaming (defining the
> DAI links should IMHO be done better through device tree) ...
> But it looks as if I can now (maybe after fixing some smaller bugs)
> compare CI20 sound to Alpha 400 sound and find out differences in
> i2s and DMA which seem the blocking components for Alpha 400.

Well, it seems like useful progress, and thanks are due again for all the work 
you've put in!


More information about the Letux-kernel mailing list