Lines Matching +full:clock +full:- +full:output +full:- +full:names

2  * wm8955.c  --  WM8955 ALSA SoC Audio driver
54 0x0079, /* R2 - LOUT1 volume */
55 0x0079, /* R3 - ROUT1 volume */
57 0x0008, /* R5 - DAC Control */
59 0x000A, /* R7 - Audio Interface */
60 0x0000, /* R8 - Sample Rate */
62 0x00FF, /* R10 - Left DAC volume */
63 0x00FF, /* R11 - Right DAC volume */
64 0x000F, /* R12 - Bass control */
65 0x000F, /* R13 - Treble control */
67 0x0000, /* R15 - Reset */
75 0x00C1, /* R23 - Additional control (1) */
76 0x0000, /* R24 - Additional control (2) */
77 0x0000, /* R25 - Power Management (1) */
78 0x0000, /* R26 - Power Management (2) */
79 0x0000, /* R27 - Additional Control (3) */
86 0x0050, /* R34 - Left out Mix (1) */
87 0x0050, /* R35 - Left out Mix (2) */
88 0x0050, /* R36 - Right out Mix (1) */
89 0x0050, /* R37 - Right Out Mix (2) */
90 0x0050, /* R38 - Mono out Mix (1) */
91 0x0050, /* R39 - Mono out Mix (2) */
92 0x0079, /* R40 - LOUT2 volume */
93 0x0079, /* R41 - ROUT2 volume */
94 0x0079, /* R42 - MONOOUT volume */
95 0x0000, /* R43 - Clocking / PLL */
96 0x0103, /* R44 - PLL Control 1 */
97 0x0024, /* R45 - PLL Control 2 */
98 0x01BA, /* R46 - PLL Control 3 */
111 0x0000, /* R59 - PLL Control 4 */
137 /* The oscilator should run at should be 90-100MHz, and in wm8995_pll_factors()
139 * output path to generate the system clock. The clock table in wm8995_pll_factors()
143 pll->outdiv = 1; in wm8995_pll_factors()
146 pll->outdiv = 0; in wm8995_pll_factors()
156 pll->n = Ndiv; in wm8995_pll_factors()
160 /* Calculate fractional part - scale up so we can round. */ in wm8995_pll_factors()
171 pll->k = K / 10; in wm8995_pll_factors()
173 dev_dbg(dev, "N=%x K=%x OUTDIV=%x\n", pll->n, pll->k, pll->outdiv); in wm8995_pll_factors()
179 * output frequencies have been rounded to the standard frequencies
234 int sr = -1; in wm8955_configure_clocking()
238 if (wm8955->fs == 0) in wm8955_configure_clocking()
239 wm8955->fs = 8000; in wm8955_configure_clocking()
241 /* Can we generate an exact output? */ in wm8955_configure_clocking()
243 if (wm8955->fs != clock_cfgs[i].fs) in wm8955_configure_clocking()
247 if (wm8955->mclk_rate == clock_cfgs[i].mclk) in wm8955_configure_clocking()
252 if (sr == -1) { in wm8955_configure_clocking()
253 dev_err(codec->dev, "Sample rate %dHz unsupported\n", in wm8955_configure_clocking()
254 wm8955->fs); in wm8955_configure_clocking()
255 WARN_ON(sr == -1); in wm8955_configure_clocking()
256 return -EINVAL; in wm8955_configure_clocking()
260 /* If we can't generate the right clock from MCLK then in wm8955_configure_clocking()
262 * appropriate clock. in wm8955_configure_clocking()
268 ret = wm8995_pll_factors(codec->dev, wm8955->mclk_rate, in wm8955_configure_clocking()
271 dev_err(codec->dev, in wm8955_configure_clocking()
273 wm8955->fs, wm8955->mclk_rate); in wm8955_configure_clocking()
274 return -EINVAL; in wm8955_configure_clocking()
319 struct snd_soc_codec *codec = w->codec; in wm8955_sysclk()
322 /* Always disable the clocks - if we're doing reconfiguration this in wm8955_sysclk()
337 ret = -EINVAL; in wm8955_sysclk()
354 if (wm8955->deemph) { in wm8955_set_deemph()
357 if (abs(deemph_settings[i] - wm8955->fs) < in wm8955_set_deemph()
358 abs(deemph_settings[best] - wm8955->fs)) in wm8955_set_deemph()
367 dev_dbg(codec->dev, "Set deemphasis %d\n", val); in wm8955_set_deemph()
379 ucontrol->value.enumerated.item[0] = wm8955->deemph; in wm8955_get_deemph()
388 int deemph = ucontrol->value.enumerated.item[0]; in wm8955_put_deemph()
391 return -EINVAL; in wm8955_put_deemph()
393 wm8955->deemph = deemph; in wm8955_put_deemph()
419 static const DECLARE_TLV_DB_SCALE(digital_tlv, -12750, 50, 1);
420 static const DECLARE_TLV_DB_SCALE(atten_tlv, -600, 600, 0);
421 static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0);
422 static const DECLARE_TLV_DB_SCALE(mono_tlv, -2100, 300, 0);
423 static const DECLARE_TLV_DB_SCALE(out_tlv, -12100, 100, 1);
424 static const DECLARE_TLV_DB_SCALE(treble_tlv, -1200, 150, 1);
493 SND_SOC_DAPM_INPUT("MONOIN-"),
514 /* The names are chosen to make the control names nice */
534 { "Mono Input", NULL, "MONOIN-" },
577 struct snd_soc_dapm_context *dapm = &codec->dapm; in wm8955_add_widgets()
594 struct snd_soc_codec *codec = dai->codec; in wm8955_hw_params()
613 return -EINVAL; in wm8955_hw_params()
618 wm8955->fs = params_rate(params); in wm8955_hw_params()
643 struct snd_soc_codec *codec = dai->codec; in wm8955_set_sysclk()
650 priv->mclk_rate = freq /= 2; in wm8955_set_sysclk()
653 priv->mclk_rate = freq; in wm8955_set_sysclk()
662 return -EINVAL; in wm8955_set_sysclk()
665 dev_dbg(dai->dev, "Clock source is %d at %uHz\n", clk_id, freq); in wm8955_set_sysclk()
672 struct snd_soc_codec *codec = dai->codec; in wm8955_set_fmt()
682 return -EINVAL; in wm8955_set_fmt()
700 return -EINVAL; in wm8955_set_fmt()
714 return -EINVAL; in wm8955_set_fmt()
734 return -EINVAL; in wm8955_set_fmt()
738 return -EINVAL; in wm8955_set_fmt()
751 struct snd_soc_codec *codec = codec_dai->codec; in wm8955_digital_mute()
768 u16 *reg_cache = codec->reg_cache; in wm8955_set_bias_level()
788 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { in wm8955_set_bias_level()
789 ret = regulator_bulk_enable(ARRAY_SIZE(wm8955->supplies), in wm8955_set_bias_level()
790 wm8955->supplies); in wm8955_set_bias_level()
792 dev_err(codec->dev, in wm8955_set_bias_level()
801 for (i = 0; i < codec->driver->reg_cache_size; i++) { in wm8955_set_bias_level()
848 regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), in wm8955_set_bias_level()
849 wm8955->supplies); in wm8955_set_bias_level()
852 codec->dapm.bias_level = level; in wm8955_set_bias_level()
869 .name = "wm8955-hifi",
902 struct wm8955_pdata *pdata = dev_get_platdata(codec->dev); in wm8955_probe()
903 u16 *reg_cache = codec->reg_cache; in wm8955_probe()
906 ret = snd_soc_codec_set_cache_io(codec, 7, 9, wm8955->control_type); in wm8955_probe()
908 dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); in wm8955_probe()
912 for (i = 0; i < ARRAY_SIZE(wm8955->supplies); i++) in wm8955_probe()
913 wm8955->supplies[i].supply = wm8955_supply_names[i]; in wm8955_probe()
915 ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8955->supplies), in wm8955_probe()
916 wm8955->supplies); in wm8955_probe()
918 dev_err(codec->dev, "Failed to request supplies: %d\n", ret); in wm8955_probe()
922 ret = regulator_bulk_enable(ARRAY_SIZE(wm8955->supplies), in wm8955_probe()
923 wm8955->supplies); in wm8955_probe()
925 dev_err(codec->dev, "Failed to enable supplies: %d\n", ret); in wm8955_probe()
931 dev_err(codec->dev, "Failed to issue reset: %d\n", ret); in wm8955_probe()
935 /* Change some default settings - latch VU and enable ZC */ in wm8955_probe()
960 if (pdata->out2_speaker) in wm8955_probe()
964 if (pdata->monoin_diff) in wm8955_probe()
972 regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); in wm8955_probe()
978 regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); in wm8955_probe()
980 regulator_bulk_free(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); in wm8955_probe()
989 regulator_bulk_free(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); in wm8955_remove()
1013 return -ENOMEM; in wm8955_i2c_probe()
1016 wm8955->control_type = SND_SOC_I2C; in wm8955_i2c_probe()
1018 ret = snd_soc_register_codec(&i2c->dev, in wm8955_i2c_probe()
1027 snd_soc_unregister_codec(&client->dev); in wm8955_i2c_remove()