Lines Matching refs:cs42xx8

206 	struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component);  in cs42xx8_set_dai_sysclk()  local
208 cs42xx8->sysclk = freq; in cs42xx8_set_dai_sysclk()
217 struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); in cs42xx8_set_dai_fmt() local
239 regmap_update_bits(cs42xx8->regmap, CS42XX8_INTF, in cs42xx8_set_dai_fmt()
246 cs42xx8->slave_mode = true; in cs42xx8_set_dai_fmt()
249 cs42xx8->slave_mode = false; in cs42xx8_set_dai_fmt()
264 struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); in cs42xx8_hw_params() local
273 cs42xx8->tx_channels = params_channels(params); in cs42xx8_hw_params()
276 rate[!tx] = cs42xx8->rate[!tx]; in cs42xx8_hw_params()
278 ratio[tx] = rate[tx] > 0 ? cs42xx8->sysclk / rate[tx] : 0; in cs42xx8_hw_params()
279 ratio[!tx] = rate[!tx] > 0 ? cs42xx8->sysclk / rate[!tx] : 0; in cs42xx8_hw_params()
283 if (cs42xx8->slave_mode) { in cs42xx8_hw_params()
307 cs42xx8->sysclk >= cs42xx8_ratios[i].min_mclk && in cs42xx8_hw_params()
308 cs42xx8->sysclk <= cs42xx8_ratios[i].max_mclk; in cs42xx8_hw_params()
336 cs42xx8->rate[tx] = params_rate(params); in cs42xx8_hw_params()
341 regmap_update_bits(cs42xx8->regmap, CS42XX8_FUNCMOD, in cs42xx8_hw_params()
352 struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); in cs42xx8_hw_free() local
356 cs42xx8->rate[tx] = 0; in cs42xx8_hw_free()
358 regmap_update_bits(cs42xx8->regmap, CS42XX8_FUNCMOD, in cs42xx8_hw_free()
367 struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); in cs42xx8_mute() local
368 u8 dac_unmute = cs42xx8->tx_channels ? in cs42xx8_mute()
369 ~((0x1 << cs42xx8->tx_channels) - 1) : 0; in cs42xx8_mute()
371 regmap_write(cs42xx8->regmap, CS42XX8_DACMUTE, in cs42xx8_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()
515 struct cs42xx8_priv *cs42xx8; in cs42xx8_probe() local
524 cs42xx8 = devm_kzalloc(dev, sizeof(*cs42xx8), GFP_KERNEL); in cs42xx8_probe()
525 if (cs42xx8 == NULL) in cs42xx8_probe()
528 dev_set_drvdata(dev, cs42xx8); in cs42xx8_probe()
530 cs42xx8->regmap = regmap; in cs42xx8_probe()
532 cs42xx8->drvdata = drvdata; in cs42xx8_probe()
534 cs42xx8->gpiod_reset = devm_gpiod_get_optional(dev, "reset", in cs42xx8_probe()
536 if (IS_ERR(cs42xx8->gpiod_reset)) in cs42xx8_probe()
537 return PTR_ERR(cs42xx8->gpiod_reset); in cs42xx8_probe()
539 gpiod_set_value_cansleep(cs42xx8->gpiod_reset, 0); in cs42xx8_probe()
541 cs42xx8->clk = devm_clk_get(dev, "mclk"); in cs42xx8_probe()
542 if (IS_ERR(cs42xx8->clk)) { in cs42xx8_probe()
544 PTR_ERR(cs42xx8->clk)); in cs42xx8_probe()
548 cs42xx8->sysclk = clk_get_rate(cs42xx8->clk); in cs42xx8_probe()
550 for (i = 0; i < ARRAY_SIZE(cs42xx8->supplies); i++) in cs42xx8_probe()
551 cs42xx8->supplies[i].supply = cs42xx8_supply_names[i]; in cs42xx8_probe()
554 ARRAY_SIZE(cs42xx8->supplies), cs42xx8->supplies); in cs42xx8_probe()
560 ret = regulator_bulk_enable(ARRAY_SIZE(cs42xx8->supplies), in cs42xx8_probe()
561 cs42xx8->supplies); in cs42xx8_probe()
571 ret = regmap_read(cs42xx8->regmap, CS42XX8_CHIPID, &val); in cs42xx8_probe()
588 cs42xx8_dai.name = cs42xx8->drvdata->name; in cs42xx8_probe()
591 cs42xx8_dai.capture.channels_max = cs42xx8->drvdata->num_adcs * 2; in cs42xx8_probe()
599 regcache_cache_only(cs42xx8->regmap, true); in cs42xx8_probe()
602 regulator_bulk_disable(ARRAY_SIZE(cs42xx8->supplies), in cs42xx8_probe()
603 cs42xx8->supplies); in cs42xx8_probe()
612 struct cs42xx8_priv *cs42xx8 = dev_get_drvdata(dev); in cs42xx8_runtime_resume() local
615 ret = clk_prepare_enable(cs42xx8->clk); in cs42xx8_runtime_resume()
621 gpiod_set_value_cansleep(cs42xx8->gpiod_reset, 0); in cs42xx8_runtime_resume()
623 ret = regulator_bulk_enable(ARRAY_SIZE(cs42xx8->supplies), in cs42xx8_runtime_resume()
624 cs42xx8->supplies); in cs42xx8_runtime_resume()
633 regcache_cache_only(cs42xx8->regmap, false); in cs42xx8_runtime_resume()
634 regcache_mark_dirty(cs42xx8->regmap); in cs42xx8_runtime_resume()
636 ret = regcache_sync(cs42xx8->regmap); in cs42xx8_runtime_resume()
645 regulator_bulk_disable(ARRAY_SIZE(cs42xx8->supplies), in cs42xx8_runtime_resume()
646 cs42xx8->supplies); in cs42xx8_runtime_resume()
648 clk_disable_unprepare(cs42xx8->clk); in cs42xx8_runtime_resume()
655 struct cs42xx8_priv *cs42xx8 = dev_get_drvdata(dev); in cs42xx8_runtime_suspend() local
657 regcache_cache_only(cs42xx8->regmap, true); in cs42xx8_runtime_suspend()
659 regulator_bulk_disable(ARRAY_SIZE(cs42xx8->supplies), in cs42xx8_runtime_suspend()
660 cs42xx8->supplies); in cs42xx8_runtime_suspend()
662 gpiod_set_value_cansleep(cs42xx8->gpiod_reset, 1); in cs42xx8_runtime_suspend()
664 clk_disable_unprepare(cs42xx8->clk); in cs42xx8_runtime_suspend()