Lines Matching defs:aic3x

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