diff options
Diffstat (limited to 'sound/pci/hda/patch_ca0132.c')
| -rw-r--r-- | sound/pci/hda/patch_ca0132.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index eefc4563b2f9..0792b5725f9c 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c | |||
| @@ -3239,7 +3239,7 @@ static int ca0132_set_vipsource(struct hda_codec *codec, int val) | |||
| 3239 | struct ca0132_spec *spec = codec->spec; | 3239 | struct ca0132_spec *spec = codec->spec; |
| 3240 | unsigned int tmp; | 3240 | unsigned int tmp; |
| 3241 | 3241 | ||
| 3242 | if (!dspload_is_loaded(codec)) | 3242 | if (spec->dsp_state != DSP_DOWNLOADED) |
| 3243 | return 0; | 3243 | return 0; |
| 3244 | 3244 | ||
| 3245 | /* if CrystalVoice if off, vipsource should be 0 */ | 3245 | /* if CrystalVoice if off, vipsource should be 0 */ |
| @@ -4267,11 +4267,12 @@ static void ca0132_refresh_widget_caps(struct hda_codec *codec) | |||
| 4267 | */ | 4267 | */ |
| 4268 | static void ca0132_setup_defaults(struct hda_codec *codec) | 4268 | static void ca0132_setup_defaults(struct hda_codec *codec) |
| 4269 | { | 4269 | { |
| 4270 | struct ca0132_spec *spec = codec->spec; | ||
| 4270 | unsigned int tmp; | 4271 | unsigned int tmp; |
| 4271 | int num_fx; | 4272 | int num_fx; |
| 4272 | int idx, i; | 4273 | int idx, i; |
| 4273 | 4274 | ||
| 4274 | if (!dspload_is_loaded(codec)) | 4275 | if (spec->dsp_state != DSP_DOWNLOADED) |
| 4275 | return; | 4276 | return; |
| 4276 | 4277 | ||
| 4277 | /* out, in effects + voicefx */ | 4278 | /* out, in effects + voicefx */ |
| @@ -4351,12 +4352,16 @@ static bool ca0132_download_dsp_images(struct hda_codec *codec) | |||
| 4351 | return false; | 4352 | return false; |
| 4352 | 4353 | ||
| 4353 | dsp_os_image = (struct dsp_image_seg *)(fw_entry->data); | 4354 | dsp_os_image = (struct dsp_image_seg *)(fw_entry->data); |
| 4354 | dspload_image(codec, dsp_os_image, 0, 0, true, 0); | 4355 | if (dspload_image(codec, dsp_os_image, 0, 0, true, 0)) { |
| 4356 | pr_err("ca0132 dspload_image failed.\n"); | ||
| 4357 | goto exit_download; | ||
| 4358 | } | ||
| 4359 | |||
| 4355 | dsp_loaded = dspload_wait_loaded(codec); | 4360 | dsp_loaded = dspload_wait_loaded(codec); |
| 4356 | 4361 | ||
| 4362 | exit_download: | ||
| 4357 | release_firmware(fw_entry); | 4363 | release_firmware(fw_entry); |
| 4358 | 4364 | ||
| 4359 | |||
| 4360 | return dsp_loaded; | 4365 | return dsp_loaded; |
| 4361 | } | 4366 | } |
| 4362 | 4367 | ||
| @@ -4367,16 +4372,13 @@ static void ca0132_download_dsp(struct hda_codec *codec) | |||
| 4367 | #ifndef CONFIG_SND_HDA_CODEC_CA0132_DSP | 4372 | #ifndef CONFIG_SND_HDA_CODEC_CA0132_DSP |
| 4368 | return; /* NOP */ | 4373 | return; /* NOP */ |
| 4369 | #endif | 4374 | #endif |
| 4370 | spec->dsp_state = DSP_DOWNLOAD_INIT; | ||
| 4371 | 4375 | ||
| 4372 | if (spec->dsp_state == DSP_DOWNLOAD_INIT) { | 4376 | chipio_enable_clocks(codec); |
| 4373 | chipio_enable_clocks(codec); | 4377 | spec->dsp_state = DSP_DOWNLOADING; |
| 4374 | spec->dsp_state = DSP_DOWNLOADING; | 4378 | if (!ca0132_download_dsp_images(codec)) |
| 4375 | if (!ca0132_download_dsp_images(codec)) | 4379 | spec->dsp_state = DSP_DOWNLOAD_FAILED; |
| 4376 | spec->dsp_state = DSP_DOWNLOAD_FAILED; | 4380 | else |
| 4377 | else | 4381 | spec->dsp_state = DSP_DOWNLOADED; |
| 4378 | spec->dsp_state = DSP_DOWNLOADED; | ||
| 4379 | } | ||
| 4380 | 4382 | ||
| 4381 | if (spec->dsp_state == DSP_DOWNLOADED) | 4383 | if (spec->dsp_state == DSP_DOWNLOADED) |
| 4382 | ca0132_set_dsp_msr(codec, true); | 4384 | ca0132_set_dsp_msr(codec, true); |
