Lines Matching refs:tas_priv
63 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
67 return tasdevice_digital_getvol(tas_priv, ucontrol, mc);
74 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
78 return tasdevice_digital_putvol(tas_priv, ucontrol, mc);
85 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
89 return tasdevice_amp_getvol(tas_priv, ucontrol, mc);
96 struct tasdevice_priv *tas_priv =
101 return tasdevice_amp_putvol(tas_priv, ucontrol, mc);
109 struct tasdevice_priv *tas_priv =
112 ucontrol->value.integer.value[0] = (int)tas_priv->force_fwload_status;
113 dev_dbg(tas_priv->dev, "%s : Force FWload %s\n", __func__,
114 tas_priv->force_fwload_status ? "ON" : "OFF");
124 struct tasdevice_priv *tas_priv =
128 if (tas_priv->force_fwload_status == val)
132 tas_priv->force_fwload_status = val;
134 dev_dbg(tas_priv->dev, "%s : Force FWload %s\n", __func__,
135 tas_priv->force_fwload_status ? "ON" : "OFF");
155 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
158 if (tas_priv->rcabin.profile_cfg_id !=
160 tas_priv->rcabin.profile_cfg_id =
172 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
173 struct tasdevice_fw *tas_fw = tas_priv->fmw;
188 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
189 struct tasdevice_fw *tas_fw = tas_priv->fmw;
203 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
208 uinfo->value.integer.max = tas_priv->rcabin.ncfgs - 1;
217 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
219 ucontrol->value.integer.value[0] = tas_priv->rcabin.profile_cfg_id;
224 static int tasdevice_create_control(struct tasdevice_priv *tas_priv)
232 prof_ctrls = devm_kcalloc(tas_priv->dev, nr_controls,
240 name = devm_kzalloc(tas_priv->dev, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
254 ret = snd_soc_add_component_controls(tas_priv->codec,
265 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
267 ucontrol->value.integer.value[0] = tas_priv->cur_prog;
276 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
280 if (tas_priv->cur_prog != nr_program) {
281 tas_priv->cur_prog = nr_program;
293 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
295 ucontrol->value.integer.value[0] = tas_priv->cur_conf;
305 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
309 if (tas_priv->cur_conf != nr_configuration) {
310 tas_priv->cur_conf = nr_configuration;
318 struct tasdevice_priv *tas_priv)
329 dsp_ctrls = devm_kcalloc(tas_priv->dev, nr_controls,
337 prog_name = devm_kzalloc(tas_priv->dev,
339 conf_name = devm_kzalloc(tas_priv->dev, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
364 ret = snd_soc_add_component_controls(tas_priv->codec, dsp_ctrls,
374 struct tasdevice_priv *tas_priv = context;
378 mutex_lock(&tas_priv->codec_lock);
380 ret = tasdevice_rca_parser(tas_priv, fmw);
383 tasdevice_create_control(tas_priv);
385 tasdevice_dsp_remove(tas_priv);
386 tasdevice_calbin_remove(tas_priv);
387 tas_priv->fw_state = TASDEVICE_DSP_FW_PENDING;
388 scnprintf(tas_priv->coef_binaryname, 64, "%s_coef.bin",
389 tas_priv->dev_name);
390 ret = tasdevice_dsp_parser(tas_priv);
392 dev_err(tas_priv->dev, "dspfw load %s error\n",
393 tas_priv->coef_binaryname);
394 tas_priv->fw_state = TASDEVICE_DSP_FW_FAIL;
397 tasdevice_dsp_create_ctrls(tas_priv);
399 tas_priv->fw_state = TASDEVICE_DSP_FW_ALL_OK;
404 for (i = 0; i < tas_priv->ndev; i++) {
405 scnprintf(tas_priv->cal_binaryname[i], 64, "%s_cal_0x%02x.bin",
406 tas_priv->dev_name, tas_priv->tasdevice[i].dev_addr);
407 ret = tas2781_load_calibration(tas_priv,
408 tas_priv->cal_binaryname[i], i);
410 dev_err(tas_priv->dev,
412 __func__, tas_priv->cal_binaryname[i]);
415 tasdevice_prmg_calibdata_load(tas_priv, 0);
416 tas_priv->cur_prog = 0;
418 if (tas_priv->fw_state == TASDEVICE_DSP_FW_FAIL) {
420 tasdevice_config_info_remove(tas_priv);
421 tasdevice_dsp_remove(tas_priv);
423 mutex_unlock(&tas_priv->codec_lock);
432 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
436 mutex_lock(&tas_priv->codec_lock);
439 tasdevice_tuning_switch(tas_priv, state);
441 mutex_unlock(&tas_priv->codec_lock);
466 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
469 if (tas_priv->fw_state != TASDEVICE_DSP_FW_ALL_OK) {
470 dev_err(tas_priv->dev, "DSP bin file not loaded\n");
480 struct tasdevice_priv *tas_priv = snd_soc_dai_get_drvdata(dai);
492 dev_err(tas_priv->dev, "%s: incorrect sample rate = %u\n",
506 dev_err(tas_priv->dev, "%s: incorrect slot width = %u\n",
514 dev_err(tas_priv->dev, "%s: incorrect bclk rate = %d\n",
527 struct tasdevice_priv *tas_priv = snd_soc_dai_get_drvdata(codec_dai);
529 tas_priv->sysclk = freq;
565 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
567 return tascodec_init(tas_priv, codec, THIS_MODULE, tasdevice_fw_ready);
572 struct tasdevice_priv *tas_priv = (struct tasdevice_priv *) context;
574 tasdevice_config_info_remove(tas_priv);
575 tasdevice_dsp_remove(tas_priv);
576 tasdevice_calbin_remove(tas_priv);
577 tas_priv->fw_state = TASDEVICE_DSP_FW_PENDING;
583 struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(codec);
585 tasdevice_deinit(tas_priv);
602 static void tasdevice_parse_dt(struct tasdevice_priv *tas_priv)
604 struct i2c_client *client = (struct i2c_client *)tas_priv->client;
608 if (tas_priv->isacpi) {
621 tas_priv->irq_info.irq_gpio =
624 struct device_node *np = tas_priv->dev->of_node;
649 tas_priv->irq_info.irq_gpio = of_irq_get(np, 0);
651 tas_priv->ndev = ndev;
653 tas_priv->tasdevice[i].dev_addr = dev_addrs[i];
655 tas_priv->reset = devm_gpiod_get_optional(&client->dev,
657 if (IS_ERR(tas_priv->reset))
658 dev_err(tas_priv->dev, "%s Can't get reset GPIO\n",
661 strcpy(tas_priv->dev_name, tasdevice_id[tas_priv->chip_id].name);
663 if (gpio_is_valid(tas_priv->irq_info.irq_gpio)) {
664 rc = gpio_request(tas_priv->irq_info.irq_gpio,
668 tas_priv->irq_info.irq_gpio);
670 tas_priv->irq_info.irq =
671 gpio_to_irq(tas_priv->irq_info.irq_gpio);
673 dev_err(tas_priv->dev, "%s: GPIO %d request error\n",
674 __func__, tas_priv->irq_info.irq_gpio);
676 dev_err(tas_priv->dev,
678 tas_priv->irq_info.irq_gpio);
685 struct tasdevice_priv *tas_priv;
688 tas_priv = tasdevice_kzalloc(i2c);
689 if (!tas_priv)
692 dev_set_drvdata(&i2c->dev, tas_priv);
702 tas_priv->chip_id = acpi_id->driver_data;
703 tas_priv->isacpi = true;
705 tas_priv->chip_id = id ? id->driver_data : 0;
706 tas_priv->isacpi = false;
709 tasdevice_parse_dt(tas_priv);
711 ret = tasdevice_init(tas_priv);
715 ret = devm_snd_soc_register_component(tas_priv->dev,
719 dev_err(tas_priv->dev, "%s: codec register error:0x%08x\n",
725 tasdevice_remove(tas_priv);
731 struct tasdevice_priv *tas_priv = i2c_get_clientdata(client);
733 tasdevice_remove(tas_priv);