Lines Matching +full:simple +full:- +full:audio +full:- +full:mux
1 // SPDX-License-Identifier: GPL-2.0
3 // rk817 ALSA SoC Audio driver
32 * I don't have another implementation to compare from the Rockchip sources. Hard-coding for now.
45 if (rk817->mic_in_differential) {
61 /* Set the PLL pre-divide value (values not documented). */
73 * 0db~-95db, 0.375db/step, for example:
75 * 0xff: -95dB
78 static const DECLARE_TLV_DB_MINMAX(rk817_vol_tlv, -9500, 0);
82 * 27db~-18db, 3db/step, for example:
83 * 0x0: -18dB
87 static const DECLARE_TLV_DB_MINMAX(rk817_gain_tlv, -1800, 2700);
98 /* Since the speaker output and L headphone pin are internally the same, make audio path mutually
99 * exclusive with a mux.
110 SOC_DAPM_ENUM("Playback Mux", dac_enum);
171 /* Mux for input/output path selection */
172 SND_SOC_DAPM_MUX("Playback Mux", SND_SOC_NOPM, 1, 0, &dac_mux),
174 /* Pins for Simple Card Bindings */
279 /* mux path for output selection */
280 {"Playback Mux", "HP", "DAC L"},
281 {"Playback Mux", "HP", "DAC R"},
282 {"Playback Mux", "SPK", "SPK DAC"},
283 {"SPKO", NULL, "Playback Mux"},
284 {"HPOL", NULL, "Playback Mux"},
285 {"HPOR", NULL, "Playback Mux"},
291 struct snd_soc_component *component = codec_dai->component;
294 rk817->stereo_sysclk = freq;
302 struct snd_soc_component *component = codec_dai->component;
313 dev_err(component->dev, "%s : set master mask failed!\n", __func__);
314 return -EINVAL;
327 struct snd_soc_component *component = dai->component;
344 return -EINVAL;
352 struct snd_soc_component *component = dai->component;
395 .name = "rk817-hifi",
417 struct rk808 *rk808 = dev_get_drvdata(component->dev->parent);
419 snd_soc_component_init_regmap(component, rk808->regmap);
420 rk817->component = component;
426 /* setting initial pll values so that we can continue to leverage simple-audio-card.
460 node = of_get_child_by_name(dev->parent->of_node, "codec");
466 rk817->mic_in_differential =
467 of_property_read_bool(node, "rockchip,mic-in-differential");
474 struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent);
478 rk817_codec_data = devm_kzalloc(&pdev->dev,
482 return -ENOMEM;
486 rk817_codec_data->rk808 = rk808;
488 rk817_codec_parse_dt_property(&pdev->dev, rk817_codec_data);
490 rk817_codec_data->mclk = devm_clk_get(pdev->dev.parent, "mclk");
491 if (IS_ERR(rk817_codec_data->mclk)) {
492 dev_dbg(&pdev->dev, "Unable to get mclk\n");
493 ret = -ENXIO;
497 ret = clk_prepare_enable(rk817_codec_data->mclk);
499 dev_err(&pdev->dev, "%s() clock prepare error %d\n",
504 ret = devm_snd_soc_register_component(&pdev->dev, &soc_codec_dev_rk817,
507 dev_err(&pdev->dev, "%s() register codec error %d\n",
515 clk_disable_unprepare(rk817_codec_data->mclk);
524 clk_disable_unprepare(rk817->mclk);
529 .name = "rk817-codec",
538 MODULE_AUTHOR("binyuan <kevan.lan@rock-chips.com>");
540 MODULE_ALIAS("platform:rk817-codec");