[Letux-kernel] [RFC v2 0/5] CI20 sound

H. Nikolaus Schaller hns at goldelico.com
Sun May 2 11:16:17 CEST 2021


Updates v2:
* replace jz4780 codec based on jz4770 by code specific for the jz4780 from the 3.18 kernel
* add ci20-audio from the 3.18 kernel to replace simple-audio-card because the CI20 needs some special setup
  for mic type detecion and HDMI audio
* enable kernel module configs
* debugged to create an audio card (which does not yet fully work)

Notes:
- not cleaned
- not checkpatched
- no YAML
- needs CI HDMI solution as basis
- tested on letux-5.12 kernel

It now basically works:

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:~# 

Except that there is no sound but an I/O error and the aplay command takes longer than expected:

root at letux:~# time aplay /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE /usr/share/sounds/alsa/Front_Center.wav : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: pcm_write:1939: write error: Input/output error

real    0m13.141s
user    0m0.021s
sys     0m0.012s
root at letux:~# 

There is one boot-warning:

[    4.089501] jz4780-codec 100200a4.audio-codec: No cache used with register defaults set!

But that just confirms that we have 

	.cache_type = REGCACHE_NONE,

For the regmap of the jz4780-codec driver.

---

RFC V1 2021-04-30 18:55:28:
defines:
* DTS nodes (some uncertainty about clocks and interrupts) for jz4780, ci20
* adds a jz4780 codec driver based on jz4770 driver
* start to adjust register offsets
* enable in ci20_defconfig

base: v5.12


H. Nikolaus Schaller (5):
  ASoC: codecs: Add jz4780-codec driver
  ASoC: JZ4740: Add CI20 board driver
  MIPS: DTS: jz4780: add definition for for i2s and codec
  MIPS: DTS: CI20: provide sound
  MIPS: configs: ci20: enable SOUND and I2S/Codec

 arch/mips/boot/dts/ingenic/ci20.dts    |  40 ++
 arch/mips/boot/dts/ingenic/jz4780.dtsi |  33 ++
 arch/mips/configs/ci20_defconfig       |  10 +
 sound/soc/codecs/Kconfig               |  13 +
 sound/soc/codecs/Makefile              |   2 +
 sound/soc/codecs/jz4780.c              | 635 +++++++++++++++++++++++++
 sound/soc/jz4740/Kconfig               |   7 +
 sound/soc/jz4740/Makefile              |   1 +
 sound/soc/jz4740/ci20-audio.c          | 317 ++++++++++++
 9 files changed, 1058 insertions(+)
 create mode 100644 sound/soc/codecs/jz4780.c
 create mode 100644 sound/soc/jz4740/ci20-audio.c

-- 
2.26.2



More information about the Letux-kernel mailing list