Lines Matching refs:cs42xx8

207 	struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component);  in cs42xx8_set_dai_sysclk()  local
209 cs42xx8->sysclk = freq; in cs42xx8_set_dai_sysclk()
218 struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); in cs42xx8_set_dai_fmt() local
240 regmap_update_bits(cs42xx8->regmap, CS42XX8_INTF, in cs42xx8_set_dai_fmt()
247 cs42xx8->slave_mode = true; in cs42xx8_set_dai_fmt()
250 cs42xx8->slave_mode = false; in cs42xx8_set_dai_fmt()
265 struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); in cs42xx8_hw_params() local
274 cs42xx8->tx_channels = params_channels(params); in cs42xx8_hw_params()
277 rate[!tx] = cs42xx8->rate[!tx]; in cs42xx8_hw_params()
279 ratio[tx] = rate[tx] > 0 ? cs42xx8->sysclk / rate[tx] : 0; in cs42xx8_hw_params()
280 ratio[!tx] = rate[!tx] > 0 ? cs42xx8->sysclk / rate[!tx] : 0; in cs42xx8_hw_params()
284 if (cs42xx8->slave_mode) { in cs42xx8_hw_params()
308 cs42xx8->sysclk >= cs42xx8_ratios[i].min_mclk && in cs42xx8_hw_params()
309 cs42xx8->sysclk <= cs42xx8_ratios[i].max_mclk; in cs42xx8_hw_params()
337 cs42xx8->rate[tx] = params_rate(params); in cs42xx8_hw_params()
342 regmap_update_bits(cs42xx8->regmap, CS42XX8_FUNCMOD, in cs42xx8_hw_params()
353 struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); in cs42xx8_hw_free() local
357 cs42xx8->rate[tx] = 0; in cs42xx8_hw_free()
359 regmap_update_bits(cs42xx8->regmap, CS42XX8_FUNCMOD, in cs42xx8_hw_free()
368 struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); in cs42xx8_digital_mute() local
369 u8 dac_unmute = cs42xx8->tx_channels ? in cs42xx8_digital_mute()
370 ~((0x1 << cs42xx8->tx_channels) - 1) : 0; in cs42xx8_digital_mute()
372 regmap_write(cs42xx8->regmap, CS42XX8_DACMUTE, in cs42xx8_digital_mute()
467 struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); in cs42xx8_component_probe() local
470 switch (cs42xx8->drvdata->num_adcs) { in cs42xx8_component_probe()
484 regmap_write(cs42xx8->regmap, CS42XX8_DACMUTE, CS42XX8_DACMUTE_ALL); in cs42xx8_component_probe()
525 struct cs42xx8_priv *cs42xx8; in cs42xx8_probe() local
534 cs42xx8 = devm_kzalloc(dev, sizeof(*cs42xx8), GFP_KERNEL); in cs42xx8_probe()
535 if (cs42xx8 == NULL) in cs42xx8_probe()
538 cs42xx8->regmap = regmap; in cs42xx8_probe()
539 dev_set_drvdata(dev, cs42xx8); in cs42xx8_probe()
543 cs42xx8->drvdata = of_id->data; in cs42xx8_probe()
545 if (!cs42xx8->drvdata) { in cs42xx8_probe()
550 cs42xx8->gpiod_reset = devm_gpiod_get_optional(dev, "reset", in cs42xx8_probe()
552 if (IS_ERR(cs42xx8->gpiod_reset)) in cs42xx8_probe()
553 return PTR_ERR(cs42xx8->gpiod_reset); in cs42xx8_probe()
555 gpiod_set_value_cansleep(cs42xx8->gpiod_reset, 0); in cs42xx8_probe()
557 cs42xx8->clk = devm_clk_get(dev, "mclk"); in cs42xx8_probe()
558 if (IS_ERR(cs42xx8->clk)) { in cs42xx8_probe()
560 PTR_ERR(cs42xx8->clk)); in cs42xx8_probe()
564 cs42xx8->sysclk = clk_get_rate(cs42xx8->clk); in cs42xx8_probe()
566 for (i = 0; i < ARRAY_SIZE(cs42xx8->supplies); i++) in cs42xx8_probe()
567 cs42xx8->supplies[i].supply = cs42xx8_supply_names[i]; in cs42xx8_probe()
570 ARRAY_SIZE(cs42xx8->supplies), cs42xx8->supplies); in cs42xx8_probe()
576 ret = regulator_bulk_enable(ARRAY_SIZE(cs42xx8->supplies), in cs42xx8_probe()
577 cs42xx8->supplies); in cs42xx8_probe()
587 ret = regmap_read(cs42xx8->regmap, CS42XX8_CHIPID, &val); in cs42xx8_probe()
604 cs42xx8_dai.name = cs42xx8->drvdata->name; in cs42xx8_probe()
607 cs42xx8_dai.capture.channels_max = cs42xx8->drvdata->num_adcs * 2; in cs42xx8_probe()
615 regcache_cache_only(cs42xx8->regmap, true); in cs42xx8_probe()
618 regulator_bulk_disable(ARRAY_SIZE(cs42xx8->supplies), in cs42xx8_probe()
619 cs42xx8->supplies); in cs42xx8_probe()
628 struct cs42xx8_priv *cs42xx8 = dev_get_drvdata(dev); in cs42xx8_runtime_resume() local
631 ret = clk_prepare_enable(cs42xx8->clk); in cs42xx8_runtime_resume()
637 gpiod_set_value_cansleep(cs42xx8->gpiod_reset, 0); in cs42xx8_runtime_resume()
639 ret = regulator_bulk_enable(ARRAY_SIZE(cs42xx8->supplies), in cs42xx8_runtime_resume()
640 cs42xx8->supplies); in cs42xx8_runtime_resume()
649 regcache_cache_only(cs42xx8->regmap, false); in cs42xx8_runtime_resume()
650 regcache_mark_dirty(cs42xx8->regmap); in cs42xx8_runtime_resume()
652 ret = regcache_sync(cs42xx8->regmap); in cs42xx8_runtime_resume()
661 regulator_bulk_disable(ARRAY_SIZE(cs42xx8->supplies), in cs42xx8_runtime_resume()
662 cs42xx8->supplies); in cs42xx8_runtime_resume()
664 clk_disable_unprepare(cs42xx8->clk); in cs42xx8_runtime_resume()
671 struct cs42xx8_priv *cs42xx8 = dev_get_drvdata(dev); in cs42xx8_runtime_suspend() local
673 regcache_cache_only(cs42xx8->regmap, true); in cs42xx8_runtime_suspend()
675 regulator_bulk_disable(ARRAY_SIZE(cs42xx8->supplies), in cs42xx8_runtime_suspend()
676 cs42xx8->supplies); in cs42xx8_runtime_suspend()
678 gpiod_set_value_cansleep(cs42xx8->gpiod_reset, 1); in cs42xx8_runtime_suspend()
680 clk_disable_unprepare(cs42xx8->clk); in cs42xx8_runtime_suspend()