aic31xx           154 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx;
aic31xx           327 sound/soc/codecs/tlv320aic31xx.c static int aic31xx_wait_bits(struct aic31xx_priv *aic31xx, unsigned int reg,
aic31xx           333 sound/soc/codecs/tlv320aic31xx.c 	int ret = regmap_read(aic31xx->regmap, reg, &bits);
aic31xx           337 sound/soc/codecs/tlv320aic31xx.c 		ret = regmap_read(aic31xx->regmap, reg, &bits);
aic31xx           341 sound/soc/codecs/tlv320aic31xx.c 		dev_err(aic31xx->dev,
aic31xx           356 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
aic31xx           391 sound/soc/codecs/tlv320aic31xx.c 		return aic31xx_wait_bits(aic31xx, reg, mask, mask, 5000, 100);
aic31xx           393 sound/soc/codecs/tlv320aic31xx.c 		return aic31xx_wait_bits(aic31xx, reg, mask, 0, 5000, 100);
aic31xx           452 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
aic31xx           459 sound/soc/codecs/tlv320aic31xx.c 				    aic31xx->micbias_vg <<
aic31xx           715 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
aic31xx           717 sound/soc/codecs/tlv320aic31xx.c 	if (!(aic31xx->codec_type & DAC31XX_BIT))
aic31xx           724 sound/soc/codecs/tlv320aic31xx.c 	if (aic31xx->codec_type & AIC31XX_STEREO_CLASS_D_BIT)
aic31xx           739 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
aic31xx           742 sound/soc/codecs/tlv320aic31xx.c 	if (aic31xx->codec_type & DAC31XX_BIT) {
aic31xx           766 sound/soc/codecs/tlv320aic31xx.c 	if (aic31xx->codec_type & AIC31XX_STEREO_CLASS_D_BIT) {
aic31xx           796 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
aic31xx           803 sound/soc/codecs/tlv320aic31xx.c 	if (!aic31xx->sysclk || !aic31xx->p_div) {
aic31xx           807 sound/soc/codecs/tlv320aic31xx.c 	mclk_p = aic31xx->sysclk / aic31xx->p_div;
aic31xx           851 sound/soc/codecs/tlv320aic31xx.c 			    (aic31xx->p_div << 4) | 0x01);
aic31xx           880 sound/soc/codecs/tlv320aic31xx.c 	aic31xx->rate_div_line = i;
aic31xx           886 sound/soc/codecs/tlv320aic31xx.c 		aic31xx->p_div,
aic31xx           958 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
aic31xx           963 sound/soc/codecs/tlv320aic31xx.c 	    aic31xx->master_dapm_route_applied) {
aic31xx           970 sound/soc/codecs/tlv320aic31xx.c 		if (!ret && !(aic31xx->codec_type & DAC31XX_BIT))
aic31xx           978 sound/soc/codecs/tlv320aic31xx.c 		aic31xx->master_dapm_route_applied = false;
aic31xx           980 sound/soc/codecs/tlv320aic31xx.c 		   !aic31xx->master_dapm_route_applied) {
aic31xx           987 sound/soc/codecs/tlv320aic31xx.c 		if (!ret && !(aic31xx->codec_type & DAC31XX_BIT))
aic31xx           995 sound/soc/codecs/tlv320aic31xx.c 		aic31xx->master_dapm_route_applied = true;
aic31xx          1088 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
aic31xx          1098 sound/soc/codecs/tlv320aic31xx.c 		dev_err(aic31xx->dev, "%s: Too high mclk frequency %u\n",
aic31xx          1102 sound/soc/codecs/tlv320aic31xx.c 	aic31xx->p_div = i;
aic31xx          1105 sound/soc/codecs/tlv320aic31xx.c 		if (aic31xx_divs[i].mclk_p == freq / aic31xx->p_div)
aic31xx          1108 sound/soc/codecs/tlv320aic31xx.c 		dev_err(aic31xx->dev, "%s: Unsupported frequency %d\n",
aic31xx          1117 sound/soc/codecs/tlv320aic31xx.c 	aic31xx->sysclk = freq;
aic31xx          1127 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = disable_nb->aic31xx;
aic31xx          1134 sound/soc/codecs/tlv320aic31xx.c 		if (aic31xx->gpio_reset)
aic31xx          1135 sound/soc/codecs/tlv320aic31xx.c 			gpiod_set_value(aic31xx->gpio_reset, 1);
aic31xx          1137 sound/soc/codecs/tlv320aic31xx.c 		regcache_mark_dirty(aic31xx->regmap);
aic31xx          1138 sound/soc/codecs/tlv320aic31xx.c 		dev_dbg(aic31xx->dev, "## %s: DISABLE received\n", __func__);
aic31xx          1144 sound/soc/codecs/tlv320aic31xx.c static int aic31xx_reset(struct aic31xx_priv *aic31xx)
aic31xx          1148 sound/soc/codecs/tlv320aic31xx.c 	if (aic31xx->gpio_reset) {
aic31xx          1149 sound/soc/codecs/tlv320aic31xx.c 		gpiod_set_value(aic31xx->gpio_reset, 1);
aic31xx          1151 sound/soc/codecs/tlv320aic31xx.c 		gpiod_set_value(aic31xx->gpio_reset, 0);
aic31xx          1153 sound/soc/codecs/tlv320aic31xx.c 		ret = regmap_write(aic31xx->regmap, AIC31XX_RESET, 1);
aic31xx          1162 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
aic31xx          1167 sound/soc/codecs/tlv320aic31xx.c 		aic31xx_divs[aic31xx->rate_div_line].rate);
aic31xx          1172 sound/soc/codecs/tlv320aic31xx.c 	if (aic31xx_divs[aic31xx->rate_div_line].nadc)
aic31xx          1174 sound/soc/codecs/tlv320aic31xx.c 	if (aic31xx_divs[aic31xx->rate_div_line].madc)
aic31xx          1195 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
aic31xx          1198 sound/soc/codecs/tlv320aic31xx.c 	ret = regulator_bulk_enable(ARRAY_SIZE(aic31xx->supplies),
aic31xx          1199 sound/soc/codecs/tlv320aic31xx.c 				    aic31xx->supplies);
aic31xx          1203 sound/soc/codecs/tlv320aic31xx.c 	regcache_cache_only(aic31xx->regmap, false);
aic31xx          1206 sound/soc/codecs/tlv320aic31xx.c 	ret = aic31xx_reset(aic31xx);
aic31xx          1208 sound/soc/codecs/tlv320aic31xx.c 		dev_err(aic31xx->dev, "Could not reset device: %d\n", ret);
aic31xx          1210 sound/soc/codecs/tlv320aic31xx.c 	ret = regcache_sync(aic31xx->regmap);
aic31xx          1214 sound/soc/codecs/tlv320aic31xx.c 		regcache_cache_only(aic31xx->regmap, true);
aic31xx          1215 sound/soc/codecs/tlv320aic31xx.c 		regulator_bulk_disable(ARRAY_SIZE(aic31xx->supplies),
aic31xx          1216 sound/soc/codecs/tlv320aic31xx.c 				       aic31xx->supplies);
aic31xx          1225 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
aic31xx          1227 sound/soc/codecs/tlv320aic31xx.c 	regcache_cache_only(aic31xx->regmap, true);
aic31xx          1228 sound/soc/codecs/tlv320aic31xx.c 	regulator_bulk_disable(ARRAY_SIZE(aic31xx->supplies),
aic31xx          1229 sound/soc/codecs/tlv320aic31xx.c 			       aic31xx->supplies);
aic31xx          1269 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
aic31xx          1271 sound/soc/codecs/tlv320aic31xx.c 	aic31xx->jack = jack;
aic31xx          1274 sound/soc/codecs/tlv320aic31xx.c 	regmap_write(aic31xx->regmap, AIC31XX_HSDETECT,
aic31xx          1282 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component);
aic31xx          1285 sound/soc/codecs/tlv320aic31xx.c 	dev_dbg(aic31xx->dev, "## %s\n", __func__);
aic31xx          1287 sound/soc/codecs/tlv320aic31xx.c 	aic31xx->component = component;
aic31xx          1289 sound/soc/codecs/tlv320aic31xx.c 	for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++) {
aic31xx          1290 sound/soc/codecs/tlv320aic31xx.c 		aic31xx->disable_nb[i].nb.notifier_call =
aic31xx          1292 sound/soc/codecs/tlv320aic31xx.c 		aic31xx->disable_nb[i].aic31xx = aic31xx;
aic31xx          1294 sound/soc/codecs/tlv320aic31xx.c 						aic31xx->supplies[i].consumer,
aic31xx          1295 sound/soc/codecs/tlv320aic31xx.c 						&aic31xx->disable_nb[i].nb);
aic31xx          1304 sound/soc/codecs/tlv320aic31xx.c 	regcache_cache_only(aic31xx->regmap, true);
aic31xx          1305 sound/soc/codecs/tlv320aic31xx.c 	regcache_mark_dirty(aic31xx->regmap);
aic31xx          1404 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx = data;
aic31xx          1405 sound/soc/codecs/tlv320aic31xx.c 	struct device *dev = aic31xx->dev;
aic31xx          1410 sound/soc/codecs/tlv320aic31xx.c 	ret = regmap_read(aic31xx->regmap, AIC31XX_INTRDACFLAG, &value);
aic31xx          1429 sound/soc/codecs/tlv320aic31xx.c 		ret = regmap_read(aic31xx->regmap, AIC31XX_INTRDACFLAG2,
aic31xx          1440 sound/soc/codecs/tlv320aic31xx.c 		ret = regmap_read(aic31xx->regmap, AIC31XX_HSDETECT, &val);
aic31xx          1458 sound/soc/codecs/tlv320aic31xx.c 		if (aic31xx->jack)
aic31xx          1459 sound/soc/codecs/tlv320aic31xx.c 			snd_soc_jack_report(aic31xx->jack, status,
aic31xx          1469 sound/soc/codecs/tlv320aic31xx.c 	ret = regmap_read(aic31xx->regmap, AIC31XX_OFFLAG, &value);
aic31xx          1507 sound/soc/codecs/tlv320aic31xx.c 	struct aic31xx_priv *aic31xx;
aic31xx          1514 sound/soc/codecs/tlv320aic31xx.c 	aic31xx = devm_kzalloc(&i2c->dev, sizeof(*aic31xx), GFP_KERNEL);
aic31xx          1515 sound/soc/codecs/tlv320aic31xx.c 	if (!aic31xx)
aic31xx          1518 sound/soc/codecs/tlv320aic31xx.c 	aic31xx->regmap = devm_regmap_init_i2c(i2c, &aic31xx_i2c_regmap);
aic31xx          1519 sound/soc/codecs/tlv320aic31xx.c 	if (IS_ERR(aic31xx->regmap)) {
aic31xx          1520 sound/soc/codecs/tlv320aic31xx.c 		ret = PTR_ERR(aic31xx->regmap);
aic31xx          1525 sound/soc/codecs/tlv320aic31xx.c 	aic31xx->dev = &i2c->dev;
aic31xx          1526 sound/soc/codecs/tlv320aic31xx.c 	aic31xx->irq = i2c->irq;
aic31xx          1528 sound/soc/codecs/tlv320aic31xx.c 	aic31xx->codec_type = id->driver_data;
aic31xx          1530 sound/soc/codecs/tlv320aic31xx.c 	dev_set_drvdata(aic31xx->dev, aic31xx);
aic31xx          1532 sound/soc/codecs/tlv320aic31xx.c 	fwnode_property_read_u32(aic31xx->dev->fwnode, "ai31xx-micbias-vg",
aic31xx          1538 sound/soc/codecs/tlv320aic31xx.c 		aic31xx->micbias_vg = micbias_value;
aic31xx          1541 sound/soc/codecs/tlv320aic31xx.c 		dev_err(aic31xx->dev, "Bad ai31xx-micbias-vg value %d\n",
aic31xx          1543 sound/soc/codecs/tlv320aic31xx.c 		aic31xx->micbias_vg = MICBIAS_2_0V;
aic31xx          1546 sound/soc/codecs/tlv320aic31xx.c 	if (dev_get_platdata(aic31xx->dev)) {
aic31xx          1547 sound/soc/codecs/tlv320aic31xx.c 		memcpy(&aic31xx->pdata, dev_get_platdata(aic31xx->dev), sizeof(aic31xx->pdata));
aic31xx          1548 sound/soc/codecs/tlv320aic31xx.c 		aic31xx->codec_type = aic31xx->pdata.codec_type;
aic31xx          1549 sound/soc/codecs/tlv320aic31xx.c 		aic31xx->micbias_vg = aic31xx->pdata.micbias_vg;
aic31xx          1552 sound/soc/codecs/tlv320aic31xx.c 	aic31xx->gpio_reset = devm_gpiod_get_optional(aic31xx->dev, "reset",
aic31xx          1554 sound/soc/codecs/tlv320aic31xx.c 	if (IS_ERR(aic31xx->gpio_reset)) {
aic31xx          1555 sound/soc/codecs/tlv320aic31xx.c 		if (PTR_ERR(aic31xx->gpio_reset) != -EPROBE_DEFER)
aic31xx          1556 sound/soc/codecs/tlv320aic31xx.c 			dev_err(aic31xx->dev, "not able to acquire gpio\n");
aic31xx          1557 sound/soc/codecs/tlv320aic31xx.c 		return PTR_ERR(aic31xx->gpio_reset);
aic31xx          1560 sound/soc/codecs/tlv320aic31xx.c 	for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++)
aic31xx          1561 sound/soc/codecs/tlv320aic31xx.c 		aic31xx->supplies[i].supply = aic31xx_supply_names[i];
aic31xx          1563 sound/soc/codecs/tlv320aic31xx.c 	ret = devm_regulator_bulk_get(aic31xx->dev,
aic31xx          1564 sound/soc/codecs/tlv320aic31xx.c 				      ARRAY_SIZE(aic31xx->supplies),
aic31xx          1565 sound/soc/codecs/tlv320aic31xx.c 				      aic31xx->supplies);
aic31xx          1568 sound/soc/codecs/tlv320aic31xx.c 			dev_err(aic31xx->dev,
aic31xx          1573 sound/soc/codecs/tlv320aic31xx.c 	if (aic31xx->irq > 0) {
aic31xx          1574 sound/soc/codecs/tlv320aic31xx.c 		regmap_update_bits(aic31xx->regmap, AIC31XX_GPIO1,
aic31xx          1579 sound/soc/codecs/tlv320aic31xx.c 		regmap_write(aic31xx->regmap, AIC31XX_INT1CTRL,
aic31xx          1585 sound/soc/codecs/tlv320aic31xx.c 		ret = devm_request_threaded_irq(aic31xx->dev, aic31xx->irq,
aic31xx          1588 sound/soc/codecs/tlv320aic31xx.c 						aic31xx);
aic31xx          1590 sound/soc/codecs/tlv320aic31xx.c 			dev_err(aic31xx->dev, "Unable to request IRQ\n");
aic31xx          1595 sound/soc/codecs/tlv320aic31xx.c 	if (aic31xx->codec_type & DAC31XX_BIT)