Lines Matching refs:aic3x

67 	struct aic3x_priv *aic3x;  member
216 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); in mic_bias_event() local
223 aic3x->micbias_vg << MICBIAS_LEVEL_SHIFT); in mic_bias_event()
1007 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); in aic3x_add_widgets() local
1010 switch (aic3x->model) { in aic3x_add_widgets()
1048 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); in aic3x_hw_params() local
1053 int width = aic3x->slot_width; in aic3x_hw_params()
1081 if (aic3x->sysclk / (128 * pll_q) == fsref) { in aic3x_hw_params()
1126 codec_clk = (2048 * fsref) / (aic3x->sysclk / 1000); in aic3x_hw_params()
1161 d = ((2048 * p * fsref) - j * aic3x->sysclk) in aic3x_hw_params()
1162 * 100 / (aic3x->sysclk/100); in aic3x_hw_params()
1200 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); in aic3x_prepare() local
1202 int width = aic3x->slot_width; in aic3x_prepare()
1208 if (aic3x->dai_fmt == SND_SOC_DAIFMT_DSP_A) in aic3x_prepare()
1209 delay += (aic3x->tdm_delay*width + 1); in aic3x_prepare()
1210 else if (aic3x->dai_fmt == SND_SOC_DAIFMT_DSP_B) in aic3x_prepare()
1211 delay += aic3x->tdm_delay*width; in aic3x_prepare()
1240 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); in aic3x_set_dai_sysclk() local
1248 aic3x->sysclk = freq; in aic3x_set_dai_sysclk()
1256 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); in aic3x_set_dai_fmt() local
1265 aic3x->master = 1; in aic3x_set_dai_fmt()
1269 aic3x->master = 0; in aic3x_set_dai_fmt()
1273 aic3x->master = 1; in aic3x_set_dai_fmt()
1278 aic3x->master = 1; in aic3x_set_dai_fmt()
1308 aic3x->dai_fmt = fmt & SND_SOC_DAIFMT_FORMAT_MASK; in aic3x_set_dai_fmt()
1322 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); in aic3x_set_dai_tdm_slot() local
1354 aic3x->tdm_delay = lsb; in aic3x_set_dai_tdm_slot()
1355 aic3x->slot_width = slot_width; in aic3x_set_dai_tdm_slot()
1369 struct aic3x_priv *aic3x = disable_nb->aic3x; in aic3x_regulator_event() local
1376 if (gpio_is_valid(aic3x->gpio_reset)) in aic3x_regulator_event()
1377 gpio_set_value(aic3x->gpio_reset, 0); in aic3x_regulator_event()
1378 regcache_mark_dirty(aic3x->regmap); in aic3x_regulator_event()
1386 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); in aic3x_set_power() local
1391 ret = regulator_bulk_enable(ARRAY_SIZE(aic3x->supplies), in aic3x_set_power()
1392 aic3x->supplies); in aic3x_set_power()
1395 aic3x->power = 1; in aic3x_set_power()
1397 if (gpio_is_valid(aic3x->gpio_reset)) { in aic3x_set_power()
1399 gpio_set_value(aic3x->gpio_reset, 1); in aic3x_set_power()
1403 regcache_cache_only(aic3x->regmap, false); in aic3x_set_power()
1404 regcache_sync(aic3x->regmap); in aic3x_set_power()
1430 regcache_mark_dirty(aic3x->regmap); in aic3x_set_power()
1431 aic3x->power = 0; in aic3x_set_power()
1433 regcache_cache_only(aic3x->regmap, true); in aic3x_set_power()
1434 ret = regulator_bulk_disable(ARRAY_SIZE(aic3x->supplies), in aic3x_set_power()
1435 aic3x->supplies); in aic3x_set_power()
1444 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); in aic3x_set_bias_level() local
1451 aic3x->master) { in aic3x_set_bias_level()
1458 if (!aic3x->power) in aic3x_set_bias_level()
1461 aic3x->master) { in aic3x_set_bias_level()
1468 if (aic3x->power) in aic3x_set_bias_level()
1533 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); in aic3x_init() local
1576 if (aic3x->model != AIC3X_MODEL_3104) { in aic3x_init()
1587 switch (aic3x->model) { in aic3x_init()
1599 aic3x->ocmv << HPOUT_SC_OCMV_SHIFT); in aic3x_init()
1604 static bool aic3x_is_shared_reset(struct aic3x_priv *aic3x) in aic3x_is_shared_reset() argument
1609 if (gpio_is_valid(aic3x->gpio_reset) && in aic3x_is_shared_reset()
1610 aic3x->gpio_reset == a->gpio_reset) in aic3x_is_shared_reset()
1619 struct aic3x_priv *aic3x = snd_soc_component_get_drvdata(component); in aic3x_probe() local
1622 aic3x->component = component; in aic3x_probe()
1624 for (i = 0; i < ARRAY_SIZE(aic3x->supplies); i++) { in aic3x_probe()
1625 aic3x->disable_nb[i].nb.notifier_call = aic3x_regulator_event; in aic3x_probe()
1626 aic3x->disable_nb[i].aic3x = aic3x; in aic3x_probe()
1628 aic3x->supplies[i].consumer, in aic3x_probe()
1629 &aic3x->disable_nb[i].nb); in aic3x_probe()
1638 regcache_mark_dirty(aic3x->regmap); in aic3x_probe()
1641 if (aic3x->setup) { in aic3x_probe()
1642 if (aic3x->model != AIC3X_MODEL_3104) { in aic3x_probe()
1645 (aic3x->setup->gpio_func[0] & 0xf) << 4); in aic3x_probe()
1647 (aic3x->setup->gpio_func[1] & 0xf) << 4); in aic3x_probe()
1653 switch (aic3x->model) { in aic3x_probe()
1672 switch (aic3x->micbias_vg) { in aic3x_probe()
1678 (aic3x->micbias_vg) << MICBIAS_LEVEL_SHIFT); in aic3x_probe()
1711 struct aic3x_priv *aic3x = i2c_get_clientdata(client); in aic3x_configure_ocmv() local
1718 aic3x->ocmv = value; in aic3x_configure_ocmv()
1723 dvdd = regulator_get_voltage(aic3x->supplies[1].consumer); in aic3x_configure_ocmv()
1724 avdd = regulator_get_voltage(aic3x->supplies[2].consumer); in aic3x_configure_ocmv()
1731 aic3x->ocmv = HPOUT_SC_OCMV_1_8V; in aic3x_configure_ocmv()
1733 aic3x->ocmv = HPOUT_SC_OCMV_1_65V; in aic3x_configure_ocmv()
1735 aic3x->ocmv = HPOUT_SC_OCMV_1_5V; in aic3x_configure_ocmv()
1737 aic3x->ocmv = HPOUT_SC_OCMV_1_35V; in aic3x_configure_ocmv()
1778 struct aic3x_priv *aic3x; in aic3x_i2c_probe() local
1784 aic3x = devm_kzalloc(&i2c->dev, sizeof(struct aic3x_priv), GFP_KERNEL); in aic3x_i2c_probe()
1785 if (!aic3x) in aic3x_i2c_probe()
1788 aic3x->regmap = devm_regmap_init_i2c(i2c, &aic3x_regmap); in aic3x_i2c_probe()
1789 if (IS_ERR(aic3x->regmap)) { in aic3x_i2c_probe()
1790 ret = PTR_ERR(aic3x->regmap); in aic3x_i2c_probe()
1794 regcache_cache_only(aic3x->regmap, true); in aic3x_i2c_probe()
1796 i2c_set_clientdata(i2c, aic3x); in aic3x_i2c_probe()
1798 aic3x->gpio_reset = pdata->gpio_reset; in aic3x_i2c_probe()
1799 aic3x->setup = pdata->setup; in aic3x_i2c_probe()
1800 aic3x->micbias_vg = pdata->micbias_vg; in aic3x_i2c_probe()
1809 aic3x->gpio_reset = ret; in aic3x_i2c_probe()
1814 aic3x->gpio_reset = ret; in aic3x_i2c_probe()
1816 aic3x->gpio_reset = -1; in aic3x_i2c_probe()
1822 aic3x->setup = ai3x_setup; in aic3x_i2c_probe()
1828 aic3x->micbias_vg = AIC3X_MICBIAS_2_0V; in aic3x_i2c_probe()
1831 aic3x->micbias_vg = AIC3X_MICBIAS_2_5V; in aic3x_i2c_probe()
1834 aic3x->micbias_vg = AIC3X_MICBIAS_AVDDV; in aic3x_i2c_probe()
1837 aic3x->micbias_vg = AIC3X_MICBIAS_OFF; in aic3x_i2c_probe()
1842 aic3x->micbias_vg = AIC3X_MICBIAS_OFF; in aic3x_i2c_probe()
1846 aic3x->gpio_reset = -1; in aic3x_i2c_probe()
1849 aic3x->model = id->driver_data; in aic3x_i2c_probe()
1851 if (gpio_is_valid(aic3x->gpio_reset) && in aic3x_i2c_probe()
1852 !aic3x_is_shared_reset(aic3x)) { in aic3x_i2c_probe()
1853 ret = gpio_request(aic3x->gpio_reset, "tlv320aic3x reset"); in aic3x_i2c_probe()
1856 gpio_direction_output(aic3x->gpio_reset, 0); in aic3x_i2c_probe()
1859 for (i = 0; i < ARRAY_SIZE(aic3x->supplies); i++) in aic3x_i2c_probe()
1860 aic3x->supplies[i].supply = aic3x_supply_names[i]; in aic3x_i2c_probe()
1862 ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(aic3x->supplies), in aic3x_i2c_probe()
1863 aic3x->supplies); in aic3x_i2c_probe()
1871 if (aic3x->model == AIC3X_MODEL_3007) { in aic3x_i2c_probe()
1872 ret = regmap_register_patch(aic3x->regmap, aic3007_class_d, in aic3x_i2c_probe()
1885 INIT_LIST_HEAD(&aic3x->list); in aic3x_i2c_probe()
1886 list_add(&aic3x->list, &reset_list); in aic3x_i2c_probe()
1891 if (gpio_is_valid(aic3x->gpio_reset) && in aic3x_i2c_probe()
1892 !aic3x_is_shared_reset(aic3x)) in aic3x_i2c_probe()
1893 gpio_free(aic3x->gpio_reset); in aic3x_i2c_probe()
1900 struct aic3x_priv *aic3x = i2c_get_clientdata(client); in aic3x_i2c_remove() local
1902 list_del(&aic3x->list); in aic3x_i2c_remove()
1904 if (gpio_is_valid(aic3x->gpio_reset) && in aic3x_i2c_remove()
1905 !aic3x_is_shared_reset(aic3x)) { in aic3x_i2c_remove()
1906 gpio_set_value(aic3x->gpio_reset, 0); in aic3x_i2c_remove()
1907 gpio_free(aic3x->gpio_reset); in aic3x_i2c_remove()