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()
964 struct cs42l56_private *cs42l56 = in cs42l56_beep_work() local
966 struct snd_soc_component *component = cs42l56->component; in cs42l56_beep_work()
972 if (cs42l56->beep_rate) { in cs42l56_beep_work()
974 if (abs(cs42l56->beep_rate - beep_freq[i]) < in cs42l56_beep_work()
975 abs(cs42l56->beep_rate - beep_freq[best])) in cs42l56_beep_work()
980 beep_freq[best], cs42l56->beep_rate); in cs42l56_beep_work()
1003 struct cs42l56_private *cs42l56 = snd_soc_component_get_drvdata(component); in cs42l56_beep_event() local
1019 cs42l56->beep_rate = hz; in cs42l56_beep_event()
1020 schedule_work(&cs42l56->beep_work); in cs42l56_beep_event()
1027 struct cs42l56_private *cs42l56 = dev_get_drvdata(dev); in beep_store() local
1035 input_event(cs42l56->beep, EV_SND, SND_TONE, time); in beep_store()
1044 struct cs42l56_private *cs42l56 = snd_soc_component_get_drvdata(component); in cs42l56_init_beep() local
1047 cs42l56->beep = devm_input_allocate_device(component->dev); in cs42l56_init_beep()
1048 if (!cs42l56->beep) { in cs42l56_init_beep()
1053 INIT_WORK(&cs42l56->beep_work, cs42l56_beep_work); in cs42l56_init_beep()
1054 cs42l56->beep_rate = 0; in cs42l56_init_beep()
1056 cs42l56->beep->name = "CS42L56 Beep Generator"; in cs42l56_init_beep()
1057 cs42l56->beep->phys = dev_name(component->dev); in cs42l56_init_beep()
1058 cs42l56->beep->id.bustype = BUS_I2C; in cs42l56_init_beep()
1060 cs42l56->beep->evbit[0] = BIT_MASK(EV_SND); in cs42l56_init_beep()
1061 cs42l56->beep->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); in cs42l56_init_beep()
1062 cs42l56->beep->event = cs42l56_beep_event; in cs42l56_init_beep()
1063 cs42l56->beep->dev.parent = component->dev; in cs42l56_init_beep()
1064 input_set_drvdata(cs42l56->beep, component); in cs42l56_init_beep()
1066 ret = input_register_device(cs42l56->beep); in cs42l56_init_beep()
1068 cs42l56->beep = NULL; in cs42l56_init_beep()
1081 struct cs42l56_private *cs42l56 = snd_soc_component_get_drvdata(component); in cs42l56_free_beep() local
1084 cancel_work_sync(&cs42l56->beep_work); in cs42l56_free_beep()
1085 cs42l56->beep = NULL; in cs42l56_free_beep()
1171 struct cs42l56_private *cs42l56; in cs42l56_i2c_probe() local
1179 cs42l56 = devm_kzalloc(&i2c_client->dev, sizeof(*cs42l56), GFP_KERNEL); in cs42l56_i2c_probe()
1180 if (cs42l56 == NULL) in cs42l56_i2c_probe()
1182 cs42l56->dev = &i2c_client->dev; in cs42l56_i2c_probe()
1184 cs42l56->regmap = devm_regmap_init_i2c(i2c_client, &cs42l56_regmap); in cs42l56_i2c_probe()
1185 if (IS_ERR(cs42l56->regmap)) { in cs42l56_i2c_probe()
1186 ret = PTR_ERR(cs42l56->regmap); in cs42l56_i2c_probe()
1192 cs42l56->pdata = *pdata; in cs42l56_i2c_probe()
1196 &cs42l56->pdata); in cs42l56_i2c_probe()
1202 if (cs42l56->pdata.gpio_nreset) { in cs42l56_i2c_probe()
1203 ret = gpio_request_one(cs42l56->pdata.gpio_nreset, in cs42l56_i2c_probe()
1208 cs42l56->pdata.gpio_nreset, ret); in cs42l56_i2c_probe()
1211 gpio_set_value_cansleep(cs42l56->pdata.gpio_nreset, 0); in cs42l56_i2c_probe()
1212 gpio_set_value_cansleep(cs42l56->pdata.gpio_nreset, 1); in cs42l56_i2c_probe()
1216 i2c_set_clientdata(i2c_client, cs42l56); in cs42l56_i2c_probe()
1218 for (i = 0; i < ARRAY_SIZE(cs42l56->supplies); i++) in cs42l56_i2c_probe()
1219 cs42l56->supplies[i].supply = cs42l56_supply_names[i]; in cs42l56_i2c_probe()
1222 ARRAY_SIZE(cs42l56->supplies), in cs42l56_i2c_probe()
1223 cs42l56->supplies); in cs42l56_i2c_probe()
1230 ret = regulator_bulk_enable(ARRAY_SIZE(cs42l56->supplies), in cs42l56_i2c_probe()
1231 cs42l56->supplies); in cs42l56_i2c_probe()
1238 ret = regmap_read(cs42l56->regmap, CS42L56_CHIP_ID_1, &reg); in cs42l56_i2c_probe()
1259 if (cs42l56->pdata.ain1a_ref_cfg) in cs42l56_i2c_probe()
1260 regmap_update_bits(cs42l56->regmap, CS42L56_AIN_REFCFG_ADC_MUX, in cs42l56_i2c_probe()
1264 if (cs42l56->pdata.ain1b_ref_cfg) in cs42l56_i2c_probe()
1265 regmap_update_bits(cs42l56->regmap, CS42L56_AIN_REFCFG_ADC_MUX, in cs42l56_i2c_probe()
1269 if (cs42l56->pdata.ain2a_ref_cfg) in cs42l56_i2c_probe()
1270 regmap_update_bits(cs42l56->regmap, CS42L56_AIN_REFCFG_ADC_MUX, in cs42l56_i2c_probe()
1274 if (cs42l56->pdata.ain2b_ref_cfg) in cs42l56_i2c_probe()
1275 regmap_update_bits(cs42l56->regmap, CS42L56_AIN_REFCFG_ADC_MUX, in cs42l56_i2c_probe()
1279 if (cs42l56->pdata.micbias_lvl) in cs42l56_i2c_probe()
1280 regmap_update_bits(cs42l56->regmap, CS42L56_GAIN_BIAS_CTL, in cs42l56_i2c_probe()
1282 cs42l56->pdata.micbias_lvl); in cs42l56_i2c_probe()
1284 if (cs42l56->pdata.chgfreq) in cs42l56_i2c_probe()
1285 regmap_update_bits(cs42l56->regmap, CS42L56_CLASSH_CTL, in cs42l56_i2c_probe()
1287 cs42l56->pdata.chgfreq); in cs42l56_i2c_probe()
1289 if (cs42l56->pdata.hpfb_freq) in cs42l56_i2c_probe()
1290 regmap_update_bits(cs42l56->regmap, CS42L56_HPF_CTL, in cs42l56_i2c_probe()
1292 cs42l56->pdata.hpfb_freq); in cs42l56_i2c_probe()
1294 if (cs42l56->pdata.hpfa_freq) in cs42l56_i2c_probe()
1295 regmap_update_bits(cs42l56->regmap, CS42L56_HPF_CTL, in cs42l56_i2c_probe()
1297 cs42l56->pdata.hpfa_freq); in cs42l56_i2c_probe()
1299 if (cs42l56->pdata.adaptive_pwr) in cs42l56_i2c_probe()
1300 regmap_update_bits(cs42l56->regmap, CS42L56_CLASSH_CTL, in cs42l56_i2c_probe()
1302 cs42l56->pdata.adaptive_pwr); in cs42l56_i2c_probe()
1312 regulator_bulk_disable(ARRAY_SIZE(cs42l56->supplies), in cs42l56_i2c_probe()
1313 cs42l56->supplies); in cs42l56_i2c_probe()
1319 struct cs42l56_private *cs42l56 = i2c_get_clientdata(client); in cs42l56_i2c_remove() local
1321 regulator_bulk_disable(ARRAY_SIZE(cs42l56->supplies), in cs42l56_i2c_remove()
1322 cs42l56->supplies); in cs42l56_i2c_remove()