Lines Matching +full:asp +full:- +full:sdout +full:- +full:hiz

1 // SPDX-License-Identifier: GPL-2.0
3 // cs35l45.c - CS35L45 ALSA SoC audio driver
5 // Copyright 2019-2022 Cirrus Logic, Inc.
53 if (!cs35l45->dsp.cs_dsp.running) { in cs35l45_set_cspl_mbox_cmd()
54 dev_err(cs35l45->dev, "DSP not running\n"); in cs35l45_set_cspl_mbox_cmd()
55 return -EPERM; in cs35l45_set_cspl_mbox_cmd()
62 dev_err(cs35l45->dev, "Failed to write MBOX: %d\n", ret); in cs35l45_set_cspl_mbox_cmd()
72 dev_err(cs35l45->dev, "Failed to read MBOX STS: %d\n", ret); in cs35l45_set_cspl_mbox_cmd()
77 dev_dbg(cs35l45->dev, "[%u] cmd %u returned invalid sts %u", i, cmd, sts); in cs35l45_set_cspl_mbox_cmd()
83 dev_err(cs35l45->dev, "Failed to set mailbox cmd %u (status %u)\n", cmd, sts); in cs35l45_set_cspl_mbox_cmd()
85 return -ENOMSG; in cs35l45_set_cspl_mbox_cmd()
91 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in cs35l45_global_en_ev()
94 dev_dbg(cs35l45->dev, "%s event : %x\n", __func__, event); in cs35l45_global_en_ev()
98 regmap_write(cs35l45->regmap, CS35L45_GLOBAL_ENABLES, in cs35l45_global_en_ev()
106 regmap_write(cs35l45->regmap, CS35L45_GLOBAL_ENABLES, 0); in cs35l45_global_en_ev()
118 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in cs35l45_dsp_preload_ev()
124 if (cs35l45->dsp.cs_dsp.booted) in cs35l45_dsp_preload_ev()
129 if (cs35l45->dsp.cs_dsp.running) in cs35l45_dsp_preload_ev()
132 regmap_set_bits(cs35l45->regmap, CS35L45_PWRMGT_CTL, in cs35l45_dsp_preload_ev()
137 if (cs35l45->dsp.preloaded) in cs35l45_dsp_preload_ev()
140 if (cs35l45->dsp.cs_dsp.running) { in cs35l45_dsp_preload_ev()
155 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in cs35l45_dsp_audio_ev()
160 return cs35l45_set_cspl_mbox_cmd(cs35l45, cs35l45->regmap, in cs35l45_dsp_audio_ev()
163 return cs35l45_set_cspl_mbox_cmd(cs35l45, cs35l45->regmap, in cs35l45_dsp_audio_ev()
175 struct snd_card *card = component->card->snd_card; in cs35l45_activate_ctl()
182 dev_err(component->dev, "Can't find kcontrol %s\n", ctl_name); in cs35l45_activate_ctl()
183 return -EINVAL; in cs35l45_activate_ctl()
186 index_offset = snd_ctl_get_ioff(kcontrol, &kcontrol->id); in cs35l45_activate_ctl()
187 vd = &kcontrol->vd[index_offset]; in cs35l45_activate_ctl()
189 vd->access |= SNDRV_CTL_ELEM_ACCESS_WRITE; in cs35l45_activate_ctl()
191 vd->access &= ~SNDRV_CTL_ELEM_ACCESS_WRITE; in cs35l45_activate_ctl()
193 snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_INFO, &kcontrol->id); in cs35l45_activate_ctl()
206 ucontrol->value.integer.value[0] = cs35l45->amplifier_mode; in cs35l45_amplifier_mode_get()
223 if ((ucontrol->value.integer.value[0] == cs35l45->amplifier_mode) || in cs35l45_amplifier_mode_put()
224 (ucontrol->value.integer.value[0] > AMP_MODE_RCV)) in cs35l45_amplifier_mode_put()
229 ret = regmap_read(cs35l45->regmap, CS35L45_BLOCK_ENABLES, &amp_state); in cs35l45_amplifier_mode_put()
231 dev_err(cs35l45->dev, "Failed to read AMP state: %d\n", ret); in cs35l45_amplifier_mode_put()
236 regmap_clear_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, in cs35l45_amplifier_mode_put()
241 if (ucontrol->value.integer.value[0] == AMP_MODE_SPK) { in cs35l45_amplifier_mode_put()
242 regmap_clear_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, in cs35l45_amplifier_mode_put()
245 regmap_update_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, in cs35l45_amplifier_mode_put()
249 regmap_update_bits(cs35l45->regmap, CS35L45_HVLV_CONFIG, in cs35l45_amplifier_mode_put()
256 dev_err(cs35l45->dev, in cs35l45_amplifier_mode_put()
260 regmap_set_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, in cs35l45_amplifier_mode_put()
263 regmap_update_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, in cs35l45_amplifier_mode_put()
268 regmap_update_bits(cs35l45->regmap, CS35L45_HVLV_CONFIG, in cs35l45_amplifier_mode_put()
273 regmap_clear_bits(cs35l45->regmap, in cs35l45_amplifier_mode_put()
277 regmap_update_bits(cs35l45->regmap, CS35L45_AMP_GAIN, in cs35l45_amplifier_mode_put()
284 dev_err(cs35l45->dev, in cs35l45_amplifier_mode_put()
289 regmap_set_bits(cs35l45->regmap, CS35L45_BLOCK_ENABLES, in cs35l45_amplifier_mode_put()
296 cs35l45->amplifier_mode = ucontrol->value.integer.value[0]; in cs35l45_amplifier_mode_put()
594 static const DECLARE_TLV_DB_SCALE(cs35l45_dig_pcm_vol_tlv, -10225, 25, true);
607 -409, 48,
608 (CS35L45_AMP_VOL_PCM_WIDTH - 1) - 1,
621 dev_err(cs35l45->dev, "Invalid freq: %u\n", freq); in cs35l45_set_pll()
622 return -EINVAL; in cs35l45_set_pll()
625 regmap_read(cs35l45->regmap, CS35L45_REFCLK_INPUT, &val); in cs35l45_set_pll()
630 regmap_set_bits(cs35l45->regmap, CS35L45_REFCLK_INPUT, CS35L45_PLL_OPEN_LOOP_MASK); in cs35l45_set_pll()
631 regmap_update_bits(cs35l45->regmap, CS35L45_REFCLK_INPUT, in cs35l45_set_pll()
634 regmap_clear_bits(cs35l45->regmap, CS35L45_REFCLK_INPUT, CS35L45_PLL_REFCLK_EN_MASK); in cs35l45_set_pll()
635 regmap_clear_bits(cs35l45->regmap, CS35L45_REFCLK_INPUT, CS35L45_PLL_OPEN_LOOP_MASK); in cs35l45_set_pll()
636 regmap_set_bits(cs35l45->regmap, CS35L45_REFCLK_INPUT, CS35L45_PLL_REFCLK_EN_MASK); in cs35l45_set_pll()
643 struct cs35l45_private *cs35l45 = snd_soc_component_get_drvdata(codec_dai->component); in cs35l45_asp_set_fmt()
650 dev_err(cs35l45->dev, "Invalid DAI clocking\n"); in cs35l45_asp_set_fmt()
651 return -EINVAL; in cs35l45_asp_set_fmt()
662 dev_err(cs35l45->dev, "Invalid DAI format\n"); in cs35l45_asp_set_fmt()
663 return -EINVAL; in cs35l45_asp_set_fmt()
684 dev_warn(cs35l45->dev, "Invalid DAI clock polarity\n"); in cs35l45_asp_set_fmt()
685 return -EINVAL; in cs35l45_asp_set_fmt()
688 regmap_update_bits(cs35l45->regmap, CS35L45_ASP_CONTROL2, in cs35l45_asp_set_fmt()
703 struct cs35l45_private *cs35l45 = snd_soc_component_get_drvdata(dai->component); in cs35l45_asp_hw_params()
721 dev_warn(cs35l45->dev, "Unsupported sample rate (%d)\n", in cs35l45_asp_hw_params()
723 return -EINVAL; in cs35l45_asp_hw_params()
726 regmap_update_bits(cs35l45->regmap, CS35L45_GLOBAL_SAMPLE_RATE, in cs35l45_asp_hw_params()
732 if (cs35l45->slot_width) in cs35l45_asp_hw_params()
733 asp_width = cs35l45->slot_width; in cs35l45_asp_hw_params()
737 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in cs35l45_asp_hw_params()
738 regmap_update_bits(cs35l45->regmap, CS35L45_ASP_CONTROL2, in cs35l45_asp_hw_params()
742 regmap_update_bits(cs35l45->regmap, CS35L45_ASP_DATA_CONTROL5, in cs35l45_asp_hw_params()
746 regmap_update_bits(cs35l45->regmap, CS35L45_ASP_CONTROL2, in cs35l45_asp_hw_params()
750 regmap_update_bits(cs35l45->regmap, CS35L45_ASP_DATA_CONTROL1, in cs35l45_asp_hw_params()
755 if (cs35l45->sysclk_set) in cs35l45_asp_hw_params()
759 regmap_read(cs35l45->regmap, CS35L45_ASP_CONTROL2, &asp_fmt); in cs35l45_asp_hw_params()
767 cs35l45->slot_count, slot_multiple); in cs35l45_asp_hw_params()
776 struct cs35l45_private *cs35l45 = snd_soc_component_get_drvdata(dai->component); in cs35l45_asp_set_tdm_slot()
779 return -EINVAL; in cs35l45_asp_set_tdm_slot()
781 cs35l45->slot_width = slot_width; in cs35l45_asp_set_tdm_slot()
782 cs35l45->slot_count = slots; in cs35l45_asp_set_tdm_slot()
790 struct cs35l45_private *cs35l45 = snd_soc_component_get_drvdata(dai->component); in cs35l45_asp_set_sysclk()
794 dev_err(cs35l45->dev, "Invalid clk_id %d\n", clk_id); in cs35l45_asp_set_sysclk()
795 return -EINVAL; in cs35l45_asp_set_sysclk()
798 cs35l45->sysclk_set = false; in cs35l45_asp_set_sysclk()
804 return -EINVAL; in cs35l45_asp_set_sysclk()
806 cs35l45->sysclk_set = true; in cs35l45_asp_set_sysclk()
813 struct cs35l45_private *cs35l45 = snd_soc_component_get_drvdata(dai->component); in cs35l45_mute_stream()
819 regmap_read(cs35l45->regmap, CS35L45_GLOBAL_SAMPLE_RATE, &global_fs); in cs35l45_mute_stream()
833 regmap_read(cs35l45->regmap, CS35L45_AMP_PCM_HPF_TST, &val); in cs35l45_mute_stream()
844 regmap_multi_reg_write(cs35l45->regmap, hpf_override_seq, in cs35l45_mute_stream()
886 return wm_adsp2_component_probe(&cs35l45->dsp, component); in cs35l45_component_probe()
893 wm_adsp2_component_remove(&cs35l45->dsp, component); in cs35l45_component_remove()
918 if (cs35l45->bus_type == CONTROL_BUS_I2C) in cs35l45_setup_hibernate()
923 regmap_update_bits(cs35l45->regmap, CS35L45_WAKESRC_CTL, in cs35l45_setup_hibernate()
927 regmap_set_bits(cs35l45->regmap, CS35L45_WAKESRC_CTL, in cs35l45_setup_hibernate()
930 regmap_update_bits(cs35l45->regmap, CS35L45_WKI2C_CTL, in cs35l45_setup_hibernate()
931 CS35L45_WKI2C_ADDR_MASK, cs35l45->i2c_addr); in cs35l45_setup_hibernate()
933 regmap_set_bits(cs35l45->regmap, CS35L45_WKI2C_CTL, in cs35l45_setup_hibernate()
939 dev_dbg(cs35l45->dev, "Enter hibernate\n"); in cs35l45_enter_hibernate()
943 regmap_set_bits(cs35l45->regmap, CS35L45_IRQ1_MASK_2, CS35L45_DSP_VIRT2_MBOX_MASK); in cs35l45_enter_hibernate()
946 regmap_write(cs35l45->regmap, CS35L45_DSP_VIRT1_MBOX_1, CSPL_MBOX_CMD_HIBERNATE); in cs35l45_enter_hibernate()
958 dev_dbg(cs35l45->dev, "Exit hibernate\n"); in cs35l45_exit_hibernate()
961 ret = cs35l45_set_cspl_mbox_cmd(cs35l45, cs35l45->regmap, in cs35l45_exit_hibernate()
964 dev_dbg(cs35l45->dev, "Wake success at cycle: %d\n", j); in cs35l45_exit_hibernate()
965 regmap_clear_bits(cs35l45->regmap, CS35L45_IRQ1_MASK_2, in cs35l45_exit_hibernate()
972 dev_err(cs35l45->dev, "Wake failed, re-enter hibernate: %d\n", ret); in cs35l45_exit_hibernate()
977 dev_err(cs35l45->dev, "Timed out waking device\n"); in cs35l45_exit_hibernate()
979 return -ETIMEDOUT; in cs35l45_exit_hibernate()
986 if (!cs35l45->dsp.preloaded || !cs35l45->dsp.cs_dsp.running) in cs35l45_runtime_suspend()
991 regcache_cache_only(cs35l45->regmap, true); in cs35l45_runtime_suspend()
992 regcache_mark_dirty(cs35l45->regmap); in cs35l45_runtime_suspend()
994 dev_dbg(cs35l45->dev, "Runtime suspended\n"); in cs35l45_runtime_suspend()
1004 if (!cs35l45->dsp.preloaded || !cs35l45->dsp.cs_dsp.running) in cs35l45_runtime_resume()
1007 dev_dbg(cs35l45->dev, "Runtime resume\n"); in cs35l45_runtime_resume()
1009 regcache_cache_only(cs35l45->regmap, false); in cs35l45_runtime_resume()
1015 ret = regcache_sync(cs35l45->regmap); in cs35l45_runtime_resume()
1017 dev_warn(cs35l45->dev, "regcache_sync failed: %d\n", ret); in cs35l45_runtime_resume()
1020 regmap_clear_bits(cs35l45->regmap, CS35L45_ERROR_RELEASE, CS35L45_GLOBAL_ERR_RLS_MASK); in cs35l45_runtime_resume()
1021 regmap_set_bits(cs35l45->regmap, CS35L45_ERROR_RELEASE, CS35L45_GLOBAL_ERR_RLS_MASK); in cs35l45_runtime_resume()
1022 regmap_clear_bits(cs35l45->regmap, CS35L45_ERROR_RELEASE, CS35L45_GLOBAL_ERR_RLS_MASK); in cs35l45_runtime_resume()
1030 dev_dbg(cs35l45->dev, "System suspend, disabling IRQ\n"); in cs35l45_sys_suspend()
1031 disable_irq(cs35l45->irq); in cs35l45_sys_suspend()
1040 dev_dbg(cs35l45->dev, "Late system suspend, reenabling IRQ\n"); in cs35l45_sys_suspend_noirq()
1041 enable_irq(cs35l45->irq); in cs35l45_sys_suspend_noirq()
1050 dev_dbg(cs35l45->dev, "Early system resume, disabling IRQ\n"); in cs35l45_sys_resume_noirq()
1051 disable_irq(cs35l45->irq); in cs35l45_sys_resume_noirq()
1060 dev_dbg(cs35l45->dev, "System resume, reenabling IRQ\n"); in cs35l45_sys_resume()
1061 enable_irq(cs35l45->irq); in cs35l45_sys_resume()
1068 struct device_node *node = cs35l45->dev->of_node; in cs35l45_apply_property_config()
1082 sprintf(of_name, "cirrus,gpio-ctrl%d", i + 1); in cs35l45_apply_property_config()
1087 ret = of_property_read_u32(child, "gpio-dir", &val); in cs35l45_apply_property_config()
1089 regmap_update_bits(cs35l45->regmap, gpio_regs[i], in cs35l45_apply_property_config()
1093 ret = of_property_read_u32(child, "gpio-lvl", &val); in cs35l45_apply_property_config()
1095 regmap_update_bits(cs35l45->regmap, gpio_regs[i], in cs35l45_apply_property_config()
1099 ret = of_property_read_u32(child, "gpio-op-cfg", &val); in cs35l45_apply_property_config()
1101 regmap_update_bits(cs35l45->regmap, gpio_regs[i], in cs35l45_apply_property_config()
1105 ret = of_property_read_u32(child, "gpio-pol", &val); in cs35l45_apply_property_config()
1107 regmap_update_bits(cs35l45->regmap, gpio_regs[i], in cs35l45_apply_property_config()
1111 ret = of_property_read_u32(child, "gpio-ctrl", &val); in cs35l45_apply_property_config()
1113 regmap_update_bits(cs35l45->regmap, pad_regs[i], in cs35l45_apply_property_config()
1117 ret = of_property_read_u32(child, "gpio-invert", &val); in cs35l45_apply_property_config()
1119 regmap_update_bits(cs35l45->regmap, pad_regs[i], in cs35l45_apply_property_config()
1123 cs35l45->irq_invert = val; in cs35l45_apply_property_config()
1129 if (device_property_read_u32(cs35l45->dev, in cs35l45_apply_property_config()
1130 "cirrus,asp-sdout-hiz-ctrl", &val) == 0) { in cs35l45_apply_property_config()
1131 regmap_update_bits(cs35l45->regmap, CS35L45_ASP_CONTROL3, in cs35l45_apply_property_config()
1159 dev_info(cs35l45->dev, "MBOX event (SPEAKER_STATUS): %s\n", in cs35l45_dsp_virt2_mbox3_irq_handle()
1163 dev_dbg(cs35l45->dev, "MBOX event (BOOT_DONE)\n"); in cs35l45_dsp_virt2_mbox3_irq_handle()
1166 dev_err(cs35l45->dev, "MBOX event not supported %u\n", cmd); in cs35l45_dsp_virt2_mbox3_irq_handle()
1167 return -EINVAL; in cs35l45_dsp_virt2_mbox3_irq_handle()
1179 ret = regmap_read(cs35l45->regmap, CS35L45_DSP_VIRT2_MBOX_3, &mbox_val); in cs35l45_dsp_virt2_mbox_cb()
1185 ret = regmap_read(cs35l45->regmap, CS35L45_DSP_VIRT2_MBOX_4, &mbox_val); in cs35l45_dsp_virt2_mbox_cb()
1187 dev_err(cs35l45->dev, "Spurious DSP MBOX4 IRQ\n"); in cs35l45_dsp_virt2_mbox_cb()
1197 dev_dbg(cs35l45->dev, "PLL unlock detected!"); in cs35l45_pll_unlock()
1206 dev_dbg(cs35l45->dev, "PLL lock detected!"); in cs35l45_pll_lock()
1233 i = irq - regmap_irq_get_virq(cs35l45->irq_data, 0); in cs35l45_spk_safe_err()
1236 dev_err(cs35l45->dev, "Unspecified global error condition (%d) detected!\n", irq); in cs35l45_spk_safe_err()
1238 dev_err(cs35l45->dev, "%s condition detected!\n", cs35l45_irqs[i].name); in cs35l45_spk_safe_err()
1272 struct device *dev = cs35l45->dev; in cs35l45_initialize()
1277 ret = regmap_read_poll_timeout(cs35l45->regmap, CS35L45_IRQ1_EINT_4, sts, in cs35l45_initialize()
1281 dev_err(cs35l45->dev, "Timeout waiting for OTP boot\n"); in cs35l45_initialize()
1285 ret = regmap_bulk_read(cs35l45->regmap, CS35L45_DEVID, dev_id, ARRAY_SIZE(dev_id)); in cs35l45_initialize()
1287 dev_err(cs35l45->dev, "Get Device ID failed: %d\n", ret); in cs35l45_initialize()
1296 dev_err(cs35l45->dev, "Bad DEVID 0x%x\n", dev_id[0]); in cs35l45_initialize()
1297 return -ENODEV; in cs35l45_initialize()
1300 dev_info(cs35l45->dev, "Cirrus Logic CS35L45: REVID %02X OTPID %02X\n", in cs35l45_initialize()
1303 regmap_write(cs35l45->regmap, CS35L45_IRQ1_EINT_4, in cs35l45_initialize()
1316 cs35l45->amplifier_mode = AMP_MODE_SPK; in cs35l45_initialize()
1350 struct wm_adsp *dsp = &cs35l45->dsp; in cs35l45_dsp_init()
1353 dsp->part = "cs35l45"; in cs35l45_dsp_init()
1354 dsp->fw = 9; /* 9 is WM_ADSP_FW_SPK_PROT in wm_adsp.c */ in cs35l45_dsp_init()
1355 dsp->toggle_preload = true; in cs35l45_dsp_init()
1356 dsp->cs_dsp.num = 1; in cs35l45_dsp_init()
1357 dsp->cs_dsp.type = WMFW_HALO; in cs35l45_dsp_init()
1358 dsp->cs_dsp.rev = 0; in cs35l45_dsp_init()
1359 dsp->cs_dsp.dev = cs35l45->dev; in cs35l45_dsp_init()
1360 dsp->cs_dsp.regmap = cs35l45->regmap; in cs35l45_dsp_init()
1361 dsp->cs_dsp.base = CS35L45_DSP1_CLOCK_FREQ; in cs35l45_dsp_init()
1362 dsp->cs_dsp.base_sysinfo = CS35L45_DSP1_SYS_ID; in cs35l45_dsp_init()
1363 dsp->cs_dsp.mem = cs35l45_dsp1_regions; in cs35l45_dsp_init()
1364 dsp->cs_dsp.num_mems = ARRAY_SIZE(cs35l45_dsp1_regions); in cs35l45_dsp_init()
1365 dsp->cs_dsp.lock_regions = 0xFFFFFFFF; in cs35l45_dsp_init()
1369 regmap_multi_reg_write(cs35l45->regmap, cs35l45_fs_errata_patch, in cs35l45_dsp_init()
1377 struct device *dev = cs35l45->dev; in cs35l45_probe()
1381 cs35l45->vdd_batt = devm_regulator_get(dev, "vdd-batt"); in cs35l45_probe()
1382 if (IS_ERR(cs35l45->vdd_batt)) in cs35l45_probe()
1383 return dev_err_probe(dev, PTR_ERR(cs35l45->vdd_batt), in cs35l45_probe()
1384 "Failed to request vdd-batt\n"); in cs35l45_probe()
1386 cs35l45->vdd_a = devm_regulator_get(dev, "vdd-a"); in cs35l45_probe()
1387 if (IS_ERR(cs35l45->vdd_a)) in cs35l45_probe()
1388 return dev_err_probe(dev, PTR_ERR(cs35l45->vdd_a), in cs35l45_probe()
1389 "Failed to request vdd-a\n"); in cs35l45_probe()
1392 ret = regulator_enable(cs35l45->vdd_batt); in cs35l45_probe()
1394 return dev_err_probe(dev, ret, "Failed to enable vdd-batt\n"); in cs35l45_probe()
1396 ret = regulator_enable(cs35l45->vdd_a); in cs35l45_probe()
1398 return dev_err_probe(dev, ret, "Failed to enable vdd-a\n"); in cs35l45_probe()
1401 cs35l45->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in cs35l45_probe()
1402 if (IS_ERR(cs35l45->reset_gpio)) { in cs35l45_probe()
1403 ret = PTR_ERR(cs35l45->reset_gpio); in cs35l45_probe()
1404 cs35l45->reset_gpio = NULL; in cs35l45_probe()
1405 if (ret == -EBUSY) { in cs35l45_probe()
1413 if (cs35l45->reset_gpio) { in cs35l45_probe()
1415 gpiod_set_value_cansleep(cs35l45->reset_gpio, 1); in cs35l45_probe()
1428 pm_runtime_set_autosuspend_delay(cs35l45->dev, 3000); in cs35l45_probe()
1429 pm_runtime_use_autosuspend(cs35l45->dev); in cs35l45_probe()
1430 pm_runtime_mark_last_busy(cs35l45->dev); in cs35l45_probe()
1431 pm_runtime_set_active(cs35l45->dev); in cs35l45_probe()
1432 pm_runtime_get_noresume(cs35l45->dev); in cs35l45_probe()
1433 pm_runtime_enable(cs35l45->dev); in cs35l45_probe()
1435 if (cs35l45->irq) { in cs35l45_probe()
1436 if (cs35l45->irq_invert) in cs35l45_probe()
1441 ret = devm_regmap_add_irq_chip(dev, cs35l45->regmap, cs35l45->irq, irq_pol, 0, in cs35l45_probe()
1442 &cs35l45_regmap_irq_chip, &cs35l45->irq_data); in cs35l45_probe()
1449 irq = regmap_irq_get_virq(cs35l45->irq_data, cs35l45_irqs[i].irq); in cs35l45_probe()
1472 pm_runtime_put_autosuspend(cs35l45->dev); in cs35l45_probe()
1477 pm_runtime_disable(cs35l45->dev); in cs35l45_probe()
1478 pm_runtime_put_noidle(cs35l45->dev); in cs35l45_probe()
1479 wm_adsp2_remove(&cs35l45->dsp); in cs35l45_probe()
1482 gpiod_set_value_cansleep(cs35l45->reset_gpio, 0); in cs35l45_probe()
1484 regulator_disable(cs35l45->vdd_a); in cs35l45_probe()
1485 regulator_disable(cs35l45->vdd_batt); in cs35l45_probe()
1493 pm_runtime_get_sync(cs35l45->dev); in cs35l45_remove()
1494 pm_runtime_disable(cs35l45->dev); in cs35l45_remove()
1495 wm_adsp2_remove(&cs35l45->dsp); in cs35l45_remove()
1497 gpiod_set_value_cansleep(cs35l45->reset_gpio, 0); in cs35l45_remove()
1499 pm_runtime_put_noidle(cs35l45->dev); in cs35l45_remove()
1500 regulator_disable(cs35l45->vdd_a); in cs35l45_remove()
1501 /* VDD_BATT must be the last to power-off */ in cs35l45_remove()
1502 regulator_disable(cs35l45->vdd_batt); in cs35l45_remove()