Lines Matching +full:rk3288 +full:- +full:i2s
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Rockchip machine ASoC driver for RK3288 boards that have an HDMI and analog
22 #include <sound/soc-dapm.h>
26 #define DRV_NAME "rk3288-snd-hdmi-analog"
36 struct rk_drvdata *machine = snd_soc_card_get_drvdata(w->dapm->card); in rk_hp_power()
38 if (!gpio_is_valid(machine->gpio_hp_en)) in rk_hp_power()
41 gpio_set_value_cansleep(machine->gpio_hp_en, in rk_hp_power()
94 return -EINVAL; in rk_hw_params()
100 if (ret && ret != -ENOTSUPP) { in rk_hw_params()
101 dev_err(codec_dai->dev, "Can't set cpu clock %d\n", ret); in rk_hw_params()
107 if (ret && ret != -ENOTSUPP) { in rk_hw_params()
108 dev_err(codec_dai->dev, "Can't set codec clock %d\n", ret); in rk_hw_params()
123 struct rk_drvdata *machine = snd_soc_card_get_drvdata(runtime->card); in rk_init()
126 if (gpio_is_valid(machine->gpio_hp_det)) { in rk_init()
127 snd_soc_card_jack_new_pins(runtime->card, "Headphone Jack", in rk_init()
131 rk_hp_jack_gpio.gpio = machine->gpio_hp_det; in rk_init()
145 COMP_CODEC("hdmi-audio-codec.2.auto", "i2s-hifi")),
160 .name = "ROCKCHIP-I2S",
174 struct device_node *np = pdev->dev.of_node; in snd_rk_mc_probe()
178 machine = devm_kzalloc(&pdev->dev, sizeof(struct rk_drvdata), in snd_rk_mc_probe()
181 return -ENOMEM; in snd_rk_mc_probe()
183 card->dev = &pdev->dev; in snd_rk_mc_probe()
185 machine->gpio_hp_det = of_get_named_gpio(np, in snd_rk_mc_probe()
186 "rockchip,hp-det-gpios", 0); in snd_rk_mc_probe()
187 if (!gpio_is_valid(machine->gpio_hp_det) && machine->gpio_hp_det != -ENODEV) in snd_rk_mc_probe()
188 return machine->gpio_hp_det; in snd_rk_mc_probe()
190 machine->gpio_hp_en = of_get_named_gpio(np, in snd_rk_mc_probe()
191 "rockchip,hp-en-gpios", 0); in snd_rk_mc_probe()
192 if (!gpio_is_valid(machine->gpio_hp_en) && machine->gpio_hp_en != -ENODEV) in snd_rk_mc_probe()
193 return machine->gpio_hp_en; in snd_rk_mc_probe()
195 if (gpio_is_valid(machine->gpio_hp_en)) { in snd_rk_mc_probe()
196 ret = devm_gpio_request_one(&pdev->dev, machine->gpio_hp_en, in snd_rk_mc_probe()
199 dev_err(card->dev, "cannot get hp_en gpio\n"); in snd_rk_mc_probe()
206 dev_err(card->dev, "SoC parse card name failed %d\n", ret); in snd_rk_mc_probe()
211 "rockchip,audio-codec", in snd_rk_mc_probe()
214 dev_err(&pdev->dev, in snd_rk_mc_probe()
215 "Property 'rockchip,audio-codec' missing or invalid\n"); in snd_rk_mc_probe()
216 return -EINVAL; in snd_rk_mc_probe()
218 ret = of_parse_phandle_with_fixed_args(np, "rockchip,audio-codec", in snd_rk_mc_probe()
221 dev_err(&pdev->dev, in snd_rk_mc_probe()
222 "Unable to parse property 'rockchip,audio-codec'\n"); in snd_rk_mc_probe()
228 dev_err(&pdev->dev, "Unable to get codec_dai_name\n"); in snd_rk_mc_probe()
232 rk_dailink.cpus->of_node = of_parse_phandle(np, "rockchip,i2s-controller", in snd_rk_mc_probe()
234 if (!rk_dailink.cpus->of_node) { in snd_rk_mc_probe()
235 dev_err(&pdev->dev, in snd_rk_mc_probe()
236 "Property 'rockchip,i2s-controller' missing or invalid\n"); in snd_rk_mc_probe()
237 return -EINVAL; in snd_rk_mc_probe()
240 rk_dailink.platforms->of_node = rk_dailink.cpus->of_node; in snd_rk_mc_probe()
244 dev_err(&pdev->dev, in snd_rk_mc_probe()
251 ret = devm_snd_soc_register_card(&pdev->dev, card); in snd_rk_mc_probe()
253 return dev_err_probe(&pdev->dev, ret, in snd_rk_mc_probe()
260 { .compatible = "rockchip,rk3288-hdmi-analog", },
278 MODULE_DESCRIPTION("Rockchip RK3288 machine ASoC driver");