Lines Matching +full:dsp +full:- +full:config +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0
3 // cs35l41.c -- CS35l41 ALSA SoC audio driver
5 // Copyright 2017-2021 Cirrus Logic, Inc.
23 #include <sound/soc-dapm.h>
165 return -EINVAL; in cs35l41_get_fs_mon_config_index()
170 1, 913, TLV_DB_MINMAX_ITEM(-10200, 1200));
187 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in cs35l41_dsp_preload_ev()
193 if (cs35l41->dsp.cs_dsp.booted) in cs35l41_dsp_preload_ev()
198 if (cs35l41->dsp.preloaded) in cs35l41_dsp_preload_ev()
201 if (cs35l41->dsp.cs_dsp.running) { in cs35l41_dsp_preload_ev()
216 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in cs35l41_dsp_audio_ev()
223 if (!cs35l41->dsp.cs_dsp.running) in cs35l41_dsp_audio_ev()
226 ret = regmap_read(cs35l41->regmap, CS35L41_DSP_MBOX_2, &fw_status); in cs35l41_dsp_audio_ev()
228 dev_err(cs35l41->dev, in cs35l41_dsp_audio_ev()
238 dev_err(cs35l41->dev, "Firmware status is invalid: %u\n", in cs35l41_dsp_audio_ev()
240 return -EINVAL; in cs35l41_dsp_audio_ev()
243 return cs35l41_set_cspl_mbox_cmd(cs35l41->dev, cs35l41->regmap, in cs35l41_dsp_audio_ev()
246 return cs35l41_set_cspl_mbox_cmd(cs35l41->dev, cs35l41->regmap, in cs35l41_dsp_audio_ev()
253 static const char * const cs35l41_pcm_source_texts[] = {"ASP", "DSP"};
362 switch (cs35l41->hw_cfg.bst_type) { in cs35l41_boost_enable()
366 regmap_update_bits(cs35l41->regmap, CS35L41_PWR_CTRL2, CS35L41_BST_EN_MASK, in cs35l41_boost_enable()
378 regmap_write(cs35l41->regmap, CS35L41_IRQ1_STATUS1, irq_err_bit); in cs35l41_error_release()
379 regmap_write(cs35l41->regmap, CS35L41_PROTECT_REL_ERR_IGN, 0); in cs35l41_error_release()
380 regmap_update_bits(cs35l41->regmap, CS35L41_PROTECT_REL_ERR_IGN, rel_err_bit, rel_err_bit); in cs35l41_error_release()
381 regmap_update_bits(cs35l41->regmap, CS35L41_PROTECT_REL_ERR_IGN, rel_err_bit, 0); in cs35l41_error_release()
392 ret = pm_runtime_resume_and_get(cs35l41->dev); in cs35l41_irq()
394 dev_err(cs35l41->dev, in cs35l41_irq()
403 regmap_read(cs35l41->regmap, in cs35l41_irq()
406 regmap_read(cs35l41->regmap, in cs35l41_irq()
417 regmap_update_bits(cs35l41->regmap, CS35L41_IRQ1_MASK4, in cs35l41_irq()
424 * speaker out of Safe-Mode. in cs35l41_irq()
427 dev_crit_ratelimited(cs35l41->dev, "Amp short error\n"); in cs35l41_irq()
433 dev_crit_ratelimited(cs35l41->dev, "Over temperature warning\n"); in cs35l41_irq()
439 dev_crit_ratelimited(cs35l41->dev, "Over temperature error\n"); in cs35l41_irq()
445 dev_crit_ratelimited(cs35l41->dev, "VBST Over Voltage error\n"); in cs35l41_irq()
453 dev_crit_ratelimited(cs35l41->dev, "DCM VBST Under Voltage Error\n"); in cs35l41_irq()
461 dev_crit_ratelimited(cs35l41->dev, "LBST error: powering off!\n"); in cs35l41_irq()
469 regmap_write(cs35l41->regmap, CS35L41_IRQ1_STATUS3, CS35L41_PLL_LOCK); in cs35l41_irq()
471 if (cs35l41->hw_cfg.bst_type == CS35L41_SHD_BOOST_ACTV || in cs35l41_irq()
472 cs35l41->hw_cfg.bst_type == CS35L41_SHD_BOOST_PASS) { in cs35l41_irq()
473 ret = cs35l41_mdsync_up(cs35l41->regmap); in cs35l41_irq()
475 dev_err(cs35l41->dev, "MDSYNC-up failed: %d\n", ret); in cs35l41_irq()
477 dev_dbg(cs35l41->dev, "MDSYNC-up done\n"); in cs35l41_irq()
479 dev_dbg(cs35l41->dev, "PUP-done status: %d\n", in cs35l41_irq()
487 pm_runtime_mark_last_busy(cs35l41->dev); in cs35l41_irq()
488 pm_runtime_put_autosuspend(cs35l41->dev); in cs35l41_irq()
512 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in cs35l41_main_amp_event()
518 regmap_multi_reg_write_bypassed(cs35l41->regmap, in cs35l41_main_amp_event()
522 ret = cs35l41_global_enable(cs35l41->dev, cs35l41->regmap, cs35l41->hw_cfg.bst_type, in cs35l41_main_amp_event()
523 1, cs35l41->dsp.cs_dsp.running); in cs35l41_main_amp_event()
526 ret = cs35l41_global_enable(cs35l41->dev, cs35l41->regmap, cs35l41->hw_cfg.bst_type, in cs35l41_main_amp_event()
527 0, cs35l41->dsp.cs_dsp.running); in cs35l41_main_amp_event()
529 regmap_multi_reg_write_bypassed(cs35l41->regmap, in cs35l41_main_amp_event()
534 dev_err(cs35l41->dev, "Invalid event = 0x%x\n", event); in cs35l41_main_amp_event()
535 ret = -EINVAL; in cs35l41_main_amp_event()
587 SND_SOC_DAPM_MUX("DSP RX1 Source", SND_SOC_NOPM, 0, 0, &dsp_rx1_mux),
588 SND_SOC_DAPM_MUX("DSP RX2 Source", SND_SOC_NOPM, 0, 0, &dsp_rx2_mux),
594 {"DSP RX1 Source", "ASPRX1", "ASPRX1"},
595 {"DSP RX1 Source", "ASPRX2", "ASPRX2"},
596 {"DSP RX2 Source", "ASPRX1", "ASPRX1"},
597 {"DSP RX2 Source", "ASPRX2", "ASPRX2"},
599 {"DSP1", NULL, "DSP RX1 Source"},
600 {"DSP1", NULL, "DSP RX2 Source"},
672 {"PCM Source", "DSP", "DSP1"},
679 struct cs35l41_private *cs35l41 = snd_soc_component_get_drvdata(dai->component); in cs35l41_set_channel_map()
681 return cs35l41_set_channels(cs35l41->dev, cs35l41->regmap, tx_n, tx_slot, rx_n, rx_slot); in cs35l41_set_channel_map()
686 struct cs35l41_private *cs35l41 = snd_soc_component_get_drvdata(dai->component); in cs35l41_set_dai_fmt()
696 dev_warn(cs35l41->dev, "Mixed provider/consumer mode unsupported\n"); in cs35l41_set_dai_fmt()
697 return -EINVAL; in cs35l41_set_dai_fmt()
707 dev_warn(cs35l41->dev, "Invalid or unsupported DAI format\n"); in cs35l41_set_dai_fmt()
708 return -EINVAL; in cs35l41_set_dai_fmt()
724 dev_warn(cs35l41->dev, "Invalid DAI clock INV\n"); in cs35l41_set_dai_fmt()
725 return -EINVAL; in cs35l41_set_dai_fmt()
728 return regmap_update_bits(cs35l41->regmap, CS35L41_SP_FORMAT, in cs35l41_set_dai_fmt()
759 struct cs35l41_private *cs35l41 = snd_soc_component_get_drvdata(dai->component); in cs35l41_pcm_hw_params()
770 dev_err(cs35l41->dev, "Unsupported rate: %u\n", rate); in cs35l41_pcm_hw_params()
771 return -EINVAL; in cs35l41_pcm_hw_params()
777 regmap_update_bits(cs35l41->regmap, CS35L41_GLOBAL_CLK_CTRL, in cs35l41_pcm_hw_params()
781 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in cs35l41_pcm_hw_params()
782 regmap_update_bits(cs35l41->regmap, CS35L41_SP_FORMAT, in cs35l41_pcm_hw_params()
785 regmap_update_bits(cs35l41->regmap, CS35L41_SP_RX_WL, in cs35l41_pcm_hw_params()
789 regmap_update_bits(cs35l41->regmap, CS35L41_SP_FORMAT, in cs35l41_pcm_hw_params()
792 regmap_update_bits(cs35l41->regmap, CS35L41_SP_TX_WL, in cs35l41_pcm_hw_params()
809 return -EINVAL; in cs35l41_get_clk_config()
825 if (substream->runtime) in cs35l41_pcm_startup()
826 return snd_pcm_hw_constraint_list(substream->runtime, 0, in cs35l41_pcm_startup()
850 dev_err(cs35l41->dev, "Invalid CLK Config\n"); in cs35l41_component_set_sysclk()
851 return -EINVAL; in cs35l41_component_set_sysclk()
857 dev_err(cs35l41->dev, "Invalid CLK Config: %d, freq: %u\n", in cs35l41_component_set_sysclk()
859 return -EINVAL; in cs35l41_component_set_sysclk()
862 regmap_update_bits(cs35l41->regmap, CS35L41_PLL_CLK_CTRL, in cs35l41_component_set_sysclk()
865 regmap_update_bits(cs35l41->regmap, CS35L41_PLL_CLK_CTRL, in cs35l41_component_set_sysclk()
868 regmap_update_bits(cs35l41->regmap, CS35L41_PLL_CLK_CTRL, in cs35l41_component_set_sysclk()
871 regmap_update_bits(cs35l41->regmap, CS35L41_PLL_CLK_CTRL, in cs35l41_component_set_sysclk()
873 regmap_update_bits(cs35l41->regmap, CS35L41_PLL_CLK_CTRL, in cs35l41_component_set_sysclk()
876 regmap_update_bits(cs35l41->regmap, CS35L41_PLL_CLK_CTRL, in cs35l41_component_set_sysclk()
886 struct cs35l41_private *cs35l41 = snd_soc_component_get_drvdata(dai->component); in cs35l41_dai_set_sysclk()
894 dev_err(cs35l41->dev, "Invalid CLK Config freq: %u\n", freq); in cs35l41_dai_set_sysclk()
895 return -EINVAL; in cs35l41_dai_set_sysclk()
898 dev_dbg(cs35l41->dev, "Set DAI sysclk %d\n", freq); in cs35l41_dai_set_sysclk()
905 /* Use hard-coded values */ in cs35l41_dai_set_sysclk()
912 regmap_write(cs35l41->regmap, CS35L41_TST_FS_MON0, val); in cs35l41_dai_set_sysclk()
919 struct cs35l41_hw_cfg *hw_cfg = &cs35l41->hw_cfg; in cs35l41_set_pdata()
922 if (!hw_cfg->valid) in cs35l41_set_pdata()
923 return -EINVAL; in cs35l41_set_pdata()
925 if (hw_cfg->bst_type == CS35L41_EXT_BOOST_NO_VSPK_SWITCH) in cs35l41_set_pdata()
926 return -EINVAL; in cs35l41_set_pdata()
929 ret = cs35l41_init_boost(cs35l41->dev, cs35l41->regmap, hw_cfg); in cs35l41_set_pdata()
934 if (hw_cfg->dout_hiz <= CS35L41_ASP_DOUT_HIZ_MASK && hw_cfg->dout_hiz >= 0) in cs35l41_set_pdata()
935 regmap_update_bits(cs35l41->regmap, CS35L41_SP_HIZ_CTRL, CS35L41_ASP_DOUT_HIZ_MASK, in cs35l41_set_pdata()
936 hw_cfg->dout_hiz); in cs35l41_set_pdata()
955 if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST) { in cs35l41_component_probe()
967 return wm_adsp2_component_probe(&cs35l41->dsp, component); in cs35l41_component_probe()
974 wm_adsp2_component_remove(&cs35l41->dsp, component); in cs35l41_component_remove()
987 .name = "cs35l41-pcm",
1009 .name = "cs35l41-codec",
1027 struct cs35l41_gpio_cfg *gpio1 = &hw_cfg->gpio1; in cs35l41_handle_pdata()
1028 struct cs35l41_gpio_cfg *gpio2 = &hw_cfg->gpio2; in cs35l41_handle_pdata()
1034 * To correctly configure those systems add shared-boost-active and shared-boost-passive in cs35l41_handle_pdata()
1035 * properties mapped to the correct value in boost-type. in cs35l41_handle_pdata()
1038 if (device_property_read_bool(dev, "cirrus,shared-boost-active")) { in cs35l41_handle_pdata()
1039 hw_cfg->bst_type = CS35L41_SHD_BOOST_ACTV; in cs35l41_handle_pdata()
1040 } else if (device_property_read_bool(dev, "cirrus,shared-boost-passive")) { in cs35l41_handle_pdata()
1041 hw_cfg->bst_type = CS35L41_SHD_BOOST_PASS; in cs35l41_handle_pdata()
1043 ret = device_property_read_u32(dev, "cirrus,boost-type", &val); in cs35l41_handle_pdata()
1045 hw_cfg->bst_type = val; in cs35l41_handle_pdata()
1048 ret = device_property_read_u32(dev, "cirrus,boost-peak-milliamp", &val); in cs35l41_handle_pdata()
1050 hw_cfg->bst_ipk = val; in cs35l41_handle_pdata()
1052 hw_cfg->bst_ipk = -1; in cs35l41_handle_pdata()
1054 ret = device_property_read_u32(dev, "cirrus,boost-ind-nanohenry", &val); in cs35l41_handle_pdata()
1056 hw_cfg->bst_ind = val; in cs35l41_handle_pdata()
1058 hw_cfg->bst_ind = -1; in cs35l41_handle_pdata()
1060 ret = device_property_read_u32(dev, "cirrus,boost-cap-microfarad", &val); in cs35l41_handle_pdata()
1062 hw_cfg->bst_cap = val; in cs35l41_handle_pdata()
1064 hw_cfg->bst_cap = -1; in cs35l41_handle_pdata()
1066 ret = device_property_read_u32(dev, "cirrus,asp-sdout-hiz", &val); in cs35l41_handle_pdata()
1068 hw_cfg->dout_hiz = val; in cs35l41_handle_pdata()
1070 hw_cfg->dout_hiz = -1; in cs35l41_handle_pdata()
1072 /* GPIO1 Pin Config */ in cs35l41_handle_pdata()
1073 gpio1->pol_inv = device_property_read_bool(dev, "cirrus,gpio1-polarity-invert"); in cs35l41_handle_pdata()
1074 gpio1->out_en = device_property_read_bool(dev, "cirrus,gpio1-output-enable"); in cs35l41_handle_pdata()
1075 ret = device_property_read_u32(dev, "cirrus,gpio1-src-select", &val); in cs35l41_handle_pdata()
1077 gpio1->func = val; in cs35l41_handle_pdata()
1078 gpio1->valid = true; in cs35l41_handle_pdata()
1081 /* GPIO2 Pin Config */ in cs35l41_handle_pdata()
1082 gpio2->pol_inv = device_property_read_bool(dev, "cirrus,gpio2-polarity-invert"); in cs35l41_handle_pdata()
1083 gpio2->out_en = device_property_read_bool(dev, "cirrus,gpio2-output-enable"); in cs35l41_handle_pdata()
1084 ret = device_property_read_u32(dev, "cirrus,gpio2-src-select", &val); in cs35l41_handle_pdata()
1086 gpio2->func = val; in cs35l41_handle_pdata()
1087 gpio2->valid = true; in cs35l41_handle_pdata()
1090 hw_cfg->valid = true; in cs35l41_handle_pdata()
1097 struct wm_adsp *dsp; in cs35l41_dsp_init() local
1101 dsp = &cs35l41->dsp; in cs35l41_dsp_init()
1102 dsp->part = "cs35l41"; in cs35l41_dsp_init()
1103 dsp->fw = 9; /* 9 is WM_ADSP_FW_SPK_PROT in wm_adsp.c */ in cs35l41_dsp_init()
1104 dsp->toggle_preload = true; in cs35l41_dsp_init()
1106 cs35l41_configure_cs_dsp(cs35l41->dev, cs35l41->regmap, &dsp->cs_dsp); in cs35l41_dsp_init()
1108 ret = cs35l41_write_fs_errata(cs35l41->dev, cs35l41->regmap); in cs35l41_dsp_init()
1112 ret = wm_halo_init(dsp); in cs35l41_dsp_init()
1114 dev_err(cs35l41->dev, "wm_halo_init failed: %d\n", ret); in cs35l41_dsp_init()
1118 switch (cs35l41->hw_cfg.bst_type) { in cs35l41_dsp_init()
1128 dev_err(cs35l41->dev, "wm_halo_init failed - Invalid Boost Type: %d\n", in cs35l41_dsp_init()
1129 cs35l41->hw_cfg.bst_type); in cs35l41_dsp_init()
1133 ret = regmap_write(cs35l41->regmap, CS35L41_DSP1_RX5_SRC, dsp1rx5_src); in cs35l41_dsp_init()
1135 dev_err(cs35l41->dev, "Write DSP1RX5_SRC: %d failed: %d\n", dsp1rx5_src, ret); in cs35l41_dsp_init()
1138 ret = regmap_write(cs35l41->regmap, CS35L41_DSP1_RX6_SRC, CS35L41_INPUT_SRC_VBSTMON); in cs35l41_dsp_init()
1140 dev_err(cs35l41->dev, "Write CS35L41_INPUT_SRC_VBSTMON failed: %d\n", ret); in cs35l41_dsp_init()
1143 ret = regmap_write(cs35l41->regmap, CS35L41_DSP1_RX7_SRC, in cs35l41_dsp_init()
1146 dev_err(cs35l41->dev, "Write INPUT_SRC_TEMPMON failed: %d\n", ret); in cs35l41_dsp_init()
1149 ret = regmap_write(cs35l41->regmap, CS35L41_DSP1_RX8_SRC, in cs35l41_dsp_init()
1152 dev_err(cs35l41->dev, "Write INPUT_SRC_RSVD failed: %d\n", ret); in cs35l41_dsp_init()
1159 wm_adsp2_remove(dsp); in cs35l41_dsp_init()
1166 acpi_handle handle = ACPI_HANDLE(cs35l41->dev); in cs35l41_acpi_get_name()
1176 if (PTR_ERR(sub) == -ENODATA) in cs35l41_acpi_get_name()
1182 cs35l41->dsp.system_name = sub; in cs35l41_acpi_get_name()
1183 dev_dbg(cs35l41->dev, "Subsystem ID: %s\n", cs35l41->dsp.system_name); in cs35l41_acpi_get_name()
1195 cs35l41->hw_cfg = *hw_cfg; in cs35l41_probe()
1197 ret = cs35l41_handle_pdata(cs35l41->dev, &cs35l41->hw_cfg); in cs35l41_probe()
1203 cs35l41->supplies[i].supply = cs35l41_supplies[i]; in cs35l41_probe()
1205 ret = devm_regulator_bulk_get(cs35l41->dev, CS35L41_NUM_SUPPLIES, in cs35l41_probe()
1206 cs35l41->supplies); in cs35l41_probe()
1208 dev_err(cs35l41->dev, "Failed to request core supplies: %d\n", ret); in cs35l41_probe()
1212 ret = regulator_bulk_enable(CS35L41_NUM_SUPPLIES, cs35l41->supplies); in cs35l41_probe()
1214 dev_err(cs35l41->dev, "Failed to enable core supplies: %d\n", ret); in cs35l41_probe()
1219 cs35l41->reset_gpio = devm_gpiod_get_optional(cs35l41->dev, "reset", in cs35l41_probe()
1221 if (IS_ERR(cs35l41->reset_gpio)) { in cs35l41_probe()
1222 ret = PTR_ERR(cs35l41->reset_gpio); in cs35l41_probe()
1223 cs35l41->reset_gpio = NULL; in cs35l41_probe()
1224 if (ret == -EBUSY) { in cs35l41_probe()
1225 dev_info(cs35l41->dev, in cs35l41_probe()
1228 dev_err(cs35l41->dev, in cs35l41_probe()
1233 if (cs35l41->reset_gpio) { in cs35l41_probe()
1236 gpiod_set_value_cansleep(cs35l41->reset_gpio, 1); in cs35l41_probe()
1241 ret = regmap_read_poll_timeout(cs35l41->regmap, CS35L41_IRQ1_STATUS4, in cs35l41_probe()
1245 dev_err(cs35l41->dev, in cs35l41_probe()
1250 regmap_read(cs35l41->regmap, CS35L41_IRQ1_STATUS3, &int_status); in cs35l41_probe()
1252 dev_err(cs35l41->dev, "OTP Boot error\n"); in cs35l41_probe()
1253 ret = -EINVAL; in cs35l41_probe()
1257 ret = regmap_read(cs35l41->regmap, CS35L41_DEVID, ®id); in cs35l41_probe()
1259 dev_err(cs35l41->dev, "Get Device ID failed: %d\n", ret); in cs35l41_probe()
1263 ret = regmap_read(cs35l41->regmap, CS35L41_REVID, ®_revid); in cs35l41_probe()
1265 dev_err(cs35l41->dev, "Get Revision ID failed: %d\n", ret); in cs35l41_probe()
1276 dev_err(cs35l41->dev, "CS35L41 Device ID (%X). Expected ID %X\n", in cs35l41_probe()
1278 ret = -ENODEV; in cs35l41_probe()
1282 cs35l41_test_key_unlock(cs35l41->dev, cs35l41->regmap); in cs35l41_probe()
1284 ret = cs35l41_register_errata_patch(cs35l41->dev, cs35l41->regmap, reg_revid); in cs35l41_probe()
1288 ret = cs35l41_otp_unpack(cs35l41->dev, cs35l41->regmap); in cs35l41_probe()
1290 dev_err(cs35l41->dev, "OTP Unpack failed: %d\n", ret); in cs35l41_probe()
1294 cs35l41_test_key_lock(cs35l41->dev, cs35l41->regmap); in cs35l41_probe()
1296 irq_pol = cs35l41_gpio_config(cs35l41->regmap, &cs35l41->hw_cfg); in cs35l41_probe()
1299 regmap_write(cs35l41->regmap, CS35L41_IRQ1_MASK1, in cs35l41_probe()
1301 if (cs35l41->hw_cfg.bst_type == CS35L41_SHD_BOOST_PASS || in cs35l41_probe()
1302 cs35l41->hw_cfg.bst_type == CS35L41_SHD_BOOST_ACTV) in cs35l41_probe()
1303 regmap_update_bits(cs35l41->regmap, CS35L41_IRQ1_MASK3, CS35L41_INT3_PLL_LOCK_MASK, in cs35l41_probe()
1306 ret = devm_request_threaded_irq(cs35l41->dev, cs35l41->irq, NULL, cs35l41_irq, in cs35l41_probe()
1310 dev_err(cs35l41->dev, "Failed to request IRQ: %d\n", ret); in cs35l41_probe()
1316 dev_err(cs35l41->dev, "Set pdata failed: %d\n", ret); in cs35l41_probe()
1328 pm_runtime_set_autosuspend_delay(cs35l41->dev, 3000); in cs35l41_probe()
1329 pm_runtime_use_autosuspend(cs35l41->dev); in cs35l41_probe()
1330 pm_runtime_mark_last_busy(cs35l41->dev); in cs35l41_probe()
1331 pm_runtime_set_active(cs35l41->dev); in cs35l41_probe()
1332 pm_runtime_get_noresume(cs35l41->dev); in cs35l41_probe()
1333 pm_runtime_enable(cs35l41->dev); in cs35l41_probe()
1335 ret = devm_snd_soc_register_component(cs35l41->dev, in cs35l41_probe()
1339 dev_err(cs35l41->dev, "Register codec failed: %d\n", ret); in cs35l41_probe()
1343 pm_runtime_put_autosuspend(cs35l41->dev); in cs35l41_probe()
1345 dev_info(cs35l41->dev, "Cirrus Logic CS35L41 (%x), Revision: %02X\n", in cs35l41_probe()
1351 pm_runtime_dont_use_autosuspend(cs35l41->dev); in cs35l41_probe()
1352 pm_runtime_disable(cs35l41->dev); in cs35l41_probe()
1353 pm_runtime_put_noidle(cs35l41->dev); in cs35l41_probe()
1355 wm_adsp2_remove(&cs35l41->dsp); in cs35l41_probe()
1357 cs35l41_safe_reset(cs35l41->regmap, cs35l41->hw_cfg.bst_type); in cs35l41_probe()
1358 regulator_bulk_disable(CS35L41_NUM_SUPPLIES, cs35l41->supplies); in cs35l41_probe()
1359 gpiod_set_value_cansleep(cs35l41->reset_gpio, 0); in cs35l41_probe()
1367 pm_runtime_get_sync(cs35l41->dev); in cs35l41_remove()
1368 pm_runtime_dont_use_autosuspend(cs35l41->dev); in cs35l41_remove()
1369 pm_runtime_disable(cs35l41->dev); in cs35l41_remove()
1371 regmap_write(cs35l41->regmap, CS35L41_IRQ1_MASK1, 0xFFFFFFFF); in cs35l41_remove()
1372 if (cs35l41->hw_cfg.bst_type == CS35L41_SHD_BOOST_PASS || in cs35l41_remove()
1373 cs35l41->hw_cfg.bst_type == CS35L41_SHD_BOOST_ACTV) in cs35l41_remove()
1374 regmap_update_bits(cs35l41->regmap, CS35L41_IRQ1_MASK3, CS35L41_INT3_PLL_LOCK_MASK, in cs35l41_remove()
1376 kfree(cs35l41->dsp.system_name); in cs35l41_remove()
1377 wm_adsp2_remove(&cs35l41->dsp); in cs35l41_remove()
1378 cs35l41_safe_reset(cs35l41->regmap, cs35l41->hw_cfg.bst_type); in cs35l41_remove()
1380 pm_runtime_put_noidle(cs35l41->dev); in cs35l41_remove()
1382 regulator_bulk_disable(CS35L41_NUM_SUPPLIES, cs35l41->supplies); in cs35l41_remove()
1383 gpiod_set_value_cansleep(cs35l41->reset_gpio, 0); in cs35l41_remove()
1391 dev_dbg(cs35l41->dev, "Runtime suspend\n"); in cs35l41_runtime_suspend()
1393 if (!cs35l41->dsp.preloaded || !cs35l41->dsp.cs_dsp.running) in cs35l41_runtime_suspend()
1396 cs35l41_enter_hibernate(dev, cs35l41->regmap, cs35l41->hw_cfg.bst_type); in cs35l41_runtime_suspend()
1398 regcache_cache_only(cs35l41->regmap, true); in cs35l41_runtime_suspend()
1399 regcache_mark_dirty(cs35l41->regmap); in cs35l41_runtime_suspend()
1409 dev_dbg(cs35l41->dev, "Runtime resume\n"); in cs35l41_runtime_resume()
1411 if (!cs35l41->dsp.preloaded || !cs35l41->dsp.cs_dsp.running) in cs35l41_runtime_resume()
1414 regcache_cache_only(cs35l41->regmap, false); in cs35l41_runtime_resume()
1416 ret = cs35l41_exit_hibernate(cs35l41->dev, cs35l41->regmap); in cs35l41_runtime_resume()
1420 /* Test key needs to be unlocked to allow the OTP settings to re-apply */ in cs35l41_runtime_resume()
1421 cs35l41_test_key_unlock(cs35l41->dev, cs35l41->regmap); in cs35l41_runtime_resume()
1422 ret = regcache_sync(cs35l41->regmap); in cs35l41_runtime_resume()
1423 cs35l41_test_key_lock(cs35l41->dev, cs35l41->regmap); in cs35l41_runtime_resume()
1425 dev_err(cs35l41->dev, "Failed to restore register cache: %d\n", ret); in cs35l41_runtime_resume()
1428 cs35l41_init_boost(cs35l41->dev, cs35l41->regmap, &cs35l41->hw_cfg); in cs35l41_runtime_resume()
1437 dev_dbg(cs35l41->dev, "System suspend, disabling IRQ\n"); in cs35l41_sys_suspend()
1438 disable_irq(cs35l41->irq); in cs35l41_sys_suspend()
1447 dev_dbg(cs35l41->dev, "Late system suspend, reenabling IRQ\n"); in cs35l41_sys_suspend_noirq()
1448 enable_irq(cs35l41->irq); in cs35l41_sys_suspend_noirq()
1457 dev_dbg(cs35l41->dev, "Early system resume, disabling IRQ\n"); in cs35l41_sys_resume_noirq()
1458 disable_irq(cs35l41->irq); in cs35l41_sys_resume_noirq()
1467 dev_dbg(cs35l41->dev, "System resume, reenabling IRQ\n"); in cs35l41_sys_resume()
1468 enable_irq(cs35l41->irq); in cs35l41_sys_resume()