Skip to content

ASoc: sunxi: Add Allwinner A33 codec driver

Mylène Josserand alsa-devel linux-arm-kernel linux-clk linux-devicetree lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 43 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14dma: sun6i-dma: Add burst case of 4drivers/dma/sun6i-dma.c+2 -012 replies
2/14clk: ccu-sun8i-a33: Add CLK_SET_RATE_PARENT to ac-digdrivers/clk/sunxi-ng/ccu-sun8i-a33.c+1 -12 replies
3/14ASoC: sun4i-i2s: Add apb resetsound/soc/sunxi/sun4i-i2s.c+15 -14 replies
4/14ASoC: Add sun8i analog codec driversound/soc/sunxi/Kconfig sound/soc/sunxi/Makefile sound/soc/sunxi/sun8i-codec-analog.c+312 -02 replies
5/14mfd: sun6i-prcm: Add sun8i analog codec as subnodedrivers/mfd/sun6i-prcm.c+16 -02 replies
6/14ASoC: Add sun8i digital audio codecsound/soc/sunxi/Kconfig sound/soc/sunxi/Makefile sound/soc/sunxi/sun8i-codec.c+502 -09 replies
7/14ASoC: Add sun8i audio cardsound/soc/sunxi/Kconfig sound/soc/sunxi/Makefile sound/soc/sunxi/sun8i.c+116 -05 replies
8/14dt-bindings: sound: Add sun8i analog codec documentationDocumentation/devicetree/bindings/sound/sun8i-codec-analog.txt+20 -04 replies
9/14dt-bindings: sound: Add sun8i codec documentationDocumentation/devicetree/bindings/sound/sun8i-codec.txt+24 -01 reply
10/14dt-bindings: sound: Add sun8i audio card documentationDocumentation/devicetree/bindings/sound/sun8i-audio.txt+17 -01 reply
11/14ARM: dts: sun8i: Add analog codec on prcm nodearch/arm/boot/dts/sun8i-a23-a33.dtsi+7 -00 replies
12/14ARM: dts: sun8i: Add audio codec, dai and card for A33arch/arm/boot/dts/sun8i-a33.dtsi+33 -00 replies
13/14ARM: dts: sun8i: parrot: Enable audio nodesarch/arm/boot/dts/sun8i-r16-parrot.dts+8 -00 replies
14/14ARM: dts: sun8i: sinlinx: Enable audio nodesarch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts+8 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/14] ASoc: sunxi: Add Allwinner A33 codec driver

Hi everyone,

This patchset add the audio codec for Allwinner A33 (sun8i) SoC.

It adds different drivers:
- sun8i-codec-analog (patch 4): This driver implements the analog part of the audio codec. The analog part is handled in PRCM registers so this driver must be added as prcm's subnode (patch 5).
- sun8i-codec (patch 6): This driver implements the digital part of the A33 codec.
- sun8i (patch 7): This driver implements a sound card for A33. It links the DAI and the audio codec. The analog codec driver is handled as an "aux_device".

The DAI for this codec is the same than for A20: "sun4i-i2s". The digital codec code is coming from Allwinner's BSP (after some cleanup and DAPM conversion) [1]
The analog codec driver is coming from Chen-Yu Tsai's driver [2] with some modifications (such as read/write regmap functions).

Currently, all the drivers handle only the playback feature. The other ones (such as capture) and all other interfaces except headphone are not supported.

These drivers are functional except for one issue. When playing a sound for the first time, a short delay can be noticed. On a second play (right after), the sound is played correctly. If we wait a short time (~5 sec), the delay is back.
There is the same behavior for left/right channel. On the first time, a left sound is played on the left channel but in the second time, the sound will be played on wrong channel.

These issues will be fixed in a second time. Is someone have suggestions about it?

Examples of amixer commands:
amixer set 'Headphone' 75%
amixer set 'Headphone' on
amixer set 'DAC' on
amixer set 'Right DAC Mixer RSlot 0' on
amixer set 'Left DAC Mixer LSlot 0' on
amixer set 'DAC Reversed Right' on
amixer set 'DAC Reversed Left' on

It was tested on Parrot and Sinlinx board where device tree's modifications are added (patch 11 to 14).

Thank you in advance,
Best regards,

[1]: https://github.com/allwinner-zh/linux-3.4-sunxi/blob/master/sound/soc/sunxi/audiocodec/sun8iw5_sndcodec.c
[2]: https://github.com/wens/linux/tree/a31-audio

Mylène Josserand (14):
dma: sun6i-dma: Add burst case of 4
clk: ccu-sun8i-a33: Add CLK_SET_RATE_PARENT to ac-dig
ASoC: sun4i-i2s: Add apb reset
ASoC: Add sun8i analog codec driver
mfd: sun6i-prcm: Add sun8i analog codec as subnode
ASoC: Add sun8i digital audio codec
ASoC: Add sun8i audio card
dt-bindings: sound: Add sun8i analog codec documentation
dt-bindings: sound: Add sun8i codec documentation
dt-bindings: sound: Add sun8i audio card documentation
ARM: dts: sun8i: Add analog codec on prcm node
ARM: dts: sun8i: Add audio codec, dai and card for A33
ARM: dts: sun8i: parrot: Enable audio nodes
ARM: dts: sun8i: sinlinx: Enable audio nodes

 .../devicetree/bindings/sound/sun8i-audio.txt      |  17 +
 .../bindings/sound/sun8i-codec-analog.txt          |  20 +
 .../devicetree/bindings/sound/sun8i-codec.txt      |  24 +
 arch/arm/boot/dts/sun8i-a23-a33.dtsi               |   7 +
 arch/arm/boot/dts/sun8i-a33-sinlinx-sina33.dts     |   8 +
 arch/arm/boot/dts/sun8i-a33.dtsi                   |  33 ++
 arch/arm/boot/dts/sun8i-r16-parrot.dts             |   8 +
 drivers/clk/sunxi-ng/ccu-sun8i-a33.c               |   2 +-
 drivers/dma/sun6i-dma.c                            |   2 +
 drivers/mfd/sun6i-prcm.c                           |  16 +
 sound/soc/sunxi/Kconfig                            |  30 ++
 sound/soc/sunxi/Makefile                           |   3 +
 sound/soc/sunxi/sun4i-i2s.c                        |  16 +-
 sound/soc/sunxi/sun8i-codec-analog.c               | 305 +++++++++++++
 sound/soc/sunxi/sun8i-codec.c                      | 492 +++++++++++++++++++++
 sound/soc/sunxi/sun8i.c                            | 101 +++++
 16 files changed, 1082 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/sun8i-audio.txt
 create mode 100644 Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt
 create mode 100644 Documentation/devicetree/bindings/sound/sun8i-codec.txt
 create mode 100644 sound/soc/sunxi/sun8i-codec-analog.c
 create mode 100644 sound/soc/sunxi/sun8i-codec.c
 create mode 100644 sound/soc/sunxi/sun8i.c
Signature · 1 line
2.9.3