@@ -502,13 +502,6 @@ static void wm_adsp_buf_free(struct list_head *list)
502502
503503#define WM_ADSP_NUM_FW 11
504504
505- #define WM_VPU_FW_MISC 0
506- #define WM_VPU_NUM_FW 1
507-
508- static const char * wm_vpu_fw_text [WM_VPU_NUM_FW ] = {
509- [WM_VPU_FW_MISC ] = "Misc" ,
510- };
511-
512505static const char * wm_adsp_fw_text [WM_ADSP_NUM_FW ] = {
513506 [WM_ADSP_FW_MBC_VSS ] = "MBC/VSS" ,
514507 [WM_ADSP_FW_HIFI ] = "MasterHiFi" ,
@@ -721,12 +714,6 @@ static const struct {
721714 [WM_ADSP_FW_MISC ] = { .file = "misc" },
722715};
723716
724- static const struct {
725- const char * file ;
726- } wm_vpu_fw [WM_VPU_NUM_FW ] = {
727- [WM_VPU_FW_MISC ] = { .file = "misc" },
728- };
729-
730717struct wm_coeff_ctl_ops {
731718 int (* xget )(struct snd_kcontrol * kcontrol ,
732719 struct snd_ctl_elem_value * ucontrol );
@@ -1617,19 +1604,7 @@ static int wm_adsp_create_control(struct wm_adsp *dsp,
16171604 return - EINVAL ;
16181605 }
16191606
1620- switch (dsp -> type ) {
1621- case WMFW_VPU :
1622- fw_txt = wm_vpu_fw_text [dsp -> fw ];
1623- break ;
1624- case WMFW_ADSP1 :
1625- case WMFW_ADSP2 :
1626- case WMFW_HALO :
1627- fw_txt = wm_adsp_fw_text [dsp -> fw ];
1628- break ;
1629- default :
1630- adsp_err (dsp , "Unknown Architecture type: %d\n" , dsp -> type );
1631- return - EINVAL ;
1632- }
1607+ fw_txt = wm_adsp_fw_text [dsp -> fw ];
16331608
16341609 switch (dsp -> fw_ver ) {
16351610 case 0 :
@@ -1965,29 +1940,13 @@ static int wm_adsp_load(struct wm_adsp *dsp)
19651940 unsigned int reg ;
19661941 int regions = 0 ;
19671942 int ret , offset , type , sizes ;
1968- const char * fw_txt ;
19691943
19701944 file = kzalloc (PAGE_SIZE , GFP_KERNEL );
19711945 if (file == NULL )
19721946 return - ENOMEM ;
19731947
1974- switch (dsp -> type ) {
1975- case WMFW_VPU :
1976- fw_txt = wm_vpu_fw [dsp -> fw ].file ;
1977- break ;
1978- case WMFW_ADSP1 :
1979- case WMFW_ADSP2 :
1980- case WMFW_HALO :
1981- fw_txt = wm_adsp_fw [dsp -> fw ].file ;
1982- break ;
1983- default :
1984- adsp_err (dsp , "Unknown Architecture type: %d\n" , dsp -> type );
1985- ret = - EINVAL ;
1986- goto out ;
1987- }
1988-
19891948 snprintf (file , PAGE_SIZE , "%s-%s-%s.wmfw" , dsp -> part , dsp -> fwf_name ,
1990- fw_txt );
1949+ wm_adsp_fw [ dsp -> fw ]. file );
19911950 file [PAGE_SIZE - 1 ] = '\0' ;
19921951
19931952 ret = request_firmware (& firmware , file , dsp -> dev );
@@ -2242,23 +2201,9 @@ static void wm_adsp_ctl_fixup_base(struct wm_adsp *dsp,
22422201 const struct wm_adsp_alg_region * alg_region )
22432202{
22442203 struct wm_coeff_ctl * ctl ;
2245- const char * fw_txt ;
2246-
2247- switch (dsp -> type ) {
2248- case WMFW_VPU :
2249- fw_txt = wm_vpu_fw_text [dsp -> fw ];
2250- break ;
2251- case WMFW_ADSP1 :
2252- case WMFW_ADSP2 :
2253- case WMFW_HALO :
2254- fw_txt = wm_adsp_fw_text [dsp -> fw ];
2255- break ;
2256- default :
2257- return ;
2258- }
22592204
22602205 list_for_each_entry (ctl , & dsp -> ctl_list , list ) {
2261- if (ctl -> fw_name == fw_txt &&
2206+ if (ctl -> fw_name == wm_adsp_fw_text [ dsp -> fw ] &&
22622207 alg_region -> alg == ctl -> alg_region .alg &&
22632208 alg_region -> type == ctl -> alg_region .type ) {
22642209 ctl -> alg_region .base = alg_region -> base ;
@@ -2827,7 +2772,6 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
28272772 const struct wm_adsp_region * mem ;
28282773 struct wm_adsp_alg_region * alg_region ;
28292774 const char * region_name ;
2830- const char * fw_txt ;
28312775 int ret , pos , blocks , type , offset , reg ;
28322776 char * file ;
28332777 struct wm_adsp_buf * buf ;
@@ -2836,17 +2780,8 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
28362780 if (file == NULL )
28372781 return - ENOMEM ;
28382782
2839- switch (dsp -> type ) {
2840- case WMFW_VPU :
2841- fw_txt = wm_vpu_fw [dsp -> fw ].file ;
2842- break ;
2843- default :
2844- fw_txt = wm_adsp_fw [dsp -> fw ].file ;
2845- break ;
2846- }
2847-
28482783 snprintf (file , PAGE_SIZE , "%s-%s-%s.bin" , dsp -> part , dsp -> fwf_name ,
2849- fw_txt );
2784+ wm_adsp_fw [ dsp -> fw ]. file );
28502785 file [PAGE_SIZE - 1 ] = '\0' ;
28512786
28522787 ret = request_firmware (& firmware , file , dsp -> dev );
0 commit comments