Lines Matching +full:vd +full:- +full:supply

6  * Copyright 2007-2009 Freescale Semiconductor, Inc.  This file is licensed
15 * - Software mode is supported. Stand-alone mode is not supported.
16 * - Only I2C is supported, not SPI
17 * - Support for master and slave mode
18 * - The machine driver's 'startup' function must call
20 * - Only I2S and left-justified modes are supported
21 * - Power management is supported
51 #define CS4270_NUMREGS (CS4270_LASTREG - CS4270_FIRSTREG + 1)
101 /* Power-on default values for the registers
103 * This array contains the power-on default values of the registers, with the
118 "va", "vd", "vlc"
125 unsigned int mode; /* The mode (I2S or left-justified) */
153 * struct cs4270_mode_ratios - clock ratio tables
175 * double-speed instead of quad-speed. However, the CS4270 errata states
176 * that divide-By-1.5 can cause failures, so we avoid that mode where
179 * Errata: There is an errata for the CS4270 where divide-by-1.5 does not
180 * work if Vd is 3.3V. If this effects you, select the
182 * never select any sample rates that require divide-by-1.5.
222 * cs4270_set_dai_sysclk - determine the CS4270 samples rates.
233 * supported values - 64, 96, 128, 192, 256, 384, 512, 768, and 1024.
251 struct snd_soc_component *component = codec_dai->component;
254 cs4270->mclk = freq;
259 * cs4270_set_dai_fmt - configure the codec for the selected audio format
267 * SND_SOC_DAIFMT_LEFT_J. The CS4270 codec also supports right-justified
274 struct snd_soc_component *component = codec_dai->component;
281 cs4270->mode = format & SND_SOC_DAIFMT_FORMAT_MASK;
284 dev_err(component->dev, "invalid dai format\n");
285 return -EINVAL;
291 cs4270->slave_mode = 1;
294 cs4270->slave_mode = 0;
298 dev_err(component->dev, "Unknown master/slave configuration\n");
299 return -EINVAL;
306 * cs4270_hw_params - program the CS4270 with the given hardware parameters.
314 * The .ops functions are used to provide board-specific data, like input
323 struct snd_soc_component *component = dai->component;
334 ratio = cs4270->mclk / rate; /* MCLK/LRCK ratio */
343 dev_err(component->dev, "could not find matching ratio\n");
344 return -EINVAL;
353 if (cs4270->slave_mode)
360 dev_err(component->dev, "i2c write failed\n");
369 switch (cs4270->mode) {
377 dev_err(component->dev, "unknown dai format\n");
378 return -EINVAL;
383 dev_err(component->dev, "i2c write failed\n");
391 * cs4270_dai_mute - enable/disable the CS4270 external mute
403 struct snd_soc_component *component = dai->component;
413 reg6 |= cs4270->manual_mute;
420 * cs4270_soc_put_mute - put callback for the 'Master Playback switch'
438 int left = !ucontrol->value.integer.value[0];
439 int right = !ucontrol->value.integer.value[1];
441 cs4270->manual_mute = (left ? CS4270_MUTE_DAC_A : 0) |
447 /* A list of non-DAPM controls that the CS4270 supports */
454 SOC_SINGLE("De-emphasis filter", CS4270_TRANS, 0, 1, 0),
456 SOC_SINGLE("Auto-Mute Switch", CS4270_MUTE, 5, 1, 0),
471 .name = "cs4270-hifi",
494 * cs4270_probe - ASoC probe function
505 /* Disable auto-mute. This feature appears to be buggy. In some
506 * situations, auto-mute will not deactivate when it should, so we want
508 * re-enabled it by using the controls.
512 dev_err(component->dev, "i2c write failed\n");
519 * re-enabled it by using the controls.
524 dev_err(component->dev, "i2c write failed\n");
528 ret = regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies),
529 cs4270->supplies);
535 * cs4270_remove - ASoC remove function
544 regulator_bulk_disable(ARRAY_SIZE(cs4270->supplies), cs4270->supplies);
549 /* This suspend/resume implementation can handle both - a simple standby
571 regulator_bulk_disable(ARRAY_SIZE(cs4270->supplies),
572 cs4270->supplies);
582 ret = regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies),
583 cs4270->supplies);
592 regcache_sync(cs4270->regmap);
594 /* ... then disable the power-down bits */
625 * cs4270_of_match - the device tree bindings
647 * cs4270_i2c_remove - deinitialize the I2C interface of the CS4270
657 gpiod_set_value_cansleep(cs4270->reset_gpio, 0);
661 * cs4270_i2c_probe - initialize the I2C interface of the CS4270
673 cs4270 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs4270_private),
676 return -ENOMEM;
678 /* get the power supply regulators */
680 cs4270->supplies[i].supply = supply_names[i];
682 ret = devm_regulator_bulk_get(&i2c_client->dev,
683 ARRAY_SIZE(cs4270->supplies),
684 cs4270->supplies);
689 cs4270->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev, "reset",
691 if (IS_ERR(cs4270->reset_gpio)) {
692 dev_dbg(&i2c_client->dev, "Error getting CS4270 reset GPIO\n");
693 return PTR_ERR(cs4270->reset_gpio);
696 if (cs4270->reset_gpio) {
697 dev_dbg(&i2c_client->dev, "Found reset GPIO\n");
698 gpiod_set_value_cansleep(cs4270->reset_gpio, 1);
704 cs4270->regmap = devm_regmap_init_i2c(i2c_client, &cs4270_regmap);
705 if (IS_ERR(cs4270->regmap))
706 return PTR_ERR(cs4270->regmap);
709 ret = regmap_read(cs4270->regmap, CS4270_CHIPID, &val);
711 dev_err(&i2c_client->dev, "failed to read i2c at addr %X\n",
712 i2c_client->addr);
717 dev_err(&i2c_client->dev, "device at addr %X is not a CS4270\n",
718 i2c_client->addr);
719 return -ENODEV;
722 dev_info(&i2c_client->dev, "found device at i2c address %X\n",
723 i2c_client->addr);
724 dev_info(&i2c_client->dev, "hardware revision %X\n", val & 0xF);
728 ret = devm_snd_soc_register_component(&i2c_client->dev,
734 * cs4270_id - I2C device IDs supported by this driver
743 * cs4270_i2c_driver - I2C device identification