Lines Matching refs:es8316
367 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_set_dai_sysclk() local
371 es8316->sysclk = freq; in es8316_set_dai_sysclk()
372 es8316->sysclk_constraints.list = NULL; in es8316_set_dai_sysclk()
373 es8316->sysclk_constraints.count = 0; in es8316_set_dai_sysclk()
378 ret = clk_set_rate(es8316->mclk, freq); in es8316_set_dai_sysclk()
389 es8316->allowed_rates[count++] = freq / ratio; in es8316_set_dai_sysclk()
393 es8316->sysclk_constraints.list = es8316->allowed_rates; in es8316_set_dai_sysclk()
394 es8316->sysclk_constraints.count = count; in es8316_set_dai_sysclk()
453 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_pcm_startup() local
455 if (es8316->sysclk_constraints.list) in es8316_pcm_startup()
458 &es8316->sysclk_constraints); in es8316_pcm_startup()
468 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_pcm_hw_params() local
478 if (es8316->sysclk % ratio != 0) in es8316_pcm_hw_params()
480 if (es8316->sysclk / ratio == params_rate(params)) in es8316_pcm_hw_params()
485 lrck_divider = es8316->sysclk / params_rate(params); in es8316_pcm_hw_params()
590 struct es8316_priv *es8316 = data; in es8316_irq() local
591 struct snd_soc_component *comp = es8316->component; in es8316_irq()
594 mutex_lock(&es8316->lock); in es8316_irq()
596 regmap_read(es8316->regmap, ES8316_GPIO_FLAG, &flags); in es8316_irq()
601 if (!es8316->jack) in es8316_irq()
604 if (es8316->jd_inverted) in es8316_irq()
610 if (es8316->jack->status & SND_JACK_MICROPHONE) in es8316_irq()
613 if (es8316->jack->status & SND_JACK_HEADPHONE) { in es8316_irq()
614 snd_soc_jack_report(es8316->jack, 0, in es8316_irq()
618 } else if (!(es8316->jack->status & SND_JACK_HEADPHONE)) { in es8316_irq()
621 regmap_read(es8316->regmap, ES8316_GPIO_FLAG, &flags); in es8316_irq()
622 if (es8316->jd_inverted) in es8316_irq()
630 snd_soc_jack_report(es8316->jack, in es8316_irq()
636 snd_soc_jack_report(es8316->jack, in es8316_irq()
642 } else if (es8316->jack->status & SND_JACK_MICROPHONE) { in es8316_irq()
646 snd_soc_jack_report(es8316->jack, 0, SND_JACK_BTN_0); in es8316_irq()
649 snd_soc_jack_report(es8316->jack, in es8316_irq()
656 mutex_unlock(&es8316->lock); in es8316_irq()
663 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_enable_jack_detect() local
670 es8316->jd_inverted = device_property_read_bool(component->dev, in es8316_enable_jack_detect()
673 mutex_lock(&es8316->lock); in es8316_enable_jack_detect()
675 es8316->jack = jack; in es8316_enable_jack_detect()
677 if (es8316->jack->status & SND_JACK_MICROPHONE) in es8316_enable_jack_detect()
684 mutex_unlock(&es8316->lock); in es8316_enable_jack_detect()
687 enable_irq(es8316->irq); in es8316_enable_jack_detect()
688 es8316_irq(es8316->irq, es8316); in es8316_enable_jack_detect()
693 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_disable_jack_detect() local
695 if (!es8316->jack) in es8316_disable_jack_detect()
698 disable_irq(es8316->irq); in es8316_disable_jack_detect()
700 mutex_lock(&es8316->lock); in es8316_disable_jack_detect()
705 if (es8316->jack->status & SND_JACK_MICROPHONE) { in es8316_disable_jack_detect()
707 snd_soc_jack_report(es8316->jack, 0, SND_JACK_BTN_0); in es8316_disable_jack_detect()
710 es8316->jack = NULL; in es8316_disable_jack_detect()
712 mutex_unlock(&es8316->lock); in es8316_disable_jack_detect()
728 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_probe() local
731 es8316->component = component; in es8316_probe()
733 es8316->mclk = devm_clk_get_optional(component->dev, "mclk"); in es8316_probe()
734 if (IS_ERR(es8316->mclk)) { in es8316_probe()
736 return PTR_ERR(es8316->mclk); in es8316_probe()
738 if (!es8316->mclk) in es8316_probe()
741 ret = clk_prepare_enable(es8316->mclk); in es8316_probe()
771 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_remove() local
773 clk_disable_unprepare(es8316->mclk); in es8316_remove()
778 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_resume() local
780 regcache_cache_only(es8316->regmap, false); in es8316_resume()
781 regcache_sync(es8316->regmap); in es8316_resume()
788 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_suspend() local
790 regcache_cache_only(es8316->regmap, true); in es8316_suspend()
791 regcache_mark_dirty(es8316->regmap); in es8316_suspend()
835 struct es8316_priv *es8316; in es8316_i2c_probe() local
838 es8316 = devm_kzalloc(&i2c_client->dev, sizeof(struct es8316_priv), in es8316_i2c_probe()
840 if (es8316 == NULL) in es8316_i2c_probe()
843 i2c_set_clientdata(i2c_client, es8316); in es8316_i2c_probe()
845 es8316->regmap = devm_regmap_init_i2c(i2c_client, &es8316_regmap); in es8316_i2c_probe()
846 if (IS_ERR(es8316->regmap)) in es8316_i2c_probe()
847 return PTR_ERR(es8316->regmap); in es8316_i2c_probe()
849 es8316->irq = i2c_client->irq; in es8316_i2c_probe()
850 mutex_init(&es8316->lock); in es8316_i2c_probe()
852 if (es8316->irq > 0) { in es8316_i2c_probe()
853 ret = devm_request_threaded_irq(dev, es8316->irq, NULL, es8316_irq, in es8316_i2c_probe()
855 "es8316", es8316); in es8316_i2c_probe()
857 dev_warn(dev, "Failed to get IRQ %d: %d\n", es8316->irq, ret); in es8316_i2c_probe()
858 es8316->irq = -ENXIO; in es8316_i2c_probe()