int snd_hdac_display_power(struct hdac_bus *bus, bool enable);
int snd_hdac_get_display_clk(struct hdac_bus *bus);
int snd_hdac_i915_init(struct hdac_bus *bus);
+int snd_hdac_i915_init_bpo(struct hdac_bus *bus);
int snd_hdac_i915_exit(struct hdac_bus *bus);
int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *);
#else
{
return -ENODEV;
}
+static inline int snd_hdac_i915_init_bpo(struct hdac_bus *bus)
+{
+ return -ENODEV;
+}
static inline int snd_hdac_i915_exit(struct hdac_bus *bus)
{
return 0;
return !strcmp(dev->driver->name, "i915");
}
+static int hdac_component_master_match_bpo(struct device *dev, void *data)
+{
+ return !strcmp(dev->driver->name, "i915_bpo");
+}
+
/**
* snd_hdac_i915_register_notifier - Register i915 audio component ops
* @aops: i915 audio component ops
}
EXPORT_SYMBOL_GPL(snd_hdac_i915_init);
+int snd_hdac_i915_init_bpo(struct hdac_bus *bus)
+{
+ struct component_match *match = NULL;
+ struct device *dev = bus->dev;
+ struct i915_audio_component *acomp;
+ int ret;
+
+ acomp = kzalloc(sizeof(*acomp), GFP_KERNEL);
+ if (!acomp)
+ return -ENOMEM;
+ bus->audio_component = acomp;
+ hdac_acomp = acomp;
+
+ component_match_add(dev, &match, hdac_component_master_match_bpo, bus);
+ ret = component_master_add_with_match(dev, &hdac_component_master_ops,
+ match);
+ if (ret < 0)
+ goto out_err;
+
+ /*
+ * Atm, we don't support deferring the component binding, so make sure
+ * i915_bpo is loaded and that the binding successfully completes.
+ */
+ request_module("i915_bpo");
+
+ if (!acomp->ops) {
+ ret = -ENODEV;
+ goto out_master_del;
+ }
+ dev_dbg(dev, "bound to i915_bpo component master\n");
+
+ return 0;
+out_master_del:
+ component_master_del(dev, &hdac_component_master_ops);
+out_err:
+ kfree(acomp);
+ bus->audio_component = NULL;
+ dev_err(dev, "failed to add i915_bpo component master (%d)\n", ret);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(snd_hdac_i915_init_bpo);
+
/**
* snd_hdac_i915_exit - Finalize i915 audio component
* @bus: HDA core bus
if (CONTROLLER_IN_GPU(pci))
hda->need_i915_power = 1;
- err = snd_hdac_i915_init(bus);
+ if (((chip->driver_caps & AZX_DCAPS_INTEL_SKYLAKE) == AZX_DCAPS_INTEL_SKYLAKE) || \
+ ((chip->driver_caps & AZX_DCAPS_INTEL_BROXTON) == AZX_DCAPS_INTEL_BROXTON))
+ err = snd_hdac_i915_init_bpo(bus);
+ else
+ err = snd_hdac_i915_init(bus);
+
if (err < 0) {
/* if the controller is bound only with HDMI/DP
* (for HSW and BDW), we need to abort the probe;