On Wed, Jul 22, 2015 at 10:55:55AM +0200, Takashi Iwai wrote:
On Wed, 22 Jul 2015 10:50:03 +0200, David Henningsson wrote:
struct i915_audio_component { struct device *dev;
- struct hdac_bus *hdac_bus;
If we want to be more generic, using a struct device would be better, e.g. struct device *audio_dev;
Does this work? If we want to have the hdac_bus.dev ptr instead of a hdac_bus ptr, there does not seem to be an obvious way to go from the audio_dev back to the hdac_bus struct (as snd_hdac_bus_init takes an arbitrary dev pointer).
Hrm, right, currently it's not straightforward. Scratch the idea, then.
That depends on the device we register this with. Actually this makes more sense to me :)
If we register with struct device *audio_dev, which in this case would be the codec device we create while probing the bus. This way you are linking i915 ops to the codec device. Ofcourse hdac_device has bus pointer but you can invoke device callback without even searching for the device :)