// SPDX-License-Identifier: GPL-2.0 // // TSE-850 audio - ASoC driver for the Axentia TSE-850 with a PCM5142 codec // // Copyright (C) 2016 Axentia Technologies AB // // Author: Peter Rosin <peda@axentia.se> // // loop1 relays // IN1 +---o +------------+ o---+ OUT1 // \ / // + + // | / | // +--o +--. | // | add | | // | V | // | .---. | // DAC +----------->|Sum|---+ // | '---' | // | | // + + // // IN2 +---o--+------------+--o---+ OUT2 // loop2 relays // // The 'loop1' gpio pin controls two relays, which are either in loop // position, meaning that input and output are directly connected, or // they are in mixer position, meaning that the signal is passed through // the 'Sum' mixer. Similarly for 'loop2'. // // In the above, the 'loop1' relays are inactive, thus feeding IN1 to the // mixer (if 'add' is active) and feeding the mixer output to OUT1. The // 'loop2' relays are active, short-cutting the TSE-850 from channel 2. // IN1, IN2, OUT1 and OUT2 are TSE-850 connectors and DAC is the PCB name // of the (filtered) output from the PCM5142 codec.
/* * Map enum zero (Low) to 2 volts on the regulator, do this since * the ana regulator is supplied by the system 12V voltage and * requesting anything below the system voltage causes the system * voltage to be passed through the regulator. Also, the ana * regulator induces noise when requesting voltages near the * system voltage. So, by mapping Low to 2V, that noise is * eliminated when all that is needed is 12V (the system voltage).
*/ if (uV)
uV = 11000000 + (1000000 * uV); else
uV = 2000000;
ret = regulator_set_voltage(tse850->ana, uV, uV); if (ret < 0) return ret;
/* * These connections are not entirely correct, since both IN1 and IN2 * are always fed to MIX (if the "IN switch" is set so), i.e. without * regard to the loop1 and loop2 relays that according to this only * control MUX1 and MUX2 but in fact also control how the input signals * are routed. * But, 1) I don't know how to do it right, and 2) it doesn't seem to * matter in practice since nothing is powered in those sections anyway.
*/ staticconststruct snd_soc_dapm_route tse850_intercon[] = {
{ "OUT1", NULL, "MUX1" },
{ "OUT2", NULL, "MUX2" },
tse850 = devm_kzalloc(dev, sizeof(*tse850), GFP_KERNEL); if (!tse850) return -ENOMEM;
snd_soc_card_set_drvdata(card, tse850);
ret = tse850_dt_init(pdev); if (ret) {
dev_err(dev, "failed to init dt info\n"); return ret;
}
tse850->add = devm_gpiod_get(dev, "axentia,add", GPIOD_OUT_HIGH); if (IS_ERR(tse850->add)) return dev_err_probe(dev, PTR_ERR(tse850->add), "failed to get 'add' gpio\n");
tse850->add_cache = 1;
tse850->loop1 = devm_gpiod_get(dev, "axentia,loop1", GPIOD_OUT_HIGH); if (IS_ERR(tse850->loop1)) return dev_err_probe(dev, PTR_ERR(tse850->loop1), "failed to get 'loop1' gpio\n");
tse850->loop1_cache = 1;
tse850->loop2 = devm_gpiod_get(dev, "axentia,loop2", GPIOD_OUT_HIGH); if (IS_ERR(tse850->loop2)) return dev_err_probe(dev, PTR_ERR(tse850->loop2), "failed to get 'loop2' gpio\n");
tse850->loop2_cache = 1;
tse850->ana = devm_regulator_get(dev, "axentia,ana"); if (IS_ERR(tse850->ana)) return dev_err_probe(dev, PTR_ERR(tse850->ana), "failed to get 'ana' regulator\n");
ret = regulator_enable(tse850->ana); if (ret < 0) {
dev_err(dev, "failed to enable the 'ana' regulator\n"); return ret;
}
ret = snd_soc_register_card(card); if (ret) {
dev_err(dev, "snd_soc_register_card failed\n"); goto err_disable_ana;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.