Re: [PATCH 4/6] arm64: dts: renesas: gray-hawk-single: Add Sound support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Morimoto-san,

On Mon, Jun 24, 2024 at 2:16 AM Kuninori Morimoto
<kuninori.morimoto.gx@xxxxxxxxxxx> wrote:
> Because V4M supports only 1 SSI, it can't use Playback/Capture
> in the same time. It select Playback as default.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>

Thanks for your patch!

> --- a/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts
> +++ b/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts
> @@ -5,6 +5,25 @@
>   * Copyright (C) 2023 Renesas Electronics Corp.
>   * Copyright (C) 2024 Glider bv
>   */
> +/*
> + * [How to use Sound]
> + *
> + * Because R-Car V4M has only 1 SSI, it can't handle both Playback/Capture
> + * in the same time. You need to switch the direction which is controlled
> + * by GP0_01 pin via amixer.
> + *
> + * Playback (CN9500)
> + *     > amixer set "MUX" "Input 1"    // for GP0_01
> + *     > amixer set "DAC 1" 85%
> + *     > aplay xxx.wav
> + *
> + * Capture (CN9501)
> + *     > amixer set "MUX" "Input 2"    // for GP0_01
> + *     > amixer set "Mic 1" 80%
> + *     > amixer set "ADC 1" on
> + *     > amixer set 'ADC 1' 80%
> + *     > arecord xxx hoge.wav

The use of "Input 1" and "Input 2" sounds a bit strange to me.
Looking at sound/soc/codecs/simple-mux.c, these are dictated by the
MUX driver.

> + */
>
>  /dts-v1/;
>
> @@ -59,6 +78,23 @@ reg_3p3v: regulator-3p3v {
>                         regulator-boot-on;
>                         regulator-always-on;
>         };
> +
> +       sound_mux: mux {
> +               compatible = "simple-audio-mux";
> +               mux-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;

Adding support to simple-audio-mux to override the default "Input 1"
and "Input 2" names, using e.g.

    state-names = "Playback", "Record";

would make this more user-friendly.

Still, I wonder if there are any side-effects of (ab)using
simple-audio-mux for your use case. This MUX driver is really meant
to pick one of two sources to connect to a single sink, as described
by the topology in simple_mux_dapm_routes[] in the driver.  Perhaps
there exists software which interpretes these routes, and offers the
user a graphical description of the topology, which would be wrong?

> +       };

The rest LGTM.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux