@@ -338,39 +338,6 @@ static int rt5514_dsp_voice_wake_up_put(struct snd_kcontrol *kcontrol,
338338 fw = NULL;
339339 }
340340
341- if (rt5514 -> model_buf && rt5514 -> model_len ) {
342- #if IS_ENABLED (CONFIG_SND_SOC_RT5514_SPI )
343- int ret ;
344-
345- ret = rt5514_spi_burst_write (0x4ff80000 ,
346- rt5514 - > model_buf ,
347- ((rt5514 - > model_len / 8 ) + 1 ) * 8 );
348- if (ret ) {
349- dev_err (codec - > dev ,
350- "Model load failed %d \n ", ret );
351- return ret ;
352- }
353- #else
354- dev_err (codec - > dev ,
355- "No SPI driver for loading firmware \n ");
356- #endif
357- } else {
358- request_firmware (& fw , RT5514_FIRMWARE3 ,
359- codec - > dev );
360- if (fw ) {
361- #if IS_ENABLED (CONFIG_SND_SOC_RT5514_SPI )
362- rt5514_spi_burst_write (0x4ff80000 ,
363- fw - > data ,
364- ((fw - > size /8 )+ 1 )* 8 );
365- #else
366- dev_err (codec - > dev ,
367- "No SPI driver to load fw \n ");
368- #endif
369- release_firmware (fw );
370- fw = NULL;
371- }
372- }
373-
374341 /* DSP run */
375342 regmap_write (rt5514 - > i2c_regmap , 0x18002f00 ,
376343 0x00055148 );
@@ -385,34 +352,6 @@ static int rt5514_dsp_voice_wake_up_put(struct snd_kcontrol *kcontrol,
385352 return 0 ;
386353}
387354
388- static int rt5514_hotword_model_put (struct snd_kcontrol * kcontrol ,
389- const unsigned int __user * bytes , unsigned int size )
390- {
391- struct snd_soc_component * component = snd_kcontrol_chip (kcontrol );
392- struct rt5514_priv * rt5514 = snd_soc_component_get_drvdata (component );
393- struct snd_soc_codec * codec = rt5514 -> codec ;
394- int ret = 0 ;
395-
396- if (rt5514 -> model_buf || rt5514 -> model_len < size ) {
397- if (rt5514 -> model_buf )
398- devm_kfree (codec -> dev , rt5514 -> model_buf );
399- rt5514 -> model_buf = devm_kmalloc (codec -> dev , size , GFP_KERNEL );
400- if (!rt5514 -> model_buf ) {
401- ret = - ENOMEM ;
402- goto done ;
403- }
404- }
405-
406- /* Skips the TLV header. */
407- bytes += 2 ;
408-
409- if (copy_from_user (rt5514 -> model_buf , bytes , size ))
410- ret = - EFAULT ;
411- done :
412- rt5514 -> model_len = (ret ? 0 : size );
413- return ret ;
414- }
415-
416355static const struct snd_kcontrol_new rt5514_snd_controls [] = {
417356 SOC_DOUBLE_TLV ("MIC Boost Volume ", RT5514_ANA_CTRL_MICBST ,
418357 RT5514_SEL_BSTL_SFT , RT5514_SEL_BSTR_SFT , 8 , 0 , bst_tlv ),
@@ -424,8 +363,6 @@ static const struct snd_kcontrol_new rt5514_snd_controls[] = {
424363 adc_vol_tlv ),
425364 SOC_SINGLE_EXT ("DSP Voice Wake Up ", SND_SOC_NOPM, 0, 1, 0,
426365 rt5514_dsp_voice_wake_up_get , rt5514_dsp_voice_wake_up_put ),
427- SND_SOC_BYTES_TLV ("Hotword Model" , 0x8504 ,
428- NULL , rt5514_hotword_model_put ),
429366};
430367
431368/* ADC Mixer*/
0 commit comments