Lines Matching refs:component
55 struct snd_soc_component *component; member
118 static int wm5100_alloc_sr(struct snd_soc_component *component, int rate) in wm5100_alloc_sr() argument
120 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); in wm5100_alloc_sr()
127 dev_err(component->dev, "Unsupported sample rate: %dHz\n", rate); in wm5100_alloc_sr()
140 if ((snd_soc_component_read(component, wm5100_sr_regs[i]) & in wm5100_alloc_sr()
147 dev_dbg(component->dev, "SR %dHz, slot %d, ref %d\n", in wm5100_alloc_sr()
153 dev_err(component->dev, "All SR slots already in use\n"); in wm5100_alloc_sr()
157 dev_dbg(component->dev, "Allocating SR slot %d for %dHz\n", in wm5100_alloc_sr()
160 snd_soc_component_update_bits(component, wm5100_sr_regs[sr_free], in wm5100_alloc_sr()
167 dev_err(component->dev, in wm5100_alloc_sr()
174 static void wm5100_free_sr(struct snd_soc_component *component, int rate) in wm5100_free_sr() argument
176 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); in wm5100_free_sr()
183 dev_err(component->dev, "Unsupported sample rate: %dHz\n", rate); in wm5100_free_sr()
192 if ((snd_soc_component_read(component, wm5100_sr_regs[i]) & in wm5100_free_sr()
198 dev_dbg(component->dev, "Dereference SR %dHz, count now %d\n", in wm5100_free_sr()
201 dev_warn(component->dev, "Freeing unreferenced sample rate %dHz\n", in wm5100_free_sr()
733 static void wm5100_seq_notifier(struct snd_soc_component *component, in wm5100_seq_notifier() argument
736 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); in wm5100_seq_notifier()
741 expect = snd_soc_component_read(component, WM5100_CHANNEL_ENABLES_1); in wm5100_seq_notifier()
743 val = snd_soc_component_read(component, WM5100_OUTPUT_STATUS_1); in wm5100_seq_notifier()
750 dev_err(component->dev, "Timeout waiting for OUTPUT1 %x\n", in wm5100_seq_notifier()
756 expect = snd_soc_component_read(component, WM5100_OUTPUT_ENABLES_2); in wm5100_seq_notifier()
758 val = snd_soc_component_read(component, WM5100_OUTPUT_STATUS_2); in wm5100_seq_notifier()
765 dev_err(component->dev, "Timeout waiting for OUTPUT2 %x\n", in wm5100_seq_notifier()
775 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm5100_out_ev() local
776 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); in wm5100_out_ev()
840 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm5100_post_ev() local
841 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); in wm5100_post_ev()
844 ret = snd_soc_component_read(component, WM5100_INTERRUPT_RAW_STATUS_3); in wm5100_post_ev()
850 ret = snd_soc_component_read(component, WM5100_INTERRUPT_RAW_STATUS_4); in wm5100_post_ev()
1281 struct snd_soc_component *component = dai->component; in wm5100_set_fmt() local
1297 dev_err(component->dev, "Unsupported DAI format %d\n", in wm5100_set_fmt()
1316 dev_err(component->dev, "Unsupported master mode %d\n", in wm5100_set_fmt()
1338 snd_soc_component_update_bits(component, base + 1, WM5100_AIF1_BCLK_MSTR | in wm5100_set_fmt()
1340 snd_soc_component_update_bits(component, base + 2, WM5100_AIF1TX_LRCLK_MSTR | in wm5100_set_fmt()
1342 snd_soc_component_update_bits(component, base + 3, WM5100_AIF1TX_LRCLK_MSTR | in wm5100_set_fmt()
1344 snd_soc_component_update_bits(component, base + 5, WM5100_AIF1_FMT_MASK, mask); in wm5100_set_fmt()
1399 struct snd_soc_component *component = dai->component; in wm5100_hw_params() local
1400 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); in wm5100_hw_params()
1415 dev_dbg(component->dev, "Word length %d bits, frame length %d bits\n", in wm5100_hw_params()
1426 sr = wm5100_alloc_sr(component, params_rate(params)); in wm5100_hw_params()
1438 dev_err(component->dev, "Invalid rate %dHzn", in wm5100_hw_params()
1444 snd_soc_component_update_bits(component, WM5100_CLOCKING_8, in wm5100_hw_params()
1449 dev_err(component->dev, "%s has no rate set\n", in wm5100_hw_params()
1454 dev_dbg(component->dev, "Target BCLK is %dHz, using %dHz %s\n", in wm5100_hw_params()
1466 dev_err(component->dev, in wm5100_hw_params()
1473 dev_dbg(component->dev, "Setting %dHz BCLK\n", bclk_rates[bclk]); in wm5100_hw_params()
1474 snd_soc_component_update_bits(component, base + 1, WM5100_AIF1_BCLK_FREQ_MASK, bclk); in wm5100_hw_params()
1477 dev_dbg(component->dev, "Setting %dHz LRCLK\n", bclk_rates[bclk] / lrclk); in wm5100_hw_params()
1480 snd_soc_component_update_bits(component, base + 7, in wm5100_hw_params()
1483 snd_soc_component_update_bits(component, base + 6, in wm5100_hw_params()
1488 snd_soc_component_update_bits(component, base + 9, in wm5100_hw_params()
1492 snd_soc_component_update_bits(component, base + 8, in wm5100_hw_params()
1496 snd_soc_component_update_bits(component, base + 4, WM5100_AIF1_RATE_MASK, sr); in wm5100_hw_params()
1506 static int wm5100_set_sysclk(struct snd_soc_component *component, int clk_id, in wm5100_set_sysclk() argument
1509 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); in wm5100_set_sysclk()
1528 snd_soc_component_update_bits(component, WM5100_CLOCKING_1, in wm5100_set_sysclk()
1549 dev_err(component->dev, "Invalid source %d\n", source); in wm5100_set_sysclk()
1558 snd_soc_component_update_bits(component, WM5100_MISC_GPIO_1, in wm5100_set_sysclk()
1563 snd_soc_component_update_bits(component, WM5100_MISC_GPIO_1, in wm5100_set_sysclk()
1568 snd_soc_component_update_bits(component, WM5100_MISC_GPIO_1, in wm5100_set_sysclk()
1572 dev_err(component->dev, "Unsupported OPCLK %dHz\n", in wm5100_set_sysclk()
1579 dev_err(component->dev, "Unknown clock %d\n", clk_id); in wm5100_set_sysclk()
1586 dev_err(component->dev, "Invalid source %d\n", source); in wm5100_set_sysclk()
1604 dev_err(component->dev, "Invalid clock rate: %d\n", freq); in wm5100_set_sysclk()
1631 snd_soc_component_update_bits(component, reg, WM5100_SYSCLK_FREQ_MASK | in wm5100_set_sysclk()
1640 dev_dbg(component->dev, "Setting primary audio rate to %dHz", in wm5100_set_sysclk()
1643 wm5100_free_sr(component, audio_rate); in wm5100_set_sysclk()
1644 ret = wm5100_alloc_sr(component, audio_rate); in wm5100_set_sysclk()
1646 dev_warn(component->dev, "Primary audio slot is %d\n", in wm5100_set_sysclk()
1754 static int wm5100_set_fll(struct snd_soc_component *component, int fll_id, int source, in wm5100_set_fll() argument
1757 struct i2c_client *i2c = to_i2c_client(component->dev); in wm5100_set_fll()
1758 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); in wm5100_set_fll()
1776 dev_err(component->dev, "Unknown FLL %d\n",fll_id); in wm5100_set_fll()
1781 dev_dbg(component->dev, "FLL%d disabled", fll_id); in wm5100_set_fll()
1783 pm_runtime_put(component->dev); in wm5100_set_fll()
1785 snd_soc_component_update_bits(component, base + 1, WM5100_FLL1_ENA, 0); in wm5100_set_fll()
1799 dev_err(component->dev, "Invalid FLL source %d\n", source); in wm5100_set_fll()
1808 snd_soc_component_update_bits(component, base + 1, WM5100_FLL1_ENA, 0); in wm5100_set_fll()
1810 snd_soc_component_update_bits(component, base + 2, in wm5100_set_fll()
1814 snd_soc_component_update_bits(component, base + 3, WM5100_FLL1_THETA_MASK, in wm5100_set_fll()
1816 snd_soc_component_update_bits(component, base + 5, WM5100_FLL1_N_MASK, factors.n); in wm5100_set_fll()
1817 snd_soc_component_update_bits(component, base + 6, in wm5100_set_fll()
1822 snd_soc_component_update_bits(component, base + 7, WM5100_FLL1_LAMBDA_MASK, in wm5100_set_fll()
1828 pm_runtime_get_sync(component->dev); in wm5100_set_fll()
1830 snd_soc_component_update_bits(component, base + 1, WM5100_FLL1_ENA, WM5100_FLL1_ENA); in wm5100_set_fll()
1837 snd_soc_component_update_bits(component, WM5100_CLOCKING_3, WM5100_SYSCLK_ENA, in wm5100_set_fll()
1851 ret = snd_soc_component_read(component, in wm5100_set_fll()
1854 dev_err(component->dev, in wm5100_set_fll()
1863 dev_err(component->dev, "FLL%d lock timed out\n", fll_id); in wm5100_set_fll()
1864 pm_runtime_put(component->dev); in wm5100_set_fll()
1872 dev_dbg(component->dev, "FLL%d running %dHz->%dHz\n", fll_id, in wm5100_set_fll()
2098 int wm5100_detect(struct snd_soc_component *component, struct snd_soc_jack *jack) in wm5100_detect() argument
2100 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); in wm5100_detect()
2101 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm5100_detect()
2112 snd_soc_component_update_bits(component, WM5100_MIC_DETECT_1, in wm5100_detect()
2131 snd_soc_component_update_bits(component, WM5100_MIC_DETECT_1, in wm5100_detect()
2134 snd_soc_component_update_bits(component, WM5100_INTERRUPT_STATUS_3_MASK, in wm5100_detect()
2137 snd_soc_component_update_bits(component, WM5100_INTERRUPT_STATUS_3_MASK, in wm5100_detect()
2142 snd_soc_component_update_bits(component, WM5100_MIC_DETECT_1, in wm5100_detect()
2329 static int wm5100_probe(struct snd_soc_component *component) in wm5100_probe() argument
2331 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm5100_probe()
2332 struct i2c_client *i2c = to_i2c_client(component->dev); in wm5100_probe()
2333 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); in wm5100_probe()
2336 wm5100->component = component; in wm5100_probe()
2339 snd_soc_component_update_bits(component, wm5100_dig_vu[i], WM5100_OUT_VU, in wm5100_probe()
2343 snd_soc_component_write(component, WM5100_IRQ_DEBOUNCE_1, 0); in wm5100_probe()
2344 snd_soc_component_write(component, WM5100_IRQ_DEBOUNCE_2, 0); in wm5100_probe()
2369 static void wm5100_remove(struct snd_soc_component *component) in wm5100_remove() argument
2371 struct wm5100_priv *wm5100 = snd_soc_component_get_drvdata(component); in wm5100_remove()