• Home
  • Raw
  • Download

Lines Matching +full:left +full:- +full:right

1 // SPDX-License-Identifier: GPL-2.0-or-later
25 #include "sirf-audio-codec.h"
33 static const char * const input_mode_mux[] = {"Single-ended",
42 static const DECLARE_TLV_DB_SCALE(playback_vol_tlv, -12400, 100, 0);
45 0, 7, TLV_DB_SCALE_ITEM(-100, 100, 0),
64 SOC_DAPM_SINGLE("Line Left Switch", AUDIO_IC_CODEC_CTRL1, 6, 1, 0),
65 SOC_DAPM_SINGLE("Mic Left Switch", AUDIO_IC_CODEC_CTRL1, 3, 1, 0),
69 SOC_DAPM_SINGLE("Line Right Switch", AUDIO_IC_CODEC_CTRL1, 5, 1, 0),
70 SOC_DAPM_SINGLE("Mic Right Switch", AUDIO_IC_CODEC_CTRL1, 2, 1, 0),
122 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in atlas6_codec_enable_and_reset_event()
126 enable_and_reset_codec(sirf_audio_codec->regmap, in atlas6_codec_enable_and_reset_event()
130 regmap_update_bits(sirf_audio_codec->regmap, in atlas6_codec_enable_and_reset_event()
145 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in prima2_codec_enable_and_reset_event()
149 enable_and_reset_codec(sirf_audio_codec->regmap, in prima2_codec_enable_and_reset_event()
153 regmap_update_bits(sirf_audio_codec->regmap, in prima2_codec_enable_and_reset_event()
164 SND_SOC_DAPM_OUT_DRV("HP Left Driver", AUDIO_IC_CODEC_CTRL1,
166 SND_SOC_DAPM_OUT_DRV("HP Right Driver", AUDIO_IC_CODEC_CTRL1,
173 SND_SOC_DAPM_OUT_DRV("HP Left Driver", AUDIO_IC_CODEC_CTRL1,
175 SND_SOC_DAPM_OUT_DRV("HP Right Driver", AUDIO_IC_CODEC_CTRL1,
192 SND_SOC_DAPM_DAC("DAC left", NULL, AUDIO_IC_CODEC_CTRL0, 1, 0),
193 SND_SOC_DAPM_DAC("DAC right", NULL, AUDIO_IC_CODEC_CTRL0, 0, 0),
194 SND_SOC_DAPM_SWITCH("Left dac to hp left amp", SND_SOC_NOPM, 0, 0,
196 SND_SOC_DAPM_SWITCH("Left dac to hp right amp", SND_SOC_NOPM, 0, 0,
198 SND_SOC_DAPM_SWITCH("Right dac to hp left amp", SND_SOC_NOPM, 0, 0,
200 SND_SOC_DAPM_SWITCH("Right dac to hp right amp", SND_SOC_NOPM, 0, 0,
202 SND_SOC_DAPM_OUT_DRV("HP amp left driver", AUDIO_IC_CODEC_CTRL0, 3, 0,
204 SND_SOC_DAPM_OUT_DRV("HP amp right driver", AUDIO_IC_CODEC_CTRL0, 3, 0,
207 SND_SOC_DAPM_SWITCH("Left dac to speaker lineout", SND_SOC_NOPM, 0, 0,
209 SND_SOC_DAPM_SWITCH("Right dac to speaker lineout", SND_SOC_NOPM, 0, 0,
218 SND_SOC_DAPM_ADC_E("ADC left", NULL, AUDIO_IC_CODEC_CTRL1, 8, 0,
220 SND_SOC_DAPM_ADC_E("ADC right", NULL, AUDIO_IC_CODEC_CTRL1, 7, 0,
222 SND_SOC_DAPM_MIXER("Left PGA mixer", AUDIO_IC_CODEC_CTRL1, 1, 0,
225 SND_SOC_DAPM_MIXER("Right PGA mixer", AUDIO_IC_CODEC_CTRL1, 0, 0,
244 {"Speaker amp driver", NULL, "Left dac to speaker lineout"},
245 {"Speaker amp driver", NULL, "Right dac to speaker lineout"},
246 {"Left dac to speaker lineout", "Switch", "DAC left"},
247 {"Right dac to speaker lineout", "Switch", "DAC right"},
248 {"HPOUTL", NULL, "HP Left Driver"},
249 {"HPOUTR", NULL, "HP Right Driver"},
250 {"HP Left Driver", NULL, "HP amp left driver"},
251 {"HP Right Driver", NULL, "HP amp right driver"},
252 {"HP amp left driver", NULL, "Right dac to hp left amp"},
253 {"HP amp right driver", NULL , "Right dac to hp right amp"},
254 {"HP amp left driver", NULL, "Left dac to hp left amp"},
255 {"HP amp right driver", NULL , "Right dac to hp right amp"},
256 {"Right dac to hp left amp", "Switch", "DAC left"},
257 {"Right dac to hp right amp", "Switch", "DAC right"},
258 {"Left dac to hp left amp", "Switch", "DAC left"},
259 {"Left dac to hp right amp", "Switch", "DAC right"},
260 {"DAC left", NULL, "codecclk"},
261 {"DAC right", NULL, "codecclk"},
262 {"DAC left", NULL, "Playback"},
263 {"DAC right", NULL, "Playback"},
264 {"DAC left", NULL, "HSL Phase Opposite"},
265 {"DAC right", NULL, "HSL Phase Opposite"},
267 {"Capture", NULL, "ADC left"},
268 {"Capture", NULL, "ADC right"},
269 {"ADC left", NULL, "codecclk"},
270 {"ADC right", NULL, "codecclk"},
271 {"ADC left", NULL, "Left PGA mixer"},
272 {"ADC right", NULL, "Right PGA mixer"},
273 {"Left PGA mixer", "Line Left Switch", "LINEIN2"},
274 {"Right PGA mixer", "Line Right Switch", "LINEIN1"},
275 {"Left PGA mixer", "Mic Left Switch", "MICIN2"},
276 {"Right PGA mixer", "Mic Right Switch", "Mic input mode mux"},
277 {"Mic input mode mux", "Single-ended", "MICIN1"},
283 regmap_update_bits(sirf_audio_codec->regmap, AUDIO_PORT_IC_TXFIFO_OP, in sirf_audio_codec_tx_enable()
285 regmap_update_bits(sirf_audio_codec->regmap, AUDIO_PORT_IC_TXFIFO_OP, in sirf_audio_codec_tx_enable()
287 regmap_write(sirf_audio_codec->regmap, AUDIO_PORT_IC_TXFIFO_INT_MSK, 0); in sirf_audio_codec_tx_enable()
288 regmap_write(sirf_audio_codec->regmap, AUDIO_PORT_IC_TXFIFO_OP, 0); in sirf_audio_codec_tx_enable()
289 regmap_update_bits(sirf_audio_codec->regmap, AUDIO_PORT_IC_TXFIFO_OP, in sirf_audio_codec_tx_enable()
291 regmap_update_bits(sirf_audio_codec->regmap, in sirf_audio_codec_tx_enable()
297 regmap_write(sirf_audio_codec->regmap, AUDIO_PORT_IC_TXFIFO_OP, 0); in sirf_audio_codec_tx_disable()
298 regmap_update_bits(sirf_audio_codec->regmap, in sirf_audio_codec_tx_disable()
305 regmap_update_bits(sirf_audio_codec->regmap, AUDIO_PORT_IC_RXFIFO_OP, in sirf_audio_codec_rx_enable()
307 regmap_update_bits(sirf_audio_codec->regmap, AUDIO_PORT_IC_RXFIFO_OP, in sirf_audio_codec_rx_enable()
309 regmap_write(sirf_audio_codec->regmap, in sirf_audio_codec_rx_enable()
311 regmap_write(sirf_audio_codec->regmap, AUDIO_PORT_IC_RXFIFO_OP, 0); in sirf_audio_codec_rx_enable()
312 regmap_update_bits(sirf_audio_codec->regmap, AUDIO_PORT_IC_RXFIFO_OP, in sirf_audio_codec_rx_enable()
315 regmap_update_bits(sirf_audio_codec->regmap, in sirf_audio_codec_rx_enable()
319 regmap_update_bits(sirf_audio_codec->regmap, in sirf_audio_codec_rx_enable()
326 regmap_update_bits(sirf_audio_codec->regmap, in sirf_audio_codec_rx_disable()
335 struct snd_soc_component *component = dai->component; in sirf_audio_codec_trigger()
337 int playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; in sirf_audio_codec_trigger()
363 substream->runtime->channels); in sirf_audio_codec_trigger()
366 return -EINVAL; in sirf_audio_codec_trigger()
377 .name = "sirf-audio-codec",
399 pm_runtime_enable(component->dev); in sirf_audio_codec_probe()
401 if (of_device_is_compatible(component->dev->of_node, "sirf,prima2-audio-codec")) { in sirf_audio_codec_probe()
411 if (of_device_is_compatible(component->dev->of_node, "sirf,atlas6-audio-codec")) { in sirf_audio_codec_probe()
422 return -EINVAL; in sirf_audio_codec_probe()
427 pm_runtime_disable(component->dev); in sirf_audio_codec_remove()
443 { .compatible = "sirf,prima2-audio-codec" },
444 { .compatible = "sirf,atlas6-audio-codec" },
463 sirf_audio_codec = devm_kzalloc(&pdev->dev, in sirf_audio_codec_driver_probe()
466 return -ENOMEM; in sirf_audio_codec_driver_probe()
474 sirf_audio_codec->regmap = devm_regmap_init_mmio(&pdev->dev, base, in sirf_audio_codec_driver_probe()
476 if (IS_ERR(sirf_audio_codec->regmap)) in sirf_audio_codec_driver_probe()
477 return PTR_ERR(sirf_audio_codec->regmap); in sirf_audio_codec_driver_probe()
479 sirf_audio_codec->clk = devm_clk_get(&pdev->dev, NULL); in sirf_audio_codec_driver_probe()
480 if (IS_ERR(sirf_audio_codec->clk)) { in sirf_audio_codec_driver_probe()
481 dev_err(&pdev->dev, "Get clock failed.\n"); in sirf_audio_codec_driver_probe()
482 return PTR_ERR(sirf_audio_codec->clk); in sirf_audio_codec_driver_probe()
485 ret = clk_prepare_enable(sirf_audio_codec->clk); in sirf_audio_codec_driver_probe()
487 dev_err(&pdev->dev, "Enable clock failed.\n"); in sirf_audio_codec_driver_probe()
491 ret = devm_snd_soc_register_component(&(pdev->dev), in sirf_audio_codec_driver_probe()
495 dev_err(&pdev->dev, "Register Audio Codec dai failed.\n"); in sirf_audio_codec_driver_probe()
503 regmap_update_bits(sirf_audio_codec->regmap, AUDIO_IC_CODEC_CTRL0, in sirf_audio_codec_driver_probe()
506 if (of_device_is_compatible(pdev->dev.of_node, "sirf,atlas6-audio-codec")) in sirf_audio_codec_driver_probe()
507 regmap_update_bits(sirf_audio_codec->regmap, in sirf_audio_codec_driver_probe()
512 clk_disable_unprepare(sirf_audio_codec->clk); in sirf_audio_codec_driver_probe()
520 clk_disable_unprepare(sirf_audio_codec->clk); in sirf_audio_codec_driver_remove()
530 regmap_read(sirf_audio_codec->regmap, AUDIO_IC_CODEC_CTRL0, in sirf_audio_codec_suspend()
531 &sirf_audio_codec->reg_ctrl0); in sirf_audio_codec_suspend()
532 regmap_read(sirf_audio_codec->regmap, AUDIO_IC_CODEC_CTRL1, in sirf_audio_codec_suspend()
533 &sirf_audio_codec->reg_ctrl1); in sirf_audio_codec_suspend()
534 clk_disable_unprepare(sirf_audio_codec->clk); in sirf_audio_codec_suspend()
544 ret = clk_prepare_enable(sirf_audio_codec->clk); in sirf_audio_codec_resume()
548 regmap_write(sirf_audio_codec->regmap, AUDIO_IC_CODEC_CTRL0, in sirf_audio_codec_resume()
549 sirf_audio_codec->reg_ctrl0); in sirf_audio_codec_resume()
550 regmap_write(sirf_audio_codec->regmap, AUDIO_IC_CODEC_CTRL1, in sirf_audio_codec_resume()
551 sirf_audio_codec->reg_ctrl1); in sirf_audio_codec_resume()
563 .name = "sirf-audio-codec",