diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-09-20 23:29:13 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-11-28 02:47:03 -0500 |
commit | 1d1a4564d8e0a05d56a95df08c6c411bea704bec (patch) | |
tree | 19bfbe4c00fe3c14d3cc2696731495bb2a28c3ce /sound/pci/hda/hda_codec.h | |
parent | f4a75d2eb7b1e2206094b901be09adb31ba63681 (diff) |
ALSA: hda - Add new DSP loader callback routines
Pass DMA buffer pointers in calls to setup_bdle().
Add DSP loader callback routines to controller.
Add new DSP loader switch to Kconfig to turn off DSP firmware.
Signed-off-by: Ian Minett <ian_minett@creativelabs.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.h')
-rw-r--r-- | sound/pci/hda/hda_codec.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 507fe8a917b6..c218bf41261a 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -618,6 +618,17 @@ struct hda_bus_ops { | |||
618 | /* notify power-up/down from codec to controller */ | 618 | /* notify power-up/down from codec to controller */ |
619 | void (*pm_notify)(struct hda_bus *bus, bool power_up); | 619 | void (*pm_notify)(struct hda_bus *bus, bool power_up); |
620 | #endif | 620 | #endif |
621 | #ifdef CONFIG_SND_HDA_DSP_LOADER | ||
622 | /* prepare DSP transfer */ | ||
623 | int (*load_dsp_prepare)(struct hda_bus *bus, unsigned int format, | ||
624 | unsigned int byte_size, | ||
625 | struct snd_dma_buffer *bufp); | ||
626 | /* start/stop DSP transfer */ | ||
627 | void (*load_dsp_trigger)(struct hda_bus *bus, bool start); | ||
628 | /* clean up DSP transfer */ | ||
629 | void (*load_dsp_cleanup)(struct hda_bus *bus, | ||
630 | struct snd_dma_buffer *dmab); | ||
631 | #endif | ||
621 | }; | 632 | }; |
622 | 633 | ||
623 | /* template to pass to the bus constructor */ | 634 | /* template to pass to the bus constructor */ |
@@ -1129,6 +1140,40 @@ static inline void snd_hda_power_sync(struct hda_codec *codec) | |||
1129 | int snd_hda_load_patch(struct hda_bus *bus, size_t size, const void *buf); | 1140 | int snd_hda_load_patch(struct hda_bus *bus, size_t size, const void *buf); |
1130 | #endif | 1141 | #endif |
1131 | 1142 | ||
1143 | #ifdef CONFIG_SND_HDA_DSP_LOADER | ||
1144 | static inline int | ||
1145 | snd_hda_codec_load_dsp_prepare(struct hda_codec *codec, unsigned int format, | ||
1146 | unsigned int size, | ||
1147 | struct snd_dma_buffer *bufp) | ||
1148 | { | ||
1149 | return codec->bus->ops.load_dsp_prepare(codec->bus, format, size, bufp); | ||
1150 | } | ||
1151 | static inline void | ||
1152 | snd_hda_codec_load_dsp_trigger(struct hda_codec *codec, bool start) | ||
1153 | { | ||
1154 | return codec->bus->ops.load_dsp_trigger(codec->bus, start); | ||
1155 | } | ||
1156 | static inline void | ||
1157 | snd_hda_codec_load_dsp_cleanup(struct hda_codec *codec, | ||
1158 | struct snd_dma_buffer *dmab) | ||
1159 | { | ||
1160 | return codec->bus->ops.load_dsp_cleanup(codec->bus, dmab); | ||
1161 | } | ||
1162 | #else | ||
1163 | static inline int | ||
1164 | snd_hda_codec_load_dsp_prepare(struct hda_codec *codec, unsigned int format, | ||
1165 | unsigned int size, | ||
1166 | struct snd_dma_buffer *bufp) | ||
1167 | { | ||
1168 | return 0; | ||
1169 | } | ||
1170 | static inline void | ||
1171 | snd_hda_codec_load_dsp_trigger(struct hda_codec *codec, bool start) {} | ||
1172 | static inline void | ||
1173 | snd_hda_codec_load_dsp_cleanup(struct hda_codec *codec, | ||
1174 | struct snd_dma_buffer *dmab) {} | ||
1175 | #endif | ||
1176 | |||
1132 | /* | 1177 | /* |
1133 | * Codec modularization | 1178 | * Codec modularization |
1134 | */ | 1179 | */ |