Skip to content

RFC sun8i-codec fixes and new features

Samuel Holland alsa-devel linux-arm-kernel linux-devicetree lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest34 patches 34 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/34ASoC: dt-bindings: Add a separate compatible for the A64 codecDocumentation/devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml+3 -13 replies
2/34ASoC: sun8i-codec: LRCK is not inverted on A64sound/soc/sunxi/sun8i-codec.c+17 -52 replies
3/34arm64: dts: allwinner: a64: Fix the audio codec compatiblearch/arm64/boot/dts/allwinner/sun50i-a64.dtsi+1 -11 reply
4/34ASoC: sun8i-codec: Remove unused dev from codec structsound/soc/sunxi/sun8i-codec.c+0 -33 replies
5/34ASoC: sun8i-codec: Remove incorrect SND_SOC_DAIFMT_DSP_Bsound/soc/sunxi/sun8i-codec.c+0 -14 replies
6/34ASoC: sun8i-codec: Fix setting DAI data formatsound/soc/sunxi/sun8i-codec.c+2 -12 replies
7/34ASoC: sun8i-codec: Remove extraneous widgetssound/soc/sunxi/sun8i-codec.c+0 -42 replies
8/34ASoC: sun8i-codec: Fix direction of AIF1 outputssound/soc/sunxi/sun8i-codec.c+6 -63 replies
9/34ASoC: sun8i-codec: Fix broken DAPM routingarch/arm/boot/dts/sun8i-a33-olinuxino.dts arch/arm/boot/dts/sun8i-a33.dtsi arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts +8 more+71 -451 reply
10/34ASoC: sun8i-codec: Advertise only hardware-supported ratessound/soc/sunxi/sun8i-codec.c+7 -22 replies
11/34ASoC: sun8i-codec: Enforce parameter symmetrysound/soc/sunxi/sun8i-codec.c+3 -00 replies
12/34ASoC: sun8i-codec: Fix AIF1 MODCLK widget namesound/soc/sunxi/sun8i-codec.c+4 -41 reply
13/34ASoC: sun8i-codec: Fix AIF1_ADCDAT_CTRL field namessound/soc/sunxi/sun8i-codec.c+4 -41 reply
14/34ASoC: sun8i-codec: Fix AIF1_MXR_SRC field namessound/soc/sunxi/sun8i-codec.c+8 -81 reply
15/34ASoC: sun8i-codec: Fix ADC_DIG_CTRL field namesound/soc/sunxi/sun8i-codec.c+2 -21 reply
16/34ASoC: sun8i-codec: Fix field bit number indentationsound/soc/sunxi/sun8i-codec.c+7 -71 reply
17/34ASoC: sun8i-codec: Sort masks in a consistent ordersound/soc/sunxi/sun8i-codec.c+3 -31 reply
18/34ASoC: sun8i-codec: Allow all clock inversion permutationssound/soc/sunxi/sun8i-codec.c+11 -90 replies
19/34ASoC: sun8i-codec: Support mono DAI configurationssound/soc/sunxi/sun8i-codec.c+13 -30 replies
20/34ASoC: sun8i-codec: Support 8/20/24-bit word sizessound/soc/sunxi/sun8i-codec.c+32 -150 replies
21/34ASoC: sun8i-codec: Clean up module/clock hierarchysound/soc/sunxi/sun8i-codec.c+68 -460 replies
22/34ASoC: sun8i-codec: Clean up AIF1 Slot 0 widgetssound/soc/sunxi/sun8i-codec.c+42 -380 replies
23/34ASoC: sun8i-codec: Clean up DAC widgetssound/soc/sunxi/sun8i-codec.c+32 -290 replies
24/34ASoC: sun8i-codec: Prepare to support multiple AIFssound/soc/sunxi/sun8i-codec.c+80 -790 replies
25/34ASoC: sun8i-codec: Add support for AIF2sound/soc/sunxi/sun8i-codec.c+125 -00 replies
26/34ASoC: sun8i-codec: Add support for AIF3sound/soc/sunxi/sun8i-codec.c+178 -630 replies
27/34ASoC: sun8i-codec: Add AIF mono/stereo controlssound/soc/sunxi/sun8i-codec.c+146 -140 replies
28/34ASoC: sun8i-codec: Add AIF loopback controlssound/soc/sunxi/sun8i-codec.c+48 -00 replies
29/34ASoC: sun8i-codec: Add AIF, ADC, and DAC volume controlssound/soc/sunxi/sun8i-codec.c+56 -00 replies
30/34ASoC: dt-bindings: Bump sound-dai-cells on sun8i-codecDocumentation/devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml+1 -11 reply
31/34ARM: dts: sun8i-a33: Allow using multiple codec DAIsarch/arm/boot/dts/sun8i-a33.dtsi+2 -20 replies
32/34arm64: dts: allwinner: a64: Allow using multiple codec DAIsarch/arm64/boot/dts/allwinner/sun50i-a64.dtsi+2 -20 replies
33/34arm64: dts: allwinner: a64: Allow multiple DAI linksarch/arm64/boot/dts/allwinner/sun50i-a64.dtsi+14 -90 replies
34/34arm64: dts: allwinner: a64: Add pinmux for AIF2/AIF3arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi+12 -00 replies

Reviews trailers per patch

12 of 34 patches have a Reviewed-by or Acked-by.

PatchChen-Yu TsaiRob Herring
1/34A-b
2/34
3/34
4/34A-b A-b
5/34A-b
6/34A-b A-b
7/34R-b
8/34A-b
9/34
10/34
11/34
12/34A-b
13/34A-b
14/34A-b
15/34A-b
16/34A-b
17/34A-b
18/34
19/34
20/34
21/34
22/34
23/34
24/34
25/34
26/34
27/34
28/34
29/34
30/34
31/34
32/34
33/34
34/34

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 00/34] sun8i-codec fixes and new features

Hello all,

The sun8i-codec driver, as used in the Allwinner A33 and A64, currently only exposes a small subset of the available hardware features. In order to use the A64 in a smartphone (the PinePhone), I've added the necessary functionality to the driver:
* The full set of supported DAI format options
* Support for AIF2 and AIF3
* Additional routing knobs
* Additional volume controls

Unfortunately, due to preexisting issues with the driver, there are some breaking changes, as explained further in the commit messages:
* The LRCK inversion issue means we need a new compatible for the A64.
* Some controls are named inaccurately, so they are renamed.
* Likewise, the DAPM widgets used in device trees were either named wrong, or the device trees were using the wrong widgets in the first place. (Specifically, the links between the analog codec and digital codec happen at the ADC and DAC, not AIF1.)

I tended to take the philosophy of "while I'm breaking things, I might as well do them right", so I've probably made a few more changes than absolutely necessary. I'm not sure about where all of the policy boundaries are, about how far I should go to maintain compatibility. For example, for the DT widget usage, I could:
* Rename everything and update the DTS files (which is what I did)
* Keep the old (misleading/wrong) name for the widgets, but repurpose them to work correctly
(i.e. "ADC Left" would be named "AIF1 Slot 0 Left ADC", but it
would work just like "ADC Left" does in this patchset)
* Keep the old widgets around as a compatibility layer, but add new widgets and update the in-tree DTS files to use them (i.e. "ADC Left" would have a path from "AIF1 Slot 0 Left ADC", but "AIF1 Slot 0 Left ADC" would be a no-op widget)
* Something else entirely

There are several trivial fixes in here, and there are several commits that just add new features without changing any existing behavior, but there is enough changing that I thought it would be best to send the whole thing as an RFC. I'm more than happy to reorganize this into one or several patchsets in future revisions. It doesn't have to all go in at once.

This has all been tested on the PinePhone. For example, I've successfully routed a voice call between the modem at AIF2 and a Bluetooth headset at AIF3, merged with an audio file played from AIF1. Unfortunately, the PinePhone does not have a DTS upstream yet (partially due to the audio driver situation), so I don't have an example DTS in this patchset.

Thanks for any feedback,
Samuel

Samuel Holland (34):
ASoC: dt-bindings: Add a separate compatible for the A64 codec
ASoC: sun8i-codec: LRCK is not inverted on A64
arm64: dts: allwinner: a64: Fix the audio codec compatible
ASoC: sun8i-codec: Remove unused dev from codec struct
ASoC: sun8i-codec: Remove incorrect SND_SOC_DAIFMT_DSP_B
ASoC: sun8i-codec: Fix setting DAI data format
ASoC: sun8i-codec: Remove extraneous widgets
ASoC: sun8i-codec: Fix direction of AIF1 outputs
ASoC: sun8i-codec: Fix broken DAPM routing
ASoC: sun8i-codec: Advertise only hardware-supported rates
ASoC: sun8i-codec: Enforce parameter symmetry
ASoC: sun8i-codec: Fix AIF1 MODCLK widget name
ASoC: sun8i-codec: Fix AIF1_ADCDAT_CTRL field names
ASoC: sun8i-codec: Fix AIF1_MXR_SRC field names
ASoC: sun8i-codec: Fix ADC_DIG_CTRL field name
ASoC: sun8i-codec: Fix field bit number indentation
ASoC: sun8i-codec: Sort masks in a consistent order
ASoC: sun8i-codec: Allow all clock inversion permutations
ASoC: sun8i-codec: Support mono DAI configurations
ASoC: sun8i-codec: Support 8/20/24-bit word sizes
ASoC: sun8i-codec: Clean up module/clock hierarchy
ASoC: sun8i-codec: Clean up AIF1 Slot 0 widgets
ASoC: sun8i-codec: Clean up DAC widgets
ASoC: sun8i-codec: Prepare to support multiple AIFs
ASoC: sun8i-codec: Add support for AIF2
ASoC: sun8i-codec: Add support for AIF3
ASoC: sun8i-codec: Add AIF mono/stereo controls
ASoC: sun8i-codec: Add AIF loopback controls
ASoC: sun8i-codec: Add AIF, ADC, and DAC volume controls
ASoC: dt-bindings: Bump sound-dai-cells on sun8i-codec
ARM: dts: sun8i-a33: Allow using multiple codec DAIs
arm64: dts: allwinner: a64: Allow using multiple codec DAIs
arm64: dts: allwinner: a64: Allow multiple DAI links
arm64: dts: allwinner: a64: Add pinmux for AIF2/AIF3

 .../sound/allwinner,sun8i-a33-codec.yaml      |    6 +-
 arch/arm/boot/dts/sun8i-a33-olinuxino.dts     |    6 +-
 arch/arm/boot/dts/sun8i-a33.dtsi              |   10 +-
 .../dts/allwinner/sun50i-a64-bananapi-m64.dts |    8 +-
 .../dts/allwinner/sun50i-a64-orangepi-win.dts |    8 +-
 .../boot/dts/allwinner/sun50i-a64-pine64.dts  |    8 +-
 .../dts/allwinner/sun50i-a64-pinebook.dts     |    8 +-
 .../boot/dts/allwinner/sun50i-a64-pinetab.dts |   14 +-
 .../allwinner/sun50i-a64-sopine-baseboard.dts |    8 +-
 .../boot/dts/allwinner/sun50i-a64-teres-i.dts |    8 +-
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi |   47 +-
 sound/soc/sunxi/sun8i-codec.c                 | 1056 +++++++++++++----
 12 files changed, 890 insertions(+), 297 deletions(-)
Signature · 7 lines
2.24.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel