37
37
#include "skl.h"
38
38
#include "skl-sst-dsp.h"
39
39
#include "skl-sst-ipc.h"
40
+ #if IS_ENABLED (CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC )
40
41
#include "../../../soc/codecs/hdac_hda.h"
42
+ #endif
41
43
42
44
/*
43
45
* initialize the PCI registers
@@ -661,6 +663,8 @@ static void skl_clock_device_unregister(struct skl *skl)
661
663
platform_device_unregister (skl -> clk_dev );
662
664
}
663
665
666
+ #if IS_ENABLED (CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC )
667
+
664
668
#define IDISP_INTEL_VENDOR_ID 0x80860000
665
669
666
670
/*
@@ -679,6 +683,8 @@ static void load_codec_module(struct hda_codec *codec)
679
683
#endif
680
684
}
681
685
686
+ #endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */
687
+
682
688
/*
683
689
* Probe the given codec address
684
690
*/
@@ -688,9 +694,11 @@ static int probe_codec(struct hdac_bus *bus, int addr)
688
694
(AC_VERB_PARAMETERS << 8 ) | AC_PAR_VENDOR_ID ;
689
695
unsigned int res = -1 ;
690
696
struct skl * skl = bus_to_skl (bus );
697
+ #if IS_ENABLED (CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC )
691
698
struct hdac_hda_priv * hda_codec ;
692
- struct hdac_device * hdev ;
693
699
int err ;
700
+ #endif
701
+ struct hdac_device * hdev ;
694
702
695
703
mutex_lock (& bus -> cmd_mutex );
696
704
snd_hdac_bus_send_cmd (bus , cmd );
@@ -700,6 +708,7 @@ static int probe_codec(struct hdac_bus *bus, int addr)
700
708
return - EIO ;
701
709
dev_dbg (bus -> dev , "codec #%d probed OK: %x\n" , addr , res );
702
710
711
+ #if IS_ENABLED (CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC )
703
712
hda_codec = devm_kzalloc (& skl -> pci -> dev , sizeof (* hda_codec ),
704
713
GFP_KERNEL );
705
714
if (!hda_codec )
@@ -718,6 +727,13 @@ static int probe_codec(struct hdac_bus *bus, int addr)
718
727
load_codec_module (& hda_codec -> codec );
719
728
}
720
729
return 0 ;
730
+ #else
731
+ hdev = devm_kzalloc (& skl -> pci -> dev , sizeof (* hdev ), GFP_KERNEL );
732
+ if (!hdev )
733
+ return - ENOMEM ;
734
+
735
+ return snd_hdac_ext_bus_device_init (bus , addr , hdev );
736
+ #endif /* CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC */
721
737
}
722
738
723
739
/* Codec initialization */
@@ -873,7 +889,7 @@ static int skl_create(struct pci_dev *pci,
873
889
hbus = skl_to_hbus (skl );
874
890
bus = skl_to_bus (skl );
875
891
876
- #if IS_ENABLED (CONFIG_SND_SOC_HDAC_HDA )
892
+ #if IS_ENABLED (CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC )
877
893
ext_ops = snd_soc_hdac_hda_get_ops ();
878
894
#endif
879
895
snd_hdac_ext_bus_init (bus , & pci -> dev , & bus_core_ops , io_ops , ext_ops );
0 commit comments