CHROMIUM: ASoC: samsung: don't configure smdk audio everywhere
authorOlof Johansson <olofj@chromium.org>
Thu, 21 Jun 2012 18:29:27 +0000 (11:29 -0700)
committerOlof Johansson <olofj@chromium.org>
Tue, 26 Jun 2012 18:20:42 +0000 (11:20 -0700)
We want both drivers enabled so the same kernel can boot SMDK and
Daisy/Snow, but we can't have the SMDK driver registering itself on
hardware it doesn't exist on.

Change-Id: I5a446c1a840f539200b26e2f5aadf6b28d7fcb45
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit-int.chromium.org/20547
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Ready: Olof Johansson <olofj@google.com>
Tested-by: Olof Johansson <olofj@google.com>
sound/soc/samsung/smdk_wm8994.c

index 8eb309f..7f5661d 100644 (file)
@@ -10,6 +10,7 @@
 #include "../codecs/wm8994.h"
 #include <sound/pcm_params.h>
 #include <linux/module.h>
+#include <linux/of.h>
 
  /*
   * Default CFG switch settings to use this driver:
@@ -155,6 +156,9 @@ static int __init smdk_audio_init(void)
 {
        int ret;
 
+       if (!of_machine_is_compatible("samsung,smdk5250"))
+               return -ENODEV;
+
        smdk_snd_device = platform_device_alloc("soc-audio", -1);
        if (!smdk_snd_device)
                return -ENOMEM;