Lines Matching +full:bias +full:- +full:bus +full:- +full:hold

1 // SPDX-License-Identifier: GPL-2.0-only
3 * cs42l42.c -- CS42L42 ALSA SoC audio driver
33 #include <sound/soc-dapm.h>
36 #include <dt-bindings/sound/cs42l42.h>
408 static DECLARE_TLV_DB_SCALE(adc_tlv, -9700, 100, true);
409 static DECLARE_TLV_DB_SCALE(mixer_tlv, -6300, 100, true);
438 SOC_SINGLE_S8_TLV("ADC Volume", CS42L42_ADC_VOLUME, -97, 12, adc_tlv),
518 cs42l42->jack = jk; in cs42l42_set_jack()
520 regmap_update_bits(cs42l42->regmap, CS42L42_TSRS_PLUG_INT_MASK, in cs42l42_set_jack()
533 cs42l42->component = component; in cs42l42_component_probe()
586 * Table 4-5 from the Datasheet
616 if (!cs42l42->sclk) in cs42l42_pll_config()
617 clk = cs42l42->bclk; in cs42l42_pll_config()
619 clk = cs42l42->sclk; in cs42l42_pll_config()
623 cs42l42->pll_config = i; in cs42l42_pll_config()
639 fsync = clk / cs42l42->srate; in cs42l42_pll_config()
640 if (((fsync * cs42l42->srate) != clk) in cs42l42_pll_config()
642 dev_err(component->dev, in cs42l42_pll_config()
645 cs42l42->srate); in cs42l42_pll_config()
646 return -EINVAL; in cs42l42_pll_config()
652 CS42L42_FRAC0_VAL(fsync - 1) << in cs42l42_pll_config()
657 CS42L42_FRAC1_VAL(fsync - 1) << in cs42l42_pll_config()
664 CS42L42_FRAC0_VAL(fsync - 1) << in cs42l42_pll_config()
669 CS42L42_FRAC1_VAL(fsync - 1) << in cs42l42_pll_config()
693 /* Configure PLL per table 4-5 */ in cs42l42_pll_config()
733 cs42l42->pll_divout = pll_ratio_table[i].pll_divout; in cs42l42_pll_config()
735 cs42l42->pll_divout = 0; in cs42l42_pll_config()
746 return -EINVAL; in cs42l42_pll_config()
751 struct snd_soc_component *component = codec_dai->component; in cs42l42_set_dai_fmt()
764 return -EINVAL; in cs42l42_set_dai_fmt()
784 return -EINVAL; in cs42l42_set_dai_fmt()
813 struct snd_soc_component *component = dai->component; in cs42l42_dai_startup()
817 * Sample rates < 44.1 kHz would produce an out-of-range SCLK with in cs42l42_dai_startup()
821 if (cs42l42->sclk) in cs42l42_dai_startup()
825 return snd_pcm_hw_constraint_minmax(substream->runtime, in cs42l42_dai_startup()
834 struct snd_soc_component *component = dai->component; in cs42l42_pcm_hw_params()
837 unsigned int width = (params_width(params) / 8) - 1; in cs42l42_pcm_hw_params()
840 cs42l42->srate = params_rate(params); in cs42l42_pcm_hw_params()
841 cs42l42->bclk = snd_soc_params_to_bclk(params); in cs42l42_pcm_hw_params()
845 cs42l42->bclk *= 2; in cs42l42_pcm_hw_params()
848 * Assume 24-bit samples are in 32-bit slots, to prevent SCLK being in cs42l42_pcm_hw_params()
852 cs42l42->bclk = (cs42l42->bclk / 3) * 4; in cs42l42_pcm_hw_params()
854 switch(substream->stream) { in cs42l42_pcm_hw_params()
881 (channels - 1) << CS42L42_SP_RX_CHB_SEL_SHIFT); in cs42l42_pcm_hw_params()
899 struct snd_soc_component *component = dai->component; in cs42l42_set_sysclk()
904 cs42l42->sclk = 0; in cs42l42_set_sysclk()
910 cs42l42->sclk = freq; in cs42l42_set_sysclk()
915 dev_err(component->dev, "SCLK %u not supported\n", freq); in cs42l42_set_sysclk()
917 return -EINVAL; in cs42l42_set_sysclk()
922 struct snd_soc_component *component = dai->component; in cs42l42_mute_stream()
936 cs42l42->stream_use &= ~(1 << stream); in cs42l42_mute_stream()
937 if(!cs42l42->stream_use) { in cs42l42_mute_stream()
941 * Without a source of clock the I2C bus doesn't work. in cs42l42_mute_stream()
943 regmap_multi_reg_write(cs42l42->regmap, cs42l42_to_osc_seq, in cs42l42_mute_stream()
957 if (!cs42l42->stream_use) { in cs42l42_mute_stream()
959 if (pll_ratio_table[cs42l42->pll_config].mclk_src_sel) { in cs42l42_mute_stream()
963 if (cs42l42->pll_divout) { in cs42l42_mute_stream()
968 cs42l42->pll_divout << in cs42l42_mute_stream()
972 ret = regmap_read_poll_timeout(cs42l42->regmap, in cs42l42_mute_stream()
979 dev_warn(component->dev, "PLL failed to lock: %d\n", ret); in cs42l42_mute_stream()
989 regmap_multi_reg_write(cs42l42->regmap, cs42l42_to_sclk_seq, in cs42l42_mute_stream()
992 cs42l42->stream_use |= 1 << stream; in cs42l42_mute_stream()
995 /* Un-mute the headphone */ in cs42l42_mute_stream()
1045 regmap_update_bits(cs42l42->regmap, in cs42l42_process_hs_type_detect()
1053 regmap_update_bits(cs42l42->regmap, in cs42l42_process_hs_type_detect()
1065 regmap_read(cs42l42->regmap, CS42L42_HS_DET_STATUS, &hs_det_status); in cs42l42_process_hs_type_detect()
1067 cs42l42->hs_type = (hs_det_status & CS42L42_HSDET_TYPE_MASK) >> in cs42l42_process_hs_type_detect()
1071 if ((cs42l42->hs_type == CS42L42_PLUG_CTIA) || in cs42l42_process_hs_type_detect()
1072 (cs42l42->hs_type == CS42L42_PLUG_OMTP)) { in cs42l42_process_hs_type_detect()
1073 /* Set auto HS bias settings to default */ in cs42l42_process_hs_type_detect()
1074 regmap_update_bits(cs42l42->regmap, in cs42l42_process_hs_type_detect()
1086 regmap_update_bits(cs42l42->regmap, in cs42l42_process_hs_type_detect()
1093 (cs42l42->bias_thresholds[0] << in cs42l42_process_hs_type_detect()
1096 /* Set auto HS bias settings to default */ in cs42l42_process_hs_type_detect()
1097 regmap_update_bits(cs42l42->regmap, in cs42l42_process_hs_type_detect()
1103 (cs42l42->hs_bias_sense_en << CS42L42_HSBIAS_SENSE_EN_SHIFT) | in cs42l42_process_hs_type_detect()
1109 regmap_update_bits(cs42l42->regmap, in cs42l42_process_hs_type_detect()
1118 msleep(cs42l42->btn_det_init_dbnce); in cs42l42_process_hs_type_detect()
1121 regmap_read(cs42l42->regmap, CS42L42_DET_INT_STATUS2, in cs42l42_process_hs_type_detect()
1125 regmap_update_bits(cs42l42->regmap, in cs42l42_process_hs_type_detect()
1138 /* Make sure button detect and HS bias circuits are off */ in cs42l42_process_hs_type_detect()
1139 regmap_update_bits(cs42l42->regmap, in cs42l42_process_hs_type_detect()
1149 regmap_update_bits(cs42l42->regmap, in cs42l42_process_hs_type_detect()
1163 regmap_update_bits(cs42l42->regmap, in cs42l42_process_hs_type_detect()
1178 regmap_update_bits(cs42l42->regmap, in cs42l42_init_hs_type_detect()
1189 /* Make sure button detect and HS bias circuits are off */ in cs42l42_init_hs_type_detect()
1190 regmap_update_bits(cs42l42->regmap, in cs42l42_init_hs_type_detect()
1199 /* Set auto HS bias settings to default */ in cs42l42_init_hs_type_detect()
1200 regmap_update_bits(cs42l42->regmap, in cs42l42_init_hs_type_detect()
1212 regmap_update_bits(cs42l42->regmap, in cs42l42_init_hs_type_detect()
1223 regmap_update_bits(cs42l42->regmap, in cs42l42_init_hs_type_detect()
1236 /* Power up HS bias to 2.7V */ in cs42l42_init_hs_type_detect()
1237 regmap_update_bits(cs42l42->regmap, in cs42l42_init_hs_type_detect()
1246 /* Wait for HS bias to ramp up */ in cs42l42_init_hs_type_detect()
1247 msleep(cs42l42->hs_bias_ramp_time); in cs42l42_init_hs_type_detect()
1250 regmap_update_bits(cs42l42->regmap, in cs42l42_init_hs_type_detect()
1258 regmap_update_bits(cs42l42->regmap, in cs42l42_init_hs_type_detect()
1273 regmap_update_bits(cs42l42->regmap, in cs42l42_cancel_hs_type_detect()
1286 /* Ground HS bias */ in cs42l42_cancel_hs_type_detect()
1287 regmap_update_bits(cs42l42->regmap, in cs42l42_cancel_hs_type_detect()
1296 /* Set auto HS bias settings to default */ in cs42l42_cancel_hs_type_detect()
1297 regmap_update_bits(cs42l42->regmap, in cs42l42_cancel_hs_type_detect()
1309 regmap_update_bits(cs42l42->regmap, in cs42l42_cancel_hs_type_detect()
1327 regmap_update_bits(cs42l42->regmap, in cs42l42_handle_button_press()
1340 usleep_range(cs42l42->btn_det_event_dbnce * 1000, in cs42l42_handle_button_press()
1341 cs42l42->btn_det_event_dbnce * 2000); in cs42l42_handle_button_press()
1347 regmap_update_bits(cs42l42->regmap, in cs42l42_handle_button_press()
1354 (cs42l42->bias_thresholds[bias_level] << in cs42l42_handle_button_press()
1357 regmap_read(cs42l42->regmap, CS42L42_DET_STATUS2, in cs42l42_handle_button_press()
1365 dev_dbg(cs42l42->component->dev, "Function C button press\n"); in cs42l42_handle_button_press()
1369 dev_dbg(cs42l42->component->dev, "Function B button press\n"); in cs42l42_handle_button_press()
1373 dev_dbg(cs42l42->component->dev, "Function D button press\n"); in cs42l42_handle_button_press()
1377 dev_dbg(cs42l42->component->dev, "Function A button press\n"); in cs42l42_handle_button_press()
1385 regmap_update_bits(cs42l42->regmap, in cs42l42_handle_button_press()
1392 (cs42l42->bias_thresholds[0] << CS42L42_HS_DET_LEVEL_SHIFT)); in cs42l42_handle_button_press()
1395 regmap_read(cs42l42->regmap, CS42L42_DET_INT_STATUS2, in cs42l42_handle_button_press()
1399 regmap_update_bits(cs42l42->regmap, in cs42l42_handle_button_press()
1451 struct snd_soc_component *component = cs42l42->component; in cs42l42_irq_thread()
1462 regmap_read(cs42l42->regmap, irq_params_table[i].status_addr, in cs42l42_irq_thread()
1464 regmap_read(cs42l42->regmap, irq_params_table[i].mask_addr, in cs42l42_irq_thread()
1481 /* Check auto-detect status */ in cs42l42_irq_thread()
1485 switch(cs42l42->hs_type){ in cs42l42_irq_thread()
1488 snd_soc_jack_report(cs42l42->jack, SND_JACK_HEADSET, in cs42l42_irq_thread()
1492 snd_soc_jack_report(cs42l42->jack, SND_JACK_HEADPHONE, in cs42l42_irq_thread()
1498 dev_dbg(component->dev, "Auto detect done (%d)\n", cs42l42->hs_type); in cs42l42_irq_thread()
1506 if (cs42l42->plug_state != CS42L42_TS_PLUG) { in cs42l42_irq_thread()
1507 cs42l42->plug_state = CS42L42_TS_PLUG; in cs42l42_irq_thread()
1513 if (cs42l42->plug_state != CS42L42_TS_UNPLUG) { in cs42l42_irq_thread()
1514 cs42l42->plug_state = CS42L42_TS_UNPLUG; in cs42l42_irq_thread()
1517 switch(cs42l42->hs_type){ in cs42l42_irq_thread()
1520 snd_soc_jack_report(cs42l42->jack, 0, SND_JACK_HEADSET); in cs42l42_irq_thread()
1523 snd_soc_jack_report(cs42l42->jack, 0, SND_JACK_HEADPHONE); in cs42l42_irq_thread()
1528 snd_soc_jack_report(cs42l42->jack, 0, in cs42l42_irq_thread()
1532 dev_dbg(component->dev, "Unplug event\n"); in cs42l42_irq_thread()
1537 if (cs42l42->plug_state != CS42L42_TS_TRANS) in cs42l42_irq_thread()
1538 cs42l42->plug_state = CS42L42_TS_TRANS; in cs42l42_irq_thread()
1543 if (cs42l42->plug_state == CS42L42_TS_PLUG && ((~masks[7]) & irq_params_table[7].mask)) { in cs42l42_irq_thread()
1548 dev_dbg(component->dev, "Button released\n"); in cs42l42_irq_thread()
1554 snd_soc_jack_report(cs42l42->jack, report, SND_JACK_BTN_0 | SND_JACK_BTN_1 | in cs42l42_irq_thread()
1564 regmap_update_bits(cs42l42->regmap, CS42L42_ADC_OVFL_INT_MASK, in cs42l42_set_interrupt_masks()
1568 regmap_update_bits(cs42l42->regmap, CS42L42_MIXER_INT_MASK, in cs42l42_set_interrupt_masks()
1578 regmap_update_bits(cs42l42->regmap, CS42L42_SRC_INT_MASK, in cs42l42_set_interrupt_masks()
1588 regmap_update_bits(cs42l42->regmap, CS42L42_ASP_RX_INT_MASK, in cs42l42_set_interrupt_masks()
1600 regmap_update_bits(cs42l42->regmap, CS42L42_ASP_TX_INT_MASK, in cs42l42_set_interrupt_masks()
1610 regmap_update_bits(cs42l42->regmap, CS42L42_CODEC_INT_MASK, in cs42l42_set_interrupt_masks()
1616 regmap_update_bits(cs42l42->regmap, CS42L42_SRCPL_INT_MASK, in cs42l42_set_interrupt_masks()
1626 regmap_update_bits(cs42l42->regmap, CS42L42_DET_INT1_MASK, in cs42l42_set_interrupt_masks()
1634 regmap_update_bits(cs42l42->regmap, CS42L42_DET_INT2_MASK, in cs42l42_set_interrupt_masks()
1646 regmap_update_bits(cs42l42->regmap, CS42L42_VPMON_INT_MASK, in cs42l42_set_interrupt_masks()
1650 regmap_update_bits(cs42l42->regmap, CS42L42_PLL_LOCK_INT_MASK, in cs42l42_set_interrupt_masks()
1654 regmap_update_bits(cs42l42->regmap, CS42L42_TSRS_PLUG_INT_MASK, in cs42l42_set_interrupt_masks()
1669 cs42l42->hs_type = CS42L42_PLUG_INVALID; in cs42l42_setup_hs_type_detect()
1672 regmap_update_bits(cs42l42->regmap, CS42L42_MIC_DET_CTL1, in cs42l42_setup_hs_type_detect()
1678 (cs42l42->bias_thresholds[0] << in cs42l42_setup_hs_type_detect()
1681 /* Remove ground noise-suppression clamps */ in cs42l42_setup_hs_type_detect()
1682 regmap_update_bits(cs42l42->regmap, in cs42l42_setup_hs_type_detect()
1688 regmap_update_bits(cs42l42->regmap, CS42L42_TIPSENSE_CTL, in cs42l42_setup_hs_type_detect()
1697 regmap_read(cs42l42->regmap, in cs42l42_setup_hs_type_detect()
1700 cs42l42->plug_state = (((char) reg) & in cs42l42_setup_hs_type_detect()
1720 ret = device_property_read_u32(dev, "cirrus,ts-inv", &val); in cs42l42_handle_device_data()
1725 cs42l42->ts_inv = val; in cs42l42_handle_device_data()
1729 "Wrong cirrus,ts-inv DT value %d\n", in cs42l42_handle_device_data()
1731 cs42l42->ts_inv = CS42L42_TS_INV_DIS; in cs42l42_handle_device_data()
1734 cs42l42->ts_inv = CS42L42_TS_INV_DIS; in cs42l42_handle_device_data()
1737 regmap_update_bits(cs42l42->regmap, CS42L42_TSENSE_CTL, in cs42l42_handle_device_data()
1739 (cs42l42->ts_inv << CS42L42_TS_INV_SHIFT)); in cs42l42_handle_device_data()
1741 ret = device_property_read_u32(dev, "cirrus,ts-dbnc-rise", &val); in cs42l42_handle_device_data()
1752 cs42l42->ts_dbnc_rise = val; in cs42l42_handle_device_data()
1756 "Wrong cirrus,ts-dbnc-rise DT value %d\n", in cs42l42_handle_device_data()
1758 cs42l42->ts_dbnc_rise = CS42L42_TS_DBNCE_1000; in cs42l42_handle_device_data()
1761 cs42l42->ts_dbnc_rise = CS42L42_TS_DBNCE_1000; in cs42l42_handle_device_data()
1764 regmap_update_bits(cs42l42->regmap, CS42L42_TSENSE_CTL, in cs42l42_handle_device_data()
1766 (cs42l42->ts_dbnc_rise << in cs42l42_handle_device_data()
1769 ret = device_property_read_u32(dev, "cirrus,ts-dbnc-fall", &val); in cs42l42_handle_device_data()
1780 cs42l42->ts_dbnc_fall = val; in cs42l42_handle_device_data()
1784 "Wrong cirrus,ts-dbnc-fall DT value %d\n", in cs42l42_handle_device_data()
1786 cs42l42->ts_dbnc_fall = CS42L42_TS_DBNCE_0; in cs42l42_handle_device_data()
1789 cs42l42->ts_dbnc_fall = CS42L42_TS_DBNCE_0; in cs42l42_handle_device_data()
1792 regmap_update_bits(cs42l42->regmap, CS42L42_TSENSE_CTL, in cs42l42_handle_device_data()
1794 (cs42l42->ts_dbnc_fall << in cs42l42_handle_device_data()
1797 ret = device_property_read_u32(dev, "cirrus,btn-det-init-dbnce", &val); in cs42l42_handle_device_data()
1800 cs42l42->btn_det_init_dbnce = val; in cs42l42_handle_device_data()
1803 "Wrong cirrus,btn-det-init-dbnce DT value %d\n", in cs42l42_handle_device_data()
1805 cs42l42->btn_det_init_dbnce = in cs42l42_handle_device_data()
1809 cs42l42->btn_det_init_dbnce = in cs42l42_handle_device_data()
1813 ret = device_property_read_u32(dev, "cirrus,btn-det-event-dbnce", &val); in cs42l42_handle_device_data()
1816 cs42l42->btn_det_event_dbnce = val; in cs42l42_handle_device_data()
1819 "Wrong cirrus,btn-det-event-dbnce DT value %d\n", val); in cs42l42_handle_device_data()
1820 cs42l42->btn_det_event_dbnce = in cs42l42_handle_device_data()
1824 cs42l42->btn_det_event_dbnce = in cs42l42_handle_device_data()
1828 ret = device_property_read_u32_array(dev, "cirrus,bias-lvls", in cs42l42_handle_device_data()
1833 cs42l42->bias_thresholds[i] = thresholds[i]; in cs42l42_handle_device_data()
1836 "Wrong cirrus,bias-lvls[%d] DT value %d\n", i, in cs42l42_handle_device_data()
1838 cs42l42->bias_thresholds[i] = threshold_defaults[i]; in cs42l42_handle_device_data()
1843 cs42l42->bias_thresholds[i] = threshold_defaults[i]; in cs42l42_handle_device_data()
1846 ret = device_property_read_u32(dev, "cirrus,hs-bias-ramp-rate", &val); in cs42l42_handle_device_data()
1850 cs42l42->hs_bias_ramp_rate = val; in cs42l42_handle_device_data()
1851 cs42l42->hs_bias_ramp_time = CS42L42_HSBIAS_RAMP_TIME0; in cs42l42_handle_device_data()
1854 cs42l42->hs_bias_ramp_rate = val; in cs42l42_handle_device_data()
1855 cs42l42->hs_bias_ramp_time = CS42L42_HSBIAS_RAMP_TIME1; in cs42l42_handle_device_data()
1858 cs42l42->hs_bias_ramp_rate = val; in cs42l42_handle_device_data()
1859 cs42l42->hs_bias_ramp_time = CS42L42_HSBIAS_RAMP_TIME2; in cs42l42_handle_device_data()
1862 cs42l42->hs_bias_ramp_rate = val; in cs42l42_handle_device_data()
1863 cs42l42->hs_bias_ramp_time = CS42L42_HSBIAS_RAMP_TIME3; in cs42l42_handle_device_data()
1867 "Wrong cirrus,hs-bias-ramp-rate DT value %d\n", in cs42l42_handle_device_data()
1869 cs42l42->hs_bias_ramp_rate = CS42L42_HSBIAS_RAMP_SLOW; in cs42l42_handle_device_data()
1870 cs42l42->hs_bias_ramp_time = CS42L42_HSBIAS_RAMP_TIME2; in cs42l42_handle_device_data()
1873 cs42l42->hs_bias_ramp_rate = CS42L42_HSBIAS_RAMP_SLOW; in cs42l42_handle_device_data()
1874 cs42l42->hs_bias_ramp_time = CS42L42_HSBIAS_RAMP_TIME2; in cs42l42_handle_device_data()
1877 regmap_update_bits(cs42l42->regmap, CS42L42_HS_BIAS_CTL, in cs42l42_handle_device_data()
1879 (cs42l42->hs_bias_ramp_rate << in cs42l42_handle_device_data()
1882 if (device_property_read_bool(dev, "cirrus,hs-bias-sense-disable")) in cs42l42_handle_device_data()
1883 cs42l42->hs_bias_sense_en = 0; in cs42l42_handle_device_data()
1885 cs42l42->hs_bias_sense_en = 1; in cs42l42_handle_device_data()
1897 cs42l42 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs42l42_private), in cs42l42_i2c_probe()
1900 return -ENOMEM; in cs42l42_i2c_probe()
1904 cs42l42->regmap = devm_regmap_init_i2c(i2c_client, &cs42l42_regmap); in cs42l42_i2c_probe()
1905 if (IS_ERR(cs42l42->regmap)) { in cs42l42_i2c_probe()
1906 ret = PTR_ERR(cs42l42->regmap); in cs42l42_i2c_probe()
1907 dev_err(&i2c_client->dev, "regmap_init() failed: %d\n", ret); in cs42l42_i2c_probe()
1911 for (i = 0; i < ARRAY_SIZE(cs42l42->supplies); i++) in cs42l42_i2c_probe()
1912 cs42l42->supplies[i].supply = cs42l42_supply_names[i]; in cs42l42_i2c_probe()
1914 ret = devm_regulator_bulk_get(&i2c_client->dev, in cs42l42_i2c_probe()
1915 ARRAY_SIZE(cs42l42->supplies), in cs42l42_i2c_probe()
1916 cs42l42->supplies); in cs42l42_i2c_probe()
1918 dev_err(&i2c_client->dev, in cs42l42_i2c_probe()
1923 ret = regulator_bulk_enable(ARRAY_SIZE(cs42l42->supplies), in cs42l42_i2c_probe()
1924 cs42l42->supplies); in cs42l42_i2c_probe()
1926 dev_err(&i2c_client->dev, in cs42l42_i2c_probe()
1932 cs42l42->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev, in cs42l42_i2c_probe()
1934 if (IS_ERR(cs42l42->reset_gpio)) { in cs42l42_i2c_probe()
1935 ret = PTR_ERR(cs42l42->reset_gpio); in cs42l42_i2c_probe()
1939 if (cs42l42->reset_gpio) { in cs42l42_i2c_probe()
1940 dev_dbg(&i2c_client->dev, "Found reset GPIO\n"); in cs42l42_i2c_probe()
1941 gpiod_set_value_cansleep(cs42l42->reset_gpio, 1); in cs42l42_i2c_probe()
1946 ret = devm_request_threaded_irq(&i2c_client->dev, in cs42l42_i2c_probe()
1947 i2c_client->irq, in cs42l42_i2c_probe()
1953 dev_err(&i2c_client->dev, in cs42l42_i2c_probe()
1957 devid = cirrus_read_device_id(cs42l42->regmap, CS42L42_DEVID_AB); in cs42l42_i2c_probe()
1960 dev_err(&i2c_client->dev, "Failed to read device ID: %d\n", ret); in cs42l42_i2c_probe()
1965 ret = -ENODEV; in cs42l42_i2c_probe()
1966 dev_err(&i2c_client->dev, in cs42l42_i2c_probe()
1972 ret = regmap_read(cs42l42->regmap, CS42L42_REVID, &reg); in cs42l42_i2c_probe()
1974 dev_err(&i2c_client->dev, "Get Revision ID failed\n"); in cs42l42_i2c_probe()
1978 dev_info(&i2c_client->dev, in cs42l42_i2c_probe()
1982 regmap_update_bits(cs42l42->regmap, CS42L42_PWR_CTL1, in cs42l42_i2c_probe()
1998 ret = cs42l42_handle_device_data(&i2c_client->dev, cs42l42); in cs42l42_i2c_probe()
2009 ret = devm_snd_soc_register_component(&i2c_client->dev, in cs42l42_i2c_probe()
2016 regulator_bulk_disable(ARRAY_SIZE(cs42l42->supplies), in cs42l42_i2c_probe()
2017 cs42l42->supplies); in cs42l42_i2c_probe()
2025 devm_free_irq(&i2c_client->dev, i2c_client->irq, cs42l42); in cs42l42_i2c_remove()
2026 pm_runtime_suspend(&i2c_client->dev); in cs42l42_i2c_remove()
2027 pm_runtime_disable(&i2c_client->dev); in cs42l42_i2c_remove()
2037 regcache_cache_only(cs42l42->regmap, true); in cs42l42_runtime_suspend()
2038 regcache_mark_dirty(cs42l42->regmap); in cs42l42_runtime_suspend()
2040 /* Hold down reset */ in cs42l42_runtime_suspend()
2041 gpiod_set_value_cansleep(cs42l42->reset_gpio, 0); in cs42l42_runtime_suspend()
2044 regulator_bulk_disable(ARRAY_SIZE(cs42l42->supplies), in cs42l42_runtime_suspend()
2045 cs42l42->supplies); in cs42l42_runtime_suspend()
2056 ret = regulator_bulk_enable(ARRAY_SIZE(cs42l42->supplies), in cs42l42_runtime_resume()
2057 cs42l42->supplies); in cs42l42_runtime_resume()
2064 gpiod_set_value_cansleep(cs42l42->reset_gpio, 1); in cs42l42_runtime_resume()
2067 regcache_cache_only(cs42l42->regmap, false); in cs42l42_runtime_resume()
2068 regcache_sync(cs42l42->regmap); in cs42l42_runtime_resume()