[RFC,01/34] ASoC: dt-bindings: Add a separate compatible for the A64 codec
diff mbox series

Message ID 20200217064250.15516-2-samuel@sholland.org
State New
Headers show
Series
  • sun8i-codec fixes and new features
Related show

Commit Message

Samuel Holland Feb. 17, 2020, 6:42 a.m. UTC
The digital codec in the A64 is largely compatible with the one in the
A33, with two changes:
 - It is missing some muxing options for AIF1/2/3 (not currently
   supported by the driver)
 - It does not have the LRCK inversion issue that A33 has

To fix the Left/Right channel inversion on the A64 caused by the A33
LRCK fix, we need to introduce a new compatible for the codec in the
A64.

Cc: stable@kernel.org
Fixes: ec4a95409d5c ("arm64: dts: allwinner: a64: add nodes necessary for analog sound support")
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
 .../devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Chen-Yu Tsai Feb. 17, 2020, 9:49 a.m. UTC | #1
On Mon, Feb 17, 2020 at 2:42 PM Samuel Holland <samuel@sholland.org> wrote:
>
> The digital codec in the A64 is largely compatible with the one in the
> A33, with two changes:
>  - It is missing some muxing options for AIF1/2/3 (not currently
>    supported by the driver)

Is this at the pinctrl level or mixer level? If it's at the pinctrl level
then it's out of the scope of this driver/binding. It could very well have
those signals, just that they aren't routed outside the SoC.


ChenYu

>  - It does not have the LRCK inversion issue that A33 has
>
> To fix the Left/Right channel inversion on the A64 caused by the A33
> LRCK fix, we need to introduce a new compatible for the codec in the
> A64.
>
> Cc: stable@kernel.org
> Fixes: ec4a95409d5c ("arm64: dts: allwinner: a64: add nodes necessary for analog sound support")
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
>  .../devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml  | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml b/Documentation/devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml
> index 55d28268d2f4..7c66409f13ea 100644
> --- a/Documentation/devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml
> +++ b/Documentation/devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml
> @@ -15,7 +15,9 @@ properties:
>      const: 0
>
>    compatible:
> -    const: allwinner,sun8i-a33-codec
> +    enum:
> +      - allwinner,sun8i-a33-codec
> +      - allwinner,sun50i-a64-codec
>
>    reg:
>      maxItems: 1
> --
> 2.24.1
>
Samuel Holland Feb. 18, 2020, 3:17 a.m. UTC | #2
On 2/17/20 3:49 AM, Chen-Yu Tsai wrote:
> On Mon, Feb 17, 2020 at 2:42 PM Samuel Holland <samuel@sholland.org> wrote:
>>
>> The digital codec in the A64 is largely compatible with the one in the
>> A33, with two changes:
>>  - It is missing some muxing options for AIF1/2/3 (not currently
>>    supported by the driver)
> 
> Is this at the pinctrl level or mixer level? If it's at the pinctrl level
> then it's out of the scope of this driver/binding. It could very well have
> those signals, just that they aren't routed outside the SoC.

This is in reference to the muxes shown at the top of the A33 diagram, above the
I2S/PCM interfaces. These appear to map to bits 0-6 of AIF3_SGP_CTRL, which are
marked as reserved on the A64 and the AC100.

Comparing the three datasheets in a bit more detail (but by no means exhaustively):
 - The A64 has a second DRC block, unlike the A33 and AC100.
 - The jack detection registers (0x310-0x318) are present on the A64
   and AC100, but undocumented/missing on the A33.

So there are enough differences to warrant a new compatible, but since none of
the unique functionality is used by the driver (even after this series), a
fallback should work.
Rob Herring Feb. 26, 2020, 3:18 p.m. UTC | #3
On Mon, 17 Feb 2020 00:42:17 -0600, Samuel Holland wrote:
> The digital codec in the A64 is largely compatible with the one in the
> A33, with two changes:
>  - It is missing some muxing options for AIF1/2/3 (not currently
>    supported by the driver)
>  - It does not have the LRCK inversion issue that A33 has
> 
> To fix the Left/Right channel inversion on the A64 caused by the A33
> LRCK fix, we need to introduce a new compatible for the codec in the
> A64.
> 
> Cc: stable@kernel.org
> Fixes: ec4a95409d5c ("arm64: dts: allwinner: a64: add nodes necessary for analog sound support")
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
>  .../devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml  | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 

Acked-by: Rob Herring <robh@kernel.org>

Patch
diff mbox series

diff --git a/Documentation/devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml b/Documentation/devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml
index 55d28268d2f4..7c66409f13ea 100644
--- a/Documentation/devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml
+++ b/Documentation/devicetree/bindings/sound/allwinner,sun8i-a33-codec.yaml
@@ -15,7 +15,9 @@  properties:
     const: 0
 
   compatible:
-    const: allwinner,sun8i-a33-codec
+    enum:
+      - allwinner,sun8i-a33-codec
+      - allwinner,sun50i-a64-codec
 
   reg:
     maxItems: 1