Lines Matching full:aio

3 // Socionext UniPhier AIO ALSA CPU DAI driver.
21 #include "aio.h"
37 * @chip: the AIO chip pointer
40 * Find AIO device from device list by HW port number. Volume feature is
44 * Return: The pointer of AIO substream if successful, otherwise NULL on error.
88 * @aio: the AIO device pointer
96 * in each drivers (see: aio-i2s.c).
98 * Return: The pointer of hardware specification of AIO if successful,
101 static const struct uniphier_aio_spec *find_spec(struct uniphier_aio *aio, in find_spec() argument
105 const struct uniphier_aio_chip_spec *chip_spec = aio->chip->chip_spec; in find_spec()
120 * @aio: the AIO device pointer
128 static int find_divider(struct uniphier_aio *aio, int pll_id, unsigned int freq) in find_divider() argument
135 if (!is_valid_pll(aio->chip, pll_id)) in find_divider()
138 pll = &aio->chip->plls[pll_id]; in find_divider()
149 struct uniphier_aio *aio = uniphier_priv(dai); in uniphier_aio_set_sysclk() local
150 struct device *dev = &aio->chip->pdev->dev; in uniphier_aio_set_sysclk()
195 for (pll_id = 0; pll_id < aio->chip->num_plls; pll_id++) { in uniphier_aio_set_sysclk()
196 div_id = find_divider(aio, pll_id, freq); in uniphier_aio_set_sysclk()
198 aio->plldiv = div_id; in uniphier_aio_set_sysclk()
202 if (pll_id == aio->chip->num_plls) { in uniphier_aio_set_sysclk()
210 aio->pll_out = pll_id; in uniphier_aio_set_sysclk()
212 aio->pll_in = pll_id; in uniphier_aio_set_sysclk()
221 struct uniphier_aio *aio = uniphier_priv(dai); in uniphier_aio_set_pll() local
224 if (!is_valid_pll(aio->chip, pll_id)) in uniphier_aio_set_pll()
227 ret = aio_chip_set_pll(aio->chip, pll_id, freq_out); in uniphier_aio_set_pll()
236 struct uniphier_aio *aio = uniphier_priv(dai); in uniphier_aio_set_fmt() local
237 struct device *dev = &aio->chip->pdev->dev; in uniphier_aio_set_fmt()
243 aio->fmt = fmt & SND_SOC_DAIFMT_FORMAT_MASK; in uniphier_aio_set_fmt()
257 struct uniphier_aio *aio = uniphier_priv(dai); in uniphier_aio_startup() local
258 struct uniphier_aio_sub *sub = &aio->sub[substream->stream]; in uniphier_aio_startup()
270 struct uniphier_aio *aio = uniphier_priv(dai); in uniphier_aio_shutdown() local
271 struct uniphier_aio_sub *sub = &aio->sub[substream->stream]; in uniphier_aio_shutdown()
280 struct uniphier_aio *aio = uniphier_priv(dai); in uniphier_aio_hw_params() local
281 struct uniphier_aio_sub *sub = &aio->sub[substream->stream]; in uniphier_aio_hw_params()
282 struct device *dev = &aio->chip->pdev->dev; in uniphier_aio_hw_params()
318 struct uniphier_aio *aio = uniphier_priv(dai); in uniphier_aio_hw_free() local
319 struct uniphier_aio_sub *sub = &aio->sub[substream->stream]; in uniphier_aio_hw_free()
329 struct uniphier_aio *aio = uniphier_priv(dai); in uniphier_aio_prepare() local
330 struct uniphier_aio_sub *sub = &aio->sub[substream->stream]; in uniphier_aio_prepare()
360 struct uniphier_aio *aio = uniphier_priv(dai); in uniphier_aio_dai_probe() local
363 for (i = 0; i < ARRAY_SIZE(aio->sub); i++) { in uniphier_aio_dai_probe()
364 struct uniphier_aio_sub *sub = &aio->sub[i]; in uniphier_aio_dai_probe()
367 spec = find_spec(aio, dai->name, i); in uniphier_aio_dai_probe()
377 aio_iecout_set_enable(aio->chip, true); in uniphier_aio_dai_probe()
378 aio_chip_init(aio->chip); in uniphier_aio_dai_probe()
379 aio->chip->active = 1; in uniphier_aio_dai_probe()
386 struct uniphier_aio *aio = uniphier_priv(dai); in uniphier_aio_dai_remove() local
388 aio->chip->active = 0; in uniphier_aio_dai_remove()
527 struct uniphier_aio *aio = uniphier_priv(dai); in uniphier_aio_dai_suspend() local
532 aio->chip->num_wup_aios--; in uniphier_aio_dai_suspend()
533 if (!aio->chip->num_wup_aios) { in uniphier_aio_dai_suspend()
534 reset_control_assert(aio->chip->rst); in uniphier_aio_dai_suspend()
535 clk_disable_unprepare(aio->chip->clk); in uniphier_aio_dai_suspend()
550 struct uniphier_aio *aio = uniphier_priv(dai); in uniphier_aio_dai_resume() local
556 if (!aio->chip->active) in uniphier_aio_dai_resume()
559 if (!aio->chip->num_wup_aios) { in uniphier_aio_dai_resume()
560 ret = clk_prepare_enable(aio->chip->clk); in uniphier_aio_dai_resume()
564 ret = reset_control_deassert(aio->chip->rst); in uniphier_aio_dai_resume()
569 aio_iecout_set_enable(aio->chip, true); in uniphier_aio_dai_resume()
570 aio_chip_init(aio->chip); in uniphier_aio_dai_resume()
572 for (i = 0; i < ARRAY_SIZE(aio->sub); i++) { in uniphier_aio_dai_resume()
573 struct uniphier_aio_sub *sub = &aio->sub[i]; in uniphier_aio_dai_resume()
588 aio->chip->num_wup_aios++; in uniphier_aio_dai_resume()
593 if (!aio->chip->num_wup_aios) in uniphier_aio_dai_resume()
594 reset_control_assert(aio->chip->rst); in uniphier_aio_dai_resume()
596 if (!aio->chip->num_wup_aios) in uniphier_aio_dai_resume()
597 clk_disable_unprepare(aio->chip->clk); in uniphier_aio_dai_resume()
719 .name = "uniphier-aio",
748 chip->clk = devm_clk_get(dev, "aio"); in uniphier_aio_probe()
752 chip->rst = devm_reset_control_get_shared(dev, "aio"); in uniphier_aio_probe()
775 struct uniphier_aio *aio = &chip->aios[i]; in uniphier_aio_probe() local
777 aio->chip = chip; in uniphier_aio_probe()
778 aio->fmt = SND_SOC_DAIFMT_I2S; in uniphier_aio_probe()
780 for (j = 0; j < ARRAY_SIZE(aio->sub); j++) { in uniphier_aio_probe()
781 struct uniphier_aio_sub *sub = &aio->sub[j]; in uniphier_aio_probe()
783 sub->aio = aio; in uniphier_aio_probe()
835 MODULE_DESCRIPTION("UniPhier AIO CPU DAI driver.");