Lines Matching refs:cs42l52
476 struct cs42l52_private *cs42l52 = snd_soc_component_get_drvdata(component); in cs42l52_add_mic_controls() local
477 struct cs42l52_platform_data *pdata = &cs42l52->pdata; in cs42l52_add_mic_controls()
718 struct cs42l52_private *cs42l52 = snd_soc_component_get_drvdata(component); in cs42l52_set_sysclk() local
721 cs42l52->sysclk = freq; in cs42l52_set_sysclk()
732 struct cs42l52_private *cs42l52 = snd_soc_component_get_drvdata(component); in cs42l52_set_fmt() local
783 cs42l52->config.format = iface; in cs42l52_set_fmt()
784 snd_soc_component_write(component, CS42L52_IFACE_CTL1, cs42l52->config.format); in cs42l52_set_fmt()
810 struct cs42l52_private *cs42l52 = snd_soc_component_get_drvdata(component); in cs42l52_pcm_hw_params() local
814 index = cs42l52_get_clk(cs42l52->sysclk, params_rate(params)); in cs42l52_pcm_hw_params()
816 cs42l52->sysclk = clk_map_table[index].mclk; in cs42l52_pcm_hw_params()
836 struct cs42l52_private *cs42l52 = snd_soc_component_get_drvdata(component); in cs42l52_set_bias_level() local
847 regcache_cache_only(cs42l52->regmap, false); in cs42l52_set_bias_level()
848 regcache_sync(cs42l52->regmap); in cs42l52_set_bias_level()
854 regcache_cache_only(cs42l52->regmap, true); in cs42l52_set_bias_level()
902 struct cs42l52_private *cs42l52 = in cs42l52_beep_work() local
904 struct snd_soc_component *component = cs42l52->component; in cs42l52_beep_work()
910 if (cs42l52->beep_rate) { in cs42l52_beep_work()
912 if (abs(cs42l52->beep_rate - beep_rates[i]) < in cs42l52_beep_work()
913 abs(cs42l52->beep_rate - beep_rates[best])) in cs42l52_beep_work()
918 beep_rates[best], cs42l52->beep_rate); in cs42l52_beep_work()
941 struct cs42l52_private *cs42l52 = snd_soc_component_get_drvdata(component); in cs42l52_beep_event() local
957 cs42l52->beep_rate = hz; in cs42l52_beep_event()
958 schedule_work(&cs42l52->beep_work); in cs42l52_beep_event()
965 struct cs42l52_private *cs42l52 = dev_get_drvdata(dev); in beep_store() local
973 input_event(cs42l52->beep, EV_SND, SND_TONE, time); in beep_store()
982 struct cs42l52_private *cs42l52 = snd_soc_component_get_drvdata(component); in cs42l52_init_beep() local
985 cs42l52->beep = devm_input_allocate_device(component->dev); in cs42l52_init_beep()
986 if (!cs42l52->beep) { in cs42l52_init_beep()
991 INIT_WORK(&cs42l52->beep_work, cs42l52_beep_work); in cs42l52_init_beep()
992 cs42l52->beep_rate = 0; in cs42l52_init_beep()
994 cs42l52->beep->name = "CS42L52 Beep Generator"; in cs42l52_init_beep()
995 cs42l52->beep->phys = dev_name(component->dev); in cs42l52_init_beep()
996 cs42l52->beep->id.bustype = BUS_I2C; in cs42l52_init_beep()
998 cs42l52->beep->evbit[0] = BIT_MASK(EV_SND); in cs42l52_init_beep()
999 cs42l52->beep->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); in cs42l52_init_beep()
1000 cs42l52->beep->event = cs42l52_beep_event; in cs42l52_init_beep()
1001 cs42l52->beep->dev.parent = component->dev; in cs42l52_init_beep()
1002 input_set_drvdata(cs42l52->beep, component); in cs42l52_init_beep()
1004 ret = input_register_device(cs42l52->beep); in cs42l52_init_beep()
1006 cs42l52->beep = NULL; in cs42l52_init_beep()
1019 struct cs42l52_private *cs42l52 = snd_soc_component_get_drvdata(component); in cs42l52_free_beep() local
1022 cancel_work_sync(&cs42l52->beep_work); in cs42l52_free_beep()
1023 cs42l52->beep = NULL; in cs42l52_free_beep()
1031 struct cs42l52_private *cs42l52 = snd_soc_component_get_drvdata(component); in cs42l52_probe() local
1033 regcache_cache_only(cs42l52->regmap, true); in cs42l52_probe()
1039 cs42l52->sysclk = CS42L52_DEFAULT_CLK; in cs42l52_probe()
1040 cs42l52->config.format = CS42L52_DEFAULT_FORMAT; in cs42l52_probe()
1092 struct cs42l52_private *cs42l52; in cs42l52_i2c_probe() local
1099 cs42l52 = devm_kzalloc(&i2c_client->dev, sizeof(*cs42l52), GFP_KERNEL); in cs42l52_i2c_probe()
1100 if (cs42l52 == NULL) in cs42l52_i2c_probe()
1102 cs42l52->dev = &i2c_client->dev; in cs42l52_i2c_probe()
1104 cs42l52->regmap = devm_regmap_init_i2c(i2c_client, &cs42l52_regmap); in cs42l52_i2c_probe()
1105 if (IS_ERR(cs42l52->regmap)) { in cs42l52_i2c_probe()
1106 ret = PTR_ERR(cs42l52->regmap); in cs42l52_i2c_probe()
1111 cs42l52->pdata = *pdata; in cs42l52_i2c_probe()
1139 cs42l52->pdata = *pdata; in cs42l52_i2c_probe()
1142 if (cs42l52->pdata.reset_gpio) { in cs42l52_i2c_probe()
1144 cs42l52->pdata.reset_gpio, in cs42l52_i2c_probe()
1149 cs42l52->pdata.reset_gpio, ret); in cs42l52_i2c_probe()
1152 gpio_set_value_cansleep(cs42l52->pdata.reset_gpio, 0); in cs42l52_i2c_probe()
1153 gpio_set_value_cansleep(cs42l52->pdata.reset_gpio, 1); in cs42l52_i2c_probe()
1156 i2c_set_clientdata(i2c_client, cs42l52); in cs42l52_i2c_probe()
1158 ret = regmap_register_patch(cs42l52->regmap, cs42l52_threshold_patch, in cs42l52_i2c_probe()
1161 dev_warn(cs42l52->dev, "Failed to apply regmap patch: %d\n", in cs42l52_i2c_probe()
1164 ret = regmap_read(cs42l52->regmap, CS42L52_CHIP, ®); in cs42l52_i2c_probe()
1183 if (cs42l52->pdata.mica_diff_cfg) in cs42l52_i2c_probe()
1184 regmap_update_bits(cs42l52->regmap, CS42L52_MICA_CTL, in cs42l52_i2c_probe()
1186 cs42l52->pdata.mica_diff_cfg << in cs42l52_i2c_probe()
1189 if (cs42l52->pdata.micb_diff_cfg) in cs42l52_i2c_probe()
1190 regmap_update_bits(cs42l52->regmap, CS42L52_MICB_CTL, in cs42l52_i2c_probe()
1192 cs42l52->pdata.micb_diff_cfg << in cs42l52_i2c_probe()
1195 if (cs42l52->pdata.chgfreq) in cs42l52_i2c_probe()
1196 regmap_update_bits(cs42l52->regmap, CS42L52_CHARGE_PUMP, in cs42l52_i2c_probe()
1198 cs42l52->pdata.chgfreq << in cs42l52_i2c_probe()
1201 if (cs42l52->pdata.micbias_lvl) in cs42l52_i2c_probe()
1202 regmap_update_bits(cs42l52->regmap, CS42L52_IFACE_CTL2, in cs42l52_i2c_probe()
1204 cs42l52->pdata.micbias_lvl); in cs42l52_i2c_probe()