Lines Matching +full:mclk +full:- +full:fs

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * da7219.c - DA7219 ALSA SoC Codec Driver
13 #include <linux/clk-provider.h>
26 #include <sound/soc-dapm.h>
33 #include "da7219-aad.h"
41 static const DECLARE_TLV_DB_SCALE(da7219_mic_gain_tlv, -600, 600, 0);
42 static const DECLARE_TLV_DB_SCALE(da7219_mixin_gain_tlv, -450, 150, 0);
43 static const DECLARE_TLV_DB_SCALE(da7219_adc_dig_gain_tlv, -8325, 75, 0);
44 static const DECLARE_TLV_DB_SCALE(da7219_alc_threshold_tlv, -9450, 150, 0);
47 static const DECLARE_TLV_DB_SCALE(da7219_sidetone_gain_tlv, -4200, 300, 0);
48 static const DECLARE_TLV_DB_SCALE(da7219_tonegen_gain_tlv, -4500, 300, 0);
51 static const DECLARE_TLV_DB_SCALE(da7219_dac_eq_band_tlv, -1050, 150, 0);
55 /* -77.25dB to 12dB */
56 0x08, 0x7f, TLV_DB_SCALE_ITEM(-7725, 75, 0)
59 static const DECLARE_TLV_DB_SCALE(da7219_dac_ng_threshold_tlv, -10200, 600, 0);
60 static const DECLARE_TLV_DB_SCALE(da7219_hp_gain_tlv, -5700, 100, 0);
64 "7.33/fs", "14.66/fs", "29.32/fs", "58.64/fs", "117.3/fs", "234.6/fs",
65 "469.1/fs", "938.2/fs", "1876/fs", "3753/fs", "7506/fs", "15012/fs",
66 "30024/fs"
74 "28.66/fs", "57.33/fs", "114.6/fs", "229.3/fs", "458.6/fs", "917.1/fs",
75 "1834/fs", "3668/fs", "7337/fs", "14674/fs", "29348/fs"
83 "62/fs", "124/fs", "248/fs", "496/fs", "992/fs", "1984/fs", "3968/fs",
84 "7936/fs", "15872/fs", "31744/fs", "63488/fs", "126976/fs",
85 "253952/fs", "507904/fs", "1015808/fs", "2031616/fs"
105 "0.034dB/fs", "0.068dB/fs", "0.136dB/fs", "0.272dB/fs"
184 "Sum", "SWG1", "SWG2", "SWG1_1-Cos"
261 mutex_lock(&da7219->ctrl_lock); in da7219_volsw_locked_get()
263 mutex_unlock(&da7219->ctrl_lock); in da7219_volsw_locked_get()
275 mutex_lock(&da7219->ctrl_lock); in da7219_volsw_locked_put()
277 mutex_unlock(&da7219->ctrl_lock); in da7219_volsw_locked_put()
289 mutex_lock(&da7219->ctrl_lock); in da7219_enum_locked_get()
291 mutex_unlock(&da7219->ctrl_lock); in da7219_enum_locked_get()
303 mutex_lock(&da7219->ctrl_lock); in da7219_enum_locked_put()
305 mutex_unlock(&da7219->ctrl_lock); in da7219_enum_locked_put()
352 dev_warn(component->dev, in da7219_alc_calib()
389 if ((ret == 1) && (da7219->alc_en)) in da7219_mixin_gain_put()
403 if ((ucontrol->value.integer.value[0]) && (!da7219->alc_en)) { in da7219_alc_sw_put()
405 da7219->alc_en = true; in da7219_alc_sw_put()
407 da7219->alc_en = false; in da7219_alc_sw_put()
420 (struct soc_mixer_control *) kcontrol->private_value; in da7219_tonegen_freq_get()
421 unsigned int reg = mixer_ctrl->reg; in da7219_tonegen_freq_get()
425 mutex_lock(&da7219->ctrl_lock); in da7219_tonegen_freq_get()
426 ret = regmap_raw_read(da7219->regmap, reg, &val, sizeof(val)); in da7219_tonegen_freq_get()
427 mutex_unlock(&da7219->ctrl_lock); in da7219_tonegen_freq_get()
433 * Frequency value spans two 8-bit registers, lower then upper byte. in da7219_tonegen_freq_get()
436 ucontrol->value.integer.value[0] = le16_to_cpu(val); in da7219_tonegen_freq_get()
447 (struct soc_mixer_control *) kcontrol->private_value; in da7219_tonegen_freq_put()
448 unsigned int reg = mixer_ctrl->reg; in da7219_tonegen_freq_put()
453 * Frequency value spans two 8-bit registers, lower then upper byte. in da7219_tonegen_freq_put()
457 val_new = cpu_to_le16(ucontrol->value.integer.value[0]); in da7219_tonegen_freq_put()
459 mutex_lock(&da7219->ctrl_lock); in da7219_tonegen_freq_put()
460 ret = regmap_raw_read(da7219->regmap, reg, &val_old, sizeof(val_old)); in da7219_tonegen_freq_put()
462 ret = regmap_raw_write(da7219->regmap, reg, in da7219_tonegen_freq_put()
464 mutex_unlock(&da7219->ctrl_lock); in da7219_tonegen_freq_put()
551 /* Input High-Pass Filters */
594 /* DAC High-Pass Filter */
600 /* DAC 5-Band Equaliser */
776 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in da7219_mic_pga_event()
781 if (da7219->micbias_on_event) { in da7219_mic_pga_event()
786 da7219->micbias_on_event = false; in da7219_mic_pga_event()
787 msleep(da7219->mic_pga_delay); in da7219_mic_pga_event()
800 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in da7219_dai_event()
802 struct clk *bclk = da7219->dai_clks[DA7219_DAI_BCLK_IDX]; in da7219_dai_event()
809 if (da7219->master) { in da7219_dai_event()
814 dev_err(component->dev, in da7219_dai_event()
847 dev_warn(component->dev, "SRM failed to lock\n"); in da7219_dai_event()
851 /* PC free-running */ in da7219_dai_event()
857 if (da7219->master) { in da7219_dai_event()
869 return -EINVAL; in da7219_dai_event()
891 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in da7219_mixout_event()
894 switch (w->reg) { in da7219_mixout_event()
904 return -EINVAL; in da7219_mixout_event()
929 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in da7219_gain_ramp_event()
936 da7219->gain_ramp_ctrl = in da7219_gain_ramp_event()
945 da7219->gain_ramp_ctrl); in da7219_gain_ramp_event()
1166 struct snd_soc_component *component = codec_dai->component; in da7219_set_dai_sysclk()
1170 if ((da7219->clk_src == clk_id) && (da7219->mclk_rate == freq)) in da7219_set_dai_sysclk()
1174 dev_err(codec_dai->dev, "Unsupported MCLK value %d\n", in da7219_set_dai_sysclk()
1176 return -EINVAL; in da7219_set_dai_sysclk()
1179 mutex_lock(&da7219->pll_lock); in da7219_set_dai_sysclk()
1192 dev_err(codec_dai->dev, "Unknown clock source %d\n", clk_id); in da7219_set_dai_sysclk()
1193 mutex_unlock(&da7219->pll_lock); in da7219_set_dai_sysclk()
1194 return -EINVAL; in da7219_set_dai_sysclk()
1197 da7219->clk_src = clk_id; in da7219_set_dai_sysclk()
1199 if (da7219->mclk) { in da7219_set_dai_sysclk()
1200 freq = clk_round_rate(da7219->mclk, freq); in da7219_set_dai_sysclk()
1201 ret = clk_set_rate(da7219->mclk, freq); in da7219_set_dai_sysclk()
1203 dev_err(codec_dai->dev, "Failed to set clock rate %d\n", in da7219_set_dai_sysclk()
1205 mutex_unlock(&da7219->pll_lock); in da7219_set_dai_sysclk()
1210 da7219->mclk_rate = freq; in da7219_set_dai_sysclk()
1212 mutex_unlock(&da7219->pll_lock); in da7219_set_dai_sysclk()
1226 /* Verify 2MHz - 54MHz MCLK provided, and set input divider */ in da7219_set_pll()
1227 if (da7219->mclk_rate < 2000000) { in da7219_set_pll()
1228 dev_err(component->dev, "PLL input clock %d below valid range\n", in da7219_set_pll()
1229 da7219->mclk_rate); in da7219_set_pll()
1230 return -EINVAL; in da7219_set_pll()
1231 } else if (da7219->mclk_rate <= 4500000) { in da7219_set_pll()
1234 } else if (da7219->mclk_rate <= 9000000) { in da7219_set_pll()
1237 } else if (da7219->mclk_rate <= 18000000) { in da7219_set_pll()
1240 } else if (da7219->mclk_rate <= 36000000) { in da7219_set_pll()
1243 } else if (da7219->mclk_rate <= 54000000) { in da7219_set_pll()
1247 dev_err(component->dev, "PLL input clock %d above valid range\n", in da7219_set_pll()
1248 da7219->mclk_rate); in da7219_set_pll()
1249 return -EINVAL; in da7219_set_pll()
1251 freq_ref = (da7219->mclk_rate / indiv); in da7219_set_pll()
1269 dev_err(component->dev, "Invalid PLL config\n"); in da7219_set_pll()
1270 return -EINVAL; in da7219_set_pll()
1294 struct snd_soc_component *component = codec_dai->component; in da7219_set_dai_pll()
1298 mutex_lock(&da7219->pll_lock); in da7219_set_dai_pll()
1300 mutex_unlock(&da7219->pll_lock); in da7219_set_dai_pll()
1307 struct snd_soc_component *component = codec_dai->component; in da7219_set_dai_fmt()
1313 da7219->master = true; in da7219_set_dai_fmt()
1316 da7219->master = false; in da7219_set_dai_fmt()
1319 return -EINVAL; in da7219_set_dai_fmt()
1340 return -EINVAL; in da7219_set_dai_fmt()
1358 return -EINVAL; in da7219_set_dai_fmt()
1362 return -EINVAL; in da7219_set_dai_fmt()
1379 return -EINVAL; in da7219_set_dai_fmt()
1410 return -EINVAL; in da7219_set_bclks_per_wclk()
1424 struct snd_soc_component *component = dai->component; in da7219_set_dai_tdm_slot()
1426 struct clk *wclk = da7219->dai_clks[DA7219_DAI_WCLK_IDX]; in da7219_set_dai_tdm_slot()
1427 struct clk *bclk = da7219->dai_clks[DA7219_DAI_BCLK_IDX]; in da7219_set_dai_tdm_slot()
1441 da7219->tdm_en = false; in da7219_set_dai_tdm_slot()
1446 slot_offset = ffs(tx_mask) - 1; in da7219_set_dai_tdm_slot()
1449 dev_err(component->dev, in da7219_set_dai_tdm_slot()
1452 return -EINVAL; in da7219_set_dai_tdm_slot()
1461 dev_err(component->dev, "Invalid frame offset %d\n", offset); in da7219_set_dai_tdm_slot()
1462 return -EINVAL; in da7219_set_dai_tdm_slot()
1469 if (da7219->master) { in da7219_set_dai_tdm_slot()
1477 dev_err(component->dev, in da7219_set_dai_tdm_slot()
1485 dev_err(component->dev, in da7219_set_dai_tdm_slot()
1494 regmap_bulk_write(da7219->regmap, DA7219_DAI_OFFSET_LOWER, in da7219_set_dai_tdm_slot()
1503 da7219->tdm_en = true; in da7219_set_dai_tdm_slot()
1511 u8 fs; in da7219_set_sr() local
1515 fs = DA7219_SR_8000; in da7219_set_sr()
1518 fs = DA7219_SR_11025; in da7219_set_sr()
1521 fs = DA7219_SR_12000; in da7219_set_sr()
1524 fs = DA7219_SR_16000; in da7219_set_sr()
1527 fs = DA7219_SR_22050; in da7219_set_sr()
1530 fs = DA7219_SR_24000; in da7219_set_sr()
1533 fs = DA7219_SR_32000; in da7219_set_sr()
1536 fs = DA7219_SR_44100; in da7219_set_sr()
1539 fs = DA7219_SR_48000; in da7219_set_sr()
1542 fs = DA7219_SR_88200; in da7219_set_sr()
1545 fs = DA7219_SR_96000; in da7219_set_sr()
1548 return -EINVAL; in da7219_set_sr()
1551 snd_soc_component_write(component, DA7219_SR, fs); in da7219_set_sr()
1560 struct snd_soc_component *component = dai->component; in da7219_hw_params()
1562 struct clk *wclk = da7219->dai_clks[DA7219_DAI_WCLK_IDX]; in da7219_hw_params()
1563 struct clk *bclk = da7219->dai_clks[DA7219_DAI_BCLK_IDX]; in da7219_hw_params()
1584 return -EINVAL; in da7219_hw_params()
1589 dev_err(component->dev, in da7219_hw_params()
1592 return -EINVAL; in da7219_hw_params()
1597 if (da7219->master && wclk) { in da7219_hw_params()
1600 dev_err(component->dev, in da7219_hw_params()
1607 dev_err(component->dev, in da7219_hw_params()
1618 if (da7219->master && !da7219->tdm_en) { in da7219_hw_params()
1636 dev_err(component->dev, in da7219_hw_params()
1638 return -EINVAL; in da7219_hw_params()
1643 dev_err(component->dev, in da7219_hw_params()
1651 dev_err(component->dev, in da7219_hw_params()
1685 .name = "da7219-hifi",
1774 pdata->wakeup_source = device_property_read_bool(dev, "wakeup-source"); in da7219_fw_to_pdata()
1776 pdata->dai_clk_names[DA7219_DAI_WCLK_IDX] = "da7219-dai-wclk"; in da7219_fw_to_pdata()
1777 pdata->dai_clk_names[DA7219_DAI_BCLK_IDX] = "da7219-dai-bclk"; in da7219_fw_to_pdata()
1778 if (device_property_read_string_array(dev, "clock-output-names", in da7219_fw_to_pdata()
1779 pdata->dai_clk_names, in da7219_fw_to_pdata()
1782 pdata->dai_clk_names[DA7219_DAI_WCLK_IDX], in da7219_fw_to_pdata()
1783 pdata->dai_clk_names[DA7219_DAI_BCLK_IDX]); in da7219_fw_to_pdata()
1785 if (device_property_read_u32(dev, "dlg,micbias-lvl", &of_val32) >= 0) in da7219_fw_to_pdata()
1786 pdata->micbias_lvl = da7219_fw_micbias_lvl(dev, of_val32); in da7219_fw_to_pdata()
1788 pdata->micbias_lvl = DA7219_MICBIAS_2_2V; in da7219_fw_to_pdata()
1790 if (!device_property_read_string(dev, "dlg,mic-amp-in-sel", &of_str)) in da7219_fw_to_pdata()
1791 pdata->mic_amp_in_sel = da7219_fw_mic_amp_in_sel(dev, of_str); in da7219_fw_to_pdata()
1793 pdata->mic_amp_in_sel = DA7219_MIC_AMP_IN_SEL_DIFF; in da7219_fw_to_pdata()
1813 /* Enable MCLK for transition to ON state */ in da7219_set_bias_level()
1815 if (da7219->mclk) { in da7219_set_bias_level()
1816 ret = clk_prepare_enable(da7219->mclk); in da7219_set_bias_level()
1818 dev_err(component->dev, in da7219_set_bias_level()
1819 "Failed to enable mclk\n"); in da7219_set_bias_level()
1834 /* Remove MCLK */ in da7219_set_bias_level()
1835 if (da7219->mclk) in da7219_set_bias_level()
1836 clk_disable_unprepare(da7219->mclk); in da7219_set_bias_level()
1840 /* Only disable master bias if we're not a wake-up source */ in da7219_set_bias_level()
1841 if (!da7219->wakeup_source) in da7219_set_bias_level()
1866 da7219->supplies[i].supply = da7219_supply_names[i]; in da7219_handle_supplies()
1868 ret = regulator_bulk_get(component->dev, DA7219_NUM_SUPPLIES, in da7219_handle_supplies()
1869 da7219->supplies); in da7219_handle_supplies()
1871 dev_err(component->dev, "Failed to get supplies"); in da7219_handle_supplies()
1879 vddio = da7219->supplies[DA7219_SUPPLY_VDDIO].consumer; in da7219_handle_supplies()
1882 dev_warn(component->dev, "Invalid VDDIO voltage\n"); in da7219_handle_supplies()
1887 ret = regulator_bulk_enable(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_handle_supplies()
1889 dev_err(component->dev, "Failed to enable supplies"); in da7219_handle_supplies()
1890 regulator_bulk_free(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_handle_supplies()
1903 struct snd_soc_component *component = da7219->component; in da7219_wclk_prepare()
1905 if (!da7219->master) in da7219_wclk_prepare()
1906 return -EINVAL; in da7219_wclk_prepare()
1920 struct snd_soc_component *component = da7219->component; in da7219_wclk_unprepare()
1922 if (!da7219->master) in da7219_wclk_unprepare()
1934 struct snd_soc_component *component = da7219->component; in da7219_wclk_is_prepared()
1937 if (!da7219->master) in da7219_wclk_is_prepared()
1938 return -EINVAL; in da7219_wclk_is_prepared()
1951 struct snd_soc_component *component = da7219->component; in da7219_wclk_recalc_rate()
1952 u8 fs = snd_soc_component_read(component, DA7219_SR); in da7219_wclk_recalc_rate() local
1954 switch (fs & DA7219_SR_MASK) { in da7219_wclk_recalc_rate()
1989 if (!da7219->master) in da7219_wclk_round_rate()
1990 return -EINVAL; in da7219_wclk_round_rate()
2022 struct snd_soc_component *component = da7219->component; in da7219_wclk_set_rate()
2024 if (!da7219->master) in da7219_wclk_set_rate()
2025 return -EINVAL; in da7219_wclk_set_rate()
2036 struct snd_soc_component *component = da7219->component; in da7219_bclk_recalc_rate()
2078 if (!*parent_rate || !da7219->master) in da7219_bclk_round_rate()
2079 return -EINVAL; in da7219_bclk_round_rate()
2099 struct snd_soc_component *component = da7219->component; in da7219_bclk_set_rate()
2102 if (!da7219->master) in da7219_bclk_set_rate()
2103 return -EINVAL; in da7219_bclk_set_rate()
2128 struct device *dev = component->dev; in da7219_register_dai_clks()
2129 struct device_node *np = dev->of_node; in da7219_register_dai_clks()
2131 struct da7219_pdata *pdata = da7219->pdata; in da7219_register_dai_clks()
2141 return -ENOMEM; in da7219_register_dai_clks()
2143 clk_data->num = DA7219_DAI_NUM_CLKS; in da7219_register_dai_clks()
2144 da7219->clk_hw_data = clk_data; in da7219_register_dai_clks()
2150 struct clk_hw *dai_clk_hw = &da7219->dai_clks_hw[i]; in da7219_register_dai_clks()
2155 * If we can, make MCLK the parent of WCLK to ensure in da7219_register_dai_clks()
2158 if (da7219->mclk) { in da7219_register_dai_clks()
2159 parent_name = __clk_get_name(da7219->mclk); in da7219_register_dai_clks()
2169 parent_name = __clk_get_name(da7219->dai_clks[DA7219_DAI_WCLK_IDX]); in da7219_register_dai_clks()
2175 ret = -EINVAL; in da7219_register_dai_clks()
2179 init.name = pdata->dai_clk_names[i]; in da7219_register_dai_clks()
2182 dai_clk_hw->init = &init; in da7219_register_dai_clks()
2190 da7219->dai_clks[i] = dai_clk_hw->clk; in da7219_register_dai_clks()
2194 da7219->clk_hw_data->hws[i] = dai_clk_hw; in da7219_register_dai_clks()
2200 ret = -ENOMEM; in da7219_register_dai_clks()
2203 da7219->dai_clks_lookup[i] = dai_clk_lookup; in da7219_register_dai_clks()
2210 ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get, in da7219_register_dai_clks()
2211 da7219->clk_hw_data); in da7219_register_dai_clks()
2221 while (--i >= 0) { in da7219_register_dai_clks()
2222 if (da7219->dai_clks_lookup[i]) in da7219_register_dai_clks()
2223 clkdev_drop(da7219->dai_clks_lookup[i]); in da7219_register_dai_clks()
2225 clk_hw_unregister(&da7219->dai_clks_hw[i]); in da7219_register_dai_clks()
2229 kfree(da7219->clk_hw_data); in da7219_register_dai_clks()
2237 struct device_node *np = component->dev->of_node; in da7219_free_dai_clks()
2243 for (i = DA7219_DAI_NUM_CLKS - 1; i >= 0; --i) { in da7219_free_dai_clks()
2244 if (da7219->dai_clks_lookup[i]) in da7219_free_dai_clks()
2245 clkdev_drop(da7219->dai_clks_lookup[i]); in da7219_free_dai_clks()
2247 clk_hw_unregister(&da7219->dai_clks_hw[i]); in da7219_free_dai_clks()
2251 kfree(da7219->clk_hw_data); in da7219_free_dai_clks()
2265 struct da7219_pdata *pdata = da7219->pdata; in da7219_handle_pdata()
2270 da7219->wakeup_source = pdata->wakeup_source; in da7219_handle_pdata()
2273 switch (pdata->micbias_lvl) { in da7219_handle_pdata()
2280 micbias_lvl |= (pdata->micbias_lvl << in da7219_handle_pdata()
2291 da7219->mic_pga_delay = DA7219_MIC_PGA_BASE_DELAY + in da7219_handle_pdata()
2292 (pdata->micbias_lvl * in da7219_handle_pdata()
2296 switch (pdata->mic_amp_in_sel) { in da7219_handle_pdata()
2301 pdata->mic_amp_in_sel); in da7219_handle_pdata()
2454 da7219->component = component; in da7219_probe()
2455 mutex_init(&da7219->ctrl_lock); in da7219_probe()
2456 mutex_init(&da7219->pll_lock); in da7219_probe()
2463 regcache_cache_bypass(da7219->regmap, true); in da7219_probe()
2466 regmap_read(da7219->regmap, DA7219_SYSTEM_ACTIVE, &system_active); in da7219_probe()
2468 regmap_write(da7219->regmap, DA7219_GAIN_RAMP_CTRL, in da7219_probe()
2470 regmap_write(da7219->regmap, DA7219_SYSTEM_MODES_INPUT, 0x00); in da7219_probe()
2471 regmap_write(da7219->regmap, DA7219_SYSTEM_MODES_OUTPUT, 0x01); in da7219_probe()
2474 regmap_read(da7219->regmap, DA7219_SYSTEM_STATUS, in da7219_probe()
2484 regmap_write_bits(da7219->regmap, DA7219_ACCDET_CONFIG_1, in da7219_probe()
2486 regmap_write_bits(da7219->regmap, DA7219_CIF_CTRL, in da7219_probe()
2489 regmap_write_bits(da7219->regmap, DA7219_SYSTEM_ACTIVE, in da7219_probe()
2491 regmap_write_bits(da7219->regmap, DA7219_SYSTEM_ACTIVE, in da7219_probe()
2494 regcache_cache_bypass(da7219->regmap, false); in da7219_probe()
2495 regmap_reinit_cache(da7219->regmap, &da7219_regmap_config); in da7219_probe()
2500 ret = regmap_read(da7219->regmap, DA7219_CHIP_REVISION, &rev); in da7219_probe()
2502 dev_err(component->dev, "Failed to read chip revision: %d\n", ret); in da7219_probe()
2508 ret = regmap_register_patch(da7219->regmap, da7219_rev_aa_patch, in da7219_probe()
2511 dev_err(component->dev, "Failed to register AA patch: %d\n", in da7219_probe()
2523 /* Check if MCLK provided */ in da7219_probe()
2524 da7219->mclk = clk_get(component->dev, "mclk"); in da7219_probe()
2525 if (IS_ERR(da7219->mclk)) { in da7219_probe()
2526 if (PTR_ERR(da7219->mclk) != -ENOENT) { in da7219_probe()
2527 ret = PTR_ERR(da7219->mclk); in da7219_probe()
2530 da7219->mclk = NULL; in da7219_probe()
2539 /* Default PC counter to free-running */ in da7219_probe()
2582 clk_put(da7219->mclk); in da7219_probe()
2585 regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_probe()
2586 regulator_bulk_free(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_probe()
2598 clk_put(da7219->mclk); in da7219_remove()
2601 regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_remove()
2602 regulator_bulk_free(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_remove()
2610 /* Suspend AAD if we're not a wake-up source */ in da7219_suspend()
2611 if (!da7219->wakeup_source) in da7219_suspend()
2626 if (!da7219->wakeup_source) in da7219_resume()
2669 struct device *dev = &i2c->dev; in da7219_i2c_probe()
2676 return -ENOMEM; in da7219_i2c_probe()
2680 da7219->regmap = devm_regmap_init_i2c(i2c, &da7219_regmap_config); in da7219_i2c_probe()
2681 if (IS_ERR(da7219->regmap)) { in da7219_i2c_probe()
2682 ret = PTR_ERR(da7219->regmap); in da7219_i2c_probe()
2688 da7219->pdata = dev_get_platdata(dev); in da7219_i2c_probe()
2689 if (!da7219->pdata) in da7219_i2c_probe()
2690 da7219->pdata = da7219_fw_to_pdata(dev); in da7219_i2c_probe()