Lines Matching refs:ssm2518

109 struct ssm2518 {  struct
310 static int ssm2518_lookup_mcs(struct ssm2518 *ssm2518, in ssm2518_lookup_mcs() argument
327 if (sysclks[i] == ssm2518->sysclk) in ssm2518_lookup_mcs()
338 struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(component); in ssm2518_hw_params() local
344 mcs = ssm2518_lookup_mcs(ssm2518, rate); in ssm2518_hw_params()
361 if (ssm2518->right_j) { in ssm2518_hw_params()
376 ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_CLOCK, in ssm2518_hw_params()
381 ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_SAI_CTRL1, in ssm2518_hw_params()
386 return regmap_update_bits(ssm2518->regmap, SSM2518_REG_POWER1, in ssm2518_hw_params()
392 struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(dai->component); in ssm2518_mute() local
400 return regmap_update_bits(ssm2518->regmap, SSM2518_REG_MUTE_CTRL, in ssm2518_mute()
406 struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(dai->component); in ssm2518_set_dai_fmt() local
437 ssm2518->right_j = false; in ssm2518_set_dai_fmt()
448 ssm2518->right_j = true; in ssm2518_set_dai_fmt()
468 ret = regmap_write(ssm2518->regmap, SSM2518_REG_SAI_CTRL1, ctrl1); in ssm2518_set_dai_fmt()
472 return regmap_write(ssm2518->regmap, SSM2518_REG_SAI_CTRL2, ctrl2); in ssm2518_set_dai_fmt()
475 static int ssm2518_set_power(struct ssm2518 *ssm2518, bool enable) in ssm2518_set_power() argument
480 ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_POWER1, in ssm2518_set_power()
482 regcache_mark_dirty(ssm2518->regmap); in ssm2518_set_power()
485 if (ssm2518->enable_gpio) in ssm2518_set_power()
486 gpiod_set_value_cansleep(ssm2518->enable_gpio, enable); in ssm2518_set_power()
488 regcache_cache_only(ssm2518->regmap, !enable); in ssm2518_set_power()
491 ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_POWER1, in ssm2518_set_power()
493 regcache_sync(ssm2518->regmap); in ssm2518_set_power()
502 struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(component); in ssm2518_set_bias_level() local
512 ret = ssm2518_set_power(ssm2518, true); in ssm2518_set_bias_level()
515 ret = ssm2518_set_power(ssm2518, false); in ssm2518_set_bias_level()
525 struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(dai->component); in ssm2518_set_tdm_slot() local
531 return regmap_update_bits(ssm2518->regmap, in ssm2518_set_tdm_slot()
592 ret = regmap_write(ssm2518->regmap, SSM2518_REG_CHAN_MAP, in ssm2518_set_tdm_slot()
598 ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_SAI_CTRL1, in ssm2518_set_tdm_slot()
603 return regmap_update_bits(ssm2518->regmap, SSM2518_REG_SAI_CTRL2, in ssm2518_set_tdm_slot()
610 struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(dai->component); in ssm2518_startup() local
612 if (ssm2518->constraints) in ssm2518_startup()
614 SNDRV_PCM_HW_PARAM_RATE, ssm2518->constraints); in ssm2518_startup()
646 struct ssm2518 *ssm2518 = snd_soc_component_get_drvdata(component); in ssm2518_set_sysclk() local
668 ssm2518->constraints = NULL; in ssm2518_set_sysclk()
676 ssm2518->constraints = &ssm2518_constraints_2048000; in ssm2518_set_sysclk()
687 ssm2518->constraints = &ssm2518_constraints_2822000; in ssm2518_set_sysclk()
695 ssm2518->constraints = &ssm2518_constraints_3072000; in ssm2518_set_sysclk()
700 ssm2518->constraints = &ssm2518_constraints_12288000; in ssm2518_set_sysclk()
706 ssm2518->sysclk = freq; in ssm2518_set_sysclk()
708 return regmap_update_bits(ssm2518->regmap, SSM2518_REG_POWER1, in ssm2518_set_sysclk()
738 struct ssm2518 *ssm2518; in ssm2518_i2c_probe() local
741 ssm2518 = devm_kzalloc(&i2c->dev, sizeof(*ssm2518), GFP_KERNEL); in ssm2518_i2c_probe()
742 if (ssm2518 == NULL) in ssm2518_i2c_probe()
746 ssm2518->enable_gpio = devm_gpiod_get_optional(&i2c->dev, NULL, in ssm2518_i2c_probe()
748 ret = PTR_ERR_OR_ZERO(ssm2518->enable_gpio); in ssm2518_i2c_probe()
752 gpiod_set_consumer_name(ssm2518->enable_gpio, "SSM2518 nSD"); in ssm2518_i2c_probe()
754 i2c_set_clientdata(i2c, ssm2518); in ssm2518_i2c_probe()
756 ssm2518->regmap = devm_regmap_init_i2c(i2c, &ssm2518_regmap_config); in ssm2518_i2c_probe()
757 if (IS_ERR(ssm2518->regmap)) in ssm2518_i2c_probe()
758 return PTR_ERR(ssm2518->regmap); in ssm2518_i2c_probe()
766 regcache_cache_bypass(ssm2518->regmap, true); in ssm2518_i2c_probe()
767 ret = regmap_write(ssm2518->regmap, SSM2518_REG_POWER1, in ssm2518_i2c_probe()
769 regcache_cache_bypass(ssm2518->regmap, false); in ssm2518_i2c_probe()
773 ret = regmap_update_bits(ssm2518->regmap, SSM2518_REG_POWER2, in ssm2518_i2c_probe()
778 ret = ssm2518_set_power(ssm2518, false); in ssm2518_i2c_probe()