Message ID | 20241023075917.186835-3-ryan@testtoast.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | ASoC: add Allwinner H616 audio codec support | expand |
On Wed, Oct 23, 2024 at 08:56:58PM +1300, Ryan Walklin wrote: > The H616 has an audio codec compatible with the sun4i-a10 driver. > > The codec is relatively cut down compared to some of the other Allwinner > SoCs and only has a single line-out route (relying on a separate digital > microphone IP block for input). HDMI and SPDIF audio are handled > separately by an audio hub IP block, which is not currently implemented > in mainline kernels. This requires some additional flexibility in the > DMA bindings. > > Add compatible string and routing for the H616 audio codec, and update > the required DMA descriptions. > > Signed-off-by: Ryan Walklin <ryan@testtoast.com> > > --- > Changelog v1..v2: > - Remove PLL_AUDIO_4X clock from definition (defined internally but > not used by driver and so not required in DTSI) > - Restrict TX-only DMA definition to H616 > > Changelog v2..v3: > > - Fix missing - in H616 conditional binding reported by dt_binding_check. > --- > .../sound/allwinner,sun4i-a10-codec.yaml | 53 ++++++++++++++++--- > 1 file changed, 47 insertions(+), 6 deletions(-) > > diff --git a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml > index 78273647f7665..ebc9097f936ad 100644 > --- a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml > +++ b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml > @@ -22,6 +22,7 @@ properties: > - allwinner,sun8i-a23-codec > - allwinner,sun8i-h3-codec > - allwinner,sun8i-v3s-codec > + - allwinner,sun50i-h616-codec Are you keeping preferred ordering of entries? Usually it is alphanumerical, but you introduce now by model number. > > reg: > maxItems: 1 > @@ -40,14 +41,20 @@ properties: > - const: codec Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof
On Wed, Oct 23, 2024 at 08:56:58PM +1300, Ryan Walklin wrote:
> The H616 has an audio codec compatible with the sun4i-a10 driver.
Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.
diff --git a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml index 78273647f7665..ebc9097f936ad 100644 --- a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml +++ b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-codec.yaml @@ -22,6 +22,7 @@ properties: - allwinner,sun8i-a23-codec - allwinner,sun8i-h3-codec - allwinner,sun8i-v3s-codec + - allwinner,sun50i-h616-codec reg: maxItems: 1 @@ -40,14 +41,20 @@ properties: - const: codec dmas: - items: - - description: RX DMA Channel - - description: TX DMA Channel + oneOf: + - items: + - description: RX DMA Channel + - description: TX DMA Channel + - items: + - description: TX DMA Channel dma-names: - items: - - const: rx - - const: tx + oneOf: + - items: + - const: rx + - const: tx + - items: + - const: tx resets: maxItems: 1 @@ -229,6 +236,40 @@ allOf: - Mic - Speaker + - if: + properties: + compatible: + enum: + - allwinner,sun50i-h616-codec + + then: + properties: + allwinner,audio-routing: + items: + enum: + - LINEOUT + - Line Out + + dmas: + items: + - description: TX DMA Channel + + dma-names: + items: + - const: tx + + else: + properties: + dmas: + items: + - description: RX DMA Channel + - description: TX DMA Channel + + dma-names: + items: + - const: rx + - const: tx + unevaluatedProperties: false examples:
The H616 has an audio codec compatible with the sun4i-a10 driver. The codec is relatively cut down compared to some of the other Allwinner SoCs and only has a single line-out route (relying on a separate digital microphone IP block for input). HDMI and SPDIF audio are handled separately by an audio hub IP block, which is not currently implemented in mainline kernels. This requires some additional flexibility in the DMA bindings. Add compatible string and routing for the H616 audio codec, and update the required DMA descriptions. Signed-off-by: Ryan Walklin <ryan@testtoast.com> --- Changelog v1..v2: - Remove PLL_AUDIO_4X clock from definition (defined internally but not used by driver and so not required in DTSI) - Restrict TX-only DMA definition to H616 Changelog v2..v3: - Fix missing - in H616 conditional binding reported by dt_binding_check. --- .../sound/allwinner,sun4i-a10-codec.yaml | 53 ++++++++++++++++--- 1 file changed, 47 insertions(+), 6 deletions(-)