rt298             196 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component);
rt298             200 sound/soc/codecs/rt298.c 		snd_soc_component_write(component, rt298->index_cache[i].reg,
rt298             201 sound/soc/codecs/rt298.c 				  rt298->index_cache[i].def);
rt298             219 sound/soc/codecs/rt298.c static int rt298_jack_detect(struct rt298_priv *rt298, bool *hp, bool *mic)
rt298             227 sound/soc/codecs/rt298.c 	if (!rt298->component)
rt298             230 sound/soc/codecs/rt298.c 	dapm = snd_soc_component_get_dapm(rt298->component);
rt298             232 sound/soc/codecs/rt298.c 	if (rt298->pdata.cbj_en) {
rt298             233 sound/soc/codecs/rt298.c 		regmap_read(rt298->regmap, RT298_GET_HP_SENSE, &buf);
rt298             235 sound/soc/codecs/rt298.c 		if (*hp == rt298->is_hp_in)
rt298             237 sound/soc/codecs/rt298.c 		rt298->is_hp_in = *hp;
rt298             240 sound/soc/codecs/rt298.c 			regmap_update_bits(rt298->regmap,
rt298             249 sound/soc/codecs/rt298.c 			regmap_update_bits(rt298->regmap,
rt298             251 sound/soc/codecs/rt298.c 			regmap_update_bits(rt298->regmap,
rt298             254 sound/soc/codecs/rt298.c 			regmap_write(rt298->regmap, RT298_SET_MIC1, 0x24);
rt298             257 sound/soc/codecs/rt298.c 			regmap_update_bits(rt298->regmap,
rt298             260 sound/soc/codecs/rt298.c 			regmap_read(rt298->regmap, RT298_CBJ_CTRL2, &val);
rt298             265 sound/soc/codecs/rt298.c 				regmap_update_bits(rt298->regmap,
rt298             268 sound/soc/codecs/rt298.c 				regmap_read(rt298->regmap,
rt298             275 sound/soc/codecs/rt298.c 			regmap_update_bits(rt298->regmap,
rt298             280 sound/soc/codecs/rt298.c 			regmap_write(rt298->regmap, RT298_SET_MIC1, 0x20);
rt298             281 sound/soc/codecs/rt298.c 			regmap_update_bits(rt298->regmap,
rt298             285 sound/soc/codecs/rt298.c 		regmap_read(rt298->regmap, RT298_GET_HP_SENSE, &buf);
rt298             287 sound/soc/codecs/rt298.c 		regmap_read(rt298->regmap, RT298_GET_MIC1_SENSE, &buf);
rt298             305 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298 =
rt298             311 sound/soc/codecs/rt298.c 	if (rt298_jack_detect(rt298, &hp, &mic) < 0)
rt298             320 sound/soc/codecs/rt298.c 	snd_soc_jack_report(rt298->jack, status,
rt298             326 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component);
rt298             334 sound/soc/codecs/rt298.c 		regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x2, 0x0);
rt298             341 sound/soc/codecs/rt298.c 	rt298->jack = jack;
rt298             342 sound/soc/codecs/rt298.c 	regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x2, 0x2);
rt298             344 sound/soc/codecs/rt298.c 	rt298_jack_detect(rt298, &hp, &mic);
rt298             351 sound/soc/codecs/rt298.c 	snd_soc_jack_report(rt298->jack, status,
rt298             362 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component);
rt298             364 sound/soc/codecs/rt298.c 	if (rt298->clk_id == RT298_SCLK_S_MCLK)
rt298             747 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component);
rt298             761 sound/soc/codecs/rt298.c 	switch (rt298->sys_clk) {
rt298             766 sound/soc/codecs/rt298.c 					params_rate(params), rt298->sys_clk);
rt298             774 sound/soc/codecs/rt298.c 					params_rate(params), rt298->sys_clk);
rt298             873 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component);
rt298             925 sound/soc/codecs/rt298.c 	rt298->sys_clk = freq;
rt298             926 sound/soc/codecs/rt298.c 	rt298->clk_id = clk_id;
rt298             978 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298 = data;
rt298             983 sound/soc/codecs/rt298.c 	ret = rt298_jack_detect(rt298, &hp, &mic);
rt298             986 sound/soc/codecs/rt298.c 	regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x1, 0x1);
rt298             995 sound/soc/codecs/rt298.c 		snd_soc_jack_report(rt298->jack, status,
rt298             998 sound/soc/codecs/rt298.c 		pm_wakeup_event(&rt298->i2c->dev, 300);
rt298            1006 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component);
rt298            1008 sound/soc/codecs/rt298.c 	rt298->component = component;
rt298            1010 sound/soc/codecs/rt298.c 	if (rt298->i2c->irq) {
rt298            1011 sound/soc/codecs/rt298.c 		regmap_update_bits(rt298->regmap,
rt298            1014 sound/soc/codecs/rt298.c 		INIT_DELAYED_WORK(&rt298->jack_detect_work,
rt298            1016 sound/soc/codecs/rt298.c 		schedule_delayed_work(&rt298->jack_detect_work,
rt298            1025 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component);
rt298            1027 sound/soc/codecs/rt298.c 	cancel_delayed_work_sync(&rt298->jack_detect_work);
rt298            1033 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component);
rt298            1035 sound/soc/codecs/rt298.c 	rt298->is_hp_in = -1;
rt298            1036 sound/soc/codecs/rt298.c 	regcache_cache_only(rt298->regmap, true);
rt298            1037 sound/soc/codecs/rt298.c 	regcache_mark_dirty(rt298->regmap);
rt298            1044 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298 = snd_soc_component_get_drvdata(component);
rt298            1046 sound/soc/codecs/rt298.c 	regcache_cache_only(rt298->regmap, false);
rt298            1048 sound/soc/codecs/rt298.c 	regcache_sync(rt298->regmap);
rt298            1176 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298;
rt298            1181 sound/soc/codecs/rt298.c 	rt298 = devm_kzalloc(&i2c->dev,	sizeof(*rt298),
rt298            1183 sound/soc/codecs/rt298.c 	if (NULL == rt298)
rt298            1186 sound/soc/codecs/rt298.c 	rt298->regmap = devm_regmap_init(&i2c->dev, NULL, i2c, &rt298_regmap);
rt298            1187 sound/soc/codecs/rt298.c 	if (IS_ERR(rt298->regmap)) {
rt298            1188 sound/soc/codecs/rt298.c 		ret = PTR_ERR(rt298->regmap);
rt298            1194 sound/soc/codecs/rt298.c 	regmap_read(rt298->regmap,
rt298            1202 sound/soc/codecs/rt298.c 	rt298->index_cache = devm_kmemdup(&i2c->dev, rt298_index_def,
rt298            1204 sound/soc/codecs/rt298.c 	if (!rt298->index_cache)
rt298            1207 sound/soc/codecs/rt298.c 	rt298->index_cache_size = INDEX_CACHE_SIZE;
rt298            1208 sound/soc/codecs/rt298.c 	rt298->i2c = i2c;
rt298            1209 sound/soc/codecs/rt298.c 	i2c_set_clientdata(i2c, rt298);
rt298            1213 sound/soc/codecs/rt298.c 		regmap_write(rt298->regmap, rt298->index_cache[i].reg,
rt298            1214 sound/soc/codecs/rt298.c 				rt298->index_cache[i].def);
rt298            1216 sound/soc/codecs/rt298.c 		regmap_write(rt298->regmap, rt298_reg[i].reg,
rt298            1220 sound/soc/codecs/rt298.c 		rt298->pdata = *pdata;
rt298            1225 sound/soc/codecs/rt298.c 		rt298->pdata = *(struct rt298_platform_data *)
rt298            1230 sound/soc/codecs/rt298.c 		rt298->pdata.cbj_en = true;
rt298            1231 sound/soc/codecs/rt298.c 		rt298->pdata.gpio2_en = false;
rt298            1235 sound/soc/codecs/rt298.c 	regmap_update_bits(rt298->regmap, 0x04, 0x80, 0x80);
rt298            1236 sound/soc/codecs/rt298.c 	regmap_update_bits(rt298->regmap, 0x1b, 0x860, 0x860);
rt298            1238 sound/soc/codecs/rt298.c 	regmap_update_bits(rt298->regmap, 0x08, 0x20, 0x20);
rt298            1240 sound/soc/codecs/rt298.c 	regmap_write(rt298->regmap, RT298_SET_AUDIO_POWER, AC_PWRST_D3);
rt298            1243 sound/soc/codecs/rt298.c 		regmap_write(rt298->regmap,
rt298            1247 sound/soc/codecs/rt298.c 	if (!rt298->pdata.cbj_en) {
rt298            1248 sound/soc/codecs/rt298.c 		regmap_write(rt298->regmap, RT298_CBJ_CTRL2, 0x0000);
rt298            1249 sound/soc/codecs/rt298.c 		regmap_write(rt298->regmap, RT298_MIC1_DET_CTRL, 0x0816);
rt298            1250 sound/soc/codecs/rt298.c 		regmap_update_bits(rt298->regmap,
rt298            1253 sound/soc/codecs/rt298.c 		regmap_update_bits(rt298->regmap,
rt298            1259 sound/soc/codecs/rt298.c 	if (!rt298->pdata.gpio2_en)
rt298            1260 sound/soc/codecs/rt298.c 		regmap_write(rt298->regmap, RT298_SET_DMIC2_DEFAULT, 0x40);
rt298            1262 sound/soc/codecs/rt298.c 		regmap_write(rt298->regmap, RT298_SET_DMIC2_DEFAULT, 0);
rt298            1266 sound/soc/codecs/rt298.c 	regmap_write(rt298->regmap, RT298_MISC_CTRL1, 0x0000);
rt298            1267 sound/soc/codecs/rt298.c 	regmap_update_bits(rt298->regmap,
rt298            1270 sound/soc/codecs/rt298.c 	regmap_write(rt298->regmap, RT298_UNSOLICITED_INLINE_CMD, 0x81);
rt298            1271 sound/soc/codecs/rt298.c 	regmap_write(rt298->regmap, RT298_UNSOLICITED_HP_OUT, 0x82);
rt298            1272 sound/soc/codecs/rt298.c 	regmap_write(rt298->regmap, RT298_UNSOLICITED_MIC1, 0x84);
rt298            1273 sound/soc/codecs/rt298.c 	regmap_update_bits(rt298->regmap, RT298_IRQ_FLAG_CTRL, 0x2, 0x2);
rt298            1275 sound/soc/codecs/rt298.c 	rt298->is_hp_in = -1;
rt298            1277 sound/soc/codecs/rt298.c 	if (rt298->i2c->irq) {
rt298            1278 sound/soc/codecs/rt298.c 		ret = request_threaded_irq(rt298->i2c->irq, NULL, rt298_irq,
rt298            1279 sound/soc/codecs/rt298.c 			IRQF_TRIGGER_HIGH | IRQF_ONESHOT, "rt298", rt298);
rt298            1296 sound/soc/codecs/rt298.c 	struct rt298_priv *rt298 = i2c_get_clientdata(i2c);
rt298            1299 sound/soc/codecs/rt298.c 		free_irq(i2c->irq, rt298);