Lines Matching refs:cs42l56

718 	struct cs42l56_private *cs42l56 = snd_soc_component_get_drvdata(component);  in cs42l56_set_sysclk()  local
724 cs42l56->mclk_div2 = 0; in cs42l56_set_sysclk()
725 cs42l56->mclk_prediv = 0; in cs42l56_set_sysclk()
730 cs42l56->mclk_div2 = CS42L56_MCLK_DIV2; in cs42l56_set_sysclk()
731 cs42l56->mclk_prediv = 0; in cs42l56_set_sysclk()
736 cs42l56->mclk_div2 = CS42L56_MCLK_DIV2; in cs42l56_set_sysclk()
737 cs42l56->mclk_prediv = CS42L56_MCLK_PREDIV; in cs42l56_set_sysclk()
742 cs42l56->mclk = freq; in cs42l56_set_sysclk()
746 cs42l56->mclk_prediv); in cs42l56_set_sysclk()
749 cs42l56->mclk_div2); in cs42l56_set_sysclk()
757 struct cs42l56_private *cs42l56 = snd_soc_component_get_drvdata(component); in cs42l56_set_dai_fmt() local
761 cs42l56->iface = CS42L56_MASTER_MODE; in cs42l56_set_dai_fmt()
764 cs42l56->iface = CS42L56_SLAVE_MODE; in cs42l56_set_dai_fmt()
773 cs42l56->iface_fmt = CS42L56_DIG_FMT_I2S; in cs42l56_set_dai_fmt()
776 cs42l56->iface_fmt = CS42L56_DIG_FMT_LEFT_J; in cs42l56_set_dai_fmt()
785 cs42l56->iface_inv = 0; in cs42l56_set_dai_fmt()
788 cs42l56->iface_inv = CS42L56_SCLK_INV; in cs42l56_set_dai_fmt()
795 CS42L56_MS_MODE_MASK, cs42l56->iface); in cs42l56_set_dai_fmt()
797 CS42L56_DIG_FMT_MASK, cs42l56->iface_fmt); in cs42l56_set_dai_fmt()
799 CS42L56_SCLK_INV_MASK, cs42l56->iface_inv); in cs42l56_set_dai_fmt()
863 struct cs42l56_private *cs42l56 = snd_soc_component_get_drvdata(component); in cs42l56_pcm_hw_params() local
866 ratio = cs42l56_get_mclk_ratio(cs42l56->mclk, params_rate(params)); in cs42l56_pcm_hw_params()
881 struct cs42l56_private *cs42l56 = snd_soc_component_get_drvdata(component); in cs42l56_set_bias_level() local
895 regcache_cache_only(cs42l56->regmap, false); in cs42l56_set_bias_level()
896 regcache_sync(cs42l56->regmap); in cs42l56_set_bias_level()
897 ret = regulator_bulk_enable(ARRAY_SIZE(cs42l56->supplies), in cs42l56_set_bias_level()
898 cs42l56->supplies); in cs42l56_set_bias_level()
900 dev_err(cs42l56->dev, in cs42l56_set_bias_level()
914 regcache_cache_only(cs42l56->regmap, true); in cs42l56_set_bias_level()
915 regulator_bulk_disable(ARRAY_SIZE(cs42l56->supplies), in cs42l56_set_bias_level()
916 cs42l56->supplies); in cs42l56_set_bias_level()
963 struct cs42l56_private *cs42l56 = in cs42l56_beep_work() local
965 struct snd_soc_component *component = cs42l56->component; in cs42l56_beep_work()
971 if (cs42l56->beep_rate) { in cs42l56_beep_work()
973 if (abs(cs42l56->beep_rate - beep_freq[i]) < in cs42l56_beep_work()
974 abs(cs42l56->beep_rate - beep_freq[best])) in cs42l56_beep_work()
979 beep_freq[best], cs42l56->beep_rate); in cs42l56_beep_work()
1002 struct cs42l56_private *cs42l56 = snd_soc_component_get_drvdata(component); in cs42l56_beep_event() local
1017 cs42l56->beep_rate = hz; in cs42l56_beep_event()
1018 schedule_work(&cs42l56->beep_work); in cs42l56_beep_event()
1026 struct cs42l56_private *cs42l56 = dev_get_drvdata(dev); in cs42l56_beep_set() local
1034 input_event(cs42l56->beep, EV_SND, SND_TONE, time); in cs42l56_beep_set()
1043 struct cs42l56_private *cs42l56 = snd_soc_component_get_drvdata(component); in cs42l56_init_beep() local
1046 cs42l56->beep = devm_input_allocate_device(component->dev); in cs42l56_init_beep()
1047 if (!cs42l56->beep) { in cs42l56_init_beep()
1052 INIT_WORK(&cs42l56->beep_work, cs42l56_beep_work); in cs42l56_init_beep()
1053 cs42l56->beep_rate = 0; in cs42l56_init_beep()
1055 cs42l56->beep->name = "CS42L56 Beep Generator"; in cs42l56_init_beep()
1056 cs42l56->beep->phys = dev_name(component->dev); in cs42l56_init_beep()
1057 cs42l56->beep->id.bustype = BUS_I2C; in cs42l56_init_beep()
1059 cs42l56->beep->evbit[0] = BIT_MASK(EV_SND); in cs42l56_init_beep()
1060 cs42l56->beep->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); in cs42l56_init_beep()
1061 cs42l56->beep->event = cs42l56_beep_event; in cs42l56_init_beep()
1062 cs42l56->beep->dev.parent = component->dev; in cs42l56_init_beep()
1063 input_set_drvdata(cs42l56->beep, component); in cs42l56_init_beep()
1065 ret = input_register_device(cs42l56->beep); in cs42l56_init_beep()
1067 cs42l56->beep = NULL; in cs42l56_init_beep()
1080 struct cs42l56_private *cs42l56 = snd_soc_component_get_drvdata(component); in cs42l56_free_beep() local
1083 cancel_work_sync(&cs42l56->beep_work); in cs42l56_free_beep()
1084 cs42l56->beep = NULL; in cs42l56_free_beep()
1172 struct cs42l56_private *cs42l56; in cs42l56_i2c_probe() local
1180 cs42l56 = devm_kzalloc(&i2c_client->dev, sizeof(*cs42l56), GFP_KERNEL); in cs42l56_i2c_probe()
1181 if (cs42l56 == NULL) in cs42l56_i2c_probe()
1183 cs42l56->dev = &i2c_client->dev; in cs42l56_i2c_probe()
1185 cs42l56->regmap = devm_regmap_init_i2c(i2c_client, &cs42l56_regmap); in cs42l56_i2c_probe()
1186 if (IS_ERR(cs42l56->regmap)) { in cs42l56_i2c_probe()
1187 ret = PTR_ERR(cs42l56->regmap); in cs42l56_i2c_probe()
1193 cs42l56->pdata = *pdata; in cs42l56_i2c_probe()
1202 &cs42l56->pdata); in cs42l56_i2c_probe()
1206 cs42l56->pdata = *pdata; in cs42l56_i2c_probe()
1209 if (cs42l56->pdata.gpio_nreset) { in cs42l56_i2c_probe()
1210 ret = gpio_request_one(cs42l56->pdata.gpio_nreset, in cs42l56_i2c_probe()
1215 cs42l56->pdata.gpio_nreset, ret); in cs42l56_i2c_probe()
1218 gpio_set_value_cansleep(cs42l56->pdata.gpio_nreset, 0); in cs42l56_i2c_probe()
1219 gpio_set_value_cansleep(cs42l56->pdata.gpio_nreset, 1); in cs42l56_i2c_probe()
1223 i2c_set_clientdata(i2c_client, cs42l56); in cs42l56_i2c_probe()
1225 for (i = 0; i < ARRAY_SIZE(cs42l56->supplies); i++) in cs42l56_i2c_probe()
1226 cs42l56->supplies[i].supply = cs42l56_supply_names[i]; in cs42l56_i2c_probe()
1229 ARRAY_SIZE(cs42l56->supplies), in cs42l56_i2c_probe()
1230 cs42l56->supplies); in cs42l56_i2c_probe()
1237 ret = regulator_bulk_enable(ARRAY_SIZE(cs42l56->supplies), in cs42l56_i2c_probe()
1238 cs42l56->supplies); in cs42l56_i2c_probe()
1245 ret = regmap_read(cs42l56->regmap, CS42L56_CHIP_ID_1, &reg); in cs42l56_i2c_probe()
1260 if (cs42l56->pdata.ain1a_ref_cfg) in cs42l56_i2c_probe()
1261 regmap_update_bits(cs42l56->regmap, CS42L56_AIN_REFCFG_ADC_MUX, in cs42l56_i2c_probe()
1265 if (cs42l56->pdata.ain1b_ref_cfg) in cs42l56_i2c_probe()
1266 regmap_update_bits(cs42l56->regmap, CS42L56_AIN_REFCFG_ADC_MUX, in cs42l56_i2c_probe()
1270 if (cs42l56->pdata.ain2a_ref_cfg) in cs42l56_i2c_probe()
1271 regmap_update_bits(cs42l56->regmap, CS42L56_AIN_REFCFG_ADC_MUX, in cs42l56_i2c_probe()
1275 if (cs42l56->pdata.ain2b_ref_cfg) in cs42l56_i2c_probe()
1276 regmap_update_bits(cs42l56->regmap, CS42L56_AIN_REFCFG_ADC_MUX, in cs42l56_i2c_probe()
1280 if (cs42l56->pdata.micbias_lvl) in cs42l56_i2c_probe()
1281 regmap_update_bits(cs42l56->regmap, CS42L56_GAIN_BIAS_CTL, in cs42l56_i2c_probe()
1283 cs42l56->pdata.micbias_lvl); in cs42l56_i2c_probe()
1285 if (cs42l56->pdata.chgfreq) in cs42l56_i2c_probe()
1286 regmap_update_bits(cs42l56->regmap, CS42L56_CLASSH_CTL, in cs42l56_i2c_probe()
1288 cs42l56->pdata.chgfreq); in cs42l56_i2c_probe()
1290 if (cs42l56->pdata.hpfb_freq) in cs42l56_i2c_probe()
1291 regmap_update_bits(cs42l56->regmap, CS42L56_HPF_CTL, in cs42l56_i2c_probe()
1293 cs42l56->pdata.hpfb_freq); in cs42l56_i2c_probe()
1295 if (cs42l56->pdata.hpfa_freq) in cs42l56_i2c_probe()
1296 regmap_update_bits(cs42l56->regmap, CS42L56_HPF_CTL, in cs42l56_i2c_probe()
1298 cs42l56->pdata.hpfa_freq); in cs42l56_i2c_probe()
1300 if (cs42l56->pdata.adaptive_pwr) in cs42l56_i2c_probe()
1301 regmap_update_bits(cs42l56->regmap, CS42L56_CLASSH_CTL, in cs42l56_i2c_probe()
1303 cs42l56->pdata.adaptive_pwr); in cs42l56_i2c_probe()
1313 regulator_bulk_disable(ARRAY_SIZE(cs42l56->supplies), in cs42l56_i2c_probe()
1314 cs42l56->supplies); in cs42l56_i2c_probe()
1320 struct cs42l56_private *cs42l56 = i2c_get_clientdata(client); in cs42l56_i2c_remove() local
1322 regulator_bulk_disable(ARRAY_SIZE(cs42l56->supplies), in cs42l56_i2c_remove()
1323 cs42l56->supplies); in cs42l56_i2c_remove()