diff options
| -rw-r--r-- | sound/soc/codecs/rt5514.c | 63 | ||||
| -rw-r--r-- | sound/soc/codecs/rt5514.h | 3 |
2 files changed, 0 insertions, 66 deletions
diff --git a/sound/soc/codecs/rt5514.c b/sound/soc/codecs/rt5514.c index 0945d212b8dc..d7956ababd11 100644 --- a/sound/soc/codecs/rt5514.c +++ b/sound/soc/codecs/rt5514.c | |||
| @@ -338,39 +338,6 @@ static int rt5514_dsp_voice_wake_up_put(struct snd_kcontrol *kcontrol, | |||
| 338 | fw = NULL; | 338 | fw = NULL; |
| 339 | } | 339 | } |
| 340 | 340 | ||
| 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 | |||
| 374 | /* DSP run */ | 341 | /* DSP run */ |
| 375 | regmap_write(rt5514->i2c_regmap, 0x18002f00, | 342 | regmap_write(rt5514->i2c_regmap, 0x18002f00, |
| 376 | 0x00055148); | 343 | 0x00055148); |
| @@ -385,34 +352,6 @@ static int rt5514_dsp_voice_wake_up_put(struct snd_kcontrol *kcontrol, | |||
| 385 | return 0; | 352 | return 0; |
| 386 | } | 353 | } |
| 387 | 354 | ||
| 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 | |||
| 416 | static const struct snd_kcontrol_new rt5514_snd_controls[] = { | 355 | static const struct snd_kcontrol_new rt5514_snd_controls[] = { |
| 417 | SOC_DOUBLE_TLV("MIC Boost Volume", RT5514_ANA_CTRL_MICBST, | 356 | SOC_DOUBLE_TLV("MIC Boost Volume", RT5514_ANA_CTRL_MICBST, |
| 418 | RT5514_SEL_BSTL_SFT, RT5514_SEL_BSTR_SFT, 8, 0, bst_tlv), | 357 | 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[] = { | |||
| 424 | adc_vol_tlv), | 363 | adc_vol_tlv), |
| 425 | SOC_SINGLE_EXT("DSP Voice Wake Up", SND_SOC_NOPM, 0, 1, 0, | 364 | SOC_SINGLE_EXT("DSP Voice Wake Up", SND_SOC_NOPM, 0, 1, 0, |
| 426 | rt5514_dsp_voice_wake_up_get, rt5514_dsp_voice_wake_up_put), | 365 | 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), | ||
| 429 | }; | 366 | }; |
| 430 | 367 | ||
| 431 | /* ADC Mixer*/ | 368 | /* ADC Mixer*/ |
diff --git a/sound/soc/codecs/rt5514.h b/sound/soc/codecs/rt5514.h index 803311cb7e2a..2dc40e6d8b3f 100644 --- a/sound/soc/codecs/rt5514.h +++ b/sound/soc/codecs/rt5514.h | |||
| @@ -255,7 +255,6 @@ | |||
| 255 | 255 | ||
| 256 | #define RT5514_FIRMWARE1 "rt5514_dsp_fw1.bin" | 256 | #define RT5514_FIRMWARE1 "rt5514_dsp_fw1.bin" |
| 257 | #define RT5514_FIRMWARE2 "rt5514_dsp_fw2.bin" | 257 | #define RT5514_FIRMWARE2 "rt5514_dsp_fw2.bin" |
| 258 | #define RT5514_FIRMWARE3 "rt5514_dsp_fw3.bin" | ||
| 259 | 258 | ||
| 260 | /* System Clock Source */ | 259 | /* System Clock Source */ |
| 261 | enum { | 260 | enum { |
| @@ -282,8 +281,6 @@ struct rt5514_priv { | |||
| 282 | int pll_in; | 281 | int pll_in; |
| 283 | int pll_out; | 282 | int pll_out; |
| 284 | int dsp_enabled; | 283 | int dsp_enabled; |
| 285 | u8 *model_buf; | ||
| 286 | unsigned int model_len; | ||
| 287 | }; | 284 | }; |
| 288 | 285 | ||
| 289 | #endif /* __RT5514_H__ */ | 286 | #endif /* __RT5514_H__ */ |
