Lines Matching full:cs42l43
3 // CS42L43 CODEC driver jack handling
13 #include <linux/mfd/cs42l43.h>
14 #include <linux/mfd/cs42l43-regs.h>
24 #include "cs42l43.h"
44 struct cs42l43 *cs42l43 = priv->core; in cs42l43_find_index() local
47 ret = device_property_read_u32(cs42l43->dev, prop, &defval); in cs42l43_find_index()
68 struct cs42l43 *cs42l43 = priv->core; in cs42l43_set_jack() local
90 ret = device_property_count_u32(cs42l43->dev, "cirrus,buttons-ohms"); in cs42l43_set_jack()
104 device_property_read_u32_array(cs42l43->dev, "cirrus,buttons-ohms", in cs42l43_set_jack()
120 priv->bias_low = device_property_read_bool(cs42l43->dev, "cirrus,bias-low"); in cs42l43_set_jack()
139 if (!device_property_read_bool(cs42l43->dev, "cirrus,button-automute")) in cs42l43_set_jack()
142 ret = device_property_read_u32(cs42l43->dev, "cirrus,tip-debounce-ms", in cs42l43_set_jack()
150 if (device_property_read_bool(cs42l43->dev, "cirrus,tip-invert")) in cs42l43_set_jack()
153 if (device_property_read_bool(cs42l43->dev, "cirrus,tip-disable-pullup")) in cs42l43_set_jack()
174 if (device_property_read_bool(cs42l43->dev, "cirrus,use-ring-sense")) { in cs42l43_set_jack()
180 if (!device_property_read_bool(cs42l43->dev, "cirrus,ring-invert")) in cs42l43_set_jack()
183 if (!device_property_read_bool(cs42l43->dev, in cs42l43_set_jack()
204 regmap_update_bits(cs42l43->regmap, CS42L43_RINGSENSE_DEB_CTRL, in cs42l43_set_jack()
212 regmap_update_bits(cs42l43->regmap, CS42L43_TIPSENSE_DEB_CTRL, in cs42l43_set_jack()
216 regmap_update_bits(cs42l43->regmap, CS42L43_HS2, in cs42l43_set_jack()
223 regmap_update_bits(cs42l43->regmap, CS42L43_HS_BIAS_SENSE_AND_CLAMP_AUTOCONTROL, in cs42l43_set_jack()
226 regmap_update_bits(cs42l43->regmap, CS42L43_PDNCNTL, in cs42l43_set_jack()
242 struct cs42l43 *cs42l43 = priv->core; in cs42l43_start_hs_bias() local
247 regmap_update_bits(cs42l43->regmap, CS42L43_HS2, in cs42l43_start_hs_bias()
253 regmap_update_bits(cs42l43->regmap, CS42L43_MIC_DETECT_CONTROL_1, in cs42l43_start_hs_bias()
261 struct cs42l43 *cs42l43 = priv->core; in cs42l43_stop_hs_bias() local
265 regmap_update_bits(cs42l43->regmap, CS42L43_MIC_DETECT_CONTROL_1, in cs42l43_stop_hs_bias()
268 regmap_update_bits(cs42l43->regmap, CS42L43_HS2, in cs42l43_stop_hs_bias()
296 struct cs42l43 *cs42l43 = priv->core; in cs42l43_jack_present() local
299 regmap_read(cs42l43->regmap, CS42L43_TIP_RING_SENSE_INTERRUPT_STATUS, &sts); in cs42l43_jack_present()
308 struct cs42l43 *cs42l43 = priv->core; in cs42l43_start_button_detect() local
318 regmap_update_bits(cs42l43->regmap, CS42L43_MIC_DETECT_CONTROL_1, in cs42l43_start_button_detect()
323 regmap_update_bits(cs42l43->regmap, in cs42l43_start_button_detect()
334 struct cs42l43 *cs42l43 = priv->core; in cs42l43_stop_button_detect() local
339 regmap_update_bits(cs42l43->regmap, in cs42l43_stop_button_detect()
345 regmap_update_bits(cs42l43->regmap, CS42L43_MIC_DETECT_CONTROL_1, in cs42l43_stop_button_detect()
360 struct cs42l43 *cs42l43 = priv->core; in cs42l43_button_press_work() local
378 regmap_read(cs42l43->regmap, CS42L43_DETECT_STATUS_1, &val); in cs42l43_button_press_work()
470 struct cs42l43 *cs42l43 = priv->core; in cs42l43_bias_sense_timeout() local
484 regmap_update_bits(cs42l43->regmap, in cs42l43_bias_sense_timeout()
487 regmap_update_bits(cs42l43->regmap, in cs42l43_bias_sense_timeout()
501 struct cs42l43 *cs42l43 = priv->core; in cs42l43_start_load_detect() local
514 regmap_update_bits(cs42l43->regmap, CS42L43_BLOCK_EN8, in cs42l43_start_load_detect()
523 regmap_update_bits(cs42l43->regmap, CS42L43_BLOCK_EN3, in cs42l43_start_load_detect()
525 regmap_update_bits(cs42l43->regmap, CS42L43_DACCNFG2, CS42L43_HP_HPF_EN_MASK, 0); in cs42l43_start_load_detect()
526 regmap_update_bits(cs42l43->regmap, CS42L43_MIC_DETECT_CONTROL_1, in cs42l43_start_load_detect()
528 regmap_update_bits(cs42l43->regmap, CS42L43_CTRL, in cs42l43_start_load_detect()
530 regmap_update_bits(cs42l43->regmap, CS42L43_PGAVOL, in cs42l43_start_load_detect()
532 regmap_update_bits(cs42l43->regmap, CS42L43_DACCNFG1, in cs42l43_start_load_detect()
535 regmap_update_bits(cs42l43->regmap, CS42L43_HS2, in cs42l43_start_load_detect()
538 regmap_update_bits(cs42l43->regmap, CS42L43_LOADDETENA, in cs42l43_start_load_detect()
547 struct cs42l43 *cs42l43 = priv->core; in cs42l43_stop_load_detect() local
553 regmap_update_bits(cs42l43->regmap, CS42L43_LOADDETENA, in cs42l43_stop_load_detect()
555 regmap_update_bits(cs42l43->regmap, CS42L43_HS2, in cs42l43_stop_load_detect()
557 regmap_update_bits(cs42l43->regmap, CS42L43_DACCNFG1, in cs42l43_stop_load_detect()
560 regmap_update_bits(cs42l43->regmap, CS42L43_PGAVOL, in cs42l43_stop_load_detect()
563 regmap_update_bits(cs42l43->regmap, CS42L43_CTRL, in cs42l43_stop_load_detect()
565 regmap_update_bits(cs42l43->regmap, CS42L43_MIC_DETECT_CONTROL_1, in cs42l43_stop_load_detect()
567 regmap_update_bits(cs42l43->regmap, CS42L43_DACCNFG2, in cs42l43_stop_load_detect()
570 regmap_update_bits(cs42l43->regmap, CS42L43_BLOCK_EN3, in cs42l43_stop_load_detect()
579 regmap_update_bits(cs42l43->regmap, CS42L43_BLOCK_EN8, in cs42l43_stop_load_detect()
595 struct cs42l43 *cs42l43 = priv->core; in cs42l43_run_load_detect() local
609 regmap_read(cs42l43->regmap, CS42L43_LOADDETRESULTS, &val); in cs42l43_run_load_detect()
638 struct cs42l43 *cs42l43 = priv->core; in cs42l43_run_type_detect() local
645 regmap_update_bits(cs42l43->regmap, CS42L43_STEREO_MIC_CLAMP_CTRL, in cs42l43_run_type_detect()
650 regmap_update_bits(cs42l43->regmap, CS42L43_HS2, in cs42l43_run_type_detect()
656 regmap_update_bits(cs42l43->regmap, CS42L43_HS2, in cs42l43_run_type_detect()
660 regmap_update_bits(cs42l43->regmap, CS42L43_STEREO_MIC_CLAMP_CTRL, in cs42l43_run_type_detect()
666 regmap_read(cs42l43->regmap, CS42L43_HS_STAT, &type); in cs42l43_run_type_detect()
689 struct cs42l43 *cs42l43 = priv->core; in cs42l43_clear_jack() local
694 regmap_update_bits(cs42l43->regmap, CS42L43_ADC_B_CTRL1, in cs42l43_clear_jack()
696 regmap_update_bits(cs42l43->regmap, CS42L43_ADC_B_CTRL2, in cs42l43_clear_jack()
698 regmap_update_bits(cs42l43->regmap, CS42L43_STEREO_MIC_CTRL, in cs42l43_clear_jack()
700 regmap_update_bits(cs42l43->regmap, CS42L43_STEREO_MIC_CLAMP_CTRL, in cs42l43_clear_jack()
703 regmap_update_bits(cs42l43->regmap, CS42L43_HS2, in cs42l43_clear_jack()
714 struct cs42l43 *cs42l43 = priv->core; in cs42l43_tip_sense_work() local
727 regmap_read(cs42l43->regmap, CS42L43_TIP_RING_SENSE_INTERRUPT_STATUS, &sts); in cs42l43_tip_sense_work()
735 if (cs42l43->sdw && !priv->jack_present) { in cs42l43_tip_sense_work()
756 if (cs42l43->sdw && priv->jack_present) { in cs42l43_tip_sense_work()
876 struct cs42l43 *cs42l43 = priv->core; in cs42l43_jack_put() local
907 regmap_update_bits(cs42l43->regmap, CS42L43_HS2, in cs42l43_jack_put()
919 regmap_update_bits(cs42l43->regmap, CS42L43_STEREO_MIC_CTRL, in cs42l43_jack_put()
923 regmap_update_bits(cs42l43->regmap, CS42L43_STEREO_MIC_CLAMP_CTRL, in cs42l43_jack_put()
934 regmap_update_bits(cs42l43->regmap, CS42L43_ADC_B_CTRL1, in cs42l43_jack_put()
937 regmap_update_bits(cs42l43->regmap, CS42L43_ADC_B_CTRL2, in cs42l43_jack_put()