Lines Matching refs:arizona

100 	struct arizona *arizona = info->arizona;  in arizona_extcon_hp_clamp()  local
105 switch (arizona->type) { in arizona_extcon_hp_clamp()
122 ret = regmap_update_bits(arizona->regmap, in arizona_extcon_hp_clamp()
127 dev_warn(arizona->dev, "Failed to set TST_CAP_SEL: %d\n", ret); in arizona_extcon_hp_clamp()
136 snd_soc_dapm_mutex_lock(arizona->dapm); in arizona_extcon_hp_clamp()
138 arizona->hpdet_clamp = clamp; in arizona_extcon_hp_clamp()
142 ret = regmap_update_bits(arizona->regmap, in arizona_extcon_hp_clamp()
147 dev_warn(arizona->dev, "Failed to disable headphone outputs: %d\n", ret); in arizona_extcon_hp_clamp()
151 ret = regmap_update_bits(arizona->regmap, ARIZONA_HP_CTRL_1L, in arizona_extcon_hp_clamp()
154 dev_warn(arizona->dev, "Failed to do clamp: %d\n", ret); in arizona_extcon_hp_clamp()
156 ret = regmap_update_bits(arizona->regmap, ARIZONA_HP_CTRL_1R, in arizona_extcon_hp_clamp()
159 dev_warn(arizona->dev, "Failed to do clamp: %d\n", ret); in arizona_extcon_hp_clamp()
164 ret = regmap_update_bits(arizona->regmap, in arizona_extcon_hp_clamp()
167 ARIZONA_OUT1R_ENA, arizona->hp_ena); in arizona_extcon_hp_clamp()
169 dev_warn(arizona->dev, "Failed to restore headphone outputs: %d\n", ret); in arizona_extcon_hp_clamp()
172 snd_soc_dapm_mutex_unlock(arizona->dapm); in arizona_extcon_hp_clamp()
177 struct arizona *arizona = info->arizona; in arizona_extcon_set_mode() local
184 regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1, in arizona_extcon_set_mode()
188 regmap_update_bits(arizona->regmap, ARIZONA_ACCESSORY_DETECT_MODE_1, in arizona_extcon_set_mode()
193 dev_dbg(arizona->dev, "Set jack polarity to %d\n", mode); in arizona_extcon_set_mode()
212 struct arizona *arizona = info->arizona; in arizona_extcon_pulse_micbias() local
214 struct snd_soc_dapm_context *dapm = arizona->dapm; in arizona_extcon_pulse_micbias()
220 dev_warn(arizona->dev, "Failed to enable %s: %d\n", widget, ret); in arizona_extcon_pulse_micbias()
224 if (!arizona->pdata.micd_force_micbias) { in arizona_extcon_pulse_micbias()
227 dev_warn(arizona->dev, "Failed to disable %s: %d\n", widget, ret); in arizona_extcon_pulse_micbias()
235 struct arizona *arizona = info->arizona; in arizona_start_mic() local
241 pm_runtime_get_sync(arizona->dev); in arizona_start_mic()
246 dev_err(arizona->dev, "Failed to regulate MICVDD: %d\n", ret); in arizona_start_mic()
251 dev_err(arizona->dev, "Failed to enable MICVDD: %d\n", ret); in arizona_start_mic()
260 regmap_multi_reg_write(arizona->regmap, reva, ARRAY_SIZE(reva)); in arizona_start_mic()
263 if (info->detecting && arizona->pdata.micd_software_compare) in arizona_start_mic()
268 regmap_update_bits(arizona->regmap, in arizona_start_mic()
274 ret = regmap_update_bits_check(arizona->regmap, ARIZONA_MIC_DETECT_1, in arizona_start_mic()
278 dev_err(arizona->dev, "Failed to enable micd: %d\n", ret); in arizona_start_mic()
281 pm_runtime_put_autosuspend(arizona->dev); in arizona_start_mic()
287 struct arizona *arizona = info->arizona; in arizona_stop_mic() local
289 struct snd_soc_dapm_context *dapm = arizona->dapm; in arizona_stop_mic()
294 ret = regmap_update_bits_check(arizona->regmap, ARIZONA_MIC_DETECT_1, in arizona_stop_mic()
298 dev_err(arizona->dev, "Failed to disable micd: %d\n", ret); in arizona_stop_mic()
302 dev_warn(arizona->dev, "Failed to disable %s: %d\n", widget, ret); in arizona_stop_mic()
313 regmap_multi_reg_write(arizona->regmap, reva, ARRAY_SIZE(reva)); in arizona_stop_mic()
318 dev_err(arizona->dev, "Failed to bypass MICVDD: %d\n", ret); in arizona_stop_mic()
322 pm_runtime_mark_last_busy(arizona->dev); in arizona_stop_mic()
323 pm_runtime_put_autosuspend(arizona->dev); in arizona_stop_mic()
351 struct arizona *arizona = info->arizona; in arizona_hpdet_read() local
355 ret = regmap_read(arizona->regmap, ARIZONA_HEADPHONE_DETECT_2, &val); in arizona_hpdet_read()
357 dev_err(arizona->dev, "Failed to read HPDET status: %d\n", ret); in arizona_hpdet_read()
364 dev_err(arizona->dev, "HPDET did not complete: %x\n", val); in arizona_hpdet_read()
373 dev_err(arizona->dev, "HPDET did not complete: %x\n", val); in arizona_hpdet_read()
377 ret = regmap_read(arizona->regmap, ARIZONA_HP_DACVAL, &val); in arizona_hpdet_read()
379 dev_err(arizona->dev, "Failed to read HP value: %d\n", ret); in arizona_hpdet_read()
383 regmap_read(arizona->regmap, ARIZONA_HEADPHONE_DETECT_1, in arizona_hpdet_read()
392 dev_dbg(arizona->dev, "Moving to HPDET range %d\n", range); in arizona_hpdet_read()
393 regmap_update_bits(arizona->regmap, in arizona_hpdet_read()
404 dev_dbg(arizona->dev, "Measurement out of range\n"); in arizona_hpdet_read()
408 dev_dbg(arizona->dev, "HPDET read %d in range %d\n", val, range); in arizona_hpdet_read()
417 dev_err(arizona->dev, "HPDET did not complete: %x\n", val); in arizona_hpdet_read()
425 regmap_read(arizona->regmap, ARIZONA_HEADPHONE_DETECT_1, in arizona_hpdet_read()
434 dev_dbg(arizona->dev, "Moving to HPDET range %d-%d\n", in arizona_hpdet_read()
437 regmap_update_bits(arizona->regmap, in arizona_hpdet_read()
446 dev_dbg(arizona->dev, "Reporting range boundary %d\n", in arizona_hpdet_read()
453 dev_warn(arizona->dev, "Unknown HPDET IP revision %d\n", info->hpdet_ip_version); in arizona_hpdet_read()
457 dev_dbg(arizona->dev, "HP impedance %d ohms\n", val); in arizona_hpdet_read()
464 struct arizona *arizona = info->arizona; in arizona_hpdet_do_id() local
465 int id_gpio = arizona->pdata.hpdet_id_gpio; in arizona_hpdet_do_id()
467 if (!arizona->pdata.hpdet_acc_id) in arizona_hpdet_do_id()
478 dev_dbg(arizona->dev, "Measuring mic\n"); in arizona_hpdet_do_id()
480 regmap_update_bits(arizona->regmap, in arizona_hpdet_do_id()
489 regmap_update_bits(arizona->regmap, ARIZONA_HEADPHONE_DETECT_1, in arizona_hpdet_do_id()
495 dev_dbg(arizona->dev, "HPDET measured %d %d\n", in arizona_hpdet_do_id()
503 dev_dbg(arizona->dev, "Retrying high impedance\n"); in arizona_hpdet_do_id()
507 pm_runtime_put(arizona->dev); in arizona_hpdet_do_id()
515 dev_dbg(arizona->dev, "Detected mic\n"); in arizona_hpdet_do_id()
519 dev_dbg(arizona->dev, "Detected headphone\n"); in arizona_hpdet_do_id()
523 regmap_update_bits(arizona->regmap, ARIZONA_ACCESSORY_DETECT_MODE_1, in arizona_hpdet_do_id()
532 struct arizona *arizona = info->arizona; in arizona_hpdet_irq() local
533 int id_gpio = arizona->pdata.hpdet_id_gpio; in arizona_hpdet_irq()
541 dev_warn(arizona->dev, "Spurious HPDET IRQ\n"); in arizona_hpdet_irq()
549 dev_dbg(arizona->dev, "Ignoring HPDET for removed cable\n"); in arizona_hpdet_irq()
561 regmap_update_bits(arizona->regmap, in arizona_hpdet_irq()
582 regmap_update_bits(arizona->regmap, in arizona_hpdet_irq()
597 pm_runtime_put_autosuspend(arizona->dev); in arizona_hpdet_irq()
613 struct arizona *arizona = info->arizona; in arizona_identify_headphone() local
619 dev_dbg(arizona->dev, "Starting HPDET\n"); in arizona_identify_headphone()
622 pm_runtime_get_sync(arizona->dev); in arizona_identify_headphone()
630 ret = regmap_update_bits(arizona->regmap, in arizona_identify_headphone()
633 arizona->pdata.hpdet_channel); in arizona_identify_headphone()
635 dev_err(arizona->dev, "Failed to set HPDET mode: %d\n", ret); in arizona_identify_headphone()
639 ret = regmap_update_bits(arizona->regmap, ARIZONA_HEADPHONE_DETECT_1, in arizona_identify_headphone()
642 dev_err(arizona->dev, "Can't start HPDETL measurement: %d\n", ret); in arizona_identify_headphone()
650 pm_runtime_put_autosuspend(arizona->dev); in arizona_identify_headphone()
664 struct arizona *arizona = info->arizona; in arizona_start_hpdet_acc_id() local
669 dev_dbg(arizona->dev, "Starting identification via HPDET\n"); in arizona_start_hpdet_acc_id()
672 pm_runtime_get_sync(arizona->dev); in arizona_start_hpdet_acc_id()
678 ret = regmap_update_bits(arizona->regmap, in arizona_start_hpdet_acc_id()
682 arizona->pdata.hpdet_channel); in arizona_start_hpdet_acc_id()
684 dev_err(arizona->dev, "Failed to set HPDET mode: %d\n", ret); in arizona_start_hpdet_acc_id()
688 if (arizona->pdata.hpdet_acc_id_line) { in arizona_start_hpdet_acc_id()
689 ret = regmap_update_bits(arizona->regmap, in arizona_start_hpdet_acc_id()
693 dev_err(arizona->dev, "Can't start HPDETL measurement: %d\n", ret); in arizona_start_hpdet_acc_id()
718 dev_dbg(info->arizona->dev, "MICD timed out, reporting HP\n"); in arizona_micd_timeout_work()
729 struct arizona *arizona = info->arizona; in arizona_micd_adc_read() local
734 regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1, in arizona_micd_adc_read()
737 ret = regmap_read(arizona->regmap, ARIZONA_MIC_DETECT_4, &val); in arizona_micd_adc_read()
739 dev_err(arizona->dev, "Failed to read MICDET_ADCVAL: %d\n", ret); in arizona_micd_adc_read()
743 dev_dbg(arizona->dev, "MICDET_ADCVAL: %x\n", val); in arizona_micd_adc_read()
765 struct arizona *arizona = info->arizona; in arizona_micd_read() local
770 ret = regmap_read(arizona->regmap, ARIZONA_MIC_DETECT_3, &val); in arizona_micd_read()
772 dev_err(arizona->dev, "Failed to read MICDET: %d\n", ret); in arizona_micd_read()
776 dev_dbg(arizona->dev, "MICDET: %x\n", val); in arizona_micd_read()
779 dev_warn(arizona->dev, "Microphone detection state invalid\n"); in arizona_micd_read()
785 dev_err(arizona->dev, "Failed to get valid MICDET value\n"); in arizona_micd_read()
795 struct arizona *arizona = info->arizona; in arizona_micdet_reading() local
798 if (info->detecting && arizona->pdata.micd_software_compare) in arizona_micdet_reading()
809 dev_warn(arizona->dev, "Detected open circuit\n"); in arizona_micdet_reading()
828 dev_err(arizona->dev, "Failed to bypass MICVDD: %d\n", ret); in arizona_micdet_reading()
841 dev_dbg(arizona->dev, "Detected HP/line\n"); in arizona_micdet_reading()
854 if (arizona->pdata.micd_software_compare) in arizona_micdet_reading()
855 regmap_update_bits(arizona->regmap, in arizona_micdet_reading()
862 msecs_to_jiffies(arizona->pdata.micd_timeout)); in arizona_micdet_reading()
872 dev_dbg(arizona->dev, "Headphone detected\n"); in arizona_micdet_reading()
883 struct arizona *arizona = info->arizona; in arizona_button_reading() local
896 dev_dbg(arizona->dev, "Mic button detected\n"); in arizona_button_reading()
907 dev_err(arizona->dev, "Button out of range\n"); in arizona_button_reading()
910 dev_warn(arizona->dev, "Button with no mic: %x\n", val); in arizona_button_reading()
913 dev_dbg(arizona->dev, "Mic button released\n"); in arizona_button_reading()
926 struct arizona *arizona = info->arizona; in arizona_micd_detect() local
934 dev_dbg(arizona->dev, "Ignoring MICDET for removed cable\n"); in arizona_micd_detect()
944 pm_runtime_mark_last_busy(arizona->dev); in arizona_micd_detect()
951 struct arizona *arizona = info->arizona; in arizona_micdet() local
952 int debounce = arizona->pdata.micd_detect_debounce; in arizona_micdet()
985 struct arizona *arizona = info->arizona; in arizona_hpdet_wait() local
990 ret = regmap_read(arizona->regmap, ARIZONA_HEADPHONE_DETECT_2, in arizona_hpdet_wait()
993 dev_err(arizona->dev, "Failed to read HPDET state: %d\n", ret); in arizona_hpdet_wait()
1011 dev_warn(arizona->dev, "HPDET did not appear to complete\n"); in arizona_hpdet_wait()
1019 struct arizona *arizona = info->arizona; in arizona_jackdet() local
1027 pm_runtime_get_sync(arizona->dev); in arizona_jackdet()
1036 if (arizona->pdata.jd_invert) in arizona_jackdet()
1042 ret = regmap_read(arizona->regmap, ARIZONA_AOD_IRQ_RAW_STATUS, &val); in arizona_jackdet()
1044 dev_err(arizona->dev, "Failed to read jackdet status: %d\n", ret); in arizona_jackdet()
1046 pm_runtime_put_autosuspend(arizona->dev); in arizona_jackdet()
1052 dev_dbg(arizona->dev, "Suppressing duplicate JACKDET\n"); in arizona_jackdet()
1059 int micd_timeout = arizona->pdata.micd_timeout; in arizona_jackdet()
1071 dev_dbg(arizona->dev, "Detected jack\n"); in arizona_jackdet()
1078 if (!arizona->pdata.hpdet_acc_id) { in arizona_jackdet()
1086 if (info->micd_clamp || !arizona->pdata.jd_invert) in arizona_jackdet()
1087 regmap_update_bits(arizona->regmap, in arizona_jackdet()
1092 dev_dbg(arizona->dev, "Detected jack removal\n"); in arizona_jackdet()
1114 regmap_update_bits(arizona->regmap, in arizona_jackdet()
1122 regmap_write(arizona->regmap, ARIZONA_AOD_WKUP_AND_TRIG, in arizona_jackdet()
1130 pm_runtime_mark_last_busy(arizona->dev); in arizona_jackdet()
1131 pm_runtime_put_autosuspend(arizona->dev); in arizona_jackdet()
1137 static void arizona_micd_set_level(struct arizona *arizona, int index, in arizona_micd_set_level() argument
1153 regmap_update_bits(arizona->regmap, reg, mask, level); in arizona_micd_set_level()
1157 struct arizona *arizona) in arizona_extcon_get_micd_configs() argument
1166 nconfs = device_property_count_u32(arizona->dev, prop); in arizona_extcon_get_micd_configs()
1174 ret = device_property_read_u32_array(arizona->dev, prop, vals, nconfs); in arizona_extcon_get_micd_configs()
1192 arizona->pdata.micd_configs = micd_configs; in arizona_extcon_get_micd_configs()
1193 arizona->pdata.num_micd_configs = nconfs; in arizona_extcon_get_micd_configs()
1201 struct arizona *arizona) in arizona_extcon_device_get_pdata() argument
1203 struct arizona_pdata *pdata = &arizona->pdata; in arizona_extcon_device_get_pdata()
1207 device_property_read_u32(arizona->dev, "wlf,hpdet-channel", &val); in arizona_extcon_device_get_pdata()
1214 dev_err(arizona->dev, "Wrong wlf,hpdet-channel DT value %d\n", val); in arizona_extcon_device_get_pdata()
1218 device_property_read_u32(arizona->dev, "wlf,micd-detect-debounce", in arizona_extcon_device_get_pdata()
1221 device_property_read_u32(arizona->dev, "wlf,micd-bias-start-time", in arizona_extcon_device_get_pdata()
1224 device_property_read_u32(arizona->dev, "wlf,micd-rate", in arizona_extcon_device_get_pdata()
1227 device_property_read_u32(arizona->dev, "wlf,micd-dbtime", in arizona_extcon_device_get_pdata()
1230 device_property_read_u32(arizona->dev, "wlf,micd-timeout-ms", in arizona_extcon_device_get_pdata()
1233 pdata->micd_force_micbias = device_property_read_bool(arizona->dev, in arizona_extcon_device_get_pdata()
1236 pdata->micd_software_compare = device_property_read_bool(arizona->dev, in arizona_extcon_device_get_pdata()
1239 pdata->jd_invert = device_property_read_bool(arizona->dev, in arizona_extcon_device_get_pdata()
1242 device_property_read_u32(arizona->dev, "wlf,gpsw", &pdata->gpsw); in arizona_extcon_device_get_pdata()
1244 pdata->jd_gpio5 = device_property_read_bool(arizona->dev, in arizona_extcon_device_get_pdata()
1246 pdata->jd_gpio5_nopull = device_property_read_bool(arizona->dev, in arizona_extcon_device_get_pdata()
1249 ret = arizona_extcon_get_micd_configs(dev, arizona); in arizona_extcon_device_get_pdata()
1251 dev_err(arizona->dev, "Failed to read micd configs: %d\n", ret); in arizona_extcon_device_get_pdata()
1258 struct arizona *arizona = info->arizona; in arizona_jack_codec_dev_probe() local
1259 struct arizona_pdata *pdata = &arizona->pdata; in arizona_jack_codec_dev_probe()
1262 if (!dev_get_platdata(arizona->dev)) in arizona_jack_codec_dev_probe()
1263 arizona_extcon_device_get_pdata(dev, arizona); in arizona_jack_codec_dev_probe()
1267 return dev_err_probe(arizona->dev, PTR_ERR(info->micvdd), "getting MICVDD\n"); in arizona_jack_codec_dev_probe()
1275 switch (arizona->type) { in arizona_jack_codec_dev_probe()
1277 switch (arizona->rev) { in arizona_jack_codec_dev_probe()
1289 switch (arizona->rev) { in arizona_jack_codec_dev_probe()
1318 if (arizona->pdata.gpsw > 0) in arizona_jack_codec_dev_probe()
1319 regmap_update_bits(arizona->regmap, ARIZONA_GP_SWITCH_1, in arizona_jack_codec_dev_probe()
1320 ARIZONA_SW1_MODE_MASK, arizona->pdata.gpsw); in arizona_jack_codec_dev_probe()
1331 dev_err(arizona->dev, "Failed to request GPIO%d: %d\n", in arizona_jack_codec_dev_probe()
1348 info->micd_pol_gpio = gpiod_get_optional(arizona->dev, in arizona_jack_codec_dev_probe()
1353 dev_err_probe(arizona->dev, ret, "getting microphone polarity GPIO\n"); in arizona_jack_codec_dev_probe()
1358 if (arizona->pdata.hpdet_id_gpio > 0) { in arizona_jack_codec_dev_probe()
1359 ret = devm_gpio_request_one(dev, arizona->pdata.hpdet_id_gpio, in arizona_jack_codec_dev_probe()
1363 dev_err(arizona->dev, "Failed to request GPIO%d: %d\n", in arizona_jack_codec_dev_probe()
1364 arizona->pdata.hpdet_id_gpio, ret); in arizona_jack_codec_dev_probe()
1384 struct arizona *arizona = info->arizona; in arizona_jack_enable_jack_detect() local
1385 struct arizona_pdata *pdata = &arizona->pdata; in arizona_jack_enable_jack_detect()
1391 if (arizona->pdata.micd_bias_start_time) in arizona_jack_enable_jack_detect()
1392 regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1, in arizona_jack_enable_jack_detect()
1394 arizona->pdata.micd_bias_start_time in arizona_jack_enable_jack_detect()
1397 if (arizona->pdata.micd_rate) in arizona_jack_enable_jack_detect()
1398 regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1, in arizona_jack_enable_jack_detect()
1400 arizona->pdata.micd_rate in arizona_jack_enable_jack_detect()
1403 switch (arizona->pdata.micd_dbtime) { in arizona_jack_enable_jack_detect()
1405 regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1, in arizona_jack_enable_jack_detect()
1410 regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1, in arizona_jack_enable_jack_detect()
1420 if (arizona->pdata.num_micd_ranges) { in arizona_jack_enable_jack_detect()
1428 if (arizona->pdata.num_micd_ranges > ARIZONA_MAX_MICD_BUTTONS) { in arizona_jack_enable_jack_detect()
1429 dev_err(arizona->dev, "Too many MICD ranges: %d > %d\n", in arizona_jack_enable_jack_detect()
1430 arizona->pdata.num_micd_ranges, ARIZONA_MAX_MICD_BUTTONS); in arizona_jack_enable_jack_detect()
1438 dev_err(arizona->dev, "MICD ranges must be sorted\n"); in arizona_jack_enable_jack_detect()
1445 regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_2, in arizona_jack_enable_jack_detect()
1455 dev_err(arizona->dev, "Unsupported MICD level %d\n", in arizona_jack_enable_jack_detect()
1460 dev_dbg(arizona->dev, "%d ohms for MICD threshold %d\n", in arizona_jack_enable_jack_detect()
1463 arizona_micd_set_level(arizona, i, j); in arizona_jack_enable_jack_detect()
1471 regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_2, in arizona_jack_enable_jack_detect()
1477 arizona_micd_set_level(arizona, i, 0x3f); in arizona_jack_enable_jack_detect()
1484 if (arizona->pdata.jd_gpio5) { in arizona_jack_enable_jack_detect()
1487 if (arizona->pdata.jd_gpio5_nopull) in arizona_jack_enable_jack_detect()
1490 regmap_write(arizona->regmap, ARIZONA_GPIO5_CTRL, in arizona_jack_enable_jack_detect()
1493 if (arizona->pdata.jd_invert) in arizona_jack_enable_jack_detect()
1498 if (arizona->pdata.jd_invert) in arizona_jack_enable_jack_detect()
1504 regmap_update_bits(arizona->regmap, in arizona_jack_enable_jack_detect()
1508 regmap_update_bits(arizona->regmap, in arizona_jack_enable_jack_detect()
1518 pm_runtime_get_sync(arizona->dev); in arizona_jack_enable_jack_detect()
1528 ret = arizona_request_irq(arizona, jack_irq_rise, in arizona_jack_enable_jack_detect()
1531 dev_err(arizona->dev, "Failed to get JACKDET rise IRQ: %d\n", ret); in arizona_jack_enable_jack_detect()
1535 ret = arizona_set_irq_wake(arizona, jack_irq_rise, 1); in arizona_jack_enable_jack_detect()
1537 dev_err(arizona->dev, "Failed to set JD rise IRQ wake: %d\n", ret); in arizona_jack_enable_jack_detect()
1541 ret = arizona_request_irq(arizona, jack_irq_fall, in arizona_jack_enable_jack_detect()
1544 dev_err(arizona->dev, "Failed to get JD fall IRQ: %d\n", ret); in arizona_jack_enable_jack_detect()
1548 ret = arizona_set_irq_wake(arizona, jack_irq_fall, 1); in arizona_jack_enable_jack_detect()
1550 dev_err(arizona->dev, "Failed to set JD fall IRQ wake: %d\n", ret); in arizona_jack_enable_jack_detect()
1554 ret = arizona_request_irq(arizona, ARIZONA_IRQ_MICDET, in arizona_jack_enable_jack_detect()
1557 dev_err(arizona->dev, "Failed to get MICDET IRQ: %d\n", ret); in arizona_jack_enable_jack_detect()
1561 ret = arizona_request_irq(arizona, ARIZONA_IRQ_HPDET, in arizona_jack_enable_jack_detect()
1564 dev_err(arizona->dev, "Failed to get HPDET IRQ: %d\n", ret); in arizona_jack_enable_jack_detect()
1568 arizona_clk32k_enable(arizona); in arizona_jack_enable_jack_detect()
1569 regmap_update_bits(arizona->regmap, ARIZONA_JACK_DETECT_DEBOUNCE, in arizona_jack_enable_jack_detect()
1571 regmap_update_bits(arizona->regmap, ARIZONA_JACK_DETECT_ANALOGUE, in arizona_jack_enable_jack_detect()
1576 dev_warn(arizona->dev, "Failed to set MICVDD to bypass: %d\n", ret); in arizona_jack_enable_jack_detect()
1578 pm_runtime_put(arizona->dev); in arizona_jack_enable_jack_detect()
1583 arizona_free_irq(arizona, ARIZONA_IRQ_MICDET, info); in arizona_jack_enable_jack_detect()
1585 arizona_set_irq_wake(arizona, jack_irq_fall, 0); in arizona_jack_enable_jack_detect()
1587 arizona_free_irq(arizona, jack_irq_fall, info); in arizona_jack_enable_jack_detect()
1589 arizona_set_irq_wake(arizona, jack_irq_rise, 0); in arizona_jack_enable_jack_detect()
1591 arizona_free_irq(arizona, jack_irq_rise, info); in arizona_jack_enable_jack_detect()
1593 pm_runtime_put(arizona->dev); in arizona_jack_enable_jack_detect()
1600 struct arizona *arizona = info->arizona; in arizona_jack_disable_jack_detect() local
1616 arizona_set_irq_wake(arizona, jack_irq_rise, 0); in arizona_jack_disable_jack_detect()
1617 arizona_set_irq_wake(arizona, jack_irq_fall, 0); in arizona_jack_disable_jack_detect()
1618 arizona_free_irq(arizona, ARIZONA_IRQ_HPDET, info); in arizona_jack_disable_jack_detect()
1619 arizona_free_irq(arizona, ARIZONA_IRQ_MICDET, info); in arizona_jack_disable_jack_detect()
1620 arizona_free_irq(arizona, jack_irq_rise, info); in arizona_jack_disable_jack_detect()
1621 arizona_free_irq(arizona, jack_irq_fall, info); in arizona_jack_disable_jack_detect()
1626 ret = regmap_update_bits_check(arizona->regmap, ARIZONA_MIC_DETECT_1, in arizona_jack_disable_jack_detect()
1630 dev_err(arizona->dev, "Failed to disable micd on remove: %d\n", ret); in arizona_jack_disable_jack_detect()
1633 pm_runtime_put(arizona->dev); in arizona_jack_disable_jack_detect()
1636 regmap_update_bits(arizona->regmap, in arizona_jack_disable_jack_detect()
1639 regmap_update_bits(arizona->regmap, ARIZONA_JACK_DETECT_ANALOGUE, in arizona_jack_disable_jack_detect()
1641 arizona_clk32k_disable(arizona); in arizona_jack_disable_jack_detect()