• Home
  • Raw
  • Download

Lines Matching +full:pdm +full:- +full:mute

18  * 02110-1301 USA
35 #include <sound/soc-dapm.h>
75 u8 dl12_cache[TWL6040_REG_HFRCTL - TWL6040_REG_HSLCTL + 1];
83 /* set of rates for each pll: low-power and high-performance */
109 #define to_twl6040(component) dev_get_drvdata((component)->dev->parent)
118 return -EIO; in twl6040_read()
126 value = priv->dl12_cache[reg - TWL6040_REG_HSLCTL]; in twl6040_read()
146 return priv->dl1_unmuted; in twl6040_can_write_to_chip()
149 return priv->dl2_unmuted; in twl6040_can_write_to_chip()
166 priv->dl12_cache[reg - TWL6040_REG_HSLCTL] = value; in twl6040_update_dl12_cache()
179 return -EIO; in twl6040_write()
239 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in twl6040_hs_dac_event()
266 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in twl6040_ep_drv_event()
272 priv->hs_power_mode_locked = 1; in twl6040_ep_drv_event()
275 priv->hs_power_mode_locked = 0; in twl6040_ep_drv_event()
276 ret = headset_power_mode(component, priv->hs_power_mode); in twl6040_ep_drv_event()
290 mutex_lock(&priv->mutex); in twl6040_hs_jack_report()
299 mutex_unlock(&priv->mutex); in twl6040_hs_jack_report()
306 struct twl6040_jack_data *hs_jack = &priv->hs_jack; in twl6040_hs_jack_detect()
308 hs_jack->jack = jack; in twl6040_hs_jack_detect()
309 hs_jack->report = report; in twl6040_hs_jack_detect()
311 twl6040_hs_jack_report(component, hs_jack->jack, hs_jack->report); in twl6040_hs_jack_detect()
319 struct snd_soc_component *component = priv->component; in twl6040_accessory_work()
320 struct twl6040_jack_data *hs_jack = &priv->hs_jack; in twl6040_accessory_work()
322 twl6040_hs_jack_report(component, hs_jack->jack, hs_jack->report); in twl6040_accessory_work()
332 &priv->hs_jack.work, msecs_to_jiffies(200)); in twl6040_audio_handler()
341 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in twl6040_soc_dapm_put_vibra_enum()
345 val = twl6040_read(component, e->reg); in twl6040_soc_dapm_put_vibra_enum()
347 return -EBUSY; in twl6040_soc_dapm_put_vibra_enum()
354 * from -6 to 0 dB in 6 dB steps
356 static DECLARE_TLV_DB_SCALE(mic_preamp_tlv, -600, 600, 0);
366 * from -18 to 24 dB in 6 dB steps
368 static DECLARE_TLV_DB_SCALE(afm_amp_tlv, -1800, 600, 0);
372 * from -30 to 0 dB in 2 dB steps
374 static DECLARE_TLV_DB_SCALE(hs_tlv, -3000, 200, 0);
378 * from -52 to 6 dB in 2 dB steps
380 static DECLARE_TLV_DB_SCALE(hf_tlv, -5200, 200, 0);
384 * from -24 to 6 dB in 2 dB steps
386 static DECLARE_TLV_DB_SCALE(ep_tlv, -2400, 200, 0);
404 "Off", "HS DAC", "Line-In amp"
415 "Off", "HF DAC", "Line-In amp"
426 "Input FF", "Audio PDM"
480 "Low-Power", "High-Performance",
492 ucontrol->value.enumerated.item[0] = priv->hs_power_mode; in twl6040_headset_power_get_enum()
502 int high_perf = ucontrol->value.enumerated.item[0]; in twl6040_headset_power_put_enum()
505 if (!priv->hs_power_mode_locked) in twl6040_headset_power_put_enum()
509 priv->hs_power_mode = high_perf; in twl6040_headset_power_put_enum()
520 ucontrol->value.enumerated.item[0] = priv->pll_power_mode; in twl6040_pll_get_enum()
531 priv->pll_power_mode = ucontrol->value.enumerated.item[0]; in twl6040_pll_put_enum()
541 return -1; /* -1dB */ in twl6040_get_dl1_gain()
549 return -8; /* -8dB */ in twl6040_get_dl1_gain()
552 return -1; /* -1dB */ in twl6040_get_dl1_gain()
562 return priv->pll_power_mode; in twl6040_get_clk_id()
569 return -EINVAL; in twl6040_get_trim_value()
611 /* Left HS PDM data routed to Right HSDAC */
615 /* Left HF PDM data routed to Right HFDAC */
739 /* Stream -> DAC mapping */
753 /* ADC -> Stream mapping */
782 {"Headset Left Playback", "Line-In amp", "AFMAmpL"},
785 {"Headset Right Playback", "Line-In amp", "AFMAmpR"},
799 {"Handsfree Left Playback", "Line-In amp", "AFMAmpL"},
802 {"Handsfree Right Playback", "Line-In amp", "AFMAmpR"},
820 {"Vibra Left Playback", "Audio PDM", "VIBRA DAC"},
821 {"Vibra Right Playback", "Audio PDM", "VIBRA DAC"},
845 if (priv->codec_powered) { in twl6040_set_bias_level()
856 priv->codec_powered = 1; in twl6040_set_bias_level()
862 if (!priv->codec_powered) in twl6040_set_bias_level()
866 priv->codec_powered = 0; in twl6040_set_bias_level()
876 struct snd_soc_component *component = dai->component; in twl6040_startup()
879 snd_pcm_hw_constraint_list(substream->runtime, 0, in twl6040_startup()
881 &sysclk_constraints[priv->pll_power_mode]); in twl6040_startup()
890 struct snd_soc_component *component = dai->component; in twl6040_hw_params()
901 if (unlikely(priv->pll == TWL6040_SYSCLK_SEL_HPPLL)) { in twl6040_hw_params()
902 dev_err(component->dev, "HPPLL does not support rate %d\n", in twl6040_hw_params()
904 return -EINVAL; in twl6040_hw_params()
906 priv->sysclk = 17640000; in twl6040_hw_params()
913 priv->sysclk = 19200000; in twl6040_hw_params()
916 dev_err(component->dev, "unsupported rate %d\n", rate); in twl6040_hw_params()
917 return -EINVAL; in twl6040_hw_params()
926 struct snd_soc_component *component = dai->component; in twl6040_prepare()
931 if (!priv->sysclk) { in twl6040_prepare()
932 dev_err(component->dev, in twl6040_prepare()
934 return -EINVAL; in twl6040_prepare()
937 ret = twl6040_set_pll(twl6040, priv->pll, priv->clk_in, priv->sysclk); in twl6040_prepare()
939 dev_err(component->dev, "Can not set PLL (%d)\n", ret); in twl6040_prepare()
940 return -EPERM; in twl6040_prepare()
949 struct snd_soc_component *component = codec_dai->component; in twl6040_set_dai_sysclk()
955 priv->pll = clk_id; in twl6040_set_dai_sysclk()
956 priv->clk_in = freq; in twl6040_set_dai_sysclk()
959 dev_err(component->dev, "unknown clk_id %d\n", clk_id); in twl6040_set_dai_sysclk()
960 return -EINVAL; in twl6040_set_dai_sysclk()
967 int mute) in twl6040_mute_path() argument
980 if (mute) { in twl6040_mute_path()
991 priv->dl1_unmuted = !mute; in twl6040_mute_path()
997 if (mute) { in twl6040_mute_path()
1007 priv->dl2_unmuted = !mute; in twl6040_mute_path()
1014 static int twl6040_digital_mute(struct snd_soc_dai *dai, int mute) in twl6040_digital_mute() argument
1016 switch (dai->id) { in twl6040_digital_mute()
1018 twl6040_mute_path(dai->component, TWL6040_DAI_DL1, mute); in twl6040_digital_mute()
1019 twl6040_mute_path(dai->component, TWL6040_DAI_DL2, mute); in twl6040_digital_mute()
1023 twl6040_mute_path(dai->component, dai->id, mute); in twl6040_digital_mute()
1042 .name = "twl6040-legacy",
1061 .name = "twl6040-ul",
1073 .name = "twl6040-dl1",
1085 .name = "twl6040-dl2",
1097 .name = "twl6040-vib",
1113 struct platform_device *pdev = to_platform_device(component->dev); in twl6040_probe()
1116 priv = devm_kzalloc(component->dev, sizeof(*priv), GFP_KERNEL); in twl6040_probe()
1118 return -ENOMEM; in twl6040_probe()
1122 priv->component = component; in twl6040_probe()
1124 priv->plug_irq = platform_get_irq(pdev, 0); in twl6040_probe()
1125 if (priv->plug_irq < 0) { in twl6040_probe()
1126 dev_err(component->dev, "invalid irq: %d\n", priv->plug_irq); in twl6040_probe()
1127 return priv->plug_irq; in twl6040_probe()
1130 INIT_DELAYED_WORK(&priv->hs_jack.work, twl6040_accessory_work); in twl6040_probe()
1132 mutex_init(&priv->mutex); in twl6040_probe()
1134 ret = request_threaded_irq(priv->plug_irq, NULL, in twl6040_probe()
1139 dev_err(component->dev, "PLUG IRQ request failed: %d\n", ret); in twl6040_probe()
1153 free_irq(priv->plug_irq, component); in twl6040_remove()
1176 return devm_snd_soc_register_component(&pdev->dev, in twl6040_codec_probe()
1183 .name = "twl6040-codec",