Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[orangepilite/current] pcm5102a module disabled #1798

Closed
douardda opened this issue Feb 11, 2020 · 3 comments · Fixed by #1802
Closed

[orangepilite/current] pcm5102a module disabled #1798

douardda opened this issue Feb 11, 2020 · 3 comments · Fixed by #1802

Comments

@douardda
Copy link
Contributor

On a stock armbian image for the orangepi lite (image Armbian_20.02.0-rc1_Orangepilite_buster_current_5.4.14.7z), there is no kernel module for the pcm5102 (i2s with no hw control, so no i2c/spi required) DAC.

Trying to build a kernel using the build toolchain, I noticed for some reason, the pcm5102a build sound module is not even listed in the modules (in the allwinner soc codecs submenu) while configuring a kernel build because of the lack of a description for the entry config SND_SOC_PCM5102A in the linux-mainline/orange-pi-5.4/sound/soc/codecs/Kconfig file. Replacing:

config SND_SOC_PCM5102A
        tristate

with

config SND_SOC_PCM5102A
        tristate "Texas Instruments PCM5102A"

makes it possible to build the module (and it work!), with the help of an overlay like:

/dts-v1/;
/plugin/;

/{
  compatible = "allwinner,sun8i-h3";

  fragment@0 {
    target-path = "/";
    __overlay__ {
      pcm5102a: pcm5102a {
        #sound-dai-cells = <0>;
        compatible = "ti,pcm5102a";
        pcm510x,format = "i2s";
      };
    };
  };

  fragment@1 {
    target = <&i2s0>;
    __overlay__ {
      //compatible = "allwinner,sun8i-h3-i2s";
      status = "okay";
      pinctrl-0 = <&i2s0_pins>;
      sound-dai = <&pcm5102a>;
      //clock-source = "external";
      pinctrl-names = "default";
    };
  };

  fragment@2 {
    target-path = "/";
    __overlay__ {
      sound_i2s {
        compatible = "simple-audio-card";
        simple-audio-card,name = "I2S-master";
        simple-audio-card,mclk-fs = <256>;
        simple-audio-card,format = "i2s";
        status = "okay";
        simple-audio-card,cpu {
          sound-dai = <&i2s0>;
        };
        simple-audio-card,codec {
          sound-dai = <&pcm5102a>;
        };
      };
    };
  };
};

I'd be nice to have it already built in armbian to make life easier for those who want to play with these cheapo but very capable DACs.

I'm not sure where to start if I want to provide a PR for this. I guess I have to provide a patch in patch/kernel/sunxi-current right?

@lanefu
Copy link
Member

lanefu commented Feb 12, 2020

@igorpecovnik @martinayotte any thoughts?

@igorpecovnik
Copy link
Member

I guess I have to provide a patch in patch/kernel/sunxi-current right?

If its tested, yes, here. And to patch/kernel/sunxi-dev , optional sunxi-legacy

@ashthespy
Copy link
Collaborator

^If its tested, yes, here. And to patch/kernel/sunxi-dev , optional sunxi-legacy

Been using the PCM5102a with the orangepione/lite using a similar method with the legacy (4.19.y) kernel. It did take some head scratching initially wondering why the module wasn't getting compiled directly from Kconfig then came across this forum thread that suggested the same description fix.

diff --git a/sound/soc/sunxi/Kconfig b/sound/soc/sunxi/Kconfig
index 22408bc..73126bd 100644
--- a/sound/soc/sunxi/Kconfig
+++ b/sound/soc/sunxi/Kconfig
@@ -30,8 +30,10 @@ config SND_SUN8I_CODEC_ANALOG
 
 config SND_SUN4I_I2S
 	tristate "Allwinner A10 I2S Support"
+	depends on OF
 	select SND_SOC_GENERIC_DMAENGINE_PCM
 	select REGMAP_MMIO
+	select SND_SOC_PCM5102A
 	help
 	  Say Y or M if you want to add support for codecs attached to
 	  the Allwinner A10 I2S. You will also need to select the

douardda added a commit to douardda/build that referenced this issue Feb 13, 2020
for sunxi-current and sunx-dev kernels.

Fixes armbian#1798
douardda added a commit to douardda/build that referenced this issue Feb 13, 2020
for sunxi-current and sunx-dev kernels.

Fixes armbian#1798
igorpecovnik pushed a commit that referenced this issue Feb 14, 2020
…e by default (#1802)

* [sunxi] allow pcm5102a codec module to be built

for sunxi-current and sunx-dev kernels.

Fixes #1798

* [sunxi] build pcm5102a and pcm51xx_(i2s|spi) modules by default

on sunxi-current and sunxi-dev kernels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants