Lines Matching refs:component
310 struct snd_soc_component *component = in coeff_ram_get() local
312 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in coeff_ram_get()
343 static int write_coeff_ram(struct snd_soc_component *component, u8 *coeff_ram, in write_coeff_ram() argument
347 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in write_coeff_ram()
356 val = snd_soc_component_read(component, r_stat); in write_coeff_ram()
363 dev_err(component->dev, in write_coeff_ram()
370 dev_err(component->dev, in write_coeff_ram()
379 dev_err(component->dev, in write_coeff_ram()
391 struct snd_soc_component *component = in coeff_ram_put() local
393 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in coeff_ram_put()
442 val = snd_soc_component_read(component, R_PLLSTAT); in coeff_ram_put()
444 ret = write_coeff_ram(component, coeff_ram, in coeff_ram_put()
448 dev_err(component->dev, in coeff_ram_put()
464 static inline int coeff_ram_sync(struct snd_soc_component *component, in coeff_ram_sync() argument
471 ret = write_coeff_ram(component, tscs454->dac_ram.cache, in coeff_ram_sync()
483 ret = write_coeff_ram(component, tscs454->spk_ram.cache, in coeff_ram_sync()
495 ret = write_coeff_ram(component, tscs454->sub_ram.cache, in coeff_ram_sync()
625 static int set_sysclk(struct snd_soc_component *component) in set_sysclk() argument
627 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in set_sysclk()
640 dev_err(component->dev, in set_sysclk()
646 ret = snd_soc_component_write(component, in set_sysclk()
650 dev_err(component->dev, in set_sysclk()
677 struct snd_soc_component *component = in pll_connected() local
679 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in pll_connected()
686 dev_dbg(component->dev, "%s(): PLL 1 users = %d\n", __func__, in pll_connected()
692 dev_dbg(component->dev, "%s(): PLL 2 users = %d\n", __func__, in pll_connected()
706 struct snd_soc_component *component = in pll_power_event() local
708 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in pll_power_event()
737 ret = snd_soc_component_update_bits(component, R_PLLCTL, msk, val); in pll_power_event()
739 dev_err(component->dev, "Failed to %s PLL %d (%d)\n", in pll_power_event()
748 ret = coeff_ram_sync(component, tscs454); in pll_power_event()
750 dev_err(component->dev, in pll_power_event()
759 static inline int aif_set_provider(struct snd_soc_component *component, in aif_set_provider() argument
779 dev_err(component->dev, "Unknown DAI %d (%d)\n", aif_id, ret); in aif_set_provider()
785 ret = snd_soc_component_update_bits(component, reg, mask, val); in aif_set_provider()
787 dev_err(component->dev, "Failed to set DAI %d to %s (%d)\n", in aif_set_provider()
796 int aif_prepare(struct snd_soc_component *component, struct aif *aif) in aif_prepare() argument
800 ret = aif_set_provider(component, aif->id, aif->provider); in aif_prepare()
807 static inline int aif_free(struct snd_soc_component *component, in aif_free() argument
810 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in aif_free()
814 dev_dbg(component->dev, "%s(): aif %d\n", __func__, aif->id); in aif_free()
818 dev_dbg(component->dev, "Set aif %d inactive. Streams status is 0x%x\n", in aif_free()
823 aif_set_provider(component, aif->id, false); in aif_free()
824 dev_dbg(component->dev, "Freeing pll %d from aif %d\n", in aif_free()
830 dev_dbg(component->dev, "Freeing pll %d from ir\n", in aif_free()
2636 struct snd_soc_component *component = dai->component; in tscs454_set_sysclk() local
2637 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in tscs454_set_sysclk()
2641 dev_dbg(component->dev, "%s(): freq = %u\n", __func__, freq); in tscs454_set_sysclk()
2643 val = snd_soc_component_read(component, R_PLLCTL); in tscs454_set_sysclk()
2650 return set_sysclk(component); in tscs454_set_sysclk()
2658 struct snd_soc_component *component = dai->component; in tscs454_set_bclk_ratio() local
2662 dev_dbg(component->dev, "set_bclk_ratio() id = %d ratio = %u\n", in tscs454_set_bclk_ratio()
2680 dev_err(component->dev, "Unknown audio interface (%d)\n", ret); in tscs454_set_bclk_ratio()
2696 dev_err(component->dev, "Unsupported bclk ratio (%d)\n", ret); in tscs454_set_bclk_ratio()
2700 ret = snd_soc_component_update_bits(component, in tscs454_set_bclk_ratio()
2703 dev_err(component->dev, in tscs454_set_bclk_ratio()
2711 static inline int set_aif_provider_from_fmt(struct snd_soc_component *component, in set_aif_provider_from_fmt() argument
2725 dev_err(component->dev, "Unsupported format (%d)\n", ret); in set_aif_provider_from_fmt()
2732 static inline int set_aif_tdm_delay(struct snd_soc_component *component, in set_aif_tdm_delay() argument
2750 dev_err(component->dev, in set_aif_tdm_delay()
2754 ret = snd_soc_component_update_bits(component, in set_aif_tdm_delay()
2757 dev_err(component->dev, "Failed to setup tdm format (%d)\n", in set_aif_tdm_delay()
2765 static inline int set_aif_format_from_fmt(struct snd_soc_component *component, in set_aif_format_from_fmt() argument
2784 dev_err(component->dev, in set_aif_format_from_fmt()
2800 ret = set_aif_tdm_delay(component, dai_id, true); in set_aif_format_from_fmt()
2806 ret = set_aif_tdm_delay(component, dai_id, false); in set_aif_format_from_fmt()
2813 dev_err(component->dev, "Format unsupported (%d)\n", ret); in set_aif_format_from_fmt()
2817 ret = snd_soc_component_update_bits(component, in set_aif_format_from_fmt()
2820 dev_err(component->dev, "Failed to set DAI %d format (%d)\n", in set_aif_format_from_fmt()
2829 set_aif_clock_format_from_fmt(struct snd_soc_component *component, in set_aif_clock_format_from_fmt() argument
2848 dev_err(component->dev, in set_aif_clock_format_from_fmt()
2868 dev_err(component->dev, "Format unknown (%d)\n", ret); in set_aif_clock_format_from_fmt()
2872 ret = snd_soc_component_update_bits(component, reg, in set_aif_clock_format_from_fmt()
2875 dev_err(component->dev, in set_aif_clock_format_from_fmt()
2886 struct snd_soc_component *component = dai->component; in tscs454_set_dai_fmt() local
2887 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in tscs454_set_dai_fmt()
2891 ret = set_aif_provider_from_fmt(component, aif, fmt); in tscs454_set_dai_fmt()
2895 ret = set_aif_format_from_fmt(component, dai->id, fmt); in tscs454_set_dai_fmt()
2899 ret = set_aif_clock_format_from_fmt(component, dai->id, fmt); in tscs454_set_dai_fmt()
2910 struct snd_soc_component *component = dai->component; in tscs454_dai1_set_tdm_slot() local
2919 dev_err(component->dev, "Invalid TDM slot mask (%d)\n", ret); in tscs454_dai1_set_tdm_slot()
2935 dev_err(component->dev, "Invalid number of slots (%d)\n", ret); in tscs454_dai1_set_tdm_slot()
2951 dev_err(component->dev, "Invalid TDM slot width (%d)\n", ret); in tscs454_dai1_set_tdm_slot()
2954 ret = snd_soc_component_write(component, R_TDMCTL1, val); in tscs454_dai1_set_tdm_slot()
2956 dev_err(component->dev, "Failed to set slots (%d)\n", ret); in tscs454_dai1_set_tdm_slot()
2967 struct snd_soc_component *component = dai->component; in tscs454_dai23_set_tdm_slot() local
2977 dev_err(component->dev, "Invalid TDM slot mask (%d)\n", ret); in tscs454_dai23_set_tdm_slot()
2990 dev_err(component->dev, "Unrecognized interface %d (%d)\n", in tscs454_dai23_set_tdm_slot()
3004 dev_err(component->dev, "Invalid number of slots (%d)\n", ret); in tscs454_dai23_set_tdm_slot()
3020 dev_err(component->dev, "Invalid TDM slot width (%d)\n", ret); in tscs454_dai23_set_tdm_slot()
3023 ret = snd_soc_component_write(component, reg, val); in tscs454_dai23_set_tdm_slot()
3025 dev_err(component->dev, "Failed to set slots (%d)\n", ret); in tscs454_dai23_set_tdm_slot()
3032 static int set_aif_fs(struct snd_soc_component *component, in set_aif_fs() argument
3084 dev_err(component->dev, "Unsupported sample rate (%d)\n", ret); in set_aif_fs()
3100 dev_err(component->dev, "DAI ID not recognized (%d)\n", ret); in set_aif_fs()
3104 ret = snd_soc_component_update_bits(component, reg, in set_aif_fs()
3107 dev_err(component->dev, in set_aif_fs()
3115 static int set_aif_sample_format(struct snd_soc_component *component, in set_aif_sample_format() argument
3138 dev_err(component->dev, "Unsupported format width (%d)\n", ret); in set_aif_sample_format()
3154 dev_err(component->dev, "AIF ID not recognized (%d)\n", ret); in set_aif_sample_format()
3158 ret = snd_soc_component_update_bits(component, in set_aif_sample_format()
3161 dev_err(component->dev, in set_aif_sample_format()
3173 struct snd_soc_component *component = dai->component; in tscs454_hw_params() local
3174 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in tscs454_hw_params()
3182 dev_dbg(component->dev, "%s(): aif %d fs = %u\n", __func__, in tscs454_hw_params()
3191 dev_dbg(component->dev, "Reserving pll %d for aif %d\n", in tscs454_hw_params()
3198 val = snd_soc_component_read(component, R_ISRC); in tscs454_hw_params()
3204 dev_dbg(component->dev, "Reserving pll %d for ir\n", in tscs454_hw_params()
3210 ret = set_aif_fs(component, aif->id, fs); in tscs454_hw_params()
3212 dev_err(component->dev, "Failed to set aif fs (%d)\n", ret); in tscs454_hw_params()
3216 ret = set_aif_sample_format(component, params_format(params), aif->id); in tscs454_hw_params()
3218 dev_err(component->dev, in tscs454_hw_params()
3226 dev_dbg(component->dev, "Set aif %d active. Streams status is 0x%x\n", in tscs454_hw_params()
3239 struct snd_soc_component *component = dai->component; in tscs454_hw_free() local
3240 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in tscs454_hw_free()
3243 return aif_free(component, aif, in tscs454_hw_free()
3251 struct snd_soc_component *component = dai->component; in tscs454_prepare() local
3252 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in tscs454_prepare()
3255 ret = aif_prepare(component, aif); in tscs454_prepare()
3282 static int tscs454_probe(struct snd_soc_component *component) in tscs454_probe() argument
3284 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in tscs454_probe()
3303 dev_err(component->dev, "Invalid sysclk src id (%d)\n", ret); in tscs454_probe()
3307 ret = snd_soc_component_update_bits(component, R_PLLCTL, in tscs454_probe()
3310 dev_err(component->dev, "Failed to set PLL input (%d)\n", ret); in tscs454_probe()
3315 ret = set_sysclk(component); in tscs454_probe()