Lines Matching +full:mux +full:- +full:locked
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);
184 "Sum", "SWG1", "SWG2", "SWG1_1-Cos"
253 /* Locked Kcontrol calls */
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 = 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_write(da7219->regmap, reg, &val, sizeof(val)); in da7219_tonegen_freq_put()
461 mutex_unlock(&da7219->ctrl_lock); in da7219_tonegen_freq_put()
545 /* Input High-Pass Filters */
588 /* DAC High-Pass Filter */
594 /* DAC 5-Band Equaliser */
677 * DAPM Mux Controls
691 SOC_DAPM_ENUM("Out DAIL Mux", da7219_out_dail_sel);
700 SOC_DAPM_ENUM("Out DAIR Mux", da7219_out_dair_sel);
709 SOC_DAPM_ENUM("Out DACL Mux", da7219_out_dacl_sel);
718 SOC_DAPM_ENUM("Out DACR Mux", da7219_out_dacr_sel);
770 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in da7219_mic_pga_event()
775 if (da7219->micbias_on_event) { in da7219_mic_pga_event()
780 da7219->micbias_on_event = false; in da7219_mic_pga_event()
781 msleep(da7219->mic_pga_delay); in da7219_mic_pga_event()
794 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in da7219_dai_event()
796 struct clk *bclk = da7219->dai_clks[DA7219_DAI_BCLK_IDX]; in da7219_dai_event()
803 if (da7219->master) { in da7219_dai_event()
808 dev_err(component->dev, in da7219_dai_event()
829 /* Check SRM has locked */ in da7219_dai_event()
841 dev_warn(component->dev, "SRM failed to lock\n"); in da7219_dai_event()
845 /* PC free-running */ in da7219_dai_event()
851 if (da7219->master) { in da7219_dai_event()
863 return -EINVAL; in da7219_dai_event()
885 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in da7219_mixout_event()
888 switch (w->reg) { in da7219_mixout_event()
898 return -EINVAL; in da7219_mixout_event()
923 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in da7219_gain_ramp_event()
930 da7219->gain_ramp_ctrl = in da7219_gain_ramp_event()
939 da7219->gain_ramp_ctrl); in da7219_gain_ramp_event()
992 SND_SOC_DAPM_MUX("Out DAIL Mux", SND_SOC_NOPM, 0, 0,
994 SND_SOC_DAPM_MUX("Out DAIR Mux", SND_SOC_NOPM, 0, 0,
1008 SND_SOC_DAPM_MUX("Out DACL Mux", SND_SOC_NOPM, 0, 0,
1010 SND_SOC_DAPM_MUX("Out DACR Mux", SND_SOC_NOPM, 0, 0,
1074 * DAPM Mux Routes
1117 DA7219_OUT_DAI_MUX_ROUTES("Out DAIL Mux"),
1118 DA7219_OUT_DAI_MUX_ROUTES("Out DAIR Mux"),
1120 {"DAIOUT", NULL, "Out DAIL Mux"},
1121 {"DAIOUT", NULL, "Out DAIR Mux"},
1127 DA7219_OUT_DAC_MUX_ROUTES("Out DACL Mux"),
1128 DA7219_OUT_DAC_MUX_ROUTES("Out DACR Mux"),
1130 {"Mixer Out FilterL", "DACL Switch", "Out DACL Mux"},
1131 {"Mixer Out FilterR", "DACR Switch", "Out DACR Mux"},
1160 struct snd_soc_component *component = codec_dai->component; in da7219_set_dai_sysclk()
1164 if ((da7219->clk_src == clk_id) && (da7219->mclk_rate == freq)) in da7219_set_dai_sysclk()
1168 dev_err(codec_dai->dev, "Unsupported MCLK value %d\n", in da7219_set_dai_sysclk()
1170 return -EINVAL; in da7219_set_dai_sysclk()
1173 mutex_lock(&da7219->pll_lock); in da7219_set_dai_sysclk()
1186 dev_err(codec_dai->dev, "Unknown clock source %d\n", clk_id); in da7219_set_dai_sysclk()
1187 mutex_unlock(&da7219->pll_lock); in da7219_set_dai_sysclk()
1188 return -EINVAL; in da7219_set_dai_sysclk()
1191 da7219->clk_src = clk_id; in da7219_set_dai_sysclk()
1193 if (da7219->mclk) { in da7219_set_dai_sysclk()
1194 freq = clk_round_rate(da7219->mclk, freq); in da7219_set_dai_sysclk()
1195 ret = clk_set_rate(da7219->mclk, freq); in da7219_set_dai_sysclk()
1197 dev_err(codec_dai->dev, "Failed to set clock rate %d\n", in da7219_set_dai_sysclk()
1199 mutex_unlock(&da7219->pll_lock); in da7219_set_dai_sysclk()
1204 da7219->mclk_rate = freq; in da7219_set_dai_sysclk()
1206 mutex_unlock(&da7219->pll_lock); in da7219_set_dai_sysclk()
1220 /* Verify 2MHz - 54MHz MCLK provided, and set input divider */ in da7219_set_pll()
1221 if (da7219->mclk_rate < 2000000) { in da7219_set_pll()
1222 dev_err(component->dev, "PLL input clock %d below valid range\n", in da7219_set_pll()
1223 da7219->mclk_rate); in da7219_set_pll()
1224 return -EINVAL; in da7219_set_pll()
1225 } else if (da7219->mclk_rate <= 4500000) { in da7219_set_pll()
1228 } else if (da7219->mclk_rate <= 9000000) { in da7219_set_pll()
1231 } else if (da7219->mclk_rate <= 18000000) { in da7219_set_pll()
1234 } else if (da7219->mclk_rate <= 36000000) { in da7219_set_pll()
1237 } else if (da7219->mclk_rate <= 54000000) { in da7219_set_pll()
1241 dev_err(component->dev, "PLL input clock %d above valid range\n", in da7219_set_pll()
1242 da7219->mclk_rate); in da7219_set_pll()
1243 return -EINVAL; in da7219_set_pll()
1245 freq_ref = (da7219->mclk_rate / indiv); in da7219_set_pll()
1263 dev_err(component->dev, "Invalid PLL config\n"); in da7219_set_pll()
1264 return -EINVAL; in da7219_set_pll()
1288 struct snd_soc_component *component = codec_dai->component; in da7219_set_dai_pll()
1292 mutex_lock(&da7219->pll_lock); in da7219_set_dai_pll()
1294 mutex_unlock(&da7219->pll_lock); in da7219_set_dai_pll()
1301 struct snd_soc_component *component = codec_dai->component; in da7219_set_dai_fmt()
1307 da7219->master = true; in da7219_set_dai_fmt()
1310 da7219->master = false; in da7219_set_dai_fmt()
1313 return -EINVAL; in da7219_set_dai_fmt()
1334 return -EINVAL; in da7219_set_dai_fmt()
1352 return -EINVAL; in da7219_set_dai_fmt()
1356 return -EINVAL; in da7219_set_dai_fmt()
1373 return -EINVAL; in da7219_set_dai_fmt()
1404 return -EINVAL; in da7219_set_bclks_per_wclk()
1418 struct snd_soc_component *component = dai->component; in da7219_set_dai_tdm_slot()
1420 struct clk *wclk = da7219->dai_clks[DA7219_DAI_WCLK_IDX]; in da7219_set_dai_tdm_slot()
1421 struct clk *bclk = da7219->dai_clks[DA7219_DAI_BCLK_IDX]; in da7219_set_dai_tdm_slot()
1435 da7219->tdm_en = false; in da7219_set_dai_tdm_slot()
1440 slot_offset = ffs(tx_mask) - 1; in da7219_set_dai_tdm_slot()
1443 dev_err(component->dev, in da7219_set_dai_tdm_slot()
1446 return -EINVAL; in da7219_set_dai_tdm_slot()
1455 dev_err(component->dev, "Invalid frame offset %d\n", offset); in da7219_set_dai_tdm_slot()
1456 return -EINVAL; in da7219_set_dai_tdm_slot()
1463 if (da7219->master) { in da7219_set_dai_tdm_slot()
1471 dev_err(component->dev, in da7219_set_dai_tdm_slot()
1479 dev_err(component->dev, in da7219_set_dai_tdm_slot()
1488 regmap_bulk_write(da7219->regmap, DA7219_DAI_OFFSET_LOWER, in da7219_set_dai_tdm_slot()
1497 da7219->tdm_en = true; in da7219_set_dai_tdm_slot()
1542 return -EINVAL; in da7219_set_sr()
1554 struct snd_soc_component *component = dai->component; in da7219_hw_params()
1556 struct clk *wclk = da7219->dai_clks[DA7219_DAI_WCLK_IDX]; in da7219_hw_params()
1557 struct clk *bclk = da7219->dai_clks[DA7219_DAI_BCLK_IDX]; in da7219_hw_params()
1578 return -EINVAL; in da7219_hw_params()
1583 dev_err(component->dev, in da7219_hw_params()
1586 return -EINVAL; in da7219_hw_params()
1591 if (da7219->master && wclk) { in da7219_hw_params()
1594 dev_err(component->dev, in da7219_hw_params()
1601 dev_err(component->dev, in da7219_hw_params()
1612 if (da7219->master && !da7219->tdm_en) { in da7219_hw_params()
1630 dev_err(component->dev, in da7219_hw_params()
1632 return -EINVAL; in da7219_hw_params()
1637 dev_err(component->dev, in da7219_hw_params()
1645 dev_err(component->dev, in da7219_hw_params()
1679 .name = "da7219-hifi",
1768 pdata->wakeup_source = device_property_read_bool(dev, "wakeup-source"); in da7219_fw_to_pdata()
1770 pdata->dai_clk_names[DA7219_DAI_WCLK_IDX] = "da7219-dai-wclk"; in da7219_fw_to_pdata()
1771 pdata->dai_clk_names[DA7219_DAI_BCLK_IDX] = "da7219-dai-bclk"; in da7219_fw_to_pdata()
1772 if (device_property_read_string_array(dev, "clock-output-names", in da7219_fw_to_pdata()
1773 pdata->dai_clk_names, in da7219_fw_to_pdata()
1776 pdata->dai_clk_names[DA7219_DAI_WCLK_IDX], in da7219_fw_to_pdata()
1777 pdata->dai_clk_names[DA7219_DAI_BCLK_IDX]); in da7219_fw_to_pdata()
1779 if (device_property_read_u32(dev, "dlg,micbias-lvl", &of_val32) >= 0) in da7219_fw_to_pdata()
1780 pdata->micbias_lvl = da7219_fw_micbias_lvl(dev, of_val32); in da7219_fw_to_pdata()
1782 pdata->micbias_lvl = DA7219_MICBIAS_2_2V; in da7219_fw_to_pdata()
1784 if (!device_property_read_string(dev, "dlg,mic-amp-in-sel", &of_str)) in da7219_fw_to_pdata()
1785 pdata->mic_amp_in_sel = da7219_fw_mic_amp_in_sel(dev, of_str); in da7219_fw_to_pdata()
1787 pdata->mic_amp_in_sel = DA7219_MIC_AMP_IN_SEL_DIFF; in da7219_fw_to_pdata()
1809 if (da7219->mclk) { in da7219_set_bias_level()
1810 ret = clk_prepare_enable(da7219->mclk); in da7219_set_bias_level()
1812 dev_err(component->dev, in da7219_set_bias_level()
1829 if (da7219->mclk) in da7219_set_bias_level()
1830 clk_disable_unprepare(da7219->mclk); in da7219_set_bias_level()
1834 /* Only disable master bias if we're not a wake-up source */ in da7219_set_bias_level()
1835 if (!da7219->wakeup_source) in da7219_set_bias_level()
1860 da7219->supplies[i].supply = da7219_supply_names[i]; in da7219_handle_supplies()
1862 ret = regulator_bulk_get(component->dev, DA7219_NUM_SUPPLIES, in da7219_handle_supplies()
1863 da7219->supplies); in da7219_handle_supplies()
1865 dev_err(component->dev, "Failed to get supplies"); in da7219_handle_supplies()
1873 vddio = da7219->supplies[DA7219_SUPPLY_VDDIO].consumer; in da7219_handle_supplies()
1876 dev_warn(component->dev, "Invalid VDDIO voltage\n"); in da7219_handle_supplies()
1881 ret = regulator_bulk_enable(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_handle_supplies()
1883 dev_err(component->dev, "Failed to enable supplies"); in da7219_handle_supplies()
1884 regulator_bulk_free(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_handle_supplies()
1897 struct snd_soc_component *component = da7219->component; in da7219_wclk_prepare()
1899 if (!da7219->master) in da7219_wclk_prepare()
1900 return -EINVAL; in da7219_wclk_prepare()
1914 struct snd_soc_component *component = da7219->component; in da7219_wclk_unprepare()
1916 if (!da7219->master) in da7219_wclk_unprepare()
1928 struct snd_soc_component *component = da7219->component; in da7219_wclk_is_prepared()
1931 if (!da7219->master) in da7219_wclk_is_prepared()
1932 return -EINVAL; in da7219_wclk_is_prepared()
1945 struct snd_soc_component *component = da7219->component; in da7219_wclk_recalc_rate()
1983 if (!da7219->master) in da7219_wclk_round_rate()
1984 return -EINVAL; in da7219_wclk_round_rate()
2016 struct snd_soc_component *component = da7219->component; in da7219_wclk_set_rate()
2018 if (!da7219->master) in da7219_wclk_set_rate()
2019 return -EINVAL; in da7219_wclk_set_rate()
2030 struct snd_soc_component *component = da7219->component; in da7219_bclk_recalc_rate()
2072 if (!*parent_rate || !da7219->master) in da7219_bclk_round_rate()
2073 return -EINVAL; in da7219_bclk_round_rate()
2093 struct snd_soc_component *component = da7219->component; in da7219_bclk_set_rate()
2096 if (!da7219->master) in da7219_bclk_set_rate()
2097 return -EINVAL; in da7219_bclk_set_rate()
2122 struct device *dev = component->dev; in da7219_register_dai_clks()
2123 struct device_node *np = dev->of_node; in da7219_register_dai_clks()
2125 struct da7219_pdata *pdata = da7219->pdata; in da7219_register_dai_clks()
2135 return -ENOMEM; in da7219_register_dai_clks()
2137 clk_data->num = DA7219_DAI_NUM_CLKS; in da7219_register_dai_clks()
2138 da7219->clk_hw_data = clk_data; in da7219_register_dai_clks()
2144 struct clk_hw *dai_clk_hw = &da7219->dai_clks_hw[i]; in da7219_register_dai_clks()
2152 if (da7219->mclk) { in da7219_register_dai_clks()
2153 parent_name = __clk_get_name(da7219->mclk); in da7219_register_dai_clks()
2163 parent_name = __clk_get_name(da7219->dai_clks[DA7219_DAI_WCLK_IDX]); in da7219_register_dai_clks()
2169 ret = -EINVAL; in da7219_register_dai_clks()
2173 init.name = pdata->dai_clk_names[i]; in da7219_register_dai_clks()
2176 dai_clk_hw->init = &init; in da7219_register_dai_clks()
2184 da7219->dai_clks[i] = dai_clk_hw->clk; in da7219_register_dai_clks()
2188 da7219->clk_hw_data->hws[i] = dai_clk_hw; in da7219_register_dai_clks()
2193 ret = -ENOMEM; in da7219_register_dai_clks()
2196 da7219->dai_clks_lookup[i] = dai_clk_lookup; in da7219_register_dai_clks()
2203 ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get, in da7219_register_dai_clks()
2204 da7219->clk_hw_data); in da7219_register_dai_clks()
2215 if (da7219->dai_clks_lookup[i]) in da7219_register_dai_clks()
2216 clkdev_drop(da7219->dai_clks_lookup[i]); in da7219_register_dai_clks()
2218 clk_hw_unregister(&da7219->dai_clks_hw[i]); in da7219_register_dai_clks()
2219 } while (i-- > 0); in da7219_register_dai_clks()
2222 kfree(da7219->clk_hw_data); in da7219_register_dai_clks()
2230 struct device_node *np = component->dev->of_node; in da7219_free_dai_clks()
2236 for (i = DA7219_DAI_NUM_CLKS - 1; i >= 0; --i) { in da7219_free_dai_clks()
2237 if (da7219->dai_clks_lookup[i]) in da7219_free_dai_clks()
2238 clkdev_drop(da7219->dai_clks_lookup[i]); in da7219_free_dai_clks()
2240 clk_hw_unregister(&da7219->dai_clks_hw[i]); in da7219_free_dai_clks()
2244 kfree(da7219->clk_hw_data); in da7219_free_dai_clks()
2258 struct da7219_pdata *pdata = da7219->pdata; in da7219_handle_pdata()
2263 da7219->wakeup_source = pdata->wakeup_source; in da7219_handle_pdata()
2266 switch (pdata->micbias_lvl) { in da7219_handle_pdata()
2273 micbias_lvl |= (pdata->micbias_lvl << in da7219_handle_pdata()
2284 da7219->mic_pga_delay = DA7219_MIC_PGA_BASE_DELAY + in da7219_handle_pdata()
2285 (pdata->micbias_lvl * in da7219_handle_pdata()
2289 switch (pdata->mic_amp_in_sel) { in da7219_handle_pdata()
2294 pdata->mic_amp_in_sel); in da7219_handle_pdata()
2447 da7219->component = component; in da7219_probe()
2448 mutex_init(&da7219->ctrl_lock); in da7219_probe()
2449 mutex_init(&da7219->pll_lock); in da7219_probe()
2456 regcache_cache_bypass(da7219->regmap, true); in da7219_probe()
2459 regmap_read(da7219->regmap, DA7219_SYSTEM_ACTIVE, &system_active); in da7219_probe()
2461 regmap_write(da7219->regmap, DA7219_GAIN_RAMP_CTRL, in da7219_probe()
2463 regmap_write(da7219->regmap, DA7219_SYSTEM_MODES_INPUT, 0x00); in da7219_probe()
2464 regmap_write(da7219->regmap, DA7219_SYSTEM_MODES_OUTPUT, 0x01); in da7219_probe()
2467 regmap_read(da7219->regmap, DA7219_SYSTEM_STATUS, in da7219_probe()
2477 regmap_write_bits(da7219->regmap, DA7219_ACCDET_CONFIG_1, in da7219_probe()
2479 regmap_write_bits(da7219->regmap, DA7219_CIF_CTRL, in da7219_probe()
2482 regmap_write_bits(da7219->regmap, DA7219_SYSTEM_ACTIVE, in da7219_probe()
2484 regmap_write_bits(da7219->regmap, DA7219_SYSTEM_ACTIVE, in da7219_probe()
2487 regcache_cache_bypass(da7219->regmap, false); in da7219_probe()
2488 regmap_reinit_cache(da7219->regmap, &da7219_regmap_config); in da7219_probe()
2493 ret = regmap_read(da7219->regmap, DA7219_CHIP_REVISION, &rev); in da7219_probe()
2495 dev_err(component->dev, "Failed to read chip revision: %d\n", ret); in da7219_probe()
2501 ret = regmap_register_patch(da7219->regmap, da7219_rev_aa_patch, in da7219_probe()
2504 dev_err(component->dev, "Failed to register AA patch: %d\n", in da7219_probe()
2517 da7219->mclk = clk_get(component->dev, "mclk"); in da7219_probe()
2518 if (IS_ERR(da7219->mclk)) { in da7219_probe()
2519 if (PTR_ERR(da7219->mclk) != -ENOENT) { in da7219_probe()
2520 ret = PTR_ERR(da7219->mclk); in da7219_probe()
2523 da7219->mclk = NULL; in da7219_probe()
2532 /* Default PC counter to free-running */ in da7219_probe()
2575 clk_put(da7219->mclk); in da7219_probe()
2578 regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_probe()
2579 regulator_bulk_free(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_probe()
2591 clk_put(da7219->mclk); in da7219_remove()
2594 regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_remove()
2595 regulator_bulk_free(DA7219_NUM_SUPPLIES, da7219->supplies); in da7219_remove()
2603 /* Suspend AAD if we're not a wake-up source */ in da7219_suspend()
2604 if (!da7219->wakeup_source) in da7219_suspend()
2619 if (!da7219->wakeup_source) in da7219_resume()
2655 struct device *dev = &i2c->dev; in da7219_i2c_probe()
2662 return -ENOMEM; in da7219_i2c_probe()
2666 da7219->regmap = devm_regmap_init_i2c(i2c, &da7219_regmap_config); in da7219_i2c_probe()
2667 if (IS_ERR(da7219->regmap)) { in da7219_i2c_probe()
2668 ret = PTR_ERR(da7219->regmap); in da7219_i2c_probe()
2674 da7219->pdata = dev_get_platdata(dev); in da7219_i2c_probe()
2675 if (!da7219->pdata) in da7219_i2c_probe()
2676 da7219->pdata = da7219_fw_to_pdata(dev); in da7219_i2c_probe()