Lines Matching +full:clk +full:- +full:source
1 // SPDX-License-Identifier: GPL-2.0
9 #include <linux/clk.h>
18 #include <sound/soc-dai.h>
19 #include <sound/soc-dapm.h>
166 struct clk *clk; member
173 struct regmap *regmap = jz_codec->regmap; in jz4760_codec_set_bias_level()
199 struct snd_soc_component *codec = dai->component; in jz4760_codec_startup()
208 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in jz4760_codec_startup()
216 struct snd_soc_component *codec = dai->component; in jz4760_codec_shutdown()
219 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in jz4760_codec_shutdown()
227 struct snd_soc_component *codec = dai->component; in jz4760_codec_pcm_trigger()
234 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) in jz4760_codec_pcm_trigger()
243 ret = -EINVAL; in jz4760_codec_pcm_trigger()
251 struct snd_soc_component *codec = dai->component; in jz4760_codec_mute_stream()
261 regmap_read(jz_codec->regmap, JZ4760_CODEC_REG_PMR2, &val); in jz4760_codec_mute_stream()
266 err = regmap_read_poll_timeout(jz_codec->regmap, in jz4760_codec_mute_stream()
271 dev_err(jz_codec->dev, in jz4760_codec_mute_stream()
277 regmap_write(jz_codec->regmap, JZ4760_CODEC_REG_IFR, gain_bit); in jz4760_codec_mute_stream()
280 regmap_read(jz_codec->regmap, JZ4760_CODEC_REG_CR2, ®); in jz4760_codec_mute_stream()
286 static const DECLARE_TLV_DB_MINMAX_MUTE(dac_tlv, -3100, 100);
288 static const DECLARE_TLV_DB_MINMAX(out_tlv, -2500, 100);
289 static const DECLARE_TLV_DB_SCALE(linein_tlv, -2500, 100, 0);
290 static const DECLARE_TLV_DB_MINMAX(mixer_tlv, -3100, 0);
311 SOC_SINGLE("High-Pass Filter Capture Switch",
353 struct snd_soc_component *codec = snd_soc_dapm_to_component(w->dapm); in hpout_event()
361 regmap_clear_bits(jz_codec->regmap, JZ4760_CODEC_REG_CR1, in hpout_event()
366 /* wait for ramp-up complete (RUP) */ in hpout_event()
367 err = regmap_read_poll_timeout(jz_codec->regmap, in hpout_event()
372 dev_err(jz_codec->dev, "RUP timeout: %d", err); in hpout_event()
377 regmap_set_bits(jz_codec->regmap, JZ4760_CODEC_REG_IFR, in hpout_event()
384 regmap_set_bits(jz_codec->regmap, JZ4760_CODEC_REG_CR1, in hpout_event()
387 err = regmap_read_poll_timeout(jz_codec->regmap, in hpout_event()
392 dev_err(jz_codec->dev, "RDO timeout: %d", err); in hpout_event()
397 regmap_set_bits(jz_codec->regmap, JZ4760_CODEC_REG_IFR, in hpout_event()
465 SND_SOC_DAPM_MUX("Headphones Source", SND_SOC_NOPM, 0, 0,
468 SND_SOC_DAPM_MUX("Capture Source", SND_SOC_NOPM, 0, 0,
538 { "Headphones Source", "Mic 1", "Mic" },
539 { "Headphones Source", "Mic 2", "Mic" },
540 { "Capture Source", "Mic 1", "Mic" },
541 { "Capture Source", "Mic 2", "Mic" },
543 { "Capture Source", "Line In", "Line In" },
544 { "Capture Source", "Mic 1", "Mic 1" },
545 { "Capture Source", "Mic 2", "Mic 2" },
546 { "ADC", NULL, "Capture Source" },
550 { "Headphones Source", "Mic 1", "Mic 1" },
551 { "Headphones Source", "Mic 2", "Mic 2" },
552 { "Headphones Source", "Line In", "Line In Bypass" },
553 { "Headphones Source", "PCM", "Headphones Playback" },
554 { "HP Out", NULL, "Headphones Source" },
576 struct regmap *regmap = jz_codec->regmap; in jz4760_codec_codec_init_regs()
588 /* Set mic 1 as default source for ADC */ in jz4760_codec_codec_init_regs()
611 regmap_set_bits(jz_codec->regmap, JZ4760_CODEC_REG_CR2, in jz4760_codec_codec_init_regs()
630 clk_prepare_enable(jz_codec->clk); in jz4760_codec_codec_probe()
641 clk_disable_unprepare(jz_codec->clk); in jz4760_codec_codec_remove()
668 struct jz_codec *codec = snd_soc_component_get_drvdata(dai->component); in jz4760_codec_hw_params()
685 return -EINVAL; in jz4760_codec_hw_params()
694 return -EINVAL; in jz4760_codec_hw_params()
696 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in jz4760_codec_hw_params()
697 regmap_update_bits(codec->regmap, JZ4760_CODEC_REG_AICR, in jz4760_codec_hw_params()
700 regmap_update_bits(codec->regmap, JZ4760_CODEC_REG_CCR2, in jz4760_codec_hw_params()
704 regmap_update_bits(codec->regmap, JZ4760_CODEC_REG_AICR, in jz4760_codec_hw_params()
707 regmap_update_bits(codec->regmap, JZ4760_CODEC_REG_CCR2, in jz4760_codec_hw_params()
730 .name = "jz4760-hifi",
767 return readl_poll_timeout(codec->base + ICDC_RGADW_OFFSET, reg, in jz4760_codec_io_wait()
784 tmp = readl(codec->base + ICDC_RGADW_OFFSET); in jz4760_codec_reg_read()
787 writel(tmp, codec->base + ICDC_RGADW_OFFSET); in jz4760_codec_reg_read()
791 *val = readl(codec->base + ICDC_RGDATA_OFFSET) & in jz4760_codec_reg_read()
808 codec->base + ICDC_RGADW_OFFSET); in jz4760_codec_reg_write()
842 struct device *dev = &pdev->dev; in jz4760_codec_probe()
848 return -ENOMEM; in jz4760_codec_probe()
850 codec->dev = dev; in jz4760_codec_probe()
852 codec->base = devm_platform_ioremap_resource(pdev, 0); in jz4760_codec_probe()
853 if (IS_ERR(codec->base)) in jz4760_codec_probe()
854 return PTR_ERR(codec->base); in jz4760_codec_probe()
856 codec->regmap = devm_regmap_init(dev, NULL, codec, in jz4760_codec_probe()
858 if (IS_ERR(codec->regmap)) in jz4760_codec_probe()
859 return PTR_ERR(codec->regmap); in jz4760_codec_probe()
861 codec->clk = devm_clk_get(dev, "aic"); in jz4760_codec_probe()
862 if (IS_ERR(codec->clk)) in jz4760_codec_probe()
863 return PTR_ERR(codec->clk); in jz4760_codec_probe()
878 { .compatible = "ingenic,jz4760-codec", },
886 .name = "jz4760-codec",