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()
374 es8316->sysclk_constraints.list = NULL; in es8316_set_dai_sysclk()
375 es8316->sysclk_constraints.count = 0; in es8316_set_dai_sysclk()
380 ret = clk_set_rate(es8316->mclk, freq); in es8316_set_dai_sysclk()
391 es8316->allowed_rates[count++] = freq / ratio; in es8316_set_dai_sysclk()
394 es8316->sysclk_constraints.list = es8316->allowed_rates; in es8316_set_dai_sysclk()
395 es8316->sysclk_constraints.count = count; in es8316_set_dai_sysclk()
455 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_pcm_startup() local
457 if (es8316->sysclk_constraints.list) in es8316_pcm_startup()
460 &es8316->sysclk_constraints); in es8316_pcm_startup()
470 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()
578 struct es8316_priv *es8316 = data; in es8316_irq() local
579 struct snd_soc_component *comp = es8316->component; in es8316_irq()
582 mutex_lock(&es8316->lock); in es8316_irq()
584 regmap_read(es8316->regmap, ES8316_GPIO_FLAG, &flags); in es8316_irq()
589 if (!es8316->jack) in es8316_irq()
592 if (es8316->jd_inverted) in es8316_irq()
598 if (es8316->jack->status & SND_JACK_MICROPHONE) in es8316_irq()
601 if (es8316->jack->status & SND_JACK_HEADPHONE) { in es8316_irq()
602 snd_soc_jack_report(es8316->jack, 0, in es8316_irq()
606 } else if (!(es8316->jack->status & SND_JACK_HEADPHONE)) { in es8316_irq()
609 regmap_read(es8316->regmap, ES8316_GPIO_FLAG, &flags); in es8316_irq()
610 if (es8316->jd_inverted) in es8316_irq()
618 snd_soc_jack_report(es8316->jack, in es8316_irq()
624 snd_soc_jack_report(es8316->jack, in es8316_irq()
630 } else if (es8316->jack->status & SND_JACK_MICROPHONE) { in es8316_irq()
634 snd_soc_jack_report(es8316->jack, 0, SND_JACK_BTN_0); in es8316_irq()
637 snd_soc_jack_report(es8316->jack, in es8316_irq()
644 mutex_unlock(&es8316->lock); in es8316_irq()
651 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_enable_jack_detect() local
658 es8316->jd_inverted = device_property_read_bool(component->dev, in es8316_enable_jack_detect()
661 mutex_lock(&es8316->lock); in es8316_enable_jack_detect()
663 es8316->jack = jack; in es8316_enable_jack_detect()
665 if (es8316->jack->status & SND_JACK_MICROPHONE) in es8316_enable_jack_detect()
672 mutex_unlock(&es8316->lock); in es8316_enable_jack_detect()
675 enable_irq(es8316->irq); in es8316_enable_jack_detect()
676 es8316_irq(es8316->irq, es8316); in es8316_enable_jack_detect()
681 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_disable_jack_detect() local
683 disable_irq(es8316->irq); in es8316_disable_jack_detect()
685 mutex_lock(&es8316->lock); in es8316_disable_jack_detect()
690 if (es8316->jack->status & SND_JACK_MICROPHONE) { in es8316_disable_jack_detect()
692 snd_soc_jack_report(es8316->jack, 0, SND_JACK_BTN_0); in es8316_disable_jack_detect()
695 es8316->jack = NULL; in es8316_disable_jack_detect()
697 mutex_unlock(&es8316->lock); in es8316_disable_jack_detect()
713 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_probe() local
716 es8316->component = component; in es8316_probe()
718 es8316->mclk = devm_clk_get_optional(component->dev, "mclk"); in es8316_probe()
719 if (IS_ERR(es8316->mclk)) { in es8316_probe()
721 return PTR_ERR(es8316->mclk); in es8316_probe()
723 if (!es8316->mclk) in es8316_probe()
726 ret = clk_prepare_enable(es8316->mclk); in es8316_probe()
756 struct es8316_priv *es8316 = snd_soc_component_get_drvdata(component); in es8316_remove() local
758 clk_disable_unprepare(es8316->mclk); in es8316_remove()
797 struct es8316_priv *es8316; in es8316_i2c_probe() local
800 es8316 = devm_kzalloc(&i2c_client->dev, sizeof(struct es8316_priv), in es8316_i2c_probe()
802 if (es8316 == NULL) in es8316_i2c_probe()
805 i2c_set_clientdata(i2c_client, es8316); in es8316_i2c_probe()
807 es8316->regmap = devm_regmap_init_i2c(i2c_client, &es8316_regmap); in es8316_i2c_probe()
808 if (IS_ERR(es8316->regmap)) in es8316_i2c_probe()
809 return PTR_ERR(es8316->regmap); in es8316_i2c_probe()
811 es8316->irq = i2c_client->irq; in es8316_i2c_probe()
812 mutex_init(&es8316->lock); in es8316_i2c_probe()
814 ret = devm_request_threaded_irq(dev, es8316->irq, NULL, es8316_irq, in es8316_i2c_probe()
816 "es8316", es8316); in es8316_i2c_probe()
819 disable_irq(es8316->irq); in es8316_i2c_probe()
821 dev_warn(dev, "Failed to get IRQ %d: %d\n", es8316->irq, ret); in es8316_i2c_probe()
822 es8316->irq = -ENXIO; in es8316_i2c_probe()