Lines Matching full:machine

3  * tegra_asoc_machine.c - Universal ASoC machine driver for NVIDIA Tegra boards.
72 struct tegra_machine *machine = snd_soc_card_get_drvdata(dapm->card); in tegra_machine_event() local
75 gpiod_set_value_cansleep(machine->gpiod_spkr_en, in tegra_machine_event()
79 gpiod_set_value_cansleep(machine->gpiod_ext_mic_en, in tegra_machine_event()
83 gpiod_set_value_cansleep(machine->gpiod_int_mic_en, in tegra_machine_event()
87 gpiod_set_value_cansleep(machine->gpiod_hp_mute, in tegra_machine_event()
126 struct tegra_machine *machine = snd_soc_card_get_drvdata(card); in tegra_asoc_machine_init() local
130 if (machine->gpiod_hp_det && machine->asoc->add_hp_jack) { in tegra_asoc_machine_init()
131 if (machine->asoc->hp_jack_name) in tegra_asoc_machine_init()
132 jack_name = machine->asoc->hp_jack_name; in tegra_asoc_machine_init()
147 tegra_machine_hp_jack_gpio.desc = machine->gpiod_hp_det; in tegra_asoc_machine_init()
155 if (machine->gpiod_hp_det && machine->asoc->add_headset_jack) { in tegra_asoc_machine_init()
167 tegra_machine_headset_jack_gpio.desc = machine->gpiod_hp_det; in tegra_asoc_machine_init()
175 if (machine->gpiod_mic_det && machine->asoc->add_mic_jack) { in tegra_asoc_machine_init()
186 tegra_machine_mic_jack_gpio.desc = machine->gpiod_mic_det; in tegra_asoc_machine_init()
247 struct tegra_machine *machine = snd_soc_card_get_drvdata(card); in tegra_machine_hw_params() local
249 unsigned int mclk = machine->asoc->mclk_rate(srate); in tegra_machine_hw_params()
250 unsigned int clk_id = machine->asoc->mclk_id; in tegra_machine_hw_params()
284 if (new_baseclock != machine->set_baseclock || in tegra_machine_hw_params()
285 mclk != machine->set_mclk) { in tegra_machine_hw_params()
286 machine->set_baseclock = 0; in tegra_machine_hw_params()
287 machine->set_mclk = 0; in tegra_machine_hw_params()
289 clk_disable_unprepare(machine->clk_cdev1); in tegra_machine_hw_params()
291 err = clk_set_rate(machine->clk_pll_a, new_baseclock); in tegra_machine_hw_params()
297 err = clk_set_rate(machine->clk_pll_a_out0, mclk); in tegra_machine_hw_params()
305 err = clk_prepare_enable(machine->clk_cdev1); in tegra_machine_hw_params()
311 machine->set_baseclock = new_baseclock; in tegra_machine_hw_params()
312 machine->set_mclk = mclk; in tegra_machine_hw_params()
382 struct tegra_machine *machine; in tegra_asoc_machine_probe() local
387 machine = devm_kzalloc(dev, sizeof(*machine), GFP_KERNEL); in tegra_asoc_machine_probe()
388 if (!machine) in tegra_asoc_machine_probe()
395 machine->asoc = asoc; in tegra_asoc_machine_probe()
396 machine->mic_jack = &tegra_machine_mic_jack; in tegra_asoc_machine_probe()
397 machine->hp_jack_gpio = &tegra_machine_hp_jack_gpio; in tegra_asoc_machine_probe()
398 snd_soc_card_set_drvdata(card, machine); in tegra_asoc_machine_probe()
401 machine->gpiod_hp_mute = gpiod; in tegra_asoc_machine_probe()
406 machine->gpiod_hp_det = gpiod; in tegra_asoc_machine_probe()
411 machine->gpiod_mic_det = gpiod; in tegra_asoc_machine_probe()
416 machine->gpiod_spkr_en = gpiod; in tegra_asoc_machine_probe()
421 machine->gpiod_int_mic_en = gpiod; in tegra_asoc_machine_probe()
426 machine->gpiod_ext_mic_en = gpiod; in tegra_asoc_machine_probe()
483 machine->clk_pll_a = devm_clk_get(dev, "pll_a"); in tegra_asoc_machine_probe()
484 if (IS_ERR(machine->clk_pll_a)) { in tegra_asoc_machine_probe()
486 return PTR_ERR(machine->clk_pll_a); in tegra_asoc_machine_probe()
489 machine->clk_pll_a_out0 = devm_clk_get(dev, "pll_a_out0"); in tegra_asoc_machine_probe()
490 if (IS_ERR(machine->clk_pll_a_out0)) { in tegra_asoc_machine_probe()
492 return PTR_ERR(machine->clk_pll_a_out0); in tegra_asoc_machine_probe()
495 machine->clk_cdev1 = devm_clk_get(dev, "mclk"); in tegra_asoc_machine_probe()
496 if (IS_ERR(machine->clk_cdev1)) { in tegra_asoc_machine_probe()
498 return PTR_ERR(machine->clk_cdev1); in tegra_asoc_machine_probe()
518 err = clk_set_parent(clk_extern1, machine->clk_pll_a_out0); in tegra_asoc_machine_probe()
536 machine->clk_cdev1 = clk_out_1; in tegra_asoc_machine_probe()
544 err = clk_set_rate(machine->clk_pll_a, 73728000); in tegra_asoc_machine_probe()
550 err = clk_set_rate(machine->clk_pll_a_out0, 24576000); in tegra_asoc_machine_probe()
556 machine->set_baseclock = 73728000; in tegra_asoc_machine_probe()
557 machine->set_mclk = 24576000; in tegra_asoc_machine_probe()
565 err = clk_prepare_enable(machine->clk_cdev1); in tegra_asoc_machine_probe()
579 /* WM8753 machine */
609 /* WM9712 machine */
642 /* MAX98090 machine */
677 /* SGTL5000 machine */
707 /* TLV320AIC23 machine */
754 /* RT5677 machine */
802 /* RT5640 machine */
835 /* RT5632 machine */
902 MODULE_DESCRIPTION("Tegra machine ASoC driver");