summaryrefslogtreecommitdiff
path: root/sound/x86/intel_hdmi_audio.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-01-30 17:23:39 +0100
committerTakashi Iwai <tiwai@suse.de>2017-02-03 17:22:16 +0100
commit79dda75a2cfc5628f25338122d24ee8789b367cf (patch)
treec2dcfcc9d93a6324f201b43a92c83d2802623163 /sound/x86/intel_hdmi_audio.h
parent6f9ecc76f4e04b111160d789f36a8c5bf1cc9ab6 (diff)
ALSA: x86: Pass snd_intelhad object to helpers
For reducing the global variable reference, keep snd_intelhad object in the context and pass it to each helper. It's a preliminary change for further cleanup. This also includes the simplification of the probe procedure: the LPE platform driver directly gets the created snd_intelhad object by hdmi_audio_probe(), and passes it to each helper and destructor, hdmi_audio_remove(). The hdmi_audio_probe() function doesn't call the back-registration any longer, which is fairly useless. The LPE platform driver initializes the stuff instead at the right place, and calls the wq after the object creation in the probe function itself. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/x86/intel_hdmi_audio.h')
-rw-r--r--sound/x86/intel_hdmi_audio.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/sound/x86/intel_hdmi_audio.h b/sound/x86/intel_hdmi_audio.h
index ba13ae63bea3..5a82a3f429d7 100644
--- a/sound/x86/intel_hdmi_audio.h
+++ b/sound/x86/intel_hdmi_audio.h
@@ -39,6 +39,8 @@
#include <sound/pcm.h>
#include "intel_hdmi_lpe_audio.h"
+struct platform_device;
+
#define PCM_INDEX 0
#define MAX_PB_STREAMS 1
#define MAX_CAP_STREAMS 0
@@ -168,13 +170,19 @@ void snd_intelhad_handle_underrun(struct snd_intelhad *intelhaddata);
/* Register access functions */
int had_get_hwstate(struct snd_intelhad *intelhaddata);
-int had_get_caps(enum had_caps_list query_element, void *capabilties);
-int had_set_caps(enum had_caps_list set_element, void *capabilties);
-int had_read_register(u32 reg_addr, u32 *data);
-int had_write_register(u32 reg_addr, u32 data);
-int had_read_modify(u32 reg_addr, u32 data, u32 mask);
-
-int hdmi_audio_probe(void *devptr);
-int hdmi_audio_remove(void *pdev);
+int had_get_caps(struct snd_intelhad *intelhaddata,
+ enum had_caps_list query_element, void *capabilties);
+int had_set_caps(struct snd_intelhad *intelhaddata,
+ enum had_caps_list set_element, void *capabilties);
+int had_read_register(struct snd_intelhad *intelhaddata,
+ u32 reg_addr, u32 *data);
+int had_write_register(struct snd_intelhad *intelhaddata,
+ u32 reg_addr, u32 data);
+int had_read_modify(struct snd_intelhad *intelhaddata,
+ u32 reg_addr, u32 data, u32 mask);
+
+int hdmi_audio_probe(struct platform_device *devptr,
+ struct snd_intelhad **had_ret);
+int hdmi_audio_remove(struct snd_intelhad *intelhaddata);
#endif /* _INTEL_HDMI_AUDIO_ */