Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: cs35l56: Don't patch firmware that is already

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

Use the FIRMWARE_MISSING flag in the CS35L56 to determine whether it is
safe to download a firmware patch.

+26 -11
+16 -3
sound/soc/codecs/cs35l56.c
··· 656 656 int ret; 657 657 658 658 /* Use wm_adsp to load and apply the firmware patch and coefficient files */ 659 - ret = wm_adsp_power_up(&cs35l56->dsp); 659 + ret = wm_adsp_power_up(&cs35l56->dsp, true); 660 660 if (ret) 661 661 dev_dbg(cs35l56->base.dev, "%s: wm_adsp_power_up ret %d\n", __func__, ret); 662 662 else ··· 665 665 666 666 static void cs35l56_patch(struct cs35l56_private *cs35l56) 667 667 { 668 + unsigned int firmware_missing; 668 669 int ret; 670 + 671 + ret = regmap_read(cs35l56->base.regmap, CS35L56_PROTECTION_STATUS, &firmware_missing); 672 + if (ret) { 673 + dev_err(cs35l56->base.dev, "Failed to read PROTECTION_STATUS: %d\n", ret); 674 + return; 675 + } 676 + 677 + firmware_missing &= CS35L56_FIRMWARE_MISSING; 669 678 670 679 /* 671 680 * Disable SoundWire interrupts to prevent race with IRQ work. ··· 694 685 if (ret) 695 686 goto err; 696 687 697 - /* Use wm_adsp to load and apply the firmware patch and coefficient files */ 698 - ret = wm_adsp_power_up(&cs35l56->dsp); 688 + /* 689 + * Use wm_adsp to load and apply the firmware patch and coefficient files, 690 + * but only if firmware is missing. If firmware is already patched just 691 + * power-up wm_adsp without downloading firmware. 692 + */ 693 + ret = wm_adsp_power_up(&cs35l56->dsp, !!firmware_missing); 699 694 if (ret) { 700 695 dev_dbg(cs35l56->base.dev, "%s: wm_adsp_power_up ret %d\n", __func__, ret); 701 696 goto err;
+9 -7
sound/soc/codecs/wm_adsp.c
··· 998 998 } 999 999 EXPORT_SYMBOL_GPL(wm_adsp2_preloader_put); 1000 1000 1001 - int wm_adsp_power_up(struct wm_adsp *dsp) 1001 + int wm_adsp_power_up(struct wm_adsp *dsp, bool load_firmware) 1002 1002 { 1003 1003 int ret = 0; 1004 1004 char *wmfw_filename = NULL; ··· 1006 1006 char *coeff_filename = NULL; 1007 1007 const struct firmware *coeff_firmware = NULL; 1008 1008 1009 - ret = wm_adsp_request_firmware_files(dsp, 1010 - &wmfw_firmware, &wmfw_filename, 1011 - &coeff_firmware, &coeff_filename); 1012 - if (ret) 1013 - return ret; 1009 + if (load_firmware) { 1010 + ret = wm_adsp_request_firmware_files(dsp, 1011 + &wmfw_firmware, &wmfw_filename, 1012 + &coeff_firmware, &coeff_filename); 1013 + if (ret) 1014 + return ret; 1015 + } 1014 1016 1015 1017 ret = cs_dsp_power_up(&dsp->cs_dsp, 1016 1018 wmfw_firmware, wmfw_filename, ··· 1039 1037 struct wm_adsp, 1040 1038 boot_work); 1041 1039 1042 - wm_adsp_power_up(dsp); 1040 + wm_adsp_power_up(dsp, true); 1043 1041 } 1044 1042 1045 1043 int wm_adsp_early_event(struct snd_soc_dapm_widget *w,
+1 -1
sound/soc/codecs/wm_adsp.h
··· 91 91 int wm_adsp_early_event(struct snd_soc_dapm_widget *w, 92 92 struct snd_kcontrol *kcontrol, int event); 93 93 94 - int wm_adsp_power_up(struct wm_adsp *dsp); 94 + int wm_adsp_power_up(struct wm_adsp *dsp, bool load_firmware); 95 95 void wm_adsp_power_down(struct wm_adsp *dsp); 96 96 97 97 irqreturn_t wm_adsp2_bus_error(int irq, void *data);