Lines Matching defs:aic3x

63 	struct aic3x_priv *aic3x;
210 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
217 aic3x->micbias_vg << MICBIAS_LEVEL_SHIFT);
1001 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
1004 switch (aic3x->model) {
1043 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
1048 int width = aic3x->slot_width;
1076 if (aic3x->sysclk / (128 * pll_q) == fsref) {
1121 codec_clk = (2048 * fsref) / (aic3x->sysclk / 1000);
1156 d = ((2048 * p * fsref) - j * aic3x->sysclk)
1157 * 100 / (aic3x->sysclk/100);
1195 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
1197 int width = aic3x->slot_width;
1203 if (aic3x->dai_fmt == SND_SOC_DAIFMT_DSP_A)
1204 delay += (aic3x->tdm_delay*width + 1);
1205 else if (aic3x->dai_fmt == SND_SOC_DAIFMT_DSP_B)
1206 delay += aic3x->tdm_delay*width;
1235 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
1243 aic3x->sysclk = freq;
1251 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
1259 aic3x->master = 1;
1263 aic3x->master = 0;
1267 aic3x->master = 1;
1272 aic3x->master = 1;
1302 aic3x->dai_fmt = fmt & SND_SOC_DAIFMT_FORMAT_MASK;
1316 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
1348 aic3x->tdm_delay = lsb;
1349 aic3x->slot_width = slot_width;
1363 struct aic3x_priv *aic3x = disable_nb->aic3x;
1370 if (aic3x->gpio_reset)
1371 gpiod_set_value(aic3x->gpio_reset, 1);
1372 regcache_mark_dirty(aic3x->regmap);
1380 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
1385 ret = regulator_bulk_enable(ARRAY_SIZE(aic3x->supplies),
1386 aic3x->supplies);
1389 aic3x->power = 1;
1391 if (aic3x->gpio_reset) {
1393 gpiod_set_value(aic3x->gpio_reset, 0);
1397 regcache_cache_only(aic3x->regmap, false);
1398 regcache_sync(aic3x->regmap);
1424 regcache_mark_dirty(aic3x->regmap);
1425 aic3x->power = 0;
1427 regcache_cache_only(aic3x->regmap, true);
1428 ret = regulator_bulk_disable(ARRAY_SIZE(aic3x->supplies),
1429 aic3x->supplies);
1438 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
1445 aic3x->master) {
1452 if (!aic3x->power)
1455 aic3x->master) {
1462 if (aic3x->power)
1527 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
1570 if (aic3x->model != AIC3X_MODEL_3104) {
1581 switch (aic3x->model) {
1594 aic3x->ocmv << HPOUT_SC_OCMV_SHIFT);
1601 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component);
1604 aic3x->component = component;
1606 for (i = 0; i < ARRAY_SIZE(aic3x->supplies); i++) {
1607 aic3x->disable_nb[i].nb.notifier_call = aic3x_regulator_event;
1608 aic3x->disable_nb[i].aic3x = aic3x;
1610 aic3x->supplies[i].consumer,
1611 &aic3x->disable_nb[i].nb);
1620 regcache_mark_dirty(aic3x->regmap);
1623 if (aic3x->setup) {
1624 if (aic3x->model != AIC3X_MODEL_3104) {
1627 (aic3x->setup->gpio_func[0] & 0xf) << 4);
1629 (aic3x->setup->gpio_func[1] & 0xf) << 4);
1635 switch (aic3x->model) {
1655 switch (aic3x->micbias_vg) {
1661 (aic3x->micbias_vg) << MICBIAS_LEVEL_SHIFT);
1690 static void aic3x_configure_ocmv(struct device *dev, struct aic3x_priv *aic3x)
1699 aic3x->ocmv = value;
1704 dvdd = regulator_get_voltage(aic3x->supplies[1].consumer);
1705 avdd = regulator_get_voltage(aic3x->supplies[2].consumer);
1712 aic3x->ocmv = HPOUT_SC_OCMV_1_8V;
1714 aic3x->ocmv = HPOUT_SC_OCMV_1_65V;
1716 aic3x->ocmv = HPOUT_SC_OCMV_1_5V;
1718 aic3x->ocmv = HPOUT_SC_OCMV_1_35V;
1739 struct aic3x_priv *aic3x;
1745 aic3x = devm_kzalloc(dev, sizeof(struct aic3x_priv), GFP_KERNEL);
1746 if (!aic3x)
1749 aic3x->regmap = regmap;
1750 if (IS_ERR(aic3x->regmap)) {
1751 ret = PTR_ERR(aic3x->regmap);
1755 regcache_cache_only(aic3x->regmap, true);
1757 dev_set_drvdata(dev, aic3x);
1765 aic3x->setup = ai3x_setup;
1771 aic3x->micbias_vg = AIC3X_MICBIAS_2_0V;
1774 aic3x->micbias_vg = AIC3X_MICBIAS_2_5V;
1777 aic3x->micbias_vg = AIC3X_MICBIAS_AVDDV;
1780 aic3x->micbias_vg = AIC3X_MICBIAS_OFF;
1785 aic3x->micbias_vg = AIC3X_MICBIAS_OFF;
1789 aic3x->model = driver_data;
1791 aic3x->gpio_reset = devm_gpiod_get_optional(dev, "reset",
1793 ret = PTR_ERR_OR_ZERO(aic3x->gpio_reset);
1805 aic3x->gpio_reset = devm_gpiod_get(dev, "reset",
1807 ret = PTR_ERR_OR_ZERO(aic3x->gpio_reset);
1811 aic3x->shared_reset = true;
1814 gpiod_set_consumer_name(aic3x->gpio_reset, "tlv320aic3x reset");
1816 for (i = 0; i < ARRAY_SIZE(aic3x->supplies); i++)
1817 aic3x->supplies[i].supply = aic3x_supply_names[i];
1819 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(aic3x->supplies),
1820 aic3x->supplies);
1826 aic3x_configure_ocmv(dev, aic3x);
1828 if (aic3x->model == AIC3X_MODEL_3007) {
1829 ret = regmap_register_patch(aic3x->regmap, aic3007_class_d,
1845 struct aic3x_priv *aic3x = dev_get_drvdata(dev);
1848 if (aic3x->gpio_reset && !aic3x->shared_reset)
1849 gpiod_set_value(aic3x->gpio_reset, 1);