Lines Matching +full:hdmi +full:- +full:codec
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Rockchip machine ASoC driver for RK3288 boards that have an HDMI and analog
21 #include <sound/soc-dapm.h>
25 #define DRV_NAME "rk3288-snd-hdmi-analog"
34 struct rk_drvdata *machine = snd_soc_card_get_drvdata(w->dapm->card); in rk_hp_power()
36 gpiod_set_value_cansleep(machine->gpio_hp_en, in rk_hp_power()
52 SND_SOC_DAPM_LINE("HDMI", NULL),
57 SOC_DAPM_PIN_SWITCH("HDMI"),
89 return -EINVAL; in rk_hw_params()
95 if (ret && ret != -ENOTSUPP) { in rk_hw_params()
96 dev_err(codec_dai->dev, "Can't set cpu clock %d\n", ret); in rk_hw_params()
102 if (ret && ret != -ENOTSUPP) { in rk_hw_params()
103 dev_err(codec_dai->dev, "Can't set codec clock %d\n", ret); in rk_hw_params()
111 .name = "rockchip,hp-det",
118 struct snd_soc_card *card = runtime->card; in rk_init()
119 struct device *dev = card->dev; in rk_init()
122 if (of_property_present(dev->of_node, "rockchip,hp-det-gpios")) { in rk_init()
124 snd_soc_card_jack_new_pins(runtime->card, "Headphone Jack", in rk_init()
141 COMP_CODEC("hdmi-audio-codec.2.auto", "i2s-hifi")),
156 .name = "ROCKCHIP-I2S",
170 struct device_node *np = pdev->dev.of_node; in snd_rk_mc_probe()
174 machine = devm_kzalloc(&pdev->dev, sizeof(struct rk_drvdata), in snd_rk_mc_probe()
177 return -ENOMEM; in snd_rk_mc_probe()
179 card->dev = &pdev->dev; in snd_rk_mc_probe()
181 machine->gpio_hp_en = devm_gpiod_get_optional(&pdev->dev, "rockchip,hp-en", GPIOD_OUT_LOW); in snd_rk_mc_probe()
182 if (IS_ERR(machine->gpio_hp_en)) in snd_rk_mc_probe()
183 return PTR_ERR(machine->gpio_hp_en); in snd_rk_mc_probe()
184 gpiod_set_consumer_name(machine->gpio_hp_en, "hp_en"); in snd_rk_mc_probe()
188 dev_err(card->dev, "SoC parse card name failed %d\n", ret); in snd_rk_mc_probe()
193 "rockchip,audio-codec", in snd_rk_mc_probe()
196 dev_err(&pdev->dev, in snd_rk_mc_probe()
197 "Property 'rockchip,audio-codec' missing or invalid\n"); in snd_rk_mc_probe()
198 return -EINVAL; in snd_rk_mc_probe()
200 ret = of_parse_phandle_with_fixed_args(np, "rockchip,audio-codec", in snd_rk_mc_probe()
203 dev_err(&pdev->dev, in snd_rk_mc_probe()
204 "Unable to parse property 'rockchip,audio-codec'\n"); in snd_rk_mc_probe()
210 dev_err(&pdev->dev, "Unable to get codec_dai_name\n"); in snd_rk_mc_probe()
214 rk_dailink.cpus->of_node = of_parse_phandle(np, "rockchip,i2s-controller", in snd_rk_mc_probe()
216 if (!rk_dailink.cpus->of_node) { in snd_rk_mc_probe()
217 dev_err(&pdev->dev, in snd_rk_mc_probe()
218 "Property 'rockchip,i2s-controller' missing or invalid\n"); in snd_rk_mc_probe()
219 return -EINVAL; in snd_rk_mc_probe()
222 rk_dailink.platforms->of_node = rk_dailink.cpus->of_node; in snd_rk_mc_probe()
226 dev_err(&pdev->dev, in snd_rk_mc_probe()
233 ret = devm_snd_soc_register_card(&pdev->dev, card); in snd_rk_mc_probe()
235 return dev_err_probe(&pdev->dev, ret, in snd_rk_mc_probe()
242 { .compatible = "rockchip,rk3288-hdmi-analog", },