Lines Matching refs:aic3x

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