max98090          276 sound/soc/codecs/max98090.c static int max98090_reset(struct max98090_priv *max98090)
max98090          281 sound/soc/codecs/max98090.c 	ret = regmap_write(max98090->regmap, M98090_REG_SOFTWARE_RESET,
max98090          284 sound/soc/codecs/max98090.c 		dev_err(max98090->component->dev,
max98090          352 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090          361 sound/soc/codecs/max98090.c 		select = &(max98090->pa1en);
max98090          364 sound/soc/codecs/max98090.c 		select = &(max98090->pa2en);
max98090          367 sound/soc/codecs/max98090.c 		select = &(max98090->sidetone);
max98090          392 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090          402 sound/soc/codecs/max98090.c 		select = &(max98090->pa1en);
max98090          405 sound/soc/codecs/max98090.c 		select = &(max98090->pa2en);
max98090          408 sound/soc/codecs/max98090.c 		select = &(max98090->sidetone);
max98090          731 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090          742 sound/soc/codecs/max98090.c 			max98090->pa1en = val - 1; /* Update for volatile */
max98090          744 sound/soc/codecs/max98090.c 			max98090->pa2en = val - 1; /* Update for volatile */
max98090          752 sound/soc/codecs/max98090.c 			val = max98090->pa1en + 1;
max98090          754 sound/soc/codecs/max98090.c 			val = max98090->pa2en + 1;
max98090          778 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090          781 sound/soc/codecs/max98090.c 		max98090->shdn_pending = true;
max98090         1428 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         1434 sound/soc/codecs/max98090.c 	if (max98090->devtype == MAX98091) {
max98090         1445 sound/soc/codecs/max98090.c 	if (max98090->devtype == MAX98091) {
max98090         1484 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         1488 sound/soc/codecs/max98090.c 	if (!max98090->sysclk) {
max98090         1493 sound/soc/codecs/max98090.c 	if (!max98090->bclk || !max98090->lrclk) {
max98090         1506 sound/soc/codecs/max98090.c 		if ((pclk_rates[i] == max98090->sysclk) &&
max98090         1507 sound/soc/codecs/max98090.c 			(lrclk_rates[i] == max98090->lrclk)) {
max98090         1523 sound/soc/codecs/max98090.c 		if ((user_pclk_rates[i] == max98090->sysclk) &&
max98090         1524 sound/soc/codecs/max98090.c 			(user_lrclk_rates[i] == max98090->lrclk)) {
max98090         1562 sound/soc/codecs/max98090.c 	ni = 65536ULL * (max98090->lrclk < 50000 ? 96ULL : 48ULL)
max98090         1563 sound/soc/codecs/max98090.c 			* (unsigned long long int)max98090->lrclk;
max98090         1564 sound/soc/codecs/max98090.c 	do_div(ni, (unsigned long long int)max98090->sysclk);
max98090         1576 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         1580 sound/soc/codecs/max98090.c 	max98090->dai_fmt = fmt;
max98090         1581 sound/soc/codecs/max98090.c 	cdata = &max98090->dai[0];
max98090         1596 sound/soc/codecs/max98090.c 			max98090->master = false;
max98090         1600 sound/soc/codecs/max98090.c 			if (max98090->tdm_slots == 4) {
max98090         1604 sound/soc/codecs/max98090.c 			} else if (max98090->tdm_slots == 3) {
max98090         1613 sound/soc/codecs/max98090.c 			max98090->master = true;
max98090         1663 sound/soc/codecs/max98090.c 		if (max98090->tdm_slots > 1)
max98090         1677 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         1679 sound/soc/codecs/max98090.c 	cdata = &max98090->dai[0];
max98090         1684 sound/soc/codecs/max98090.c 	max98090->tdm_slots = slots;
max98090         1685 sound/soc/codecs/max98090.c 	max98090->tdm_width = slot_width;
max98090         1687 sound/soc/codecs/max98090.c 	if (max98090->tdm_slots > 1) {
max98090         1704 sound/soc/codecs/max98090.c 	max98090_dai_set_fmt(codec_dai, max98090->dai_fmt);
max98090         1712 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         1727 sound/soc/codecs/max98090.c 		if (IS_ERR(max98090->mclk))
max98090         1731 sound/soc/codecs/max98090.c 			clk_disable_unprepare(max98090->mclk);
max98090         1733 sound/soc/codecs/max98090.c 			ret = clk_prepare_enable(max98090->mclk);
max98090         1741 sound/soc/codecs/max98090.c 			ret = regcache_sync(max98090->regmap);
max98090         1754 sound/soc/codecs/max98090.c 		regcache_mark_dirty(max98090->regmap);
max98090         1874 sound/soc/codecs/max98090.c static int max98090_configure_dmic(struct max98090_priv *max98090,
max98090         1897 sound/soc/codecs/max98090.c 	regmap_update_bits(max98090->regmap, M98090_REG_DIGITAL_MIC_ENABLE,
max98090         1901 sound/soc/codecs/max98090.c 	regmap_update_bits(max98090->regmap, M98090_REG_DIGITAL_MIC_CONFIG,
max98090         1913 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         1914 sound/soc/codecs/max98090.c 	unsigned int fmt = max98090->dai_fmt;
max98090         1929 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         1932 sound/soc/codecs/max98090.c 	cdata = &max98090->dai[0];
max98090         1933 sound/soc/codecs/max98090.c 	max98090->bclk = snd_soc_params_to_bclk(params);
max98090         1935 sound/soc/codecs/max98090.c 		max98090->bclk *= 2;
max98090         1937 sound/soc/codecs/max98090.c 	max98090->lrclk = params_rate(params);
max98090         1948 sound/soc/codecs/max98090.c 	if (max98090->master)
max98090         1951 sound/soc/codecs/max98090.c 	cdata->rate = max98090->lrclk;
max98090         1954 sound/soc/codecs/max98090.c 	if (max98090->lrclk < 24000)
max98090         1962 sound/soc/codecs/max98090.c 	if (max98090->lrclk < 50000)
max98090         1969 sound/soc/codecs/max98090.c 	max98090_configure_dmic(max98090, max98090->dmic_freq, max98090->pclk,
max98090         1970 sound/soc/codecs/max98090.c 				max98090->lrclk);
max98090         1982 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         1985 sound/soc/codecs/max98090.c 	if (freq == max98090->sysclk)
max98090         1988 sound/soc/codecs/max98090.c 	if (!IS_ERR(max98090->mclk)) {
max98090         1989 sound/soc/codecs/max98090.c 		freq = clk_round_rate(max98090->mclk, freq);
max98090         1990 sound/soc/codecs/max98090.c 		clk_set_rate(max98090->mclk, freq);
max98090         2001 sound/soc/codecs/max98090.c 		max98090->pclk = freq;
max98090         2005 sound/soc/codecs/max98090.c 		max98090->pclk = freq >> 1;
max98090         2009 sound/soc/codecs/max98090.c 		max98090->pclk = freq >> 2;
max98090         2015 sound/soc/codecs/max98090.c 	max98090->sysclk = freq;
max98090         2036 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         2042 sound/soc/codecs/max98090.c 		if (!max98090->master && dai->active == 1)
max98090         2044 sound/soc/codecs/max98090.c 					   &max98090->pll_det_enable_work,
max98090         2050 sound/soc/codecs/max98090.c 		if (!max98090->master && dai->active == 1)
max98090         2051 sound/soc/codecs/max98090.c 			schedule_work(&max98090->pll_det_disable_work);
max98090         2062 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 =
max98090         2065 sound/soc/codecs/max98090.c 	struct snd_soc_component *component = max98090->component;
max98090         2074 sound/soc/codecs/max98090.c 	regmap_read(max98090->regmap, M98090_REG_DEVICE_STATUS, &status);
max98090         2080 sound/soc/codecs/max98090.c 	regmap_read(max98090->regmap, M98090_REG_INTERRUPT_S, &mask);
max98090         2084 sound/soc/codecs/max98090.c 				   &max98090->jack_work,
max98090         2095 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 =
max98090         2097 sound/soc/codecs/max98090.c 	struct snd_soc_component *component = max98090->component;
max98090         2099 sound/soc/codecs/max98090.c 	cancel_delayed_work_sync(&max98090->pll_det_enable_work);
max98090         2106 sound/soc/codecs/max98090.c static void max98090_pll_work(struct max98090_priv *max98090)
max98090         2108 sound/soc/codecs/max98090.c 	struct snd_soc_component *component = max98090->component;
max98090         2128 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = container_of(work,
max98090         2131 sound/soc/codecs/max98090.c 	struct snd_soc_component *component = max98090->component;
max98090         2136 sound/soc/codecs/max98090.c 	if (max98090->jack_state == M98090_JACK_STATE_NO_HEADSET) {
max98090         2159 sound/soc/codecs/max98090.c 			max98090->jack_state = M98090_JACK_STATE_NO_HEADSET;
max98090         2166 sound/soc/codecs/max98090.c 			if (max98090->jack_state ==
max98090         2188 sound/soc/codecs/max98090.c 			max98090->jack_state = M98090_JACK_STATE_HEADPHONE;
max98090         2197 sound/soc/codecs/max98090.c 			max98090->jack_state = M98090_JACK_STATE_HEADSET;
max98090         2208 sound/soc/codecs/max98090.c 	snd_soc_jack_report(max98090->jack, status,
max98090         2214 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = data;
max98090         2215 sound/soc/codecs/max98090.c 	struct snd_soc_component *component = max98090->component;
max98090         2226 sound/soc/codecs/max98090.c 	ret = regmap_read(max98090->regmap, M98090_REG_INTERRUPT_S, &mask);
max98090         2235 sound/soc/codecs/max98090.c 	ret = regmap_read(max98090->regmap, M98090_REG_DEVICE_STATUS, &active);
max98090         2260 sound/soc/codecs/max98090.c 		max98090_pll_work(max98090);
max98090         2269 sound/soc/codecs/max98090.c 				   &max98090->jack_work,
max98090         2298 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         2302 sound/soc/codecs/max98090.c 	max98090->jack = jack;
max98090         2314 sound/soc/codecs/max98090.c 	snd_soc_jack_report(max98090->jack, 0,
max98090         2318 sound/soc/codecs/max98090.c 			   &max98090->jack_work,
max98090         2361 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         2370 sound/soc/codecs/max98090.c 	max98090->mclk = devm_clk_get(component->dev, "mclk");
max98090         2371 sound/soc/codecs/max98090.c 	if (PTR_ERR(max98090->mclk) == -EPROBE_DEFER)
max98090         2374 sound/soc/codecs/max98090.c 	max98090->component = component;
max98090         2377 sound/soc/codecs/max98090.c 	max98090_reset(max98090);
max98090         2381 sound/soc/codecs/max98090.c 	max98090->sysclk = (unsigned)-1;
max98090         2382 sound/soc/codecs/max98090.c 	max98090->pclk = (unsigned)-1;
max98090         2383 sound/soc/codecs/max98090.c 	max98090->master = false;
max98090         2385 sound/soc/codecs/max98090.c 	cdata = &max98090->dai[0];
max98090         2389 sound/soc/codecs/max98090.c 	max98090->lin_state = 0;
max98090         2390 sound/soc/codecs/max98090.c 	max98090->pa1en = 0;
max98090         2391 sound/soc/codecs/max98090.c 	max98090->pa2en = 0;
max98090         2411 sound/soc/codecs/max98090.c 	if (max98090->devtype != devtype) {
max98090         2413 sound/soc/codecs/max98090.c 		max98090->devtype = devtype;
max98090         2416 sound/soc/codecs/max98090.c 	max98090->jack_state = M98090_JACK_STATE_NO_HEADSET;
max98090         2418 sound/soc/codecs/max98090.c 	INIT_DELAYED_WORK(&max98090->jack_work, max98090_jack_work);
max98090         2419 sound/soc/codecs/max98090.c 	INIT_DELAYED_WORK(&max98090->pll_det_enable_work,
max98090         2421 sound/soc/codecs/max98090.c 	INIT_WORK(&max98090->pll_det_disable_work,
max98090         2470 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         2472 sound/soc/codecs/max98090.c 	cancel_delayed_work_sync(&max98090->jack_work);
max98090         2473 sound/soc/codecs/max98090.c 	cancel_delayed_work_sync(&max98090->pll_det_enable_work);
max98090         2474 sound/soc/codecs/max98090.c 	cancel_work_sync(&max98090->pll_det_disable_work);
max98090         2475 sound/soc/codecs/max98090.c 	max98090->component = NULL;
max98090         2481 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component);
max98090         2483 sound/soc/codecs/max98090.c 	if (max98090->shdn_pending) {
max98090         2489 sound/soc/codecs/max98090.c 		max98090->shdn_pending = false;
max98090         2519 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090;
max98090         2526 sound/soc/codecs/max98090.c 	max98090 = devm_kzalloc(&i2c->dev, sizeof(struct max98090_priv),
max98090         2528 sound/soc/codecs/max98090.c 	if (max98090 == NULL)
max98090         2543 sound/soc/codecs/max98090.c 	max98090->devtype = driver_data;
max98090         2544 sound/soc/codecs/max98090.c 	i2c_set_clientdata(i2c, max98090);
max98090         2545 sound/soc/codecs/max98090.c 	max98090->pdata = i2c->dev.platform_data;
max98090         2548 sound/soc/codecs/max98090.c 				   &max98090->dmic_freq);
max98090         2550 sound/soc/codecs/max98090.c 		max98090->dmic_freq = MAX98090_DEFAULT_DMIC_FREQ;
max98090         2552 sound/soc/codecs/max98090.c 	max98090->regmap = devm_regmap_init_i2c(i2c, &max98090_regmap);
max98090         2553 sound/soc/codecs/max98090.c 	if (IS_ERR(max98090->regmap)) {
max98090         2554 sound/soc/codecs/max98090.c 		ret = PTR_ERR(max98090->regmap);
max98090         2561 sound/soc/codecs/max98090.c 		"max98090_interrupt", max98090);
max98090         2577 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = dev_get_drvdata(&i2c->dev);
max98090         2583 sound/soc/codecs/max98090.c 	regmap_write(max98090->regmap,
max98090         2585 sound/soc/codecs/max98090.c 	regmap_write(max98090->regmap,
max98090         2600 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = dev_get_drvdata(dev);
max98090         2602 sound/soc/codecs/max98090.c 	regcache_cache_only(max98090->regmap, false);
max98090         2604 sound/soc/codecs/max98090.c 	max98090_reset(max98090);
max98090         2606 sound/soc/codecs/max98090.c 	regcache_sync(max98090->regmap);
max98090         2613 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = dev_get_drvdata(dev);
max98090         2615 sound/soc/codecs/max98090.c 	regcache_cache_only(max98090->regmap, true);
max98090         2624 sound/soc/codecs/max98090.c 	struct max98090_priv *max98090 = dev_get_drvdata(dev);
max98090         2627 sound/soc/codecs/max98090.c 	regcache_mark_dirty(max98090->regmap);
max98090         2629 sound/soc/codecs/max98090.c 	max98090_reset(max98090);
max98090         2632 sound/soc/codecs/max98090.c 	regmap_read(max98090->regmap, M98090_REG_DEVICE_STATUS, &status);
max98090         2634 sound/soc/codecs/max98090.c 	regcache_sync(max98090->regmap);