Lines Matching +full:ramp +full:- +full:up
1 // SPDX-License-Identifier: GPL-2.0-only
3 * cs4349.c -- CS4349 ALSA Soc Audio driver
26 #include <sound/soc-dapm.h>
33 { 2, 0x00 }, /* r02 - Mode Control */
34 { 3, 0x09 }, /* r03 - Volume, Mixing and Inversion Control */
35 { 4, 0x81 }, /* r04 - Mute Control */
36 { 5, 0x00 }, /* r05 - Channel A Volume Control */
37 { 6, 0x00 }, /* r06 - Channel B Volume Control */
38 { 7, 0xB1 }, /* r07 - Ramp and Filter Control */
39 { 8, 0x1C }, /* r08 - Misc. Control */
73 struct snd_soc_component *component = codec_dai->component; in cs4349_set_dai_fmt()
83 cs4349->mode = format & SND_SOC_DAIFMT_FORMAT_MASK; in cs4349_set_dai_fmt()
86 return -EINVAL; in cs4349_set_dai_fmt()
96 struct snd_soc_component *component = dai->component; in cs4349_pcm_hw_params()
100 cs4349->rate = params_rate(params); in cs4349_pcm_hw_params()
102 switch (cs4349->mode) { in cs4349_pcm_hw_params()
118 return -EINVAL; in cs4349_pcm_hw_params()
122 return -EINVAL; in cs4349_pcm_hw_params()
135 struct snd_soc_component *component = dai->component; in cs4349_mute()
145 static DECLARE_TLV_DB_SCALE(dig_tlv, -12750, 50, 0);
163 "Immediate", "Zero Cross", "Soft Ramp", "SR on ZC",
195 SOC_ENUM("De-Emphasis Control", deemph_enum),
196 SOC_ENUM("Soft Ramp Zero Cross Control", softr_zeroc_enum),
201 SOC_SINGLE("Auto-Mute Switch", CS4349_MUTE, 7, 1, 0),
203 SOC_SINGLE("Soft Ramp Up Switch", CS4349_RMPFLT, 5, 1, 0),
204 SOC_SINGLE("Soft Ramp Down Switch", CS4349_RMPFLT, 4, 1, 0),
281 cs4349 = devm_kzalloc(&client->dev, sizeof(*cs4349), GFP_KERNEL); in cs4349_i2c_probe()
283 return -ENOMEM; in cs4349_i2c_probe()
285 cs4349->regmap = devm_regmap_init_i2c(client, &cs4349_regmap); in cs4349_i2c_probe()
286 if (IS_ERR(cs4349->regmap)) { in cs4349_i2c_probe()
287 ret = PTR_ERR(cs4349->regmap); in cs4349_i2c_probe()
288 dev_err(&client->dev, "regmap_init() failed: %d\n", ret); in cs4349_i2c_probe()
293 cs4349->reset_gpio = devm_gpiod_get_optional(&client->dev, in cs4349_i2c_probe()
295 if (IS_ERR(cs4349->reset_gpio)) in cs4349_i2c_probe()
296 return PTR_ERR(cs4349->reset_gpio); in cs4349_i2c_probe()
298 gpiod_set_value_cansleep(cs4349->reset_gpio, 1); in cs4349_i2c_probe()
302 return devm_snd_soc_register_component(&client->dev, in cs4349_i2c_probe()
312 gpiod_set_value_cansleep(cs4349->reset_gpio, 0); in cs4349_i2c_remove()
321 ret = regmap_update_bits(cs4349->regmap, CS4349_MISC, PWR_DWN, PWR_DWN); in cs4349_runtime_suspend()
325 regcache_cache_only(cs4349->regmap, true); in cs4349_runtime_suspend()
328 gpiod_set_value_cansleep(cs4349->reset_gpio, 0); in cs4349_runtime_suspend()
338 ret = regmap_update_bits(cs4349->regmap, CS4349_MISC, PWR_DWN, 0); in cs4349_runtime_resume()
342 gpiod_set_value_cansleep(cs4349->reset_gpio, 1); in cs4349_runtime_resume()
344 regcache_cache_only(cs4349->regmap, false); in cs4349_runtime_resume()
345 regcache_sync(cs4349->regmap); in cs4349_runtime_resume()