Commit bdb9ce39 authored by Timo Aaltonen's avatar Timo Aaltonen Committed by Tim Gardner

UBUNTU: SAUCE: sound/hda: Load i915_bpo from the hda driver on SKL/KBL/BXT

BugLink: http://bugs.launchpad.net/bugs/1540390Signed-off-by: default avatarTimo Aaltonen <timo.aaltonen@canonical.com>
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
parent 558c18dd
......@@ -11,6 +11,7 @@ int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable);
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
......@@ -30,6 +31,10 @@ static inline int snd_hdac_i915_init(struct hdac_bus *bus)
{
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;
......
......@@ -170,6 +170,11 @@ static int hdac_component_master_match(struct device *dev, void *data)
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
......@@ -246,6 +251,49 @@ int snd_hdac_i915_init(struct hdac_bus *bus)
}
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
......
......@@ -2061,7 +2061,12 @@ static int azx_probe_continue(struct azx *chip)
if (CONTROLLER_IN_GPU(pci))
hda->need_i915_power = 1;
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment