cs42l42           517 sound/soc/codecs/cs42l42.c 	struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component);
cs42l42           527 sound/soc/codecs/cs42l42.c 			regcache_cache_only(cs42l42->regmap, false);
cs42l42           528 sound/soc/codecs/cs42l42.c 			regcache_sync(cs42l42->regmap);
cs42l42           530 sound/soc/codecs/cs42l42.c 						ARRAY_SIZE(cs42l42->supplies),
cs42l42           531 sound/soc/codecs/cs42l42.c 						cs42l42->supplies);
cs42l42           542 sound/soc/codecs/cs42l42.c 		regcache_cache_only(cs42l42->regmap, true);
cs42l42           543 sound/soc/codecs/cs42l42.c 		regulator_bulk_disable(ARRAY_SIZE(cs42l42->supplies),
cs42l42           544 sound/soc/codecs/cs42l42.c 						    cs42l42->supplies);
cs42l42           553 sound/soc/codecs/cs42l42.c 	struct cs42l42_private *cs42l42 =
cs42l42           556 sound/soc/codecs/cs42l42.c 	cs42l42->component = component;
cs42l42           612 sound/soc/codecs/cs42l42.c 	struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component);
cs42l42           617 sound/soc/codecs/cs42l42.c 		if (pll_ratio_table[i].sclk == cs42l42->sclk) {
cs42l42           637 sound/soc/codecs/cs42l42.c 			fsync = cs42l42->sclk / cs42l42->srate;
cs42l42           638 sound/soc/codecs/cs42l42.c 			if (((fsync * cs42l42->srate) != cs42l42->sclk)
cs42l42           642 sound/soc/codecs/cs42l42.c 					cs42l42->sclk,
cs42l42           643 sound/soc/codecs/cs42l42.c 					cs42l42->srate);
cs42l42           830 sound/soc/codecs/cs42l42.c 	struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component);
cs42l42           833 sound/soc/codecs/cs42l42.c 	cs42l42->srate = params_rate(params);
cs42l42           834 sound/soc/codecs/cs42l42.c 	cs42l42->swidth = params_width(params);
cs42l42           845 sound/soc/codecs/cs42l42.c 	struct cs42l42_private *cs42l42 = snd_soc_component_get_drvdata(component);
cs42l42           847 sound/soc/codecs/cs42l42.c 	cs42l42->sclk = freq;
cs42l42           934 sound/soc/codecs/cs42l42.c static void cs42l42_process_hs_type_detect(struct cs42l42_private *cs42l42)
cs42l42           940 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42           948 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42           960 sound/soc/codecs/cs42l42.c 	regmap_read(cs42l42->regmap, CS42L42_HS_DET_STATUS, &hs_det_status);
cs42l42           962 sound/soc/codecs/cs42l42.c 	cs42l42->hs_type = (hs_det_status & CS42L42_HSDET_TYPE_MASK) >>
cs42l42           966 sound/soc/codecs/cs42l42.c 	if ((cs42l42->hs_type == CS42L42_PLUG_CTIA) ||
cs42l42           967 sound/soc/codecs/cs42l42.c 	      (cs42l42->hs_type == CS42L42_PLUG_OMTP)) {
cs42l42           969 sound/soc/codecs/cs42l42.c 		regmap_update_bits(cs42l42->regmap,
cs42l42           981 sound/soc/codecs/cs42l42.c 		regmap_update_bits(cs42l42->regmap,
cs42l42           988 sound/soc/codecs/cs42l42.c 			(cs42l42->bias_thresholds[0] <<
cs42l42           992 sound/soc/codecs/cs42l42.c 		regmap_update_bits(cs42l42->regmap,
cs42l42          1004 sound/soc/codecs/cs42l42.c 		regmap_update_bits(cs42l42->regmap,
cs42l42          1013 sound/soc/codecs/cs42l42.c 		msleep(cs42l42->btn_det_init_dbnce);
cs42l42          1016 sound/soc/codecs/cs42l42.c 		regmap_read(cs42l42->regmap, CS42L42_DET_INT_STATUS2,
cs42l42          1020 sound/soc/codecs/cs42l42.c 		regmap_update_bits(cs42l42->regmap,
cs42l42          1034 sound/soc/codecs/cs42l42.c 		regmap_update_bits(cs42l42->regmap,
cs42l42          1044 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1058 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1070 sound/soc/codecs/cs42l42.c static void cs42l42_init_hs_type_detect(struct cs42l42_private *cs42l42)
cs42l42          1073 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1085 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1095 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1107 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1118 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1132 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1142 sound/soc/codecs/cs42l42.c 	msleep(cs42l42->hs_bias_ramp_time);
cs42l42          1145 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1153 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1165 sound/soc/codecs/cs42l42.c static void cs42l42_cancel_hs_type_detect(struct cs42l42_private *cs42l42)
cs42l42          1168 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1182 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1192 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1204 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1216 sound/soc/codecs/cs42l42.c static void cs42l42_handle_button_press(struct cs42l42_private *cs42l42)
cs42l42          1222 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1235 sound/soc/codecs/cs42l42.c 	usleep_range(cs42l42->btn_det_event_dbnce * 1000,
cs42l42          1236 sound/soc/codecs/cs42l42.c 		     cs42l42->btn_det_event_dbnce * 2000);
cs42l42          1242 sound/soc/codecs/cs42l42.c 		regmap_update_bits(cs42l42->regmap,
cs42l42          1249 sound/soc/codecs/cs42l42.c 			(cs42l42->bias_thresholds[bias_level] <<
cs42l42          1252 sound/soc/codecs/cs42l42.c 		regmap_read(cs42l42->regmap, CS42L42_DET_STATUS2,
cs42l42          1259 sound/soc/codecs/cs42l42.c 		dev_dbg(cs42l42->component->dev, "Function C button press\n");
cs42l42          1262 sound/soc/codecs/cs42l42.c 		dev_dbg(cs42l42->component->dev, "Function B button press\n");
cs42l42          1265 sound/soc/codecs/cs42l42.c 		dev_dbg(cs42l42->component->dev, "Function D button press\n");
cs42l42          1268 sound/soc/codecs/cs42l42.c 		dev_dbg(cs42l42->component->dev, "Function A button press\n");
cs42l42          1273 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1280 sound/soc/codecs/cs42l42.c 		(cs42l42->bias_thresholds[0] << CS42L42_HS_DET_LEVEL_SHIFT));
cs42l42          1283 sound/soc/codecs/cs42l42.c 	regmap_read(cs42l42->regmap, CS42L42_DET_INT_STATUS2,
cs42l42          1287 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1336 sound/soc/codecs/cs42l42.c 	struct cs42l42_private *cs42l42 = (struct cs42l42_private *)data;
cs42l42          1337 sound/soc/codecs/cs42l42.c 	struct snd_soc_component *component = cs42l42->component;
cs42l42          1346 sound/soc/codecs/cs42l42.c 		regmap_read(cs42l42->regmap, irq_params_table[i].status_addr,
cs42l42          1348 sound/soc/codecs/cs42l42.c 		regmap_read(cs42l42->regmap, irq_params_table[i].mask_addr,
cs42l42          1368 sound/soc/codecs/cs42l42.c 			cs42l42_process_hs_type_detect(cs42l42);
cs42l42          1371 sound/soc/codecs/cs42l42.c 				cs42l42->hs_type);
cs42l42          1379 sound/soc/codecs/cs42l42.c 			if (cs42l42->plug_state != CS42L42_TS_PLUG) {
cs42l42          1380 sound/soc/codecs/cs42l42.c 				cs42l42->plug_state = CS42L42_TS_PLUG;
cs42l42          1381 sound/soc/codecs/cs42l42.c 				cs42l42_init_hs_type_detect(cs42l42);
cs42l42          1386 sound/soc/codecs/cs42l42.c 			if (cs42l42->plug_state != CS42L42_TS_UNPLUG) {
cs42l42          1387 sound/soc/codecs/cs42l42.c 				cs42l42->plug_state = CS42L42_TS_UNPLUG;
cs42l42          1388 sound/soc/codecs/cs42l42.c 				cs42l42_cancel_hs_type_detect(cs42l42);
cs42l42          1395 sound/soc/codecs/cs42l42.c 			if (cs42l42->plug_state != CS42L42_TS_TRANS)
cs42l42          1396 sound/soc/codecs/cs42l42.c 				cs42l42->plug_state = CS42L42_TS_TRANS;
cs42l42          1411 sound/soc/codecs/cs42l42.c 				cs42l42_handle_button_press(cs42l42);
cs42l42          1419 sound/soc/codecs/cs42l42.c static void cs42l42_set_interrupt_masks(struct cs42l42_private *cs42l42)
cs42l42          1421 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_ADC_OVFL_INT_MASK,
cs42l42          1425 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_MIXER_INT_MASK,
cs42l42          1435 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_SRC_INT_MASK,
cs42l42          1445 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_ASP_RX_INT_MASK,
cs42l42          1457 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_ASP_TX_INT_MASK,
cs42l42          1467 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_CODEC_INT_MASK,
cs42l42          1473 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_SRCPL_INT_MASK,
cs42l42          1483 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_DET_INT1_MASK,
cs42l42          1491 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_DET_INT2_MASK,
cs42l42          1503 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_VPMON_INT_MASK,
cs42l42          1507 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_PLL_LOCK_INT_MASK,
cs42l42          1511 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_TSRS_PLUG_INT_MASK,
cs42l42          1522 sound/soc/codecs/cs42l42.c static void cs42l42_setup_hs_type_detect(struct cs42l42_private *cs42l42)
cs42l42          1526 sound/soc/codecs/cs42l42.c 	cs42l42->hs_type = CS42L42_PLUG_INVALID;
cs42l42          1529 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_MIC_DET_CTL1,
cs42l42          1535 sound/soc/codecs/cs42l42.c 			(cs42l42->bias_thresholds[0] <<
cs42l42          1539 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap,
cs42l42          1545 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_TIPSENSE_CTL,
cs42l42          1554 sound/soc/codecs/cs42l42.c 	regmap_read(cs42l42->regmap,
cs42l42          1557 sound/soc/codecs/cs42l42.c 	cs42l42->plug_state = (((char) reg) &
cs42l42          1570 sound/soc/codecs/cs42l42.c 					struct cs42l42_private *cs42l42)
cs42l42          1584 sound/soc/codecs/cs42l42.c 			cs42l42->ts_inv = val;
cs42l42          1590 sound/soc/codecs/cs42l42.c 			cs42l42->ts_inv = CS42L42_TS_INV_DIS;
cs42l42          1593 sound/soc/codecs/cs42l42.c 		cs42l42->ts_inv = CS42L42_TS_INV_DIS;
cs42l42          1596 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_TSENSE_CTL,
cs42l42          1598 sound/soc/codecs/cs42l42.c 			(cs42l42->ts_inv << CS42L42_TS_INV_SHIFT));
cs42l42          1612 sound/soc/codecs/cs42l42.c 			cs42l42->ts_dbnc_rise = val;
cs42l42          1618 sound/soc/codecs/cs42l42.c 			cs42l42->ts_dbnc_rise = CS42L42_TS_DBNCE_1000;
cs42l42          1621 sound/soc/codecs/cs42l42.c 		cs42l42->ts_dbnc_rise = CS42L42_TS_DBNCE_1000;
cs42l42          1624 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_TSENSE_CTL,
cs42l42          1626 sound/soc/codecs/cs42l42.c 			(cs42l42->ts_dbnc_rise <<
cs42l42          1641 sound/soc/codecs/cs42l42.c 			cs42l42->ts_dbnc_fall = val;
cs42l42          1647 sound/soc/codecs/cs42l42.c 			cs42l42->ts_dbnc_fall = CS42L42_TS_DBNCE_0;
cs42l42          1650 sound/soc/codecs/cs42l42.c 		cs42l42->ts_dbnc_fall = CS42L42_TS_DBNCE_0;
cs42l42          1653 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_TSENSE_CTL,
cs42l42          1655 sound/soc/codecs/cs42l42.c 			(cs42l42->ts_dbnc_fall <<
cs42l42          1663 sound/soc/codecs/cs42l42.c 			cs42l42->btn_det_init_dbnce = val;
cs42l42          1668 sound/soc/codecs/cs42l42.c 			cs42l42->btn_det_init_dbnce =
cs42l42          1672 sound/soc/codecs/cs42l42.c 		cs42l42->btn_det_init_dbnce =
cs42l42          1681 sound/soc/codecs/cs42l42.c 			cs42l42->btn_det_event_dbnce = val;
cs42l42          1685 sound/soc/codecs/cs42l42.c 			cs42l42->btn_det_event_dbnce =
cs42l42          1689 sound/soc/codecs/cs42l42.c 		cs42l42->btn_det_event_dbnce =
cs42l42          1700 sound/soc/codecs/cs42l42.c 				cs42l42->bias_thresholds[i] = thresholds[i];
cs42l42          1705 sound/soc/codecs/cs42l42.c 				cs42l42->bias_thresholds[i] =
cs42l42          1711 sound/soc/codecs/cs42l42.c 			cs42l42->bias_thresholds[i] = threshold_defaults[i];
cs42l42          1719 sound/soc/codecs/cs42l42.c 			cs42l42->hs_bias_ramp_rate = val;
cs42l42          1720 sound/soc/codecs/cs42l42.c 			cs42l42->hs_bias_ramp_time = CS42L42_HSBIAS_RAMP_TIME0;
cs42l42          1723 sound/soc/codecs/cs42l42.c 			cs42l42->hs_bias_ramp_rate = val;
cs42l42          1724 sound/soc/codecs/cs42l42.c 			cs42l42->hs_bias_ramp_time = CS42L42_HSBIAS_RAMP_TIME1;
cs42l42          1727 sound/soc/codecs/cs42l42.c 			cs42l42->hs_bias_ramp_rate = val;
cs42l42          1728 sound/soc/codecs/cs42l42.c 			cs42l42->hs_bias_ramp_time = CS42L42_HSBIAS_RAMP_TIME2;
cs42l42          1731 sound/soc/codecs/cs42l42.c 			cs42l42->hs_bias_ramp_rate = val;
cs42l42          1732 sound/soc/codecs/cs42l42.c 			cs42l42->hs_bias_ramp_time = CS42L42_HSBIAS_RAMP_TIME3;
cs42l42          1738 sound/soc/codecs/cs42l42.c 			cs42l42->hs_bias_ramp_rate = CS42L42_HSBIAS_RAMP_SLOW;
cs42l42          1739 sound/soc/codecs/cs42l42.c 			cs42l42->hs_bias_ramp_time = CS42L42_HSBIAS_RAMP_TIME2;
cs42l42          1742 sound/soc/codecs/cs42l42.c 		cs42l42->hs_bias_ramp_rate = CS42L42_HSBIAS_RAMP_SLOW;
cs42l42          1743 sound/soc/codecs/cs42l42.c 		cs42l42->hs_bias_ramp_time = CS42L42_HSBIAS_RAMP_TIME2;
cs42l42          1746 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_HS_BIAS_CTL,
cs42l42          1748 sound/soc/codecs/cs42l42.c 			(cs42l42->hs_bias_ramp_rate <<
cs42l42          1757 sound/soc/codecs/cs42l42.c 	struct cs42l42_private *cs42l42;
cs42l42          1762 sound/soc/codecs/cs42l42.c 	cs42l42 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs42l42_private),
cs42l42          1764 sound/soc/codecs/cs42l42.c 	if (!cs42l42)
cs42l42          1767 sound/soc/codecs/cs42l42.c 	i2c_set_clientdata(i2c_client, cs42l42);
cs42l42          1769 sound/soc/codecs/cs42l42.c 	cs42l42->regmap = devm_regmap_init_i2c(i2c_client, &cs42l42_regmap);
cs42l42          1770 sound/soc/codecs/cs42l42.c 	if (IS_ERR(cs42l42->regmap)) {
cs42l42          1771 sound/soc/codecs/cs42l42.c 		ret = PTR_ERR(cs42l42->regmap);
cs42l42          1776 sound/soc/codecs/cs42l42.c 	for (i = 0; i < ARRAY_SIZE(cs42l42->supplies); i++)
cs42l42          1777 sound/soc/codecs/cs42l42.c 		cs42l42->supplies[i].supply = cs42l42_supply_names[i];
cs42l42          1780 sound/soc/codecs/cs42l42.c 				      ARRAY_SIZE(cs42l42->supplies),
cs42l42          1781 sound/soc/codecs/cs42l42.c 				      cs42l42->supplies);
cs42l42          1788 sound/soc/codecs/cs42l42.c 	ret = regulator_bulk_enable(ARRAY_SIZE(cs42l42->supplies),
cs42l42          1789 sound/soc/codecs/cs42l42.c 				    cs42l42->supplies);
cs42l42          1797 sound/soc/codecs/cs42l42.c 	cs42l42->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev,
cs42l42          1799 sound/soc/codecs/cs42l42.c 	if (IS_ERR(cs42l42->reset_gpio))
cs42l42          1800 sound/soc/codecs/cs42l42.c 		return PTR_ERR(cs42l42->reset_gpio);
cs42l42          1802 sound/soc/codecs/cs42l42.c 	if (cs42l42->reset_gpio) {
cs42l42          1804 sound/soc/codecs/cs42l42.c 		gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
cs42l42          1813 sound/soc/codecs/cs42l42.c 			"cs42l42", cs42l42);
cs42l42          1820 sound/soc/codecs/cs42l42.c 	ret = regmap_read(cs42l42->regmap, CS42L42_DEVID_AB, &reg);
cs42l42          1823 sound/soc/codecs/cs42l42.c 	ret = regmap_read(cs42l42->regmap, CS42L42_DEVID_CD, &reg);
cs42l42          1826 sound/soc/codecs/cs42l42.c 	ret = regmap_read(cs42l42->regmap, CS42L42_DEVID_E, &reg);
cs42l42          1837 sound/soc/codecs/cs42l42.c 	ret = regmap_read(cs42l42->regmap, CS42L42_REVID, &reg);
cs42l42          1847 sound/soc/codecs/cs42l42.c 	regmap_update_bits(cs42l42->regmap, CS42L42_PWR_CTL1,
cs42l42          1864 sound/soc/codecs/cs42l42.c 		ret = cs42l42_handle_device_data(i2c_client, cs42l42);
cs42l42          1870 sound/soc/codecs/cs42l42.c 	cs42l42_setup_hs_type_detect(cs42l42);
cs42l42          1873 sound/soc/codecs/cs42l42.c 	cs42l42_set_interrupt_masks(cs42l42);
cs42l42          1883 sound/soc/codecs/cs42l42.c 	regulator_bulk_disable(ARRAY_SIZE(cs42l42->supplies),
cs42l42          1884 sound/soc/codecs/cs42l42.c 				cs42l42->supplies);
cs42l42          1890 sound/soc/codecs/cs42l42.c 	struct cs42l42_private *cs42l42 = i2c_get_clientdata(i2c_client);
cs42l42          1893 sound/soc/codecs/cs42l42.c 	gpiod_set_value_cansleep(cs42l42->reset_gpio, 0);
cs42l42          1901 sound/soc/codecs/cs42l42.c 	struct cs42l42_private *cs42l42 = dev_get_drvdata(dev);
cs42l42          1903 sound/soc/codecs/cs42l42.c 	regcache_cache_only(cs42l42->regmap, true);
cs42l42          1904 sound/soc/codecs/cs42l42.c 	regcache_mark_dirty(cs42l42->regmap);
cs42l42          1907 sound/soc/codecs/cs42l42.c 	gpiod_set_value_cansleep(cs42l42->reset_gpio, 0);
cs42l42          1910 sound/soc/codecs/cs42l42.c 	regulator_bulk_disable(ARRAY_SIZE(cs42l42->supplies),
cs42l42          1911 sound/soc/codecs/cs42l42.c 				cs42l42->supplies);
cs42l42          1918 sound/soc/codecs/cs42l42.c 	struct cs42l42_private *cs42l42 = dev_get_drvdata(dev);
cs42l42          1922 sound/soc/codecs/cs42l42.c 	ret = regulator_bulk_enable(ARRAY_SIZE(cs42l42->supplies),
cs42l42          1923 sound/soc/codecs/cs42l42.c 					cs42l42->supplies);
cs42l42          1930 sound/soc/codecs/cs42l42.c 	gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
cs42l42          1932 sound/soc/codecs/cs42l42.c 	regcache_cache_only(cs42l42->regmap, false);
cs42l42          1933 sound/soc/codecs/cs42l42.c 	regcache_sync(cs42l42->regmap);